@lovrabet/rabetbase-cli 2.5.1-beta.6 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-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/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.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-skill/index.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-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.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/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.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-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.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-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.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/table-diff-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/deployment/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/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/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.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/mutations.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/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.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/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.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/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.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/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/deployment-sync.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.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/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.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/kb-search-client.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-index-auditor.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/error-output.js +1 -1
- package/lib/framework/explicit-yes.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.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.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/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/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a238_0x220cd3=a238_0x3fd7;(function(_0x51be2c,_0x598c06){const _0x1812f4=a238_0x3fd7,_0x341cbb=_0x51be2c();while(!![]){try{const _0x400b08=parseInt(_0x1812f4(0xf0))/0x1*(-parseInt(_0x1812f4(0xf9))/0x2)+parseInt(_0x1812f4(0xf7))/0x3+parseInt(_0x1812f4(0xf1))/0x4*(parseInt(_0x1812f4(0xfe))/0x5)+parseInt(_0x1812f4(0xee))/0x6+parseInt(_0x1812f4(0xd6))/0x7*(parseInt(_0x1812f4(0xea))/0x8)+parseInt(_0x1812f4(0xed))/0x9*(-parseInt(_0x1812f4(0xf8))/0xa)+-parseInt(_0x1812f4(0xfc))/0xb;if(_0x400b08===_0x598c06)break;else _0x341cbb['push'](_0x341cbb['shift']());}catch(_0x5b3536){_0x341cbb['push'](_0x341cbb['shift']());}}}(a238_0x3fbe,0x47861));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join,resolve,sep}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a238_0x220cd3(0xe5),a238_0x220cd3(0xf6),a238_0x220cd3(0xd7)];export function normalizeBffType(_0x55714c){const _0x404c07=a238_0x220cd3;if(!_0x55714c)return undefined;const _0x9061=_0x55714c[_0x404c07(0xe7)]()[_0x404c07(0xe4)]();return SUPPORTED_BFF_TYPES[_0x404c07(0xf4)](_0x9061)?_0x9061:undefined;}async function scanJsFilesRecursively(_0x55ffe7,_0x7eb3f2){const _0x1d8e8a=a238_0x220cd3,_0xa8263f=[];try{const _0x544f41=await readdir(_0x55ffe7,{'withFileTypes':!![]});for(const _0x28f008 of _0x544f41){const _0x2d6f15=join(_0x55ffe7,_0x28f008[_0x1d8e8a(0xff)]);if(_0x28f008[_0x1d8e8a(0xf2)]())_0xa8263f[_0x1d8e8a(0xe8)](...await scanJsFilesRecursively(_0x2d6f15,_0x7eb3f2+'/'+_0x28f008['name']));else _0x28f008[_0x1d8e8a(0xeb)]()&&_0x28f008['name'][_0x1d8e8a(0xfa)]('.js')&&_0xa8263f['push']({'lockKey':_0x7eb3f2+'/'+_0x28f008['name'][_0x1d8e8a(0xe6)](/\.js$/,''),'filePath':_0x2d6f15});}}catch(_0xcf91ca){if(_0xcf91ca[_0x1d8e8a(0xe2)]!=='ENOENT')throw _0xcf91ca;}return _0xa8263f;}async function scanFlatFunctions(_0x5e58f2,_0x1526c6){const _0x40d356=a238_0x220cd3,_0x59ccf6=join(_0x5e58f2[_0x40d356(0x100)],_0x1526c6),_0x464705=await scanJsFilesRecursively(_0x59ccf6,_0x1526c6);return _0x464705[_0x40d356(0xef)](({lockKey:_0x370ff9,filePath:_0x45d24d})=>({'type':_0x1526c6,'name':_0x370ff9['split']('/')['at'](-0x1)??'','filePath':_0x45d24d,'lockKey':_0x370ff9}));}async function scanHookFunctions(_0x1e0475){const _0x309870=a238_0x220cd3,_0x2953f8=join(_0x1e0475[_0x309870(0x100)],_0x309870(0xd7)),_0x69ebc2=[];try{const _0x537466=await readdir(_0x2953f8,{'withFileTypes':!![]});for(const _0x5d7d00 of _0x537466){if(!_0x5d7d00[_0x309870(0xf2)]())continue;const _0x62167e=_0x5d7d00['name'],_0x31acb4=join(_0x2953f8,_0x62167e),_0x2e542f=await readdir(_0x31acb4,{'withFileTypes':!![]});for(const _0x1ea9a1 of _0x2e542f){if(!_0x1ea9a1[_0x309870(0xf2)]())continue;const _0x453057=_0x1ea9a1[_0x309870(0xff)],_0xa58273=join(_0x31acb4,_0x453057),_0x469b25=await readdir(_0xa58273,{'withFileTypes':!![]});for(const _0x476ef3 of _0x469b25){if(!_0x476ef3['isDirectory']())continue;const _0x37ca45=_0x476ef3[_0x309870(0xff)],_0x4a319f=join(_0xa58273,_0x37ca45),_0x4f1423=await readdir(_0x4a319f,{'withFileTypes':!![]});for(const _0x46c400 of _0x4f1423){if(!_0x46c400[_0x309870(0xeb)]()||!_0x46c400[_0x309870(0xff)][_0x309870(0xfa)]('.js'))continue;const _0x412ee6=_0x46c400[_0x309870(0xff)][_0x309870(0xe6)](/\.js$/,'');_0x69ebc2['push']({'type':_0x309870(0xd7),'name':_0x412ee6,'filePath':join(_0x4a319f,_0x46c400[_0x309870(0xff)]),'lockKey':_0x309870(0xdc)+_0x62167e+'/'+_0x453057+'/'+_0x37ca45+'/'+_0x412ee6,'alias':_0x62167e,'operationType':_0x453057,'functionNode':_0x37ca45});}}}}}catch(_0x445104){if(_0x445104['code']!==_0x309870(0xec))throw _0x445104;}return _0x69ebc2;}export async function scanLocalBffFunctions(_0x1d9380,_0x5b9242){const _0x2d09a3=a238_0x220cd3;if(_0x5b9242==='COMMON'||_0x5b9242==='ENDPOINT')return scanFlatFunctions(_0x1d9380,_0x5b9242);if(_0x5b9242===_0x2d09a3(0xd7))return scanHookFunctions(_0x1d9380);const [_0x2e1ccd,_0x59cbb1,_0x885a14]=await Promise[_0x2d09a3(0xfd)]([scanFlatFunctions(_0x1d9380,_0x2d09a3(0xe5)),scanFlatFunctions(_0x1d9380,_0x2d09a3(0xf6)),scanHookFunctions(_0x1d9380)]);return[..._0x2e1ccd,..._0x59cbb1,..._0x885a14];}function a238_0x3fbe(){const _0x42a077=['HOOK/','get','beforeScriptId','split','test','scriptType','code','set','toUpperCase','COMMON','replace','trim','push','.js','94856bELbKQ','isFile','ENOENT','17361uTRyht','2590872jTKVMl','map','74446AcmzJz','1305580CbPeYd','isDirectory','startsWith','includes','operationType','ENDPOINT','937302VXnYTJ','2570hHEAPL','6KmCiWx','endsWith','Resolved\x20Backend\x20Function\x20script\x20path\x20escapes\x20scripts\x20root:\x20','1296614hubKQb','all','5NkLIiP','name','scriptsRootDir','datasetCode','35cQZjux','HOOK','afterScriptId','functionNode','alias','every'];a238_0x3fbe=function(){return _0x42a077;};return a238_0x3fbe();}const SAFE_LOCK_KEY_SEGMENT=/^[A-Za-z0-9_$.-]+$/;export function isSafeLockKeySegment(_0x37392f){const _0x564be1=a238_0x220cd3;return SAFE_LOCK_KEY_SEGMENT[_0x564be1(0xe0)](_0x37392f)&&_0x37392f!=='.'&&_0x37392f!=='..';}export function resolveLocalFilePathFromLockKey(_0x2a2b5f,_0x55fa16){const _0x3121ed=a238_0x220cd3,_0x3e21a7=_0x55fa16[_0x3121ed(0xdf)]('/');if(!_0x3e21a7[_0x3121ed(0xdb)](isSafeLockKeySegment))throw new Error('Unsafe\x20Backend\x20Function\x20lock\x20key\x20(traversal\x20or\x20invalid\x20segment):\x20'+_0x55fa16);const _0x4ca305=resolve(join(_0x2a2b5f[_0x3121ed(0x100)],..._0x3e21a7)+_0x3121ed(0xe9)),_0x2c1ea1=resolve(_0x2a2b5f[_0x3121ed(0x100)]);if(_0x4ca305!==_0x2c1ea1&&!_0x4ca305[_0x3121ed(0xf3)](_0x2c1ea1+sep))throw new Error(_0x3121ed(0xfb)+_0x4ca305);return _0x4ca305;}export function createHookLocationMap(_0x2bfec8){const _0x3f5d81=a238_0x220cd3,_0xd63a25=new Map();for(const _0x1211c5 of _0x2bfec8){_0x1211c5[_0x3f5d81(0xde)]&&_0xd63a25['set'](_0x1211c5[_0x3f5d81(0xde)],{'datasetCode':_0x1211c5[_0x3f5d81(0xd5)],'operationType':snakeToCamel(_0x1211c5[_0x3f5d81(0xf5)]),'functionNode':'before'}),_0x1211c5['afterScriptId']&&_0xd63a25[_0x3f5d81(0xe3)](_0x1211c5[_0x3f5d81(0xd8)],{'datasetCode':_0x1211c5[_0x3f5d81(0xd5)],'operationType':snakeToCamel(_0x1211c5[_0x3f5d81(0xf5)]),'functionNode':'after'});}return _0xd63a25;}function a238_0x3fd7(_0x5bc663,_0xd35107){_0x5bc663=_0x5bc663-0xd5;const _0x3fbe86=a238_0x3fbe();let _0x3fd71c=_0x3fbe86[_0x5bc663];return _0x3fd71c;}export function resolveRemoteScriptTarget(_0x15c14b,_0x545941,_0x367a0b,_0x4daf48,_0x507428){const _0x40a724=a238_0x220cd3,_0x50eb76=normalizeBffType(_0x545941[_0x40a724(0xe1)]);if(!_0x50eb76||!_0x545941['functionName'])return null;if(_0x50eb76==='HOOK'){const _0x27c8d1=(_0x545941['id']?_0x367a0b[_0x40a724(0xdd)](_0x545941['id']):undefined)??findHookLocationByRemoteId(_0x4daf48,_0x545941['id']);if(!_0x27c8d1)return null;const _0x2480c2=_0x27c8d1[_0x40a724(0xda)]||_0x507428['get'](_0x27c8d1[_0x40a724(0xd5)]),_0x5ac54e=_0x2480c2??_0x27c8d1['datasetCode'],_0x1c7db6={..._0x27c8d1,'alias':_0x2480c2},_0x4f28cd='HOOK/'+_0x5ac54e+'/'+_0x1c7db6[_0x40a724(0xf5)]+'/'+_0x1c7db6[_0x40a724(0xd9)]+'/'+_0x545941['functionName'];if(!_0x4f28cd[_0x40a724(0xdf)]('/')[_0x40a724(0xdb)](isSafeLockKeySegment))return null;return{'lockKey':_0x4f28cd,'filePath':resolveLocalFilePathFromLockKey(_0x15c14b,_0x4f28cd),'type':_0x40a724(0xd7),'hookLocation':_0x1c7db6};}const _0x2be14c=_0x50eb76+'/'+_0x545941['functionName'];if(!_0x2be14c[_0x40a724(0xdf)]('/')[_0x40a724(0xdb)](isSafeLockKeySegment))return null;return{'lockKey':_0x2be14c,'filePath':resolveLocalFilePathFromLockKey(_0x15c14b,_0x2be14c),'type':_0x50eb76};}export async function ensureParentDirectory(_0x3c4569){await mkdir(dirname(_0x3c4569),{'recursive':!![]});}export async function fileExists(_0x2e237b){try{return await access(_0x2e237b,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x1c8eb0){const _0x2d0ef1=a238_0x220cd3;try{const _0x1f65be=await stat(_0x1c8eb0);return _0x1f65be[_0x2d0ef1(0xf2)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2d4b9e,_0x43e198){const _0x193780=a239_0x22be,_0xf394cf=_0x2d4b9e();while(!![]){try{const _0x4667ee=parseInt(_0x193780(0x196))/0x1*(parseInt(_0x193780(0x197))/0x2)+-parseInt(_0x193780(0x19b))/0x3+parseInt(_0x193780(0x190))/0x4*(parseInt(_0x193780(0x19c))/0x5)+-parseInt(_0x193780(0x193))/0x6+-parseInt(_0x193780(0x18f))/0x7+-parseInt(_0x193780(0x199))/0x8*(parseInt(_0x193780(0x18e))/0x9)+parseInt(_0x193780(0x19a))/0xa*(parseInt(_0x193780(0x192))/0xb);if(_0x4667ee===_0x43e198)break;else _0xf394cf['push'](_0xf394cf['shift']());}catch(_0x448432){_0xf394cf['push'](_0xf394cf['shift']());}}}(a239_0xb421,0x94a6b));import{readFile}from'node:fs/promises';function a239_0x22be(_0x54dfa2,_0x16f133){_0x54dfa2=_0x54dfa2-0x18e;const _0xb421e7=a239_0xb421();let _0x22bef6=_0xb421e7[_0x54dfa2];return _0x22bef6;}import a239_0x5bb2f8 from'node:crypto';export function computeContentHash(_0x828809){const _0x15ba7b=a239_0x22be;return a239_0x5bb2f8['createHash'](_0x15ba7b(0x194))[_0x15ba7b(0x198)](_0x828809)[_0x15ba7b(0x195)](_0x15ba7b(0x191));}function a239_0xb421(){const _0x5afbfb=['580ndXFlI','8001wkJASX','6494257dzfOUc','20164haVtxH','hex','4166052WQSLER','2468754GXRbPB','md5','digest','3907joYFEe','486pIgwCc','update','1632mQarej','40NqUzJT','2758932kTVYCt'];a239_0xb421=function(){return _0x5afbfb;};return a239_0xb421();}export async function computeFileHash(_0x358b64){const _0x42a7fe=await readFile(_0x358b64,'utf8');return computeContentHash(_0x42a7fe);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x590dd4,_0x316924){const _0x2a945a=a240_0x225c,_0x1ede76=_0x590dd4();while(!![]){try{const _0x452a49=parseInt(_0x2a945a(0x69))/0x1*(parseInt(_0x2a945a(0x72))/0x2)+-parseInt(_0x2a945a(0x68))/0x3+parseInt(_0x2a945a(0x67))/0x4+parseInt(_0x2a945a(0x75))/0x5*(parseInt(_0x2a945a(0x70))/0x6)+-parseInt(_0x2a945a(0x6a))/0x7+-parseInt(_0x2a945a(0x6e))/0x8*(parseInt(_0x2a945a(0x6b))/0x9)+parseInt(_0x2a945a(0x73))/0xa;if(_0x452a49===_0x316924)break;else _0x1ede76['push'](_0x1ede76['shift']());}catch(_0x440ee7){_0x1ede76['push'](_0x1ede76['shift']());}}}(a240_0x561f,0x716de));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a240_0x225c(_0x2df489,_0x2dd350){_0x2df489=_0x2df489-0x64;const _0x561fbf=a240_0x561f();let _0x225c8f=_0x561fbf[_0x2df489];return _0x225c8f;}function a240_0x561f(){const _0x552be4=['171937wVBfPx','4818905UNKBfd','302301PxjAFG','scriptsRoot','utf8','40WNjqlB','lastSync','42XvAUXR','apps','6emSGks','59880MciYQW',':\x20scriptsRoot\x20mismatch\x20—\x20','612195ARBCQf','object','parse','Failed\x20to\x20read\x20Backend\x20Function\x20lock\x20file:\x20','code','\x22.\x20','ENOENT','functions','1299356qWDvEi','1148235dRTpMH'];a240_0x561f=function(){return _0x552be4;};return a240_0x561f();}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x595416,_0x232e60,_0x353f1b,_0x30d08d){const _0x254631=a240_0x225c,_0x4cd1a0={'apps':_0x595416[_0x254631(0x71)]&&typeof _0x595416[_0x254631(0x71)]===_0x254631(0x76)?_0x595416[_0x254631(0x71)]:{}};let _0x29f09a=_0x4cd1a0[_0x254631(0x71)][_0x232e60];if(!_0x29f09a)return _0x29f09a={'scriptsRoot':_0x353f1b,'lastSync':'','functions':{}},_0x4cd1a0[_0x254631(0x71)][_0x232e60]=_0x29f09a,{'lockData':_0x4cd1a0,'appLock':_0x29f09a};if(!_0x29f09a[_0x254631(0x6c)])_0x29f09a[_0x254631(0x6c)]=_0x353f1b;else{if(_0x29f09a[_0x254631(0x6c)]!==_0x353f1b)throw new Error(_0x30d08d+_0x254631(0x74)+('current\x20\x22'+_0x353f1b+'\x22\x20vs\x20lock\x20\x22'+_0x29f09a[_0x254631(0x6c)]+_0x254631(0x64))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x29f09a[_0x254631(0x66)]&&(_0x29f09a['functions']={}),!_0x29f09a[_0x254631(0x6f)]&&(_0x29f09a[_0x254631(0x6f)]=''),{'lockData':_0x4cd1a0,'appLock':_0x29f09a};}export async function readBffLockFile(_0x40ad1c){const _0xa9aba2=a240_0x225c;try{const _0x43ef52=await readFile(_0x40ad1c,_0xa9aba2(0x6d)),_0x10cb60=JSON[_0xa9aba2(0x77)](_0x43ef52);return{'apps':_0x10cb60[_0xa9aba2(0x71)]&&typeof _0x10cb60['apps']===_0xa9aba2(0x76)?_0x10cb60['apps']:{}};}catch(_0x1c5dab){if(_0x1c5dab[_0xa9aba2(0x79)]===_0xa9aba2(0x65))return null;throw new Error(_0xa9aba2(0x78)+String(_0x1c5dab));}}export async function writeBffLockFile(_0x2410cd,_0x54ac3c){await mkdir(dirname(_0x2410cd),{'recursive':!![]}),await writeFile(_0x2410cd,JSON['stringify'](_0x54ac3c,null,0x2),'utf8');}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a242_0x36d792=a242_0x272a;(function(_0x1fd381,_0x747699){const _0x18038e=a242_0x272a,_0x30bec3=_0x1fd381();while(!![]){try{const _0x12a2e9=parseInt(_0x18038e(0x1de))/0x1*(parseInt(_0x18038e(0x1f2))/0x2)+parseInt(_0x18038e(0x1ed))/0x3*(parseInt(_0x18038e(0x1df))/0x4)+parseInt(_0x18038e(0x1f3))/0x5+parseInt(_0x18038e(0x1e1))/0x6+-parseInt(_0x18038e(0x1ec))/0x7+parseInt(_0x18038e(0x1eb))/0x8*(parseInt(_0x18038e(0x1e7))/0x9)+parseInt(_0x18038e(0x1e5))/0xa*(-parseInt(_0x18038e(0x1f4))/0xb);if(_0x12a2e9===_0x747699)break;else _0x30bec3['push'](_0x30bec3['shift']());}catch(_0x4768bd){_0x30bec3['push'](_0x30bec3['shift']());}}}(a242_0x17be,0x462f2));export const DEFAULT_BFF_SCRIPT_DESCRIPTION=a242_0x36d792(0x1f8);const LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION='TODO:\x20add\x20script\x20description';export function snakeToCamel(_0x2829b4){const _0x6fcd12=a242_0x36d792;return _0x2829b4[_0x6fcd12(0x1e4)]()[_0x6fcd12(0x1e0)](/_([a-z])/g,(_0x577192,_0x3f5872)=>_0x3f5872['toUpperCase']());}function a242_0x272a(_0x18b86f,_0x31c122){_0x18b86f=_0x18b86f-0x1de;const _0x17beb6=a242_0x17be();let _0x272a2f=_0x17beb6[_0x18b86f];return _0x272a2f;}export function findHookLocationByRemoteId(_0x3be47a,_0x583a77){const _0x364136=a242_0x36d792;if(!_0x583a77)return undefined;for(const _0x33077b of Object[_0x364136(0x1e9)](_0x3be47a)){if(_0x33077b[_0x364136(0x1ef)]===_0x583a77&&_0x33077b[_0x364136(0x1e3)]&&_0x33077b[_0x364136(0x1ea)]&&_0x33077b['functionNode'])return{'datasetCode':_0x33077b['datasetCode'],'operationType':_0x33077b[_0x364136(0x1ea)],'functionNode':_0x33077b[_0x364136(0x1f0)]};}return undefined;}export function extractScriptDescription(_0x43be2d){const _0x594083=a242_0x36d792,_0x3f48d7=_0x43be2d[_0x594083(0x1f7)](/^\s*\/\*\*([\s\S]*?)\*\//);if(!_0x3f48d7?.[0x1])return undefined;const _0x17731e=_0x3f48d7[0x1],_0x402286=_0x413270=>{const _0xc7729f=_0x594083,_0x39b189=_0x413270?.[_0xc7729f(0x1f1)]();if(!_0x39b189||_0x39b189===DEFAULT_BFF_SCRIPT_DESCRIPTION||_0x39b189===LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION)return undefined;return _0x39b189;},_0x3e3a8a=_0x17731e['match'](/^\s*\*\s*\[\s*脚本描述\s*]\s*(.+)$/m);if(_0x3e3a8a)return _0x402286(_0x3e3a8a[0x1]);const _0x1fe24d=_0x17731e[_0x594083(0x1ee)](/\r?\n/)[_0x594083(0x1f9)](_0x1f89a4=>_0x1f89a4[_0x594083(0x1e0)](/^\s*\*\s?/,'')[_0x594083(0x1f1)]()),_0x4841f5=_0x1fe24d[_0x594083(0x1e2)](_0x3b080d=>/^\[\s*脚本类型\s*]\s*\S+/['test'](_0x3b080d))&&_0x1fe24d[_0x594083(0x1e2)](_0x2770ad=>/^\[\s*脚本名称\s*]\s*\S+/[_0x594083(0x1f5)](_0x2770ad));if(!_0x4841f5)return undefined;for(const _0x5666e1 of _0x1fe24d){if(!_0x5666e1||_0x5666e1[_0x594083(0x1f6)]('@')||/^\[[^\]]+]\s*/[_0x594083(0x1f5)](_0x5666e1))continue;return _0x402286(_0x5666e1);}return undefined;}export function isValidBffFunctionName(_0x5359e4){const _0x2f1599=a242_0x36d792;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x2f1599(0x1f5)](_0x5359e4);}export function normalizeHookFunctionNode(_0xb30787){const _0x5ecbcd=a242_0x36d792;if(!_0xb30787)return undefined;const _0x200d31=_0xb30787['trim']()[_0x5ecbcd(0x1e4)]();if(_0x200d31===_0x5ecbcd(0x1e8)||_0x200d31===_0x5ecbcd(0x1e6))return _0x200d31;return undefined;}function a242_0x17be(){const _0x1237f8=['TODO:\x20补充脚本功能描述','map','31sUyuCG','8DWlJTX','replace','1803336OERUvx','some','datasetCode','toLowerCase','1606460tOIlZn','after','29088llMzoC','before','values','operationType','344YSTeCv','1482565aFlKgS','196908rSwOpx','split','remoteId','functionNode','trim','32874kMZOoL','1110740GtMmFC','55yBfOSJ','test','startsWith','match'];a242_0x17be=function(){return _0x1237f8;};return a242_0x17be();}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1320a1,_0x1062f4){const _0x58e6b6=a243_0xc260,_0x1c682c=_0x1320a1();while(!![]){try{const _0x4f89e6=parseInt(_0x58e6b6(0x18e))/0x1*(parseInt(_0x58e6b6(0x17c))/0x2)+parseInt(_0x58e6b6(0x177))/0x3*(parseInt(_0x58e6b6(0x18a))/0x4)+parseInt(_0x58e6b6(0x18b))/0x5*(-parseInt(_0x58e6b6(0x185))/0x6)+-parseInt(_0x58e6b6(0x195))/0x7+parseInt(_0x58e6b6(0x186))/0x8+-parseInt(_0x58e6b6(0x183))/0x9+-parseInt(_0x58e6b6(0x190))/0xa*(-parseInt(_0x58e6b6(0x178))/0xb);if(_0x4f89e6===_0x1062f4)break;else _0x1c682c['push'](_0x1c682c['shift']());}catch(_0x5a9833){_0x1c682c['push'](_0x1c682c['shift']());}}}(a243_0x43a6,0x4011d));import{listDatasets}from'../core/api-client.js';function a243_0xc260(_0x539481,_0x4aa3df){_0x539481=_0x539481-0x177;const _0x43a67e=a243_0x43a6();let _0xc26076=_0x43a67e[_0x539481];return _0xc26076;}const cache=new Map();export async function listDatabases(_0xba7fdb){const _0x52d8aa=a243_0xc260;if(cache[_0x52d8aa(0x188)](_0xba7fdb))return cache[_0x52d8aa(0x192)](_0xba7fdb);const _0x513e5b=await listDatasets(_0xba7fdb),_0x5bf875=new Map();for(const _0x582aa9 of _0x513e5b){const _0x22258d=_0x582aa9[_0x52d8aa(0x184)];_0x22258d?.[_0x52d8aa(0x17e)]!=null&&_0x5bf875['set'](_0x22258d[_0x52d8aa(0x17e)],_0x22258d['dbName']??'db-'+_0x22258d[_0x52d8aa(0x17e)]);}const _0x4d59bc=[..._0x5bf875['entries']()][_0x52d8aa(0x18f)](([_0x250f64,_0x5ebfb0])=>({'dbId':_0x250f64,'dbName':_0x5ebfb0}));return cache[_0x52d8aa(0x180)](_0xba7fdb,_0x4d59bc),_0x4d59bc;}function a243_0x43a6(){const _0x97e3ad=['dbId','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','set','find','No\x20database\x20matching\x20\x22','4328658PTlUyX','dbtableConfig','510jGfSch','2589848yLehDA','dbName','has','.\x20Be\x20more\x20specific.','750744KkMKTg','16280CjZvzk','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','includes','15nwoCsg','map','1970IkuFTa','\x22\x20under\x20app\x20\x22','get','\x22.\x20Available:\x20','length','2142371xaxqdE','6VwJKOU','30833TnsLjj','toLowerCase','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','\x22\x20matches\x20multiple\x20databases:\x20','9988LILrmf','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'];a243_0x43a6=function(){return _0x97e3ad;};return a243_0x43a6();}export async function resolveDb(_0x44cbee,_0x48f95e){const _0x20eb20=a243_0xc260,_0x143821=await listDatabases(_0x44cbee);if(_0x143821[_0x20eb20(0x194)]===0x0)return{'resolved':[],'error':_0x20eb20(0x18c)+_0x44cbee+_0x20eb20(0x17d)};if(!_0x48f95e)return{'resolved':_0x143821};const _0x4d9083=Number(_0x48f95e);if(!Number['isNaN'](_0x4d9083)){const _0x7144c1=_0x143821[_0x20eb20(0x181)](_0x2f170e=>_0x2f170e['dbId']===_0x4d9083);if(_0x7144c1)return{'resolved':[_0x7144c1]};}const _0x2f0950=_0x48f95e[_0x20eb20(0x179)](),_0x6eb887=_0x143821['filter'](_0x4202c3=>_0x4202c3[_0x20eb20(0x187)]['toLowerCase']()[_0x20eb20(0x18d)](_0x2f0950));if(_0x6eb887['length']>0x0)return{'resolved':_0x6eb887};const _0x1425ad=_0x143821['map'](_0x28eb8a=>_0x28eb8a[_0x20eb20(0x187)]+'\x20('+_0x28eb8a['dbId']+')')['join'](',\x20');return{'resolved':[],'error':_0x20eb20(0x182)+_0x48f95e+_0x20eb20(0x191)+_0x44cbee+_0x20eb20(0x193)+_0x1425ad+_0x20eb20(0x17f)};}export async function resolveOneDb(_0x4db3cc,_0x13e073){const _0x1e9547=a243_0xc260,{resolved:_0x5cf0f5,error:_0x5d46f8}=await resolveDb(_0x4db3cc,_0x13e073);if(_0x5d46f8)return{'db':null,'error':_0x5d46f8};if(_0x5cf0f5['length']===0x1)return{'db':_0x5cf0f5[0x0]};if(!_0x13e073){const _0x3a4a9b=_0x5cf0f5['map'](_0x39566e=>_0x39566e[_0x1e9547(0x187)]+'\x20('+_0x39566e[_0x1e9547(0x17e)]+')')['join'](',\x20');return{'db':null,'error':_0x1e9547(0x17a)+_0x3a4a9b};}const _0x1f1fa7=_0x5cf0f5[_0x1e9547(0x18f)](_0x3f5fab=>_0x3f5fab[_0x1e9547(0x187)]+'\x20('+_0x3f5fab[_0x1e9547(0x17e)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x13e073+_0x1e9547(0x17b)+_0x1f1fa7+_0x1e9547(0x189)};}export async function getDbName(_0x4a7f1e,_0x4572de){const _0x44591e=a243_0xc260,_0x243616=await listDatabases(_0x4a7f1e);return _0x243616[_0x44591e(0x181)](_0x323e56=>_0x323e56[_0x44591e(0x17e)]===_0x4572de)?.['dbName'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a244_0x3dee(_0x90d2d3,_0x574f12){_0x90d2d3=_0x90d2d3-0x157;const _0x4f9703=a244_0x4f97();let _0x3dee4d=_0x4f9703[_0x90d2d3];return _0x3dee4d;}const a244_0x342bf0=a244_0x3dee;(function(_0x15e339,_0x1bc4fa){const _0x476d56=a244_0x3dee,_0x3711e1=_0x15e339();while(!![]){try{const _0x37e50d=parseInt(_0x476d56(0x16a))/0x1*(parseInt(_0x476d56(0x197))/0x2)+-parseInt(_0x476d56(0x173))/0x3*(-parseInt(_0x476d56(0x175))/0x4)+-parseInt(_0x476d56(0x18c))/0x5+parseInt(_0x476d56(0x19c))/0x6*(-parseInt(_0x476d56(0x157))/0x7)+parseInt(_0x476d56(0x15f))/0x8+parseInt(_0x476d56(0x15c))/0x9+-parseInt(_0x476d56(0x174))/0xa;if(_0x37e50d===_0x1bc4fa)break;else _0x3711e1['push'](_0x3711e1['shift']());}catch(_0x342895){_0x3711e1['push'](_0x3711e1['shift']());}}}(a244_0x4f97,0xa8124));import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=['schemaVersion',a244_0x342bf0(0x159),a244_0x342bf0(0x170),a244_0x342bf0(0x1a1),'strategyFingerprint','timingsMs'],HIT_KEYS=['documentId',a244_0x342bf0(0x18f),a244_0x342bf0(0x17f),a244_0x342bf0(0x16b),a244_0x342bf0(0x16e),a244_0x342bf0(0x16d),a244_0x342bf0(0x182),'rank',a244_0x342bf0(0x180),a244_0x342bf0(0x178),a244_0x342bf0(0x167)];export async function searchDevelopmentKnowledge(_0x306a82){const _0x56a5ac=a244_0x342bf0,_0x19430a=_0x306a82[_0x56a5ac(0x19d)][_0x56a5ac(0x196)](),_0x504c40=_0x306a82[_0x56a5ac(0x15a)]['trim']();if(!_0x19430a)throw CliErrors[_0x56a5ac(0x16c)]('Knowledge\x20search\x20appCode\x20is\x20required.');if(!_0x306a82[_0x56a5ac(0x1a3)][_0x56a5ac(0x196)]())throw CliErrors[_0x56a5ac(0x187)]();if(!_0x504c40)throw CliErrors[_0x56a5ac(0x16c)]('Knowledge\x20search\x20query\x20is\x20required.');validateTopK(_0x306a82['topK']);const _0x2e0da1=getKbDomain()+_0x56a5ac(0x17d);let _0x15d623;try{_0x15d623=await fetch(_0x2e0da1,{'method':_0x56a5ac(0x163),'headers':{'Content-Type':'application/json','Cookie':_0x306a82[_0x56a5ac(0x1a3)],'X-Invoke-Source':_0x56a5ac(0x15e)},'body':JSON[_0x56a5ac(0x1a2)]({'appCode':_0x19430a,'query':_0x504c40,..._0x306a82['topK']!==undefined?{'topK':_0x306a82['topK']}:{}}),'signal':_0x306a82['signal']});}catch(_0x5ea27c){if(_0x5ea27c instanceof CliError)throw _0x5ea27c;if(_0x5ea27c instanceof Error&&_0x5ea27c[_0x56a5ac(0x172)]===_0x56a5ac(0x18a))throw _0x5ea27c;throw CliErrors[_0x56a5ac(0x189)](_0x56a5ac(0x16f));}if(!hasNoStore(_0x15d623[_0x56a5ac(0x19e)]))throw CliErrors[_0x56a5ac(0x195)](_0x56a5ac(0x171));if(_0x15d623[_0x56a5ac(0x183)]===0x191)throw CliErrors['authRequired']();if(!_0x15d623['ok'])throw CliErrors[_0x56a5ac(0x195)](_0x56a5ac(0x18e)+_0x15d623[_0x56a5ac(0x183)]+').');if(!(_0x15d623[_0x56a5ac(0x19e)][_0x56a5ac(0x15d)](_0x56a5ac(0x179))??'')[_0x56a5ac(0x17e)]()[_0x56a5ac(0x185)](_0x56a5ac(0x199)))throw CliErrors[_0x56a5ac(0x195)](_0x56a5ac(0x165));let _0x5ad694;try{_0x5ad694=await _0x15d623[_0x56a5ac(0x194)]();}catch{throw CliErrors[_0x56a5ac(0x195)](_0x56a5ac(0x1a4));}return parseDevelopmentSearchResponse(readEnvelopeData(_0x5ad694),_0x306a82[_0x56a5ac(0x18b)]);}function a244_0x4f97(){const _0x1845f5=['json','apiError','trim','14772ixuDqM','no-store','application/json','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','isArray','205278sUoxUl','appCode','headers','development','data','hits','stringify','cookie','SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','56BqdyiY','score','profile','query','hits[','10886877tPjEGM','get','cli:rabetbase','443392RYwwIB','length','cache-control','response','POST','sort','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','string','scoreKind','some','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','3dZTvMB','scope','validation','text','title','SmartCode\x20knowledge\x20search\x20request\x20failed.','total','SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','name','27ElNvkF','13594250lKbyst','578948jVRYin','public','split','finalScore','content-type','isFinite','schemaVersion','number','/smartapi/knowledge/company-public/search','toLowerCase','chunkId','rawScore','documentId','tags','status','\x20contract.','includes','strategyFingerprint','authRequired','test','networkError','AbortError','topK','1341595FqVAed','response\x20envelope','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','revision','rank','success','isSafeInteger','timingsMs'];a244_0x4f97=function(){return _0x1845f5;};return a244_0x4f97();}function readEnvelopeData(_0x5ea034){const _0x490e5b=a244_0x342bf0,_0x4a9535=requireRecord(_0x5ea034,_0x490e5b(0x18d));if(_0x4a9535[_0x490e5b(0x191)]===![])throw CliErrors[_0x490e5b(0x195)]('SmartCode\x20knowledge\x20search\x20failed.');if(!(_0x490e5b(0x1a0)in _0x4a9535))throw invalidContract(_0x490e5b(0x18d));return _0x4a9535[_0x490e5b(0x1a0)];}function validateTopK(_0x272cf0){const _0x2af225=a244_0x342bf0;if(_0x272cf0!==undefined&&(!Number['isSafeInteger'](_0x272cf0)||_0x272cf0<0x1||_0x272cf0>0x32))throw CliErrors[_0x2af225(0x16c)](_0x2af225(0x19a));}function hasNoStore(_0x112cf7){const _0x22f0b6=a244_0x342bf0;return(_0x112cf7['get'](_0x22f0b6(0x161))??'')[_0x22f0b6(0x177)](',')[_0x22f0b6(0x168)](_0x542890=>_0x542890[_0x22f0b6(0x196)]()[_0x22f0b6(0x17e)]()===_0x22f0b6(0x198));}function parseDevelopmentSearchResponse(_0x1042a2,_0x3b0dd6){const _0x480bc2=a244_0x342bf0,_0x5eb321=requireExactRecord(_0x1042a2,RESPONSE_KEYS,_0x480bc2(0x162));if(_0x5eb321[_0x480bc2(0x17b)]!==0x2||_0x5eb321[_0x480bc2(0x159)]!==_0x480bc2(0x19f))throw invalidContract(_0x480bc2(0x159));if(!Array[_0x480bc2(0x19b)](_0x5eb321[_0x480bc2(0x1a1)])||_0x5eb321[_0x480bc2(0x1a1)][_0x480bc2(0x160)]>(_0x3b0dd6??0x32))throw invalidContract('hits');if(typeof _0x5eb321[_0x480bc2(0x186)]!==_0x480bc2(0x166)||!/^sha256:[0-9a-f]{64}$/[_0x480bc2(0x188)](_0x5eb321['strategyFingerprint']))throw invalidContract(_0x480bc2(0x186));const _0x13d7a1=requireRecord(_0x5eb321[_0x480bc2(0x193)],_0x480bc2(0x193)),_0x136d2f={};for(const [_0x32b596,_0x56debb]of Object['entries'](_0x13d7a1)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x480bc2(0x188)](_0x32b596)||typeof _0x56debb!==_0x480bc2(0x17c)||!Number[_0x480bc2(0x17a)](_0x56debb)||_0x56debb<0x0)throw invalidContract(_0x480bc2(0x193));_0x136d2f[_0x32b596]=_0x56debb;}const _0x1ecc08=_0x5eb321['hits']['map']((_0x2d2ef4,_0x3876ea)=>parseHit(_0x2d2ef4,_0x3876ea));if(!Number[_0x480bc2(0x192)](_0x5eb321[_0x480bc2(0x170)])||_0x5eb321[_0x480bc2(0x170)]!==_0x1ecc08[_0x480bc2(0x160)])throw invalidContract('total');return{'schemaVersion':_0x5eb321[_0x480bc2(0x17b)],'profile':_0x5eb321[_0x480bc2(0x159)],'total':_0x5eb321['total'],'strategyFingerprint':_0x5eb321[_0x480bc2(0x186)],'timingsMs':_0x136d2f,'hits':_0x1ecc08};}function parseHit(_0xe0ed03,_0x265d99){const _0xc5a3bc=a244_0x342bf0,_0x1c0cf9=requireExactRecord(_0xe0ed03,HIT_KEYS,_0xc5a3bc(0x15b)+_0x265d99+']'),_0xd25dcf=_0x3c5f2e=>{const _0x58886a=_0xc5a3bc,_0x179b84=_0x1c0cf9[_0x3c5f2e];if(typeof _0x179b84!==_0x58886a(0x166)||!_0x179b84)throw invalidContract(_0x3c5f2e);return _0x179b84;};if(!Number[_0xc5a3bc(0x192)](_0x1c0cf9[_0xc5a3bc(0x18f)])||_0x1c0cf9['revision']<0x1)throw invalidContract(_0xc5a3bc(0x18f));if(_0x1c0cf9[_0xc5a3bc(0x16b)]!==_0xc5a3bc(0x176)&&_0x1c0cf9[_0xc5a3bc(0x16b)]!=='company')throw invalidContract(_0xc5a3bc(0x16b));if(typeof _0x1c0cf9[_0xc5a3bc(0x16e)]!==_0xc5a3bc(0x166)||typeof _0x1c0cf9[_0xc5a3bc(0x16d)]!==_0xc5a3bc(0x166))throw invalidContract(_0xc5a3bc(0x16d));if(!Array['isArray'](_0x1c0cf9['tags'])||_0x1c0cf9[_0xc5a3bc(0x182)]['some'](_0x3a0d14=>typeof _0x3a0d14!==_0xc5a3bc(0x166)))throw invalidContract(_0xc5a3bc(0x182));if(!Number['isSafeInteger'](_0x1c0cf9[_0xc5a3bc(0x190)])||_0x1c0cf9[_0xc5a3bc(0x190)]!==_0x265d99+0x1)throw invalidContract(_0xc5a3bc(0x190));if(!isFiniteNumber(_0x1c0cf9[_0xc5a3bc(0x180)])||!isFiniteNumber(_0x1c0cf9['finalScore']))throw invalidContract(_0xc5a3bc(0x158));return{'documentId':_0xd25dcf(_0xc5a3bc(0x181)),'revision':_0x1c0cf9['revision'],'chunkId':_0xd25dcf(_0xc5a3bc(0x17f)),'scope':_0x1c0cf9['scope'],'title':_0x1c0cf9['title'],'text':_0x1c0cf9[_0xc5a3bc(0x16d)],'tags':[..._0x1c0cf9[_0xc5a3bc(0x182)]],'rank':_0x1c0cf9[_0xc5a3bc(0x190)],'rawScore':_0x1c0cf9['rawScore'],'finalScore':_0x1c0cf9[_0xc5a3bc(0x178)],'scoreKind':_0xd25dcf('scoreKind')};}function requireExactRecord(_0x3d0383,_0x5470e8,_0x3bb9fc){const _0x250ac7=a244_0x342bf0,_0x3f057e=requireRecord(_0x3d0383,_0x3bb9fc),_0x3ab90e=Object['keys'](_0x3f057e)['sort'](),_0x4b1abc=[..._0x5470e8][_0x250ac7(0x164)]();if(_0x3ab90e['length']!==_0x4b1abc[_0x250ac7(0x160)]||_0x3ab90e[_0x250ac7(0x168)]((_0x4bd664,_0xc8179d)=>_0x4bd664!==_0x4b1abc[_0xc8179d]))throw invalidContract(_0x3bb9fc);return _0x3f057e;}function requireRecord(_0x4f9ef6,_0x2b4b7b){const _0x341d8a=a244_0x342bf0;if(!_0x4f9ef6||typeof _0x4f9ef6!=='object'||Array[_0x341d8a(0x19b)](_0x4f9ef6))throw invalidContract(_0x2b4b7b);return _0x4f9ef6;}function isFiniteNumber(_0x1d06e3){const _0x1a871d=a244_0x342bf0;return typeof _0x1d06e3===_0x1a871d(0x17c)&&Number[_0x1a871d(0x17a)](_0x1d06e3);}function invalidContract(_0x1dfc2d){const _0x2fe88f=a244_0x342bf0;return CliErrors[_0x2fe88f(0x195)](_0x2fe88f(0x169)+_0x1dfc2d+_0x2fe88f(0x184));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a245_0x1719f3=a245_0x268e;(function(_0x2ec4a8,_0x55de98){const _0x11285a=a245_0x268e,_0x3c4d02=_0x2ec4a8();while(!![]){try{const _0x521ff4=parseInt(_0x11285a(0x77))/0x1*(parseInt(_0x11285a(0x76))/0x2)+-parseInt(_0x11285a(0x80))/0x3*(parseInt(_0x11285a(0x7e))/0x4)+parseInt(_0x11285a(0x74))/0x5*(parseInt(_0x11285a(0x72))/0x6)+parseInt(_0x11285a(0x7f))/0x7+-parseInt(_0x11285a(0x81))/0x8+parseInt(_0x11285a(0x7a))/0x9+-parseInt(_0x11285a(0x73))/0xa*(parseInt(_0x11285a(0x79))/0xb);if(_0x521ff4===_0x55de98)break;else _0x3c4d02['push'](_0x3c4d02['shift']());}catch(_0x5032b1){_0x3c4d02['push'](_0x3c4d02['shift']());}}}(a245_0x4131,0xd85ca));import{constants}from'node:fs';function a245_0x268e(_0x1902d8,_0x4e6a3f){_0x1902d8=_0x1902d8-0x71;const _0x413148=a245_0x4131();let _0x268e08=_0x413148[_0x1902d8];return _0x268e08;}import{access,mkdir}from'node:fs/promises';function a245_0x4131(){const _0x3e2cf6=['2053410ssxqgn','2020pEKinY','10CdkDJs','appPagesDir','34966OjbeUE','58TUdpjK','toUpperCase','125719DpapHQ','15883011xBqPUh','cwd','F_OK','.json','64FnIBJW','3928722ReGEiR','23043VMXaxD','5653896ySwQlV','.rabetbase','page'];a245_0x4131=function(){return _0x3e2cf6;};return a245_0x4131();}import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x4d5b22,_0x33b996=process[a245_0x1719f3(0x7b)]()){const _0x5e55fa=a245_0x1719f3,_0xab958c=resolve(_0x33b996),_0x466b84=join(_0xab958c,'.rabetbase',_0x5e55fa(0x71));return{'projectRoot':_0xab958c,'pagesBaseDir':_0x466b84,'appPagesDir':join(_0x466b84,_0x4d5b22),'lockFilePath':join(_0xab958c,_0x5e55fa(0x82),'page.lock.json')};}export function buildPageFileName(_0x32abf1,_0x18f4f4){const _0x427393=a245_0x1719f3;return _0x32abf1+'-'+String(_0x18f4f4)[_0x427393(0x78)]()+_0x427393(0x7d);}export function resolvePageFilePath(_0x2c8507,_0x29de3c,_0x4a183e){const _0xa4a2f0=a245_0x1719f3;return join(_0x2c8507[_0xa4a2f0(0x75)],buildPageFileName(_0x29de3c,_0x4a183e));}export async function ensureParentDirectory(_0x1427a7){await mkdir(dirname(_0x1427a7),{'recursive':!![]});}export async function fileExists(_0x5a4b1b){const _0x47c0b2=a245_0x1719f3;try{return await access(_0x5a4b1b,constants[_0x47c0b2(0x7c)]),!![];}catch{return![];}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1900e9,_0x1c1e4d){const _0x55e025=a246_0x2fe3,_0x38b783=_0x1900e9();while(!![]){try{const _0xcd3afc=-parseInt(_0x55e025(0x1e6))/0x1*(parseInt(_0x55e025(0x1db))/0x2)+-parseInt(_0x55e025(0x1de))/0x3*(-parseInt(_0x55e025(0x1d7))/0x4)+-parseInt(_0x55e025(0x1dc))/0x5+-parseInt(_0x55e025(0x1e2))/0x6*(-parseInt(_0x55e025(0x1e1))/0x7)+parseInt(_0x55e025(0x1d9))/0x8+-parseInt(_0x55e025(0x1d8))/0x9*(parseInt(_0x55e025(0x1e5))/0xa)+-parseInt(_0x55e025(0x1dd))/0xb;if(_0xcd3afc===_0x1c1e4d)break;else _0x38b783['push'](_0x38b783['shift']());}catch(_0x3fe22c){_0x38b783['push'](_0x38b783['shift']());}}}(a246_0x5761,0x95e0a));function a246_0x2fe3(_0x2844e2,_0x2627b7){_0x2844e2=_0x2844e2-0x1d7;const _0x576187=a246_0x5761();let _0x2fe354=_0x576187[_0x2844e2];return _0x2fe354;}import a246_0x431d38 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x3820a0){const _0x59201d=a246_0x2fe3;return JSON[_0x59201d(0x1e4)](JSON[_0x59201d(0x1df)](_0x3820a0),null,0x2)+'\x0a';}export function computePageContentHash(_0x3bdea6){const _0xe4c2a=a246_0x2fe3;return a246_0x431d38[_0xe4c2a(0x1e3)](_0xe4c2a(0x1e0))[_0xe4c2a(0x1da)](_0x3bdea6)[_0xe4c2a(0x1e8)]('hex');}export function computeSerializedSchemaHash(_0x299def){return computePageContentHash(serializePageSchemaForFile(_0x299def));}function a246_0x5761(){const _0x34127b=['8jfjJtl','801okAeDs','7241672mYlaNu','update','79172SKWviT','2745260bpOOma','998613MpeiOZ','1611618wyNdYz','parse','md5','3514EYIhms','7206xzySOa','createHash','stringify','91480CHpSud','13LJZWIq','utf8','digest'];a246_0x5761=function(){return _0x34127b;};return a246_0x5761();}export async function computePageFileHash(_0x5a0c59){const _0x1b2442=a246_0x2fe3,_0x452846=await readFile(_0x5a0c59,_0x1b2442(0x1e7));return computePageContentHash(_0x452846);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1afbef,_0x3acfe0){const _0x2d04a6=a247_0x13de,_0x1322b9=_0x1afbef();while(!![]){try{const _0x1b68d1=parseInt(_0x2d04a6(0xb7))/0x1+parseInt(_0x2d04a6(0xbd))/0x2*(-parseInt(_0x2d04a6(0xb8))/0x3)+-parseInt(_0x2d04a6(0xc3))/0x4+parseInt(_0x2d04a6(0xb6))/0x5*(parseInt(_0x2d04a6(0xb9))/0x6)+-parseInt(_0x2d04a6(0xbf))/0x7*(-parseInt(_0x2d04a6(0xc6))/0x8)+parseInt(_0x2d04a6(0xc2))/0x9*(-parseInt(_0x2d04a6(0xc7))/0xa)+parseInt(_0x2d04a6(0xbb))/0xb*(parseInt(_0x2d04a6(0xba))/0xc);if(_0x1b68d1===_0x3acfe0)break;else _0x1322b9['push'](_0x1322b9['shift']());}catch(_0x19ba3b){_0x1322b9['push'](_0x1322b9['shift']());}}}(a247_0x5154,0x19a1b));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a247_0x5154(){const _0x815014=['302660SyJmIR','parse','pages','382585tajRIz','18864yDMGuV','201AVmYsZ','6sLNwqQ','6192bNmkOW','5401yjGkqy','code','6038YoTjsZ','lastSync','723527dCKPku','object','utf8','27McVeWK','629604GSoRkg','apps','ENOENT','16GGEDIY'];a247_0x5154=function(){return _0x815014;};return a247_0x5154();}function a247_0x13de(_0x9821b5,_0x15967e){_0x9821b5=_0x9821b5-0xb4;const _0x515425=a247_0x5154();let _0x13de56=_0x515425[_0x9821b5];return _0x13de56;}export function ensurePageLockScope(_0x143e1e,_0x449983){const _0x1eca2b=a247_0x13de,_0x5765dd={'apps':_0x143e1e[_0x1eca2b(0xc4)]&&typeof _0x143e1e[_0x1eca2b(0xc4)]==='object'?_0x143e1e['apps']:{}};let _0x9e3c7b=_0x5765dd[_0x1eca2b(0xc4)][_0x449983];if(!_0x9e3c7b)return _0x9e3c7b={'lastSync':'','pages':{}},_0x5765dd[_0x1eca2b(0xc4)][_0x449983]=_0x9e3c7b,{'lockData':_0x5765dd,'appLock':_0x9e3c7b};return!_0x9e3c7b[_0x1eca2b(0xbe)]&&(_0x9e3c7b[_0x1eca2b(0xbe)]=''),(!_0x9e3c7b[_0x1eca2b(0xb5)]||typeof _0x9e3c7b[_0x1eca2b(0xb5)]!==_0x1eca2b(0xc0))&&(_0x9e3c7b[_0x1eca2b(0xb5)]={}),{'lockData':_0x5765dd,'appLock':_0x9e3c7b};}export async function readPageLockFile(_0x2afba2){const _0x2d3965=a247_0x13de;try{const _0x43784f=await readFile(_0x2afba2,_0x2d3965(0xc1)),_0x4c5463=JSON[_0x2d3965(0xb4)](_0x43784f);return{'apps':_0x4c5463[_0x2d3965(0xc4)]&&typeof _0x4c5463['apps']===_0x2d3965(0xc0)?_0x4c5463[_0x2d3965(0xc4)]:{}};}catch(_0x1c3129){if(_0x1c3129[_0x2d3965(0xbc)]===_0x2d3965(0xc5))return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0x1c3129));}}export async function writePageLockFile(_0x16c791,_0x20f50b){await mkdir(dirname(_0x16c791),{'recursive':!![]}),await writeFile(_0x16c791,JSON['stringify'](_0x20f50b,null,0x2),'utf8');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x37a48f,_0x27ffc3){const _0x3bd5b8=a249_0x2a7a,_0x15d61d=_0x37a48f();while(!![]){try{const _0x448e07=-parseInt(_0x3bd5b8(0x126))/0x1+parseInt(_0x3bd5b8(0x110))/0x2+-parseInt(_0x3bd5b8(0x124))/0x3*(-parseInt(_0x3bd5b8(0x144))/0x4)+-parseInt(_0x3bd5b8(0x14a))/0x5+parseInt(_0x3bd5b8(0x123))/0x6+parseInt(_0x3bd5b8(0x109))/0x7+-parseInt(_0x3bd5b8(0x11d))/0x8;if(_0x448e07===_0x27ffc3)break;else _0x15d61d['push'](_0x15d61d['shift']());}catch(_0x15d192){_0x15d61d['push'](_0x15d61d['shift']());}}}(a249_0x22ad,0x467cc));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x54551d,_0x4290fb){const _0x456893=a249_0x2a7a,_0x33e150=[],_0x2c0d80=normalizeSqlForStaticAnalysis(_0x54551d),_0x2cef88=(_0x2c0d80[_0x456893(0x141)]?[]:extractJoinFacts(_0x2c0d80[_0x456893(0x10b)]))[_0x456893(0x130)](_0x3f48c1=>{const _0x4f345f=_0x456893;if(_0x3f48c1['unsupportedPredicate']||_0x3f48c1[_0x4f345f(0x133)][_0x4f345f(0x115)]===0x0)return _0x33e150[_0x4f345f(0x10d)]({'code':_0x4f345f(0x12c),'table':_0x3f48c1['table'],'alias':_0x3f48c1['alias'],'columns':_0x3f48c1[_0x4f345f(0x133)],'reason':_0x3f48c1['unsupportedReason']??_0x4f345f(0x106)}),{'table':_0x3f48c1[_0x4f345f(0x12e)],'alias':_0x3f48c1[_0x4f345f(0x12d)],'columns':_0x3f48c1[_0x4f345f(0x133)],'status':_0x4f345f(0x134)};const _0x390335=resolveTableMetadata(_0x4290fb,_0x3f48c1[_0x4f345f(0x12e)]),_0x2146b4=(_0x390335?.[_0x4f345f(0x11e)]??[])['map'](_0x8888d=>({'index':_0x8888d,'matchedPrefix':findEqualityPrefix(_0x8888d['columns'],_0x3f48c1['columns'])}))[_0x4f345f(0x129)](_0x91c907=>_0x91c907[_0x4f345f(0x149)]['length']>0x0),_0x27c574=_0x2146b4[_0x4f345f(0x128)]((_0x5ae464,_0x1de522)=>!_0x5ae464||_0x1de522[_0x4f345f(0x149)][_0x4f345f(0x115)]>_0x5ae464['matchedPrefix']['length']?_0x1de522:_0x5ae464,_0x2146b4[0x0]);if(_0x27c574)return{'table':_0x3f48c1[_0x4f345f(0x12e)],'alias':_0x3f48c1[_0x4f345f(0x12d)],'columns':_0x3f48c1[_0x4f345f(0x133)],'status':'covered','matchedIndex':{..._0x27c574[_0x4f345f(0x11f)],'matchedPrefix':_0x27c574[_0x4f345f(0x149)]}};const _0x4abe59=_0x390335?.['indexes'][_0x4f345f(0x129)](_0x24a016=>_0x24a016[_0x4f345f(0x133)][_0x4f345f(0x10f)](_0x11a94c=>_0x3f48c1['columns'][_0x4f345f(0x10f)](_0x5cf572=>columnNamesMatch(_0x11a94c,_0x5cf572))))??[];if(_0x4abe59[_0x4f345f(0x115)]>0x0)return _0x33e150['push']({'code':'JOIN_INDEX_NOT_USABLE','table':_0x3f48c1['table'],'alias':_0x3f48c1[_0x4f345f(0x12d)],'columns':_0x3f48c1['columns'],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x3f48c1[_0x4f345f(0x12e)],'alias':_0x3f48c1[_0x4f345f(0x12d)],'columns':_0x3f48c1[_0x4f345f(0x133)],'status':_0x4f345f(0x14e),'candidateIndexes':_0x4abe59};if(_0x390335&&_0x390335[_0x4f345f(0x13b)]!==![]&&_0x390335[_0x4f345f(0x11e)]['length']>0x0&&_0x3f48c1['columns']['length']>0x0)return _0x33e150[_0x4f345f(0x10d)]({'code':'JOIN_INDEX_MISSING','table':_0x3f48c1['table'],'alias':_0x3f48c1[_0x4f345f(0x12d)],'columns':_0x3f48c1[_0x4f345f(0x133)],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x3f48c1[_0x4f345f(0x12e)],'alias':_0x3f48c1[_0x4f345f(0x12d)],'columns':_0x3f48c1[_0x4f345f(0x133)],'status':_0x4f345f(0x14e)};return _0x33e150[_0x4f345f(0x10d)]({'code':_0x4f345f(0x138),'table':_0x3f48c1['table'],'alias':_0x3f48c1[_0x4f345f(0x12d)],'columns':_0x3f48c1[_0x4f345f(0x133)],'reason':_0x390335?_0x4f345f(0x107):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x3f48c1[_0x4f345f(0x12e)],'alias':_0x3f48c1[_0x4f345f(0x12d)],'columns':_0x3f48c1[_0x4f345f(0x133)],'status':_0x4f345f(0x134)};});return{'checked':_0x2cef88[_0x456893(0x115)]>0x0,'joins':_0x2cef88,'warnings':_0x33e150};}function extractJoinFacts(_0x13cac5){const _0x455edf=a249_0x2a7a,_0x15fc47=maskNestedQueries(stripSqlNoise(_0x13cac5)),_0x2dee89=maskQuotedIdentifiers(_0x15fc47),_0x3ba370=[],_0x17d9b4=new Set(),_0x1541f4=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0xfca3ec of _0x15fc47[_0x455edf(0x125)](_0x1541f4)){const _0x2d73a5=_0xfca3ec[_0x455edf(0x11f)]??0x0,_0xd03863=_0xfca3ec[0x0]['search'](/\bJOIN\b/i),_0xc4a0d4=_0x2d73a5+Math[_0x455edf(0x131)](0x0,_0xd03863);if(!/^JOIN\b/i[_0x455edf(0x14c)](_0x2dee89['slice'](_0xc4a0d4)))continue;_0x17d9b4[_0x455edf(0x140)](_0xc4a0d4);const _0xe59577=normalizeIdentifier(_0xfca3ec[0x1]||_0x455edf(0x136)),_0xad0fa4=normalizeIdentifier(_0xfca3ec[0x2]??''),_0x40cedd=normalizeIdentifier(_0xfca3ec[0x3]||_0xad0fa4[_0x455edf(0x147)]('.')['at'](-0x1)||_0xad0fa4),_0x3f3a33=[],_0x289c1a=_0xad0fa4===_0x455edf(0x143);let _0x533252=_0xe59577===_0x455edf(0x14d)||_0xe59577===_0x455edf(0x11a)||_0x289c1a,_0x5e9073=_0x533252?_0x289c1a?_0x455edf(0x142):_0xe59577[_0x455edf(0x145)]()+_0x455edf(0x112):undefined;const _0x22f46f=stripOuterParentheses(_0xfca3ec[0x4]??''),_0x1ecd3f=_0x22f46f[_0x455edf(0x13c)](MYBATIS_DYNAMIC_START_MARKER)||_0x22f46f[_0x455edf(0x13c)](MYBATIS_DYNAMIC_END_MARKER),_0x566ed8=_0x22f46f[_0x455edf(0x13c)](MYBATIS_INCLUDE_MARKER);_0x1ecd3f&&(_0x533252=!![],_0x5e9073??=_0x455edf(0x11c));_0x566ed8&&(_0x533252=!![],_0x5e9073??=_0x455edf(0x121));const _0x434885=_0x22f46f[_0x455edf(0x113)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x455edf(0x113)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x455edf(0x113)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x434885,'OR')&&(_0x533252=!![],_0x5e9073??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.');for(const _0x1ed959 of splitTopLevelAnd(_0x434885)){const _0x2f56e3=stripOuterParentheses(_0x1ed959);if(hasTopLevelKeyword(_0x2f56e3,'OR')){_0x533252=!![],_0x5e9073??=_0x455edf(0x10c);continue;}const _0x158a4e=splitEquality(_0x2f56e3);if(!_0x158a4e){containsColumnReference(_0x1ed959,_0x40cedd)&&(_0x533252=!![]);continue;}const _0xca6a34=parseDirectColumnReference(_0x158a4e[0x0],_0x40cedd),_0xd76795=parseDirectColumnReference(_0x158a4e[0x1],_0x40cedd),_0x5d83c8=containsColumnReference(_0x158a4e[0x0],_0x40cedd),_0x16ab52=containsColumnReference(_0x158a4e[0x1],_0x40cedd),_0x167f21=_0xca6a34&&!_0x16ab52?_0xca6a34:_0xd76795&&!_0x5d83c8?_0xd76795:null;if(_0x167f21&&!_0x3f3a33[_0x455edf(0x13c)](_0x167f21))_0x3f3a33[_0x455edf(0x10d)](_0x167f21);else!_0x167f21&&containsColumnReference(_0x1ed959,_0x40cedd)&&(_0x533252=!![]);}_0x3ba370['push']({'table':_0xad0fa4,'alias':_0x40cedd,'columns':_0x3f3a33,'unsupportedPredicate':_0x533252,'unsupportedReason':_0x5e9073,'containsUnresolvedInclude':_0x566ed8,'position':_0xc4a0d4});}for(const _0x32e2a3 of _0x2dee89[_0x455edf(0x125)](/\bJOIN\b/gi)){const _0x7d52ed=_0x32e2a3[_0x455edf(0x11f)]??0x0;if(_0x17d9b4[_0x455edf(0x116)](_0x7d52ed))continue;const _0x18be16=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x455edf(0x13e)](_0x15fc47[_0x455edf(0x10e)](_0x7d52ed+_0x32e2a3[0x0][_0x455edf(0x115)])),_0x1067c7=normalizeIdentifier(_0x18be16?.[0x1]||_0x455edf(0x127)),_0x2ea0a3=normalizeIdentifier(_0x18be16?.[0x2]||''),_0x147438=isSqlClauseKeyword(_0x2ea0a3)?_0x1067c7[_0x455edf(0x147)]('.')['at'](-0x1)||_0x1067c7:_0x2ea0a3||_0x1067c7[_0x455edf(0x147)]('.')['at'](-0x1)||_0x1067c7;_0x3ba370[_0x455edf(0x10d)]({'table':_0x1067c7,'alias':_0x147438,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x455edf(0x14b),'position':_0x7d52ed});}const _0x3fd78c=_0x2dee89[_0x455edf(0x118)](MYBATIS_INCLUDE_MARKER);return _0x3fd78c>=0x0&&!_0x3ba370[_0x455edf(0x10f)](_0x42b3bc=>_0x42b3bc[_0x455edf(0x122)])&&_0x3ba370['push']({'table':_0x455edf(0x127),'alias':_0x455edf(0x127),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x455edf(0x12f),'containsUnresolvedInclude':!![],'position':_0x3fd78c}),_0x3ba370[_0x455edf(0x105)]((_0x370920,_0x3a31fc)=>_0x370920[_0x455edf(0x120)]-_0x3a31fc['position']);}function stripSqlNoise(_0x3e8e30){const _0x16e1f3=a249_0x2a7a,_0x292b52=Array['from'](_0x3e8e30),_0x3ae1f2=(_0x32ae11,_0x5e2a77)=>{for(let _0x116c80=_0x32ae11;_0x116c80<_0x5e2a77;_0x116c80+=0x1){_0x292b52[_0x116c80]!=='\x0a'&&_0x292b52[_0x116c80]!=='\x0d'&&(_0x292b52[_0x116c80]='\x20');}};for(let _0x4fa1e2=0x0;_0x4fa1e2<_0x292b52[_0x16e1f3(0x115)];_0x4fa1e2+=0x1){const _0x3890ca=_0x292b52[_0x4fa1e2],_0x2e6b17=_0x292b52[_0x4fa1e2+0x1];if(_0x3890ca==='\x27'||_0x3890ca==='\x22'||_0x3890ca==='`'){const _0x3c8ab3=_0x3890ca,_0x19d016=_0x4fa1e2;_0x4fa1e2+=0x1;while(_0x4fa1e2<_0x292b52[_0x16e1f3(0x115)]){if(_0x292b52[_0x4fa1e2]==='\x5c'&&_0x4fa1e2+0x1<_0x292b52[_0x16e1f3(0x115)]){_0x4fa1e2+=0x2;continue;}if(_0x292b52[_0x4fa1e2]!==_0x3c8ab3){_0x4fa1e2+=0x1;continue;}if(_0x292b52[_0x4fa1e2+0x1]===_0x3c8ab3){_0x4fa1e2+=0x2;continue;}break;}if(_0x3c8ab3==='\x27')_0x3ae1f2(_0x19d016,Math['min'](_0x4fa1e2+0x1,_0x292b52[_0x16e1f3(0x115)]));continue;}if(_0x3890ca==='-'&&_0x2e6b17==='-'){const _0x822f5c=_0x4fa1e2;while(_0x4fa1e2<_0x292b52[_0x16e1f3(0x115)]&&_0x292b52[_0x4fa1e2]!=='\x0a')_0x4fa1e2+=0x1;_0x3ae1f2(_0x822f5c,_0x4fa1e2);continue;}if(_0x3890ca==='/'&&_0x2e6b17==='*'){const _0x4f8fe6=_0x4fa1e2;_0x4fa1e2+=0x2;while(_0x4fa1e2<_0x292b52['length']&&!(_0x292b52[_0x4fa1e2]==='*'&&_0x292b52[_0x4fa1e2+0x1]==='/')){_0x4fa1e2+=0x1;}_0x4fa1e2=Math[_0x16e1f3(0x12b)](_0x4fa1e2+0x1,_0x292b52['length']-0x1),_0x3ae1f2(_0x4f8fe6,_0x4fa1e2+0x1);continue;}if(_0x3890ca==='#'&&_0x2e6b17!=='{'){const _0x1cdbcc=_0x4fa1e2;while(_0x4fa1e2<_0x292b52[_0x16e1f3(0x115)]&&_0x292b52[_0x4fa1e2]!=='\x0a')_0x4fa1e2+=0x1;_0x3ae1f2(_0x1cdbcc,_0x4fa1e2);continue;}if((_0x3890ca==='#'||_0x3890ca==='$')&&_0x2e6b17==='{'){const _0xc5ff40=_0x4fa1e2;_0x4fa1e2+=0x2;while(_0x4fa1e2<_0x292b52[_0x16e1f3(0x115)]&&_0x292b52[_0x4fa1e2]!=='}')_0x4fa1e2+=0x1;_0x3ae1f2(_0xc5ff40,Math['min'](_0x4fa1e2+0x1,_0x292b52[_0x16e1f3(0x115)]));}}return _0x292b52[_0x16e1f3(0x13d)]('');}function maskQuotedIdentifiers(_0x18a45f){const _0x2b28c6=a249_0x2a7a,_0x726cb5=Array[_0x2b28c6(0x139)](_0x18a45f);for(let _0x17a28e=0x0;_0x17a28e<_0x726cb5[_0x2b28c6(0x115)];_0x17a28e+=0x1){const _0x24d5ee=_0x726cb5[_0x17a28e];if(_0x24d5ee!=='\x22'&&_0x24d5ee!=='`')continue;_0x17a28e+=0x1;while(_0x17a28e<_0x726cb5[_0x2b28c6(0x115)]){if(_0x726cb5[_0x17a28e]===_0x24d5ee){if(_0x726cb5[_0x17a28e+0x1]===_0x24d5ee){_0x726cb5[_0x17a28e]='\x20',_0x726cb5[_0x17a28e+0x1]='\x20',_0x17a28e+=0x2;continue;}break;}_0x726cb5[_0x17a28e]='\x20',_0x17a28e+=0x1;}}return _0x726cb5[_0x2b28c6(0x13d)]('');}function maskNestedQueries(_0x9d1f13){const _0x58f9e9=a249_0x2a7a,_0x1e21ed=Array['from'](_0x9d1f13);for(let _0x18ef0a=0x0;_0x18ef0a<_0x1e21ed[_0x58f9e9(0x115)];_0x18ef0a+=0x1){if(_0x1e21ed[_0x18ef0a]!=='(')continue;const _0x5e8011=_0x9d1f13[_0x58f9e9(0x10e)](_0x18ef0a+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x58f9e9(0x14c)](_0x5e8011))continue;let _0x6da6fe=0x1,_0x1afcc4=_0x18ef0a+0x1;for(;_0x1afcc4<_0x1e21ed['length']&&_0x6da6fe>0x0;_0x1afcc4+=0x1){if(_0x1e21ed[_0x1afcc4]==='(')_0x6da6fe+=0x1;if(_0x1e21ed[_0x1afcc4]===')')_0x6da6fe-=0x1;}if(_0x6da6fe!==0x0)continue;for(let _0x2d7573=_0x18ef0a;_0x2d7573<_0x1afcc4;_0x2d7573+=0x1){_0x1e21ed[_0x2d7573]='\x20';}const _0x334978=_0x58f9e9(0x143);for(let _0x330619=0x0;_0x330619<_0x334978[_0x58f9e9(0x115)]&&_0x18ef0a+_0x330619<_0x1afcc4;_0x330619+=0x1){_0x1e21ed[_0x18ef0a+_0x330619]=_0x334978[_0x330619];}_0x18ef0a=_0x1afcc4-0x1;}return _0x1e21ed['join']('');}function splitTopLevelAnd(_0x5af33c){const _0x335860=a249_0x2a7a,_0x56193a=[];let _0x27c180=0x0,_0x47a879=0x0;for(let _0x5cba78=0x0;_0x5cba78<_0x5af33c[_0x335860(0x115)];_0x5cba78+=0x1){const _0x39462d=_0x5af33c[_0x5cba78];if(_0x39462d==='(')_0x27c180+=0x1;if(_0x39462d===')')_0x27c180=Math[_0x335860(0x131)](0x0,_0x27c180-0x1);_0x27c180===0x0&&_0x5af33c['slice'](_0x5cba78)[_0x335860(0x146)](/^AND\b/i)&&(_0x5cba78===0x0||/\s/[_0x335860(0x14c)](_0x5af33c[_0x5cba78-0x1]??''))&&(_0x56193a[_0x335860(0x10d)](_0x5af33c[_0x335860(0x10e)](_0x47a879,_0x5cba78)['trim']()),_0x5cba78+=0x2,_0x47a879=_0x5cba78+0x1);}const _0x91351e=_0x5af33c[_0x335860(0x10e)](_0x47a879)[_0x335860(0x108)]();if(_0x91351e)_0x56193a[_0x335860(0x10d)](_0x91351e);return _0x56193a;}function a249_0x2a7a(_0x266858,_0xb9f94f){_0x266858=_0x266858-0x105;const _0x22ad1b=a249_0x22ad();let _0x2a7a14=_0x22ad1b[_0x266858];return _0x2a7a14;}function hasTopLevelKeyword(_0x1642c5,_0x26d268){const _0x2469ff=a249_0x2a7a;let _0x4da69f=0x0;for(let _0x2942e2=0x0;_0x2942e2<_0x1642c5[_0x2469ff(0x115)];_0x2942e2+=0x1){const _0x3b59ca=_0x1642c5[_0x2942e2];if(_0x3b59ca==='(')_0x4da69f+=0x1;if(_0x3b59ca===')')_0x4da69f=Math[_0x2469ff(0x131)](0x0,_0x4da69f-0x1);if(_0x4da69f!==0x0)continue;const _0x55e650=_0x1642c5[_0x2469ff(0x10e)](_0x2942e2,_0x2942e2+_0x26d268['length']),_0xdb1751=_0x1642c5[_0x2942e2-0x1]??'\x20',_0x349ae9=_0x1642c5[_0x2942e2+_0x26d268['length']]??'\x20';if(_0x55e650[_0x2469ff(0x145)]()===_0x26d268[_0x2469ff(0x145)]()&&!/[\w$]/[_0x2469ff(0x14c)](_0xdb1751)&&!/[\w$]/[_0x2469ff(0x14c)](_0x349ae9))return!![];}return![];}function splitEquality(_0x5305e0){const _0x192c32=a249_0x2a7a,_0x960867=stripOuterParentheses(_0x5305e0);let _0x3d1f1d=0x0,_0xe9febf;for(let _0x274f25=0x0;_0x274f25<_0x960867[_0x192c32(0x115)];_0x274f25+=0x1){const _0x917562=_0x960867[_0x274f25];if(_0x917562==='(')_0x3d1f1d+=0x1;if(_0x917562===')')_0x3d1f1d=Math[_0x192c32(0x131)](0x0,_0x3d1f1d-0x1);const _0x8d8265=_0x960867[_0x274f25-0x1]??'',_0x1520ee=_0x960867[_0x274f25+0x1]??'';if(_0x917562==='='&&_0x3d1f1d===0x0&&!/[!<>=:]/[_0x192c32(0x14c)](_0x8d8265)&&_0x1520ee!=='='){if(_0xe9febf!==undefined)return null;_0xe9febf=_0x274f25;}}return _0xe9febf===undefined?null:[_0x960867[_0x192c32(0x10e)](0x0,_0xe9febf)[_0x192c32(0x108)](),_0x960867[_0x192c32(0x10e)](_0xe9febf+0x1)[_0x192c32(0x108)]()];}function parseDirectColumnReference(_0x5c29cd,_0x53d1fd){const _0x208500=a249_0x2a7a,_0x49e3be=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x208500(0x13e)](stripOuterParentheses(_0x5c29cd));if(!_0x49e3be)return null;if(normalizeIdentifier(_0x49e3be[0x1]??'')!==normalizeIdentifier(_0x53d1fd))return null;return normalizeIdentifier(_0x49e3be[0x2]??'');}function a249_0x22ad(){const _0x141eeb=['Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','__sq__','24uLkCXV','toUpperCase','match','split','where','matchedPrefix','548825dQOxJi','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','test','right','warning','sort','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','trim','3670877MVEmvn','\x5cs*\x5c.\x5cs*[\x5cw$]+','sql','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','push','slice','some','570184VcNrJo','startsWith','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','replaceAll','inner','length','has','(?:^|[^\x5cw$])','indexOf','natural','full','cross','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','3237336NeBumY','indexes','index','position','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','containsUnresolvedInclude','1212708RzuUSV','180471UDMnbP','matchAll','569415edDCsZ','unknown','reduce','filter','using','min','JOIN_PREDICATE_UNSUPPORTED','alias','table','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','map','max','endsWith','columns','unavailable','tableName','INNER','toLowerCase','INDEX_METADATA_UNAVAILABLE','from','left','metadataAvailable','includes','join','exec','\x5c$&','add','error'];a249_0x22ad=function(){return _0x141eeb;};return a249_0x22ad();}function containsColumnReference(_0x2f0851,_0x323e9c){const _0x15988b=a249_0x2a7a,_0x4bf79b=_0x2f0851['replace'](/[`"]/g,''),_0x15e8a7=_0x323e9c['replace'](/[.*+?^${}()|[\]\\]/g,_0x15988b(0x13f));return new RegExp(_0x15988b(0x117)+_0x15e8a7+_0x15988b(0x10a),'i')[_0x15988b(0x14c)](_0x4bf79b);}function findEqualityPrefix(_0x25b24f,_0x2e60ce){const _0x180d29=a249_0x2a7a,_0x23efa0=new Set(_0x2e60ce['map'](normalizeIdentifier)),_0x1b8aef=[];for(const _0x8fa31 of _0x25b24f){if(!_0x23efa0[_0x180d29(0x116)](normalizeIdentifier(_0x8fa31)))break;_0x1b8aef[_0x180d29(0x10d)](_0x8fa31);}return _0x1b8aef;}function resolveTableMetadata(_0x4bd4a1,_0x4cc3e5){const _0x38a387=a249_0x2a7a,_0x27aeba=normalizeIdentifier(_0x4cc3e5),_0x5093df=_0x4bd4a1[_0x38a387(0x129)](_0x4550f7=>normalizeIdentifier(_0x4550f7[_0x38a387(0x135)])===_0x27aeba);if(_0x5093df[_0x38a387(0x115)]===0x1)return _0x5093df[0x0];const _0x112a93=_0x27aeba[_0x38a387(0x13c)]('.'),_0x3282ca=_0x27aeba[_0x38a387(0x147)]('.')['at'](-0x1),_0x298236=_0x4bd4a1['filter'](_0x599aac=>{const _0x2eaa78=_0x38a387,_0x3080df=normalizeIdentifier(_0x599aac[_0x2eaa78(0x135)]);if(_0x112a93&&_0x3080df[_0x2eaa78(0x13c)]('.'))return![];return _0x3080df[_0x2eaa78(0x147)]('.')['at'](-0x1)===_0x3282ca;});return _0x298236[_0x38a387(0x115)]===0x1?_0x298236[0x0]:undefined;}function columnNamesMatch(_0x1b48d3,_0x5f31bd){return normalizeIdentifier(_0x1b48d3)===normalizeIdentifier(_0x5f31bd);}function normalizeIdentifier(_0x39f5a0){const _0x892d56=a249_0x2a7a;return _0x39f5a0['replace'](/[`"]/g,'')['trim']()[_0x892d56(0x137)]();}function isSqlClauseKeyword(_0x1d9b33){const _0x147039=a249_0x2a7a;return new Set(['on',_0x147039(0x12a),_0x147039(0x148),_0x147039(0x13d),_0x147039(0x114),_0x147039(0x13a),'right','full',_0x147039(0x11b),_0x147039(0x119)])[_0x147039(0x116)](_0x1d9b33);}function stripOuterParentheses(_0x5b37ef){const _0x35efa6=a249_0x2a7a;let _0x33421b=_0x5b37ef[_0x35efa6(0x108)]();while(_0x33421b[_0x35efa6(0x111)]('(')&&_0x33421b[_0x35efa6(0x132)](')')){let _0x595af0=0x0,_0xffe632=!![];for(let _0x33dc94=0x0;_0x33dc94<_0x33421b[_0x35efa6(0x115)];_0x33dc94+=0x1){if(_0x33421b[_0x33dc94]==='(')_0x595af0+=0x1;if(_0x33421b[_0x33dc94]===')')_0x595af0-=0x1;if(_0x595af0===0x0&&_0x33dc94<_0x33421b[_0x35efa6(0x115)]-0x1){_0xffe632=![];break;}}if(!_0xffe632||_0x595af0!==0x0)break;_0x33421b=_0x33421b[_0x35efa6(0x10e)](0x1,-0x1)[_0x35efa6(0x108)]();}return _0x33421b;}
|
|
1
|
+
(function(_0x48eb6a,_0x22e5c5){const _0x54326b=a249_0xb228,_0x445038=_0x48eb6a();while(!![]){try{const _0x2701c1=-parseInt(_0x54326b(0x1a3))/0x1*(-parseInt(_0x54326b(0x195))/0x2)+-parseInt(_0x54326b(0x1c0))/0x3*(-parseInt(_0x54326b(0x1ce))/0x4)+parseInt(_0x54326b(0x1d1))/0x5*(-parseInt(_0x54326b(0x1df))/0x6)+-parseInt(_0x54326b(0x1b1))/0x7*(parseInt(_0x54326b(0x1a1))/0x8)+parseInt(_0x54326b(0x1a5))/0x9+-parseInt(_0x54326b(0x19a))/0xa+parseInt(_0x54326b(0x1b2))/0xb*(parseInt(_0x54326b(0x1a6))/0xc);if(_0x2701c1===_0x22e5c5)break;else _0x445038['push'](_0x445038['shift']());}catch(_0x1ce2f7){_0x445038['push'](_0x445038['shift']());}}}(a249_0x30e7,0xb9c1d));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x1ae72e,_0x3f6879){const _0x5d643d=a249_0xb228,_0x5bdc2c=[],_0x45f8ce=normalizeSqlForStaticAnalysis(_0x1ae72e),_0x5cb9f2=(_0x45f8ce[_0x5d643d(0x1bd)]?[]:extractJoinFacts(_0x45f8ce['sql']))[_0x5d643d(0x1c1)](_0x16bd94=>{const _0x1e90b3=_0x5d643d;if(_0x16bd94['unsupportedPredicate']||_0x16bd94[_0x1e90b3(0x19d)][_0x1e90b3(0x1ab)]===0x0)return _0x5bdc2c[_0x1e90b3(0x1cf)]({'code':_0x1e90b3(0x1d0),'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94[_0x1e90b3(0x1da)],'columns':_0x16bd94[_0x1e90b3(0x19d)],'reason':_0x16bd94[_0x1e90b3(0x1b4)]??_0x1e90b3(0x1af)}),{'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94[_0x1e90b3(0x1da)],'columns':_0x16bd94['columns'],'status':_0x1e90b3(0x199)};const _0x3c5843=resolveTableMetadata(_0x3f6879,_0x16bd94[_0x1e90b3(0x1d7)]),_0x169ab=(_0x3c5843?.[_0x1e90b3(0x1ae)]??[])[_0x1e90b3(0x1c1)](_0x3757a8=>({'index':_0x3757a8,'matchedPrefix':findEqualityPrefix(_0x3757a8[_0x1e90b3(0x19d)],_0x16bd94[_0x1e90b3(0x19d)])}))[_0x1e90b3(0x1b5)](_0x11c26b=>_0x11c26b[_0x1e90b3(0x1c9)][_0x1e90b3(0x1ab)]>0x0),_0x1967e3=_0x169ab[_0x1e90b3(0x1b0)]((_0x362981,_0x5ea1ab)=>!_0x362981||_0x5ea1ab[_0x1e90b3(0x1c9)]['length']>_0x362981[_0x1e90b3(0x1c9)][_0x1e90b3(0x1ab)]?_0x5ea1ab:_0x362981,_0x169ab[0x0]);if(_0x1967e3)return{'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94[_0x1e90b3(0x1da)],'columns':_0x16bd94[_0x1e90b3(0x19d)],'status':'covered','matchedIndex':{..._0x1967e3[_0x1e90b3(0x1a2)],'matchedPrefix':_0x1967e3['matchedPrefix']}};const _0x21fbd4=_0x3c5843?.[_0x1e90b3(0x1ae)][_0x1e90b3(0x1b5)](_0x34ab2c=>_0x34ab2c[_0x1e90b3(0x19d)][_0x1e90b3(0x1c8)](_0x2df60b=>_0x16bd94[_0x1e90b3(0x19d)][_0x1e90b3(0x1c8)](_0x369a3d=>columnNamesMatch(_0x2df60b,_0x369a3d))))??[];if(_0x21fbd4['length']>0x0)return _0x5bdc2c[_0x1e90b3(0x1cf)]({'code':'JOIN_INDEX_NOT_USABLE','table':_0x16bd94['table'],'alias':_0x16bd94['alias'],'columns':_0x16bd94[_0x1e90b3(0x19d)],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94['alias'],'columns':_0x16bd94['columns'],'status':_0x1e90b3(0x194),'candidateIndexes':_0x21fbd4};if(_0x3c5843&&_0x3c5843[_0x1e90b3(0x1dd)]!==![]&&_0x3c5843[_0x1e90b3(0x1ae)][_0x1e90b3(0x1ab)]>0x0&&_0x16bd94['columns']['length']>0x0)return _0x5bdc2c[_0x1e90b3(0x1cf)]({'code':_0x1e90b3(0x197),'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94[_0x1e90b3(0x1da)],'columns':_0x16bd94[_0x1e90b3(0x19d)],'reason':_0x1e90b3(0x1cc)}),{'table':_0x16bd94['table'],'alias':_0x16bd94['alias'],'columns':_0x16bd94['columns'],'status':'warning'};return _0x5bdc2c['push']({'code':_0x1e90b3(0x193),'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94[_0x1e90b3(0x1da)],'columns':_0x16bd94[_0x1e90b3(0x19d)],'reason':_0x3c5843?_0x1e90b3(0x1ba):_0x1e90b3(0x1d5)}),{'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94[_0x1e90b3(0x1da)],'columns':_0x16bd94[_0x1e90b3(0x19d)],'status':_0x1e90b3(0x199)};});return{'checked':_0x5cb9f2[_0x5d643d(0x1ab)]>0x0,'joins':_0x5cb9f2,'warnings':_0x5bdc2c};}function extractJoinFacts(_0x3db170){const _0x9c5649=a249_0xb228,_0x4357a8=maskNestedQueries(stripSqlNoise(_0x3db170)),_0x4306ed=maskQuotedIdentifiers(_0x4357a8),_0x45e5d5=[],_0x82654a=new Set(),_0x3fac5c=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0xdcf0e6 of _0x4357a8[_0x9c5649(0x1aa)](_0x3fac5c)){const _0x3ac268=_0xdcf0e6[_0x9c5649(0x1a2)]??0x0,_0x4ceb4a=_0xdcf0e6[0x0][_0x9c5649(0x1b3)](/\bJOIN\b/i),_0x5d8ab4=_0x3ac268+Math[_0x9c5649(0x1d6)](0x0,_0x4ceb4a);if(!/^JOIN\b/i['test'](_0x4306ed[_0x9c5649(0x1ad)](_0x5d8ab4)))continue;_0x82654a[_0x9c5649(0x1b6)](_0x5d8ab4);const _0x377f89=normalizeIdentifier(_0xdcf0e6[0x1]||_0x9c5649(0x1c6)),_0x38bbdb=normalizeIdentifier(_0xdcf0e6[0x2]??''),_0x439d85=normalizeIdentifier(_0xdcf0e6[0x3]||_0x38bbdb[_0x9c5649(0x1a0)]('.')['at'](-0x1)||_0x38bbdb),_0x570f8b=[],_0x113538=_0x38bbdb===_0x9c5649(0x1c4);let _0x17d7b9=_0x377f89===_0x9c5649(0x198)||_0x377f89==='full'||_0x113538,_0x2f10ac=_0x17d7b9?_0x113538?_0x9c5649(0x1c5):_0x377f89[_0x9c5649(0x1be)]()+_0x9c5649(0x1db):undefined;const _0x6bf4f3=stripOuterParentheses(_0xdcf0e6[0x4]??''),_0xeca0f5=_0x6bf4f3[_0x9c5649(0x1bc)](MYBATIS_DYNAMIC_START_MARKER)||_0x6bf4f3[_0x9c5649(0x1bc)](MYBATIS_DYNAMIC_END_MARKER),_0xe69f7f=_0x6bf4f3[_0x9c5649(0x1bc)](MYBATIS_INCLUDE_MARKER);_0xeca0f5&&(_0x17d7b9=!![],_0x2f10ac??=_0x9c5649(0x1c3));_0xe69f7f&&(_0x17d7b9=!![],_0x2f10ac??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0x570cce=_0x6bf4f3[_0x9c5649(0x1a4)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x9c5649(0x1a4)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x9c5649(0x1a4)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x570cce,'OR')&&(_0x17d7b9=!![],_0x2f10ac??=_0x9c5649(0x19f));for(const _0x2fd723 of splitTopLevelAnd(_0x570cce)){const _0x3dee18=stripOuterParentheses(_0x2fd723);if(hasTopLevelKeyword(_0x3dee18,'OR')){_0x17d7b9=!![],_0x2f10ac??=_0x9c5649(0x19f);continue;}const _0x2c83f7=splitEquality(_0x3dee18);if(!_0x2c83f7){containsColumnReference(_0x2fd723,_0x439d85)&&(_0x17d7b9=!![]);continue;}const _0xb28ea7=parseDirectColumnReference(_0x2c83f7[0x0],_0x439d85),_0x5c32e1=parseDirectColumnReference(_0x2c83f7[0x1],_0x439d85),_0x79a08d=containsColumnReference(_0x2c83f7[0x0],_0x439d85),_0x20127a=containsColumnReference(_0x2c83f7[0x1],_0x439d85),_0x3d7524=_0xb28ea7&&!_0x20127a?_0xb28ea7:_0x5c32e1&&!_0x79a08d?_0x5c32e1:null;if(_0x3d7524&&!_0x570f8b[_0x9c5649(0x1bc)](_0x3d7524))_0x570f8b['push'](_0x3d7524);else!_0x3d7524&&containsColumnReference(_0x2fd723,_0x439d85)&&(_0x17d7b9=!![]);}_0x45e5d5['push']({'table':_0x38bbdb,'alias':_0x439d85,'columns':_0x570f8b,'unsupportedPredicate':_0x17d7b9,'unsupportedReason':_0x2f10ac,'containsUnresolvedInclude':_0xe69f7f,'position':_0x5d8ab4});}for(const _0x7eca42 of _0x4306ed[_0x9c5649(0x1aa)](/\bJOIN\b/gi)){const _0x11b989=_0x7eca42['index']??0x0;if(_0x82654a['has'](_0x11b989))continue;const _0x3d540c=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/['exec'](_0x4357a8[_0x9c5649(0x1ad)](_0x11b989+_0x7eca42[0x0][_0x9c5649(0x1ab)])),_0x5dfffd=normalizeIdentifier(_0x3d540c?.[0x1]||'unknown'),_0x20741f=normalizeIdentifier(_0x3d540c?.[0x2]||''),_0x3eaf31=isSqlClauseKeyword(_0x20741f)?_0x5dfffd[_0x9c5649(0x1a0)]('.')['at'](-0x1)||_0x5dfffd:_0x20741f||_0x5dfffd[_0x9c5649(0x1a0)]('.')['at'](-0x1)||_0x5dfffd;_0x45e5d5[_0x9c5649(0x1cf)]({'table':_0x5dfffd,'alias':_0x3eaf31,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x9c5649(0x1e1),'position':_0x11b989});}const _0x7d7f5a=_0x4306ed[_0x9c5649(0x1ac)](MYBATIS_INCLUDE_MARKER);return _0x7d7f5a>=0x0&&!_0x45e5d5[_0x9c5649(0x1c8)](_0x32041a=>_0x32041a[_0x9c5649(0x1c2)])&&_0x45e5d5[_0x9c5649(0x1cf)]({'table':'unknown','alias':_0x9c5649(0x1a7),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x9c5649(0x1bb),'containsUnresolvedInclude':!![],'position':_0x7d7f5a}),_0x45e5d5[_0x9c5649(0x19e)]((_0x243004,_0x1ff4a3)=>_0x243004[_0x9c5649(0x1d9)]-_0x1ff4a3[_0x9c5649(0x1d9)]);}function stripSqlNoise(_0x30ee55){const _0xea125b=a249_0xb228,_0x1bc5b9=Array[_0xea125b(0x19c)](_0x30ee55),_0x4a0f28=(_0x9048ec,_0x52827e)=>{for(let _0x1c5bd6=_0x9048ec;_0x1c5bd6<_0x52827e;_0x1c5bd6+=0x1){_0x1bc5b9[_0x1c5bd6]!=='\x0a'&&_0x1bc5b9[_0x1c5bd6]!=='\x0d'&&(_0x1bc5b9[_0x1c5bd6]='\x20');}};for(let _0xe5f13d=0x0;_0xe5f13d<_0x1bc5b9[_0xea125b(0x1ab)];_0xe5f13d+=0x1){const _0xf54824=_0x1bc5b9[_0xe5f13d],_0x4c6feb=_0x1bc5b9[_0xe5f13d+0x1];if(_0xf54824==='\x27'||_0xf54824==='\x22'||_0xf54824==='`'){const _0x246dba=_0xf54824,_0x545c89=_0xe5f13d;_0xe5f13d+=0x1;while(_0xe5f13d<_0x1bc5b9['length']){if(_0x1bc5b9[_0xe5f13d]==='\x5c'&&_0xe5f13d+0x1<_0x1bc5b9[_0xea125b(0x1ab)]){_0xe5f13d+=0x2;continue;}if(_0x1bc5b9[_0xe5f13d]!==_0x246dba){_0xe5f13d+=0x1;continue;}if(_0x1bc5b9[_0xe5f13d+0x1]===_0x246dba){_0xe5f13d+=0x2;continue;}break;}if(_0x246dba==='\x27')_0x4a0f28(_0x545c89,Math['min'](_0xe5f13d+0x1,_0x1bc5b9['length']));continue;}if(_0xf54824==='-'&&_0x4c6feb==='-'){const _0x3e0b05=_0xe5f13d;while(_0xe5f13d<_0x1bc5b9[_0xea125b(0x1ab)]&&_0x1bc5b9[_0xe5f13d]!=='\x0a')_0xe5f13d+=0x1;_0x4a0f28(_0x3e0b05,_0xe5f13d);continue;}if(_0xf54824==='/'&&_0x4c6feb==='*'){const _0x29677f=_0xe5f13d;_0xe5f13d+=0x2;while(_0xe5f13d<_0x1bc5b9[_0xea125b(0x1ab)]&&!(_0x1bc5b9[_0xe5f13d]==='*'&&_0x1bc5b9[_0xe5f13d+0x1]==='/')){_0xe5f13d+=0x1;}_0xe5f13d=Math['min'](_0xe5f13d+0x1,_0x1bc5b9[_0xea125b(0x1ab)]-0x1),_0x4a0f28(_0x29677f,_0xe5f13d+0x1);continue;}if(_0xf54824==='#'&&_0x4c6feb!=='{'){const _0xd65124=_0xe5f13d;while(_0xe5f13d<_0x1bc5b9[_0xea125b(0x1ab)]&&_0x1bc5b9[_0xe5f13d]!=='\x0a')_0xe5f13d+=0x1;_0x4a0f28(_0xd65124,_0xe5f13d);continue;}if((_0xf54824==='#'||_0xf54824==='$')&&_0x4c6feb==='{'){const _0x13490a=_0xe5f13d;_0xe5f13d+=0x2;while(_0xe5f13d<_0x1bc5b9[_0xea125b(0x1ab)]&&_0x1bc5b9[_0xe5f13d]!=='}')_0xe5f13d+=0x1;_0x4a0f28(_0x13490a,Math[_0xea125b(0x1c7)](_0xe5f13d+0x1,_0x1bc5b9[_0xea125b(0x1ab)]));}}return _0x1bc5b9[_0xea125b(0x1d2)]('');}function maskQuotedIdentifiers(_0x3b4653){const _0x23270a=a249_0xb228,_0xbaa479=Array[_0x23270a(0x19c)](_0x3b4653);for(let _0x44652c=0x0;_0x44652c<_0xbaa479[_0x23270a(0x1ab)];_0x44652c+=0x1){const _0x76eea1=_0xbaa479[_0x44652c];if(_0x76eea1!=='\x22'&&_0x76eea1!=='`')continue;_0x44652c+=0x1;while(_0x44652c<_0xbaa479['length']){if(_0xbaa479[_0x44652c]===_0x76eea1){if(_0xbaa479[_0x44652c+0x1]===_0x76eea1){_0xbaa479[_0x44652c]='\x20',_0xbaa479[_0x44652c+0x1]='\x20',_0x44652c+=0x2;continue;}break;}_0xbaa479[_0x44652c]='\x20',_0x44652c+=0x1;}}return _0xbaa479[_0x23270a(0x1d2)]('');}function maskNestedQueries(_0x2d1704){const _0x11dc7d=a249_0xb228,_0x4c7633=Array[_0x11dc7d(0x19c)](_0x2d1704);for(let _0x54aada=0x0;_0x54aada<_0x4c7633['length'];_0x54aada+=0x1){if(_0x4c7633[_0x54aada]!=='(')continue;const _0x3face7=_0x2d1704[_0x11dc7d(0x1ad)](_0x54aada+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x11dc7d(0x1b9)](_0x3face7))continue;let _0x309516=0x1,_0x3c92af=_0x54aada+0x1;for(;_0x3c92af<_0x4c7633[_0x11dc7d(0x1ab)]&&_0x309516>0x0;_0x3c92af+=0x1){if(_0x4c7633[_0x3c92af]==='(')_0x309516+=0x1;if(_0x4c7633[_0x3c92af]===')')_0x309516-=0x1;}if(_0x309516!==0x0)continue;for(let _0x101687=_0x54aada;_0x101687<_0x3c92af;_0x101687+=0x1){_0x4c7633[_0x101687]='\x20';}const _0x363a0e=_0x11dc7d(0x1c4);for(let _0x256e5d=0x0;_0x256e5d<_0x363a0e[_0x11dc7d(0x1ab)]&&_0x54aada+_0x256e5d<_0x3c92af;_0x256e5d+=0x1){_0x4c7633[_0x54aada+_0x256e5d]=_0x363a0e[_0x256e5d];}_0x54aada=_0x3c92af-0x1;}return _0x4c7633[_0x11dc7d(0x1d2)]('');}function splitTopLevelAnd(_0x43d581){const _0x2fc231=a249_0xb228,_0x355cc7=[];let _0x3f49d1=0x0,_0x8456d3=0x0;for(let _0x5c08d0=0x0;_0x5c08d0<_0x43d581[_0x2fc231(0x1ab)];_0x5c08d0+=0x1){const _0x208c5c=_0x43d581[_0x5c08d0];if(_0x208c5c==='(')_0x3f49d1+=0x1;if(_0x208c5c===')')_0x3f49d1=Math[_0x2fc231(0x1d6)](0x0,_0x3f49d1-0x1);_0x3f49d1===0x0&&_0x43d581[_0x2fc231(0x1ad)](_0x5c08d0)[_0x2fc231(0x1d8)](/^AND\b/i)&&(_0x5c08d0===0x0||/\s/[_0x2fc231(0x1b9)](_0x43d581[_0x5c08d0-0x1]??''))&&(_0x355cc7[_0x2fc231(0x1cf)](_0x43d581[_0x2fc231(0x1ad)](_0x8456d3,_0x5c08d0)[_0x2fc231(0x1bf)]()),_0x5c08d0+=0x2,_0x8456d3=_0x5c08d0+0x1);}const _0x2e4a75=_0x43d581['slice'](_0x8456d3)[_0x2fc231(0x1bf)]();if(_0x2e4a75)_0x355cc7['push'](_0x2e4a75);return _0x355cc7;}function hasTopLevelKeyword(_0x4a2c4c,_0x213e3d){const _0x1039c5=a249_0xb228;let _0x31e426=0x0;for(let _0x27b8a1=0x0;_0x27b8a1<_0x4a2c4c[_0x1039c5(0x1ab)];_0x27b8a1+=0x1){const _0x560963=_0x4a2c4c[_0x27b8a1];if(_0x560963==='(')_0x31e426+=0x1;if(_0x560963===')')_0x31e426=Math[_0x1039c5(0x1d6)](0x0,_0x31e426-0x1);if(_0x31e426!==0x0)continue;const _0x4c50=_0x4a2c4c[_0x1039c5(0x1ad)](_0x27b8a1,_0x27b8a1+_0x213e3d[_0x1039c5(0x1ab)]),_0x330171=_0x4a2c4c[_0x27b8a1-0x1]??'\x20',_0x3942c0=_0x4a2c4c[_0x27b8a1+_0x213e3d[_0x1039c5(0x1ab)]]??'\x20';if(_0x4c50[_0x1039c5(0x1be)]()===_0x213e3d[_0x1039c5(0x1be)]()&&!/[\w$]/[_0x1039c5(0x1b9)](_0x330171)&&!/[\w$]/['test'](_0x3942c0))return!![];}return![];}function splitEquality(_0x2807e8){const _0x47d753=a249_0xb228,_0x3e1087=stripOuterParentheses(_0x2807e8);let _0x1a02e5=0x0,_0x16e091;for(let _0x2ad4ed=0x0;_0x2ad4ed<_0x3e1087['length'];_0x2ad4ed+=0x1){const _0x417c49=_0x3e1087[_0x2ad4ed];if(_0x417c49==='(')_0x1a02e5+=0x1;if(_0x417c49===')')_0x1a02e5=Math[_0x47d753(0x1d6)](0x0,_0x1a02e5-0x1);const _0x13877e=_0x3e1087[_0x2ad4ed-0x1]??'',_0x1eeac9=_0x3e1087[_0x2ad4ed+0x1]??'';if(_0x417c49==='='&&_0x1a02e5===0x0&&!/[!<>=:]/[_0x47d753(0x1b9)](_0x13877e)&&_0x1eeac9!=='='){if(_0x16e091!==undefined)return null;_0x16e091=_0x2ad4ed;}}return _0x16e091===undefined?null:[_0x3e1087[_0x47d753(0x1ad)](0x0,_0x16e091)[_0x47d753(0x1bf)](),_0x3e1087[_0x47d753(0x1ad)](_0x16e091+0x1)[_0x47d753(0x1bf)]()];}function parseDirectColumnReference(_0x50ab0f,_0x9e80b){const _0x3c6ba7=a249_0xb228,_0x5604c3=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x3c6ba7(0x1a8)](stripOuterParentheses(_0x50ab0f));if(!_0x5604c3)return null;if(normalizeIdentifier(_0x5604c3[0x1]??'')!==normalizeIdentifier(_0x9e80b))return null;return normalizeIdentifier(_0x5604c3[0x2]??'');}function containsColumnReference(_0x11a2f2,_0x1b42b2){const _0x42c046=a249_0xb228,_0x5c410e=_0x11a2f2[_0x42c046(0x1cb)](/[`"]/g,''),_0x18f2b9=_0x1b42b2['replace'](/[.*+?^${}()|[\]\\]/g,_0x42c046(0x196));return new RegExp('(?:^|[^\x5cw$])'+_0x18f2b9+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x42c046(0x1b9)](_0x5c410e);}function a249_0x30e7(){const _0x3badfb=['add','natural','has','test','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','includes','error','toUpperCase','trim','168501VgzGaO','map','containsUnresolvedInclude','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','__sq__','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','INNER','min','some','matchedPrefix','full','replace','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','startsWith','52LlHpHM','push','JOIN_PREDICATE_UNSUPPORTED','85BbpDfS','join','left','inner','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','max','table','match','position','alias','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','toLowerCase','metadataAvailable','cross','397746KLGgbw','where','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','endsWith','INDEX_METADATA_UNAVAILABLE','warning','1916312MOiUWb','\x5c$&','JOIN_INDEX_MISSING','right','unavailable','3308840SBwblj','using','from','columns','sort','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','split','14632SZNkVO','index','1SGBtqB','replaceAll','6245658fpyANd','12uMNqGn','unknown','exec','tableName','matchAll','length','indexOf','slice','indexes','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','reduce','3878jjQyBO','9346359jDwgXw','search','unsupportedReason','filter'];a249_0x30e7=function(){return _0x3badfb;};return a249_0x30e7();}function findEqualityPrefix(_0x25d85b,_0x199c1e){const _0x391038=a249_0xb228,_0x3ca184=new Set(_0x199c1e[_0x391038(0x1c1)](normalizeIdentifier)),_0x4c4683=[];for(const _0x362bb2 of _0x25d85b){if(!_0x3ca184['has'](normalizeIdentifier(_0x362bb2)))break;_0x4c4683[_0x391038(0x1cf)](_0x362bb2);}return _0x4c4683;}function resolveTableMetadata(_0x16f718,_0x28a7ee){const _0x5d27e2=a249_0xb228,_0x429bef=normalizeIdentifier(_0x28a7ee),_0x2f890c=_0x16f718[_0x5d27e2(0x1b5)](_0x4f6f73=>normalizeIdentifier(_0x4f6f73[_0x5d27e2(0x1a9)])===_0x429bef);if(_0x2f890c[_0x5d27e2(0x1ab)]===0x1)return _0x2f890c[0x0];const _0x4c64c6=_0x429bef[_0x5d27e2(0x1bc)]('.'),_0x29bde3=_0x429bef[_0x5d27e2(0x1a0)]('.')['at'](-0x1),_0x2f6fdc=_0x16f718[_0x5d27e2(0x1b5)](_0x438dbb=>{const _0x581771=_0x5d27e2,_0x255205=normalizeIdentifier(_0x438dbb[_0x581771(0x1a9)]);if(_0x4c64c6&&_0x255205[_0x581771(0x1bc)]('.'))return![];return _0x255205[_0x581771(0x1a0)]('.')['at'](-0x1)===_0x29bde3;});return _0x2f6fdc[_0x5d27e2(0x1ab)]===0x1?_0x2f6fdc[0x0]:undefined;}function columnNamesMatch(_0x21a38b,_0x55b146){return normalizeIdentifier(_0x21a38b)===normalizeIdentifier(_0x55b146);}function normalizeIdentifier(_0x557ed7){const _0x1e5451=a249_0xb228;return _0x557ed7[_0x1e5451(0x1cb)](/[`"]/g,'')[_0x1e5451(0x1bf)]()[_0x1e5451(0x1dc)]();}function isSqlClauseKeyword(_0x3ce0b2){const _0x536903=a249_0xb228;return new Set(['on',_0x536903(0x19b),_0x536903(0x1e0),'join',_0x536903(0x1d4),_0x536903(0x1d3),_0x536903(0x198),_0x536903(0x1ca),_0x536903(0x1de),_0x536903(0x1b7)])[_0x536903(0x1b8)](_0x3ce0b2);}function a249_0xb228(_0x453cff,_0x61c91e){_0x453cff=_0x453cff-0x192;const _0x30e759=a249_0x30e7();let _0xb228ab=_0x30e759[_0x453cff];return _0xb228ab;}function stripOuterParentheses(_0x2b7867){const _0x588ed8=a249_0xb228;let _0x54b66e=_0x2b7867['trim']();while(_0x54b66e[_0x588ed8(0x1cd)]('(')&&_0x54b66e[_0x588ed8(0x192)](')')){let _0x4fa5e2=0x0,_0x3999ea=!![];for(let _0x5a6623=0x0;_0x5a6623<_0x54b66e[_0x588ed8(0x1ab)];_0x5a6623+=0x1){if(_0x54b66e[_0x5a6623]==='(')_0x4fa5e2+=0x1;if(_0x54b66e[_0x5a6623]===')')_0x4fa5e2-=0x1;if(_0x4fa5e2===0x0&&_0x5a6623<_0x54b66e[_0x588ed8(0x1ab)]-0x1){_0x3999ea=![];break;}}if(!_0x3999ea||_0x4fa5e2!==0x0)break;_0x54b66e=_0x54b66e[_0x588ed8(0x1ad)](0x1,-0x1)[_0x588ed8(0x1bf)]();}return _0x54b66e;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a250_0x1419(){const _0xc35dbe=['7832310qoHokz','33551GOlzBI','1224680BWvOZL','4748139ayujhA','2620hUcxFB','2408iRzjVh','.rabetbase','564SEtLnw','6601090kGClCy','sql.lock.json','2851278OLNAiw','3RvaRZX','sql','/sql'];a250_0x1419=function(){return _0xc35dbe;};return a250_0x1419();}function a250_0x4084(_0x107255,_0x56aee9){_0x107255=_0x107255-0xb0;const _0x1419c2=a250_0x1419();let _0x40842b=_0x1419c2[_0x107255];return _0x40842b;}const a250_0x4572a8=a250_0x4084;(function(_0x3e4682,_0x4fc8e7){const _0x9148be=a250_0x4084,_0x11bd41=_0x3e4682();while(!![]){try{const _0x2cd407=-parseInt(_0x9148be(0xb1))/0x1*(parseInt(_0x9148be(0xbc))/0x2)+parseInt(_0x9148be(0xb5))/0x3*(-parseInt(_0x9148be(0xba))/0x4)+parseInt(_0x9148be(0xb2))/0x5+parseInt(_0x9148be(0xb4))/0x6+parseInt(_0x9148be(0xb9))/0x7*(parseInt(_0x9148be(0xbd))/0x8)+-parseInt(_0x9148be(0xbb))/0x9+-parseInt(_0x9148be(0xb8))/0xa;if(_0x2cd407===_0x4fc8e7)break;else _0x11bd41['push'](_0x11bd41['shift']());}catch(_0x38ebe4){_0x11bd41['push'](_0x11bd41['shift']());}}}(a250_0x1419,0xd7688));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a250_0x4572a8(0xb0),LOCK_FILE_NAME=a250_0x4572a8(0xb3),TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x341aec,_0x14aacd){const _0xacd0c9=a250_0x4572a8,_0x429c31=resolve(_0x14aacd??findProjectRootDirectory()),_0x336252=DOT_DIR+_0xacd0c9(0xb7),_0x826e09=_0x336252+'/'+_0x341aec;return{'projectRoot':_0x429c31,'appCode':_0x341aec,'sqlWorkspaceRoot':_0x336252,'sqlRoot':_0x826e09,'sqlRootDir':resolve(_0x429c31,DOT_DIR,_0xacd0c9(0xb6),_0x341aec),'lockFilePath':resolve(_0x429c31,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x429c31,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x214ee6,_0xbff49c){const _0x53f897=a251_0x4166,_0x527095=_0x214ee6();while(!![]){try{const _0x4533d7=parseInt(_0x53f897(0x1ba))/0x1*(parseInt(_0x53f897(0x1c0))/0x2)+-parseInt(_0x53f897(0x1bf))/0x3+parseInt(_0x53f897(0x1a8))/0x4*(-parseInt(_0x53f897(0x1a6))/0x5)+parseInt(_0x53f897(0x1c2))/0x6+parseInt(_0x53f897(0x1b8))/0x7*(-parseInt(_0x53f897(0x1aa))/0x8)+-parseInt(_0x53f897(0x1b2))/0x9*(parseInt(_0x53f897(0x1c4))/0xa)+parseInt(_0x53f897(0x1c6))/0xb*(parseInt(_0x53f897(0x1c3))/0xc);if(_0x4533d7===_0xbff49c)break;else _0x527095['push'](_0x527095['shift']());}catch(_0x1a2d20){_0x527095['push'](_0x527095['shift']());}}}(a251_0xbbb0,0xd1538));function a251_0x4166(_0x20256e,_0x4e9b31){_0x20256e=_0x20256e-0x1a4;const _0xbbb074=a251_0xbbb0();let _0x416668=_0xbbb074[_0x20256e];return _0x416668;}import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function a251_0xbbb0(){const _0x112e02=['ENOENT','780397IUTwmn','toLowerCase','indexOf','dbName','length','3193917FAiZLw','2LYZigu','filter','5597658FqzUtC','172212vazzXQ','110dxLxDJ','replace','1837cKlyQN','.xml','sql','825aaOOqG','slice','29308INouWW','mode','2312SlWnLR','mybatisXml','dbId','isFile','sqlCode','sqlRootDir','isDirectory','code','6246ojZVlE','path','name','sqlName','split','push','23527CHUJGo'];a251_0xbbb0=function(){return _0x112e02;};return a251_0xbbb0();}function extensionToMode(_0x58d57f){const _0x14e3e7=a251_0x4166;if(_0x58d57f==='.sql')return _0x14e3e7(0x1a5);if(_0x58d57f===_0x14e3e7(0x1a4))return _0x14e3e7(0x1ab);return undefined;}async function scanSqlFilesRecursively(_0xf5942f,_0x4d8958){const _0x57fa1c=a251_0x4166,_0x51ced4=[];try{const _0x2e3f26=await readdir(_0xf5942f,{'withFileTypes':!![]});for(const _0x5cec58 of _0x2e3f26){const _0x5769ad=join(_0xf5942f,_0x5cec58[_0x57fa1c(0x1b4)]);if(_0x5cec58[_0x57fa1c(0x1b0)]()){_0x51ced4['push'](...await scanSqlFilesRecursively(_0x5769ad,_0x4d8958));continue;}if(!_0x5cec58[_0x57fa1c(0x1ad)]())continue;const _0x129f09=extname(_0x5cec58[_0x57fa1c(0x1b4)])[_0x57fa1c(0x1bb)](),_0x1770de=extensionToMode(_0x129f09);if(!_0x1770de)continue;const _0x4581a7=relative(_0x4d8958,_0x5769ad)[_0x57fa1c(0x1c5)](/\\/g,'/'),_0x5e4d6d=_0x4581a7[_0x57fa1c(0x1b6)]('/')[_0x57fa1c(0x1c1)](Boolean),_0xc8f7a=parseSqlPath(_0x5e4d6d,_0x5cec58[_0x57fa1c(0x1b4)],_0x129f09);if(!_0xc8f7a)continue;_0x51ced4[_0x57fa1c(0x1b7)]({'sqlCode':_0xc8f7a['sqlCode'],'sqlName':_0xc8f7a[_0x57fa1c(0x1b5)],'dbDirectory':_0x5e4d6d[0x0],'filePath':_0x5769ad,'relativePath':_0x4581a7,'lockKey':_0xc8f7a[_0x57fa1c(0x1ae)],'mode':_0x1770de});}}catch(_0x25a4b2){if(_0x25a4b2[_0x57fa1c(0x1b1)]!==_0x57fa1c(0x1b9))throw _0x25a4b2;}return _0x51ced4;}export async function scanLocalSqlQueries(_0x2801df){const _0x3018f9=a251_0x4166;return scanSqlFilesRecursively(_0x2801df[_0x3018f9(0x1af)],_0x2801df['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x59d439,_0x4beacc,_0xca754e){const _0x4758e0=a251_0x4166,_0x598b55=_0xca754e?.[_0x4758e0(0x1b3)]||(_0xca754e?.['sqlName']||_0xca754e?.[_0x4758e0(0x1bd)]?buildSqlRelativePath(_0x4beacc,_0xca754e?.['sqlName'],_0xca754e?.[_0x4758e0(0x1bd)],_0xca754e?.['mode']||_0x4758e0(0x1a5),_0xca754e?.[_0x4758e0(0x1ac)]):buildDefaultSqlFileName(_0x4beacc,_0xca754e?.[_0x4758e0(0x1a9)]||_0x4758e0(0x1a5)));return join(_0x59d439['sqlRootDir'],_0x598b55);}export async function directoryExists(_0x13bb03){const _0x4ecc96=a251_0x4166;try{const _0x30687f=await stat(_0x13bb03);return _0x30687f[_0x4ecc96(0x1b0)]();}catch{return![];}}function parseSqlPath(_0x210cc1,_0x57e155,_0x53ff5d){const _0x7a69c1=a251_0x4166,_0x3e0904=_0x57e155[_0x7a69c1(0x1a7)](0x0,-_0x53ff5d[_0x7a69c1(0x1be)]);if(_0x210cc1[_0x7a69c1(0x1be)]<0x2)return null;const _0x186bfa=_0x3e0904[_0x7a69c1(0x1bc)]('_');if(_0x186bfa<=0x0||_0x186bfa>=_0x3e0904[_0x7a69c1(0x1be)]-0x1)return null;const _0x19d43a=_0x3e0904[_0x7a69c1(0x1a7)](0x0,_0x186bfa);if(!isLikelySqlCode(_0x19d43a))return null;return{'sqlCode':_0x19d43a,'sqlName':_0x3e0904[_0x7a69c1(0x1a7)](_0x186bfa+0x1)};}function isLikelySqlCode(_0x29e133){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0x29e133);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x37c359,_0x3723f6){const _0x44d3b2=a252_0x34d2,_0x1d0fe9=_0x37c359();while(!![]){try{const _0x4d409e=parseInt(_0x44d3b2(0x1c6))/0x1*(parseInt(_0x44d3b2(0x1cd))/0x2)+parseInt(_0x44d3b2(0x1cb))/0x3*(parseInt(_0x44d3b2(0x1ca))/0x4)+-parseInt(_0x44d3b2(0x1c9))/0x5*(parseInt(_0x44d3b2(0x1c7))/0x6)+parseInt(_0x44d3b2(0x1c3))/0x7+parseInt(_0x44d3b2(0x1ce))/0x8*(-parseInt(_0x44d3b2(0x1cf))/0x9)+parseInt(_0x44d3b2(0x1c5))/0xa+-parseInt(_0x44d3b2(0x1c4))/0xb;if(_0x4d409e===_0x3723f6)break;else _0x1d0fe9['push'](_0x1d0fe9['shift']());}catch(_0x592498){_0x1d0fe9['push'](_0x1d0fe9['shift']());}}}(a252_0x9eef,0x7e584));import{readFile}from'node:fs/promises';function a252_0x9eef(){const _0x54a346=['3167176hGRAMF','18WwHaqH','update','hex','3609319ubJLUD','20053957cTkWzC','10097970aYAzgZ','34568LIQtfU','2154TwWZWr','digest','195TSdXJq','103084mwGUFj','72zNujaI','utf8','58mayAbU'];a252_0x9eef=function(){return _0x54a346;};return a252_0x9eef();}import a252_0x21313d from'node:crypto';function a252_0x34d2(_0x193c79,_0x57d8c8){_0x193c79=_0x193c79-0x1c2;const _0x9eef1b=a252_0x9eef();let _0x34d253=_0x9eef1b[_0x193c79];return _0x34d253;}export function computeSqlContentHash(_0x5c0392){const _0x1e5579=a252_0x34d2;return a252_0x21313d['createHash']('md5')[_0x1e5579(0x1d0)](_0x5c0392)[_0x1e5579(0x1c8)](_0x1e5579(0x1c2));}export async function computeSqlFileHash(_0x2ab221){const _0x57e1f0=a252_0x34d2,_0x5d52e5=await readFile(_0x2ab221,_0x57e1f0(0x1cc));return computeSqlContentHash(_0x5d52e5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x68b73b,_0x44d4c8){const _0x25344a=a253_0x4811,_0x1aee32=_0x68b73b();while(!![]){try{const _0x4f9278=-parseInt(_0x25344a(0x169))/0x1+-parseInt(_0x25344a(0x16b))/0x2*(parseInt(_0x25344a(0x168))/0x3)+parseInt(_0x25344a(0x175))/0x4+parseInt(_0x25344a(0x173))/0x5+parseInt(_0x25344a(0x16e))/0x6+parseInt(_0x25344a(0x170))/0x7*(parseInt(_0x25344a(0x178))/0x8)+parseInt(_0x25344a(0x172))/0x9*(-parseInt(_0x25344a(0x167))/0xa);if(_0x4f9278===_0x44d4c8)break;else _0x1aee32['push'](_0x1aee32['shift']());}catch(_0x3881d4){_0x1aee32['push'](_0x1aee32['shift']());}}}(a253_0x4425,0xc96ea));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x167709,_0x25e16b,_0x5897bf,_0x3aba29){const _0x5a1e54=a253_0x4811,_0x46f98f=_0x167709??createEmptySqlLock();let _0x7be57e=_0x46f98f[_0x5a1e54(0x174)][_0x25e16b];if(!_0x7be57e)return _0x7be57e={'sqlRoot':_0x5897bf,'lastSync':'','sqls':{}},_0x46f98f[_0x5a1e54(0x174)][_0x25e16b]=_0x7be57e,{'lockData':_0x46f98f,'appLock':_0x7be57e};if(!_0x7be57e[_0x5a1e54(0x177)])_0x7be57e[_0x5a1e54(0x177)]=_0x5897bf;else{if(_0x7be57e['sqlRoot']!==_0x5897bf)throw new Error(_0x3aba29+':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'+_0x5897bf+_0x5a1e54(0x16d)+_0x7be57e[_0x5a1e54(0x177)]+_0x5a1e54(0x17a)+_0x5a1e54(0x17b));}return!_0x7be57e[_0x5a1e54(0x171)]&&(_0x7be57e[_0x5a1e54(0x171)]={}),!_0x7be57e[_0x5a1e54(0x17d)]&&(_0x7be57e['lastSync']=''),{'lockData':_0x46f98f,'appLock':_0x7be57e};}export async function readSqlLockFile(_0x411b04){const _0x3078ef=a253_0x4811;try{const _0x3bb598=await readFile(_0x411b04,_0x3078ef(0x16f));return JSON[_0x3078ef(0x179)](_0x3bb598);}catch(_0x511fcd){if(_0x511fcd[_0x3078ef(0x17c)]===_0x3078ef(0x176))return null;throw new Error(_0x3078ef(0x16c)+String(_0x511fcd));}}function a253_0x4811(_0x2c1c3d,_0x42c128){_0x2c1c3d=_0x2c1c3d-0x167;const _0x442578=a253_0x4425();let _0x481116=_0x442578[_0x2c1c3d];return _0x481116;}function a253_0x4425(){const _0x3b8ba6=['\x22.\x20','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','code','lastSync','4540cLqxzL','6Xiivfh','822435qhHRmN','stringify','926708ueuofz','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','\x22\x20vs\x20lock\x20\x22','5712960dxNDaG','utf8','1702351bchDvj','sqls','28206NOftGl','3728255IqSXaX','apps','4333076PsuxTo','ENOENT','sqlRoot','40mgWGUN','parse'];a253_0x4425=function(){return _0x3b8ba6;};return a253_0x4425();}export async function writeSqlLockFile(_0x140ca2,_0x21fa42){const _0x4c1108=a253_0x4811;await mkdir(dirname(_0x140ca2),{'recursive':!![]}),await writeFile(_0x140ca2,JSON[_0x4c1108(0x16a)](_0x21fa42,null,0x2),_0x4c1108(0x16f));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5091b4,_0x439e15){const _0x4eb00c=a255_0x4895,_0x4b9fa4=_0x5091b4();while(!![]){try{const _0x159497=-parseInt(_0x4eb00c(0x18f))/0x1*(parseInt(_0x4eb00c(0x191))/0x2)+parseInt(_0x4eb00c(0x195))/0x3*(-parseInt(_0x4eb00c(0x198))/0x4)+-parseInt(_0x4eb00c(0x19c))/0x5+-parseInt(_0x4eb00c(0x192))/0x6+parseInt(_0x4eb00c(0x193))/0x7+parseInt(_0x4eb00c(0x19b))/0x8+parseInt(_0x4eb00c(0x18c))/0x9*(parseInt(_0x4eb00c(0x197))/0xa);if(_0x159497===_0x439e15)break;else _0x4b9fa4['push'](_0x4b9fa4['shift']());}catch(_0x928f52){_0x4b9fa4['push'](_0x4b9fa4['shift']());}}}(a255_0x3126,0x78dc6));function a255_0x4895(_0xd504cb,_0xf556a){_0xd504cb=_0xd504cb-0x18c;const _0x3126e7=a255_0x3126();let _0x48958d=_0x3126e7[_0xd504cb];return _0x48958d;}function a255_0x3126(){const _0x64e4af=['.sql','764298ZpQacj','3946170dyhcyg','533309Uahqsw','replace','318sdlDFQ','sql','1470KkQUnf','17552WkdvHU','mybatisXml','trim','2872968LAAohe','304080AiYZQu','test','trimStart','99522jeDvES','db-','.xml','1gbErDe'];a255_0x3126=function(){return _0x64e4af;};return a255_0x3126();}export function detectSqlMode(_0x458a17){const _0x1fec47=a255_0x4895,_0x5512e4=_0x458a17[_0x1fec47(0x19e)]();if(/^<(select|insert|update|delete)\b/i[_0x1fec47(0x19d)](_0x5512e4))return'mybatisXml';return _0x1fec47(0x196);}export function getSqlFileExtension(_0x445b77){const _0x11bfcf=a255_0x4895;return _0x445b77===_0x11bfcf(0x199)?_0x11bfcf(0x18e):_0x11bfcf(0x190);}export function buildDefaultSqlFileName(_0xa89ad4,_0x2d190f){return''+_0xa89ad4+getSqlFileExtension(_0x2d190f);}export function sanitizeSqlPathSegment(_0x1ddf76,_0x4704b0){const _0x499e30=a255_0x4895,_0x4de0b9=String(_0x1ddf76??'')[_0x499e30(0x19a)](),_0x5c0be5=_0x4de0b9[_0x499e30(0x194)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x499e30(0x194)](/\s+/g,'-')['replace'](/-+/g,'-')[_0x499e30(0x194)](/^\.+/,'')['replace'](/\.+$/,'')[_0x499e30(0x194)](/^-+/,'')[_0x499e30(0x194)](/-+$/,'');return _0x5c0be5||_0x4704b0;}export function buildDbDirectoryName(_0x4cf7c5,_0x4acd11){const _0x3ce49d=a255_0x4895;return sanitizeSqlPathSegment(_0x4cf7c5,_0x4acd11!=null?_0x3ce49d(0x18d)+_0x4acd11:'unknown-db');}export function buildSqlRelativePath(_0x18acb5,_0x1ad0e7,_0xe3570d,_0x12ad59,_0x56d27c){const _0x59ef28=buildDbDirectoryName(_0xe3570d,_0x56d27c),_0x63984b=sanitizeSqlPathSegment(_0x18acb5,'unknown-sql'),_0x531abb=sanitizeSqlPathSegment(_0x1ad0e7,_0x63984b);return _0x59ef28+'/'+_0x63984b+'_'+_0x531abb+getSqlFileExtension(_0x12ad59);}
|