@lovrabet/rabetbase-cli 2.4.7 → 2.5.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +13 -3
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.d.ts +7 -0
- package/lib/api/generate-sdk-config-file.js +1 -0
- 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.d.ts +2 -5
- 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.d.ts +5 -0
- package/lib/commands/config/delete.js +1 -0
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.d.ts +12 -0
- package/lib/commands/config/init.js +1 -0
- 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-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/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/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/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.d.ts +1 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.d.ts +6 -2
- 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.d.ts +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.d.ts +2 -2
- 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.d.ts +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/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/domain-config.d.ts +10 -0
- package/lib/config/domain-config.js +1 -0
- package/lib/config/schema.d.ts +3 -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.d.ts +23 -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.d.ts +9 -0
- package/lib/constant/region.js +1 -0
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.d.ts +4 -6
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +2 -2
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +2 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-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.d.ts +11 -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.d.ts +2 -2
- 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/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/types/index.d.ts +28 -0
- package/lib/utils/ai_config.d.ts +1 -2
- 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 -3
- package/skills/rabetbase/SKILL.md +33 -28
- package/skills/rabetbase/guides/backend-function.md +41 -12
- package/skills/rabetbase/guides/bff-creation-workflow.md +6 -4
- package/skills/rabetbase/guides/custom-page-workflow.md +1 -1
- package/skills/rabetbase/guides/data-api-guidelines.md +8 -8
- package/skills/rabetbase/guides/database-connection-workflow.md +8 -16
- package/skills/rabetbase/guides/menu-anomaly-manual-cleanup.md +1 -6
- package/skills/rabetbase/guides/sdk-client-generation.md +146 -0
- package/skills/rabetbase/guides/sql-creation-workflow.md +1 -1
- package/skills/rabetbase/guides/troubleshooting.md +1 -1
- package/skills/rabetbase/guides/typescript-sdk.md +46 -10
- package/skills/rabetbase/references/rabetbase-api-list.md +4 -4
- package/skills/rabetbase/references/rabetbase-api-pull.md +44 -29
- package/skills/rabetbase/references/rabetbase-app-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-auth-login.md +4 -2
- package/skills/rabetbase/references/rabetbase-bff-push.md +3 -1
- package/skills/rabetbase/references/rabetbase-codegen-sql.md +3 -1
- package/skills/rabetbase/references/rabetbase-config.md +75 -30
- package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +17 -6
- package/skills/rabetbase/references/rabetbase-dataset-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-db-analyze.md +3 -3
- package/skills/rabetbase/references/rabetbase-db-detail.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +4 -4
- package/skills/rabetbase/references/rabetbase-db-diff.md +6 -9
- package/skills/rabetbase/references/rabetbase-doctor.md +1 -1
- package/skills/rabetbase/references/rabetbase-init.md +57 -51
- package/skills/rabetbase/references/rabetbase-kb.md +2 -0
- package/skills/rabetbase/references/rabetbase-page-create.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-custom-detail.md +3 -3
- package/skills/rabetbase/references/rabetbase-page-custom-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-project-create.md +12 -3
- package/skills/rabetbase/references/rabetbase-project-upgrade.md +2 -2
- package/skills/rabetbase/references/rabetbase-role-user-resolve.md +2 -2
- package/skills/rabetbase/references/rabetbase-user-account.md +1 -1
- package/skills/rabetbase/references/rabetbase-workspace.md +6 -6
- package/skills/rabetbase.manifest.json +4 -3
- package/templates/README.md +17 -28
- package/templates/generate-api/api.ts.tpl +3 -3
- package/templates/generate-api/client.ts.tpl +10 -37
- package/lib/commands/data/filter.d.ts +0 -7
- package/lib/commands/data/filter.js +0 -1
- package/lib/commands/data/getOne.d.ts +0 -7
- package/lib/commands/data/getOne.js +0 -1
- package/lib/commands/data/index.d.ts +0 -8
- package/lib/commands/data/index.js +0 -1
- package/lib/commands/data/shared.d.ts +0 -33
- package/lib/commands/data/shared.js +0 -1
- package/lib/commands/init/index.d.ts +0 -11
- package/lib/commands/init/index.js +0 -1
- package/lib/utils/rules-cdn.d.ts +0 -38
- package/lib/utils/rules-cdn.js +0 -1
- package/templates/rules/lovrabet_rules.mdc.tpl +0 -893
- package/templates/skill/SKILL.md.tpl +0 -120
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a223_0xee56c=a223_0x23f6;(function(_0x46e4c9,_0x431b8e){const _0x3ebf20=a223_0x23f6,_0x46b9ef=_0x46e4c9();while(!![]){try{const _0x5cc551=parseInt(_0x3ebf20(0x18d))/0x1*(parseInt(_0x3ebf20(0x177))/0x2)+parseInt(_0x3ebf20(0x194))/0x3*(parseInt(_0x3ebf20(0x189))/0x4)+-parseInt(_0x3ebf20(0x196))/0x5*(-parseInt(_0x3ebf20(0x16a))/0x6)+-parseInt(_0x3ebf20(0x174))/0x7*(-parseInt(_0x3ebf20(0x173))/0x8)+parseInt(_0x3ebf20(0x179))/0x9*(-parseInt(_0x3ebf20(0x188))/0xa)+parseInt(_0x3ebf20(0x181))/0xb+-parseInt(_0x3ebf20(0x178))/0xc*(parseInt(_0x3ebf20(0x17e))/0xd);if(_0x5cc551===_0x431b8e)break;else _0x46b9ef['push'](_0x46b9ef['shift']());}catch(_0x1bceef){_0x46b9ef['push'](_0x46b9ef['shift']());}}}(a223_0x2c85,0xecc6c));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=[a223_0xee56c(0x170),a223_0xee56c(0x18b),a223_0xee56c(0x16c)];export function normalizeBffType(_0x3886de){const _0x24fb0e=a223_0xee56c;if(!_0x3886de)return undefined;const _0x4139d4=_0x3886de[_0x24fb0e(0x17b)]()[_0x24fb0e(0x180)]();return SUPPORTED_BFF_TYPES['includes'](_0x4139d4)?_0x4139d4:undefined;}async function scanJsFilesRecursively(_0x49bc91,_0x262ac5){const _0xe3dca=a223_0xee56c,_0x4b7761=[];try{const _0x284550=await readdir(_0x49bc91,{'withFileTypes':!![]});for(const _0x22d823 of _0x284550){const _0x4505b4=join(_0x49bc91,_0x22d823['name']);if(_0x22d823['isDirectory']())_0x4b7761[_0xe3dca(0x18a)](...await scanJsFilesRecursively(_0x4505b4,_0x262ac5+'/'+_0x22d823[_0xe3dca(0x17d)]));else _0x22d823[_0xe3dca(0x191)]()&&_0x22d823[_0xe3dca(0x17d)][_0xe3dca(0x187)](_0xe3dca(0x17f))&&_0x4b7761[_0xe3dca(0x18a)]({'lockKey':_0x262ac5+'/'+_0x22d823[_0xe3dca(0x17d)][_0xe3dca(0x16b)](/\.js$/,''),'filePath':_0x4505b4});}}catch(_0x472d58){if(_0x472d58[_0xe3dca(0x16e)]!==_0xe3dca(0x17a))throw _0x472d58;}return _0x4b7761;}async function scanFlatFunctions(_0x47082d,_0x50cd4e){const _0xf754b4=a223_0xee56c,_0x1d20e8=join(_0x47082d['scriptsRootDir'],_0x50cd4e),_0x429bdd=await scanJsFilesRecursively(_0x1d20e8,_0x50cd4e);return _0x429bdd['map'](({lockKey:_0x77d20f,filePath:_0xb61528})=>({'type':_0x50cd4e,'name':_0x77d20f[_0xf754b4(0x183)]('/')['at'](-0x1)??'','filePath':_0xb61528,'lockKey':_0x77d20f}));}async function scanHookFunctions(_0x376449){const _0x1a2637=a223_0xee56c,_0x30370f=join(_0x376449[_0x1a2637(0x182)],_0x1a2637(0x16c)),_0x5f3fb2=[];try{const _0x137c06=await readdir(_0x30370f,{'withFileTypes':!![]});for(const _0x2b3985 of _0x137c06){if(!_0x2b3985[_0x1a2637(0x197)]())continue;const _0x1bbc7b=_0x2b3985[_0x1a2637(0x17d)],_0x3e9609=join(_0x30370f,_0x1bbc7b),_0x3683b0=await readdir(_0x3e9609,{'withFileTypes':!![]});for(const _0x3f663f of _0x3683b0){if(!_0x3f663f[_0x1a2637(0x197)]())continue;const _0x529a67=_0x3f663f[_0x1a2637(0x17d)],_0x507125=join(_0x3e9609,_0x529a67),_0x2ab65f=await readdir(_0x507125,{'withFileTypes':!![]});for(const _0xc0fc8d of _0x2ab65f){if(!_0xc0fc8d['isDirectory']())continue;const _0x2272ec=_0xc0fc8d['name'],_0x1c1458=join(_0x507125,_0x2272ec),_0x3f1fdd=await readdir(_0x1c1458,{'withFileTypes':!![]});for(const _0x383276 of _0x3f1fdd){if(!_0x383276[_0x1a2637(0x191)]()||!_0x383276[_0x1a2637(0x17d)]['endsWith']('.js'))continue;const _0x3aa256=_0x383276[_0x1a2637(0x17d)][_0x1a2637(0x16b)](/\.js$/,'');_0x5f3fb2[_0x1a2637(0x18a)]({'type':_0x1a2637(0x16c),'name':_0x3aa256,'filePath':join(_0x1c1458,_0x383276['name']),'lockKey':_0x1a2637(0x18c)+_0x1bbc7b+'/'+_0x529a67+'/'+_0x2272ec+'/'+_0x3aa256,'alias':_0x1bbc7b,'operationType':_0x529a67,'functionNode':_0x2272ec});}}}}}catch(_0x1ffacd){if(_0x1ffacd[_0x1a2637(0x16e)]!==_0x1a2637(0x17a))throw _0x1ffacd;}return _0x5f3fb2;}export async function scanLocalBffFunctions(_0x322bb3,_0x49ac78){const _0x349b90=a223_0xee56c;if(_0x49ac78===_0x349b90(0x170)||_0x49ac78===_0x349b90(0x18b))return scanFlatFunctions(_0x322bb3,_0x49ac78);if(_0x49ac78===_0x349b90(0x16c))return scanHookFunctions(_0x322bb3);const [_0xadc70b,_0x4c601f,_0xdd2521]=await Promise[_0x349b90(0x199)]([scanFlatFunctions(_0x322bb3,_0x349b90(0x170)),scanFlatFunctions(_0x322bb3,'ENDPOINT'),scanHookFunctions(_0x322bb3)]);return[..._0xadc70b,..._0x4c601f,..._0xdd2521];}function a223_0x2c85(){const _0x53d94b=['1878224UqAUHv','push','ENDPOINT','HOOK/','12GaZQBY','alias','functionNode','startsWith','isFile','test','afterScriptId','6yHlRCl','datasetCode','14285jWiriT','isDirectory','functionName','all','1788QVFppT','replace','HOOK','get','code','Resolved\x20Backend\x20Function\x20script\x20path\x20escapes\x20scripts\x20root:\x20','COMMON','before','scriptType','392iLmWqp','210133uBCfAJ','after','beforeScriptId','234142vdbATW','38663004bRSWoW','408087StMrEx','ENOENT','trim','operationType','name','13yYInUF','.js','toUpperCase','6750744yYdtoq','scriptsRootDir','split','F_OK','set','every','endsWith','240WOtong'];a223_0x2c85=function(){return _0x53d94b;};return a223_0x2c85();}const SAFE_LOCK_KEY_SEGMENT=/^[A-Za-z0-9_$.-]+$/;function a223_0x23f6(_0x55e735,_0x505787){_0x55e735=_0x55e735-0x16a;const _0x2c85c2=a223_0x2c85();let _0x23f6f8=_0x2c85c2[_0x55e735];return _0x23f6f8;}export function isSafeLockKeySegment(_0x3fb6e2){const _0x1a1377=a223_0xee56c;return SAFE_LOCK_KEY_SEGMENT[_0x1a1377(0x192)](_0x3fb6e2)&&_0x3fb6e2!=='.'&&_0x3fb6e2!=='..';}export function resolveLocalFilePathFromLockKey(_0x448d34,_0x3e11dc){const _0x157e3d=a223_0xee56c,_0x13ddbc=_0x3e11dc['split']('/');if(!_0x13ddbc[_0x157e3d(0x186)](isSafeLockKeySegment))throw new Error('Unsafe\x20Backend\x20Function\x20lock\x20key\x20(traversal\x20or\x20invalid\x20segment):\x20'+_0x3e11dc);const _0x1b34f0=resolve(join(_0x448d34[_0x157e3d(0x182)],..._0x13ddbc)+_0x157e3d(0x17f)),_0x5b1cad=resolve(_0x448d34[_0x157e3d(0x182)]);if(_0x1b34f0!==_0x5b1cad&&!_0x1b34f0[_0x157e3d(0x190)](_0x5b1cad+sep))throw new Error(_0x157e3d(0x16f)+_0x1b34f0);return _0x1b34f0;}export function createHookLocationMap(_0x37dcad){const _0x2caae7=a223_0xee56c,_0x5ae96b=new Map();for(const _0x2a83cd of _0x37dcad){_0x2a83cd[_0x2caae7(0x176)]&&_0x5ae96b[_0x2caae7(0x185)](_0x2a83cd[_0x2caae7(0x176)],{'datasetCode':_0x2a83cd[_0x2caae7(0x195)],'operationType':snakeToCamel(_0x2a83cd[_0x2caae7(0x17c)]),'functionNode':_0x2caae7(0x171)}),_0x2a83cd['afterScriptId']&&_0x5ae96b[_0x2caae7(0x185)](_0x2a83cd[_0x2caae7(0x193)],{'datasetCode':_0x2a83cd[_0x2caae7(0x195)],'operationType':snakeToCamel(_0x2a83cd['operationType']),'functionNode':_0x2caae7(0x175)});}return _0x5ae96b;}export function resolveRemoteScriptTarget(_0x49e2c8,_0x311f7c,_0x231ca0,_0x13e339,_0x20b543){const _0x5cedc3=a223_0xee56c,_0x2eafc6=normalizeBffType(_0x311f7c[_0x5cedc3(0x172)]);if(!_0x2eafc6||!_0x311f7c[_0x5cedc3(0x198)])return null;if(_0x2eafc6===_0x5cedc3(0x16c)){const _0x230a5e=(_0x311f7c['id']?_0x231ca0[_0x5cedc3(0x16d)](_0x311f7c['id']):undefined)??findHookLocationByRemoteId(_0x13e339,_0x311f7c['id']);if(!_0x230a5e)return null;const _0x135044=_0x230a5e[_0x5cedc3(0x18e)]||_0x20b543[_0x5cedc3(0x16d)](_0x230a5e[_0x5cedc3(0x195)]),_0x16926a=_0x135044??_0x230a5e[_0x5cedc3(0x195)],_0x1b5bea={..._0x230a5e,'alias':_0x135044},_0x20c88b=_0x5cedc3(0x18c)+_0x16926a+'/'+_0x1b5bea[_0x5cedc3(0x17c)]+'/'+_0x1b5bea[_0x5cedc3(0x18f)]+'/'+_0x311f7c[_0x5cedc3(0x198)];if(!_0x20c88b[_0x5cedc3(0x183)]('/')[_0x5cedc3(0x186)](isSafeLockKeySegment))return null;return{'lockKey':_0x20c88b,'filePath':resolveLocalFilePathFromLockKey(_0x49e2c8,_0x20c88b),'type':'HOOK','hookLocation':_0x1b5bea};}const _0x3d17a5=_0x2eafc6+'/'+_0x311f7c[_0x5cedc3(0x198)];if(!_0x3d17a5[_0x5cedc3(0x183)]('/')[_0x5cedc3(0x186)](isSafeLockKeySegment))return null;return{'lockKey':_0x3d17a5,'filePath':resolveLocalFilePathFromLockKey(_0x49e2c8,_0x3d17a5),'type':_0x2eafc6};}export async function ensureParentDirectory(_0x4df34e){await mkdir(dirname(_0x4df34e),{'recursive':!![]});}export async function fileExists(_0x1ab3ca){const _0xedee5c=a223_0xee56c;try{return await access(_0x1ab3ca,constants[_0xedee5c(0x184)]),!![];}catch{return![];}}export async function directoryExists(_0x44a787){const _0x492b4c=a223_0xee56c;try{const _0x2b9485=await stat(_0x44a787);return _0x2b9485[_0x492b4c(0x197)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a224_0x150f(){const _0x5b5781=['15707304INUDFn','createHash','hex','md5','6521970OxwwTj','5QjgzeE','digest','798852ndeNdm','438UZwATN','3252456oPtMsl','9lCwPyd','601366jNrFpg','utf8','1848134seIhqp','update','51814sVPaGF'];a224_0x150f=function(){return _0x5b5781;};return a224_0x150f();}(function(_0x50275f,_0x286053){const _0x2500f7=a224_0x4d96,_0x492ad9=_0x50275f();while(!![]){try{const _0x55eb57=parseInt(_0x2500f7(0x1d5))/0x1+-parseInt(_0x2500f7(0x1d3))/0x2*(parseInt(_0x2500f7(0x1d2))/0x3)+-parseInt(_0x2500f7(0x1cf))/0x4*(-parseInt(_0x2500f7(0x1cd))/0x5)+-parseInt(_0x2500f7(0x1d0))/0x6*(-parseInt(_0x2500f7(0x1d7))/0x7)+parseInt(_0x2500f7(0x1d1))/0x8+-parseInt(_0x2500f7(0x1d8))/0x9+parseInt(_0x2500f7(0x1dc))/0xa;if(_0x55eb57===_0x286053)break;else _0x492ad9['push'](_0x492ad9['shift']());}catch(_0x5c3330){_0x492ad9['push'](_0x492ad9['shift']());}}}(a224_0x150f,0xf40da));import{readFile}from'node:fs/promises';import a224_0x1da9c2 from'node:crypto';export function computeContentHash(_0x10976f){const _0x2e140a=a224_0x4d96;return a224_0x1da9c2[_0x2e140a(0x1d9)](_0x2e140a(0x1db))[_0x2e140a(0x1d6)](_0x10976f)[_0x2e140a(0x1ce)](_0x2e140a(0x1da));}function a224_0x4d96(_0x216523,_0x4a2a32){_0x216523=_0x216523-0x1cd;const _0x150f96=a224_0x150f();let _0x4d9640=_0x150f96[_0x216523];return _0x4d9640;}export async function computeFileHash(_0x2a603a){const _0x4608eb=a224_0x4d96,_0x2e5363=await readFile(_0x2a603a,_0x4608eb(0x1d4));return computeContentHash(_0x2e5363);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x382c75,_0x17770a){const _0x2168ce=a225_0x1efa,_0x1f1038=_0x382c75();while(!![]){try{const _0x191570=-parseInt(_0x2168ce(0x184))/0x1+parseInt(_0x2168ce(0x18a))/0x2*(-parseInt(_0x2168ce(0x187))/0x3)+parseInt(_0x2168ce(0x183))/0x4*(-parseInt(_0x2168ce(0x188))/0x5)+-parseInt(_0x2168ce(0x189))/0x6*(parseInt(_0x2168ce(0x182))/0x7)+parseInt(_0x2168ce(0x17a))/0x8+parseInt(_0x2168ce(0x185))/0x9+parseInt(_0x2168ce(0x180))/0xa*(parseInt(_0x2168ce(0x181))/0xb);if(_0x191570===_0x17770a)break;else _0x1f1038['push'](_0x1f1038['shift']());}catch(_0x4c6410){_0x1f1038['push'](_0x1f1038['shift']());}}}(a225_0x4820,0xb85c3));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x1a8c32,_0x1d527e,_0x476276,_0x4cbcad){const _0x425e98=a225_0x1efa,_0xdf91a5={'apps':_0x1a8c32[_0x425e98(0x17d)]&&typeof _0x1a8c32['apps']===_0x425e98(0x18e)?_0x1a8c32[_0x425e98(0x17d)]:{}};let _0x433297=_0xdf91a5[_0x425e98(0x17d)][_0x1d527e];if(!_0x433297)return _0x433297={'scriptsRoot':_0x476276,'lastSync':'','functions':{}},_0xdf91a5[_0x425e98(0x17d)][_0x1d527e]=_0x433297,{'lockData':_0xdf91a5,'appLock':_0x433297};if(!_0x433297['scriptsRoot'])_0x433297['scriptsRoot']=_0x476276;else{if(_0x433297[_0x425e98(0x194)]!==_0x476276)throw new Error(_0x4cbcad+_0x425e98(0x18d)+(_0x425e98(0x186)+_0x476276+_0x425e98(0x18f)+_0x433297['scriptsRoot']+_0x425e98(0x18b))+_0x425e98(0x193));}return!_0x433297[_0x425e98(0x190)]&&(_0x433297[_0x425e98(0x190)]={}),!_0x433297[_0x425e98(0x17f)]&&(_0x433297['lastSync']=''),{'lockData':_0xdf91a5,'appLock':_0x433297};}function a225_0x4820(){const _0x41645b=['object','\x22\x20vs\x20lock\x20\x22','functions','stringify','parse','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','scriptsRoot','435608VeTmuj','ENOENT','Failed\x20to\x20read\x20Backend\x20Function\x20lock\x20file:\x20','apps','utf8','lastSync','41010SOkdHw','4697RBGjWj','9037wasteb','1512772GHOOAd','723391UVuLnu','7834428khbXxx','current\x20\x22','3wCsAWc','5WzVwuV','1638tgOrne','933808SNRBgN','\x22.\x20','code',':\x20scriptsRoot\x20mismatch\x20—\x20'];a225_0x4820=function(){return _0x41645b;};return a225_0x4820();}function a225_0x1efa(_0x1acbf8,_0x356f89){_0x1acbf8=_0x1acbf8-0x17a;const _0x4820eb=a225_0x4820();let _0x1efa36=_0x4820eb[_0x1acbf8];return _0x1efa36;}export async function readBffLockFile(_0x5a0ef2){const _0x36771b=a225_0x1efa;try{const _0x3ba111=await readFile(_0x5a0ef2,_0x36771b(0x17e)),_0x148170=JSON[_0x36771b(0x192)](_0x3ba111);return{'apps':_0x148170[_0x36771b(0x17d)]&&typeof _0x148170[_0x36771b(0x17d)]===_0x36771b(0x18e)?_0x148170[_0x36771b(0x17d)]:{}};}catch(_0x4682a6){if(_0x4682a6[_0x36771b(0x18c)]===_0x36771b(0x17b))return null;throw new Error(_0x36771b(0x17c)+String(_0x4682a6));}}export async function writeBffLockFile(_0x437676,_0x5ed2ab){const _0x228de9=a225_0x1efa;await mkdir(dirname(_0x437676),{'recursive':!![]}),await writeFile(_0x437676,JSON[_0x228de9(0x191)](_0x5ed2ab,null,0x2),_0x228de9(0x17e));}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a227_0x2b606f=a227_0x108f;(function(_0xdde2e3,_0xfac89e){const _0x5618c8=a227_0x108f,_0x46b0d9=_0xdde2e3();while(!![]){try{const _0x14b2b7=parseInt(_0x5618c8(0x1e2))/0x1*(-parseInt(_0x5618c8(0x1ee))/0x2)+-parseInt(_0x5618c8(0x1f4))/0x3+parseInt(_0x5618c8(0x1f1))/0x4*(parseInt(_0x5618c8(0x1f5))/0x5)+parseInt(_0x5618c8(0x1e3))/0x6*(parseInt(_0x5618c8(0x1f7))/0x7)+-parseInt(_0x5618c8(0x1e9))/0x8+parseInt(_0x5618c8(0x1e4))/0x9*(-parseInt(_0x5618c8(0x1ec))/0xa)+parseInt(_0x5618c8(0x1dd))/0xb*(parseInt(_0x5618c8(0x1e1))/0xc);if(_0x14b2b7===_0xfac89e)break;else _0x46b0d9['push'](_0x46b0d9['shift']());}catch(_0x1debf5){_0x46b0d9['push'](_0x46b0d9['shift']());}}}(a227_0x5b18,0xb89db));export const DEFAULT_BFF_SCRIPT_DESCRIPTION='TODO:\x20补充脚本功能描述';const LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION=a227_0x2b606f(0x1dc);function a227_0x5b18(){const _0x2d9789=['670780JKNiFx','operationType','261618lFUMug','TODO:\x20add\x20script\x20description','16008179OovSWV','replace','trim','datasetCode','36OSVKdu','67SAVmYR','6ohFDSL','2038257FBGwWN','split','some','match','after','9313840aJDaNG','values','before','50fGZYSr','toLowerCase','25802XFRGxR','functionNode','test','12aBBWfY','toUpperCase','map','2665680TpcENq'];a227_0x5b18=function(){return _0x2d9789;};return a227_0x5b18();}export function snakeToCamel(_0x2dd42f){const _0x5e85de=a227_0x2b606f;return _0x2dd42f['toLowerCase']()[_0x5e85de(0x1de)](/_([a-z])/g,(_0x399080,_0x4f48f4)=>_0x4f48f4[_0x5e85de(0x1f2)]());}export function findHookLocationByRemoteId(_0x21525e,_0x4c5d40){const _0x48e102=a227_0x2b606f;if(!_0x4c5d40)return undefined;for(const _0x17626c of Object[_0x48e102(0x1ea)](_0x21525e)){if(_0x17626c['remoteId']===_0x4c5d40&&_0x17626c[_0x48e102(0x1e0)]&&_0x17626c[_0x48e102(0x1f6)]&&_0x17626c['functionNode'])return{'datasetCode':_0x17626c[_0x48e102(0x1e0)],'operationType':_0x17626c[_0x48e102(0x1f6)],'functionNode':_0x17626c[_0x48e102(0x1ef)]};}return undefined;}export function extractScriptDescription(_0x40252a){const _0x2ef2b1=a227_0x2b606f,_0x102d8f=_0x40252a[_0x2ef2b1(0x1e7)](/^\s*\/\*\*([\s\S]*?)\*\//);if(!_0x102d8f?.[0x1])return undefined;const _0x363f5d=_0x102d8f[0x1],_0xbd7b7f=_0x3b96f9=>{const _0x298e8b=_0x2ef2b1,_0x214f05=_0x3b96f9?.[_0x298e8b(0x1df)]();if(!_0x214f05||_0x214f05===DEFAULT_BFF_SCRIPT_DESCRIPTION||_0x214f05===LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION)return undefined;return _0x214f05;},_0x1da62c=_0x363f5d[_0x2ef2b1(0x1e7)](/^\s*\*\s*\[\s*脚本描述\s*]\s*(.+)$/m);if(_0x1da62c)return _0xbd7b7f(_0x1da62c[0x1]);const _0x1680bc=_0x363f5d[_0x2ef2b1(0x1e5)](/\r?\n/)[_0x2ef2b1(0x1f3)](_0x4f9dd4=>_0x4f9dd4['replace'](/^\s*\*\s?/,'')[_0x2ef2b1(0x1df)]()),_0x10077e=_0x1680bc[_0x2ef2b1(0x1e6)](_0x317d24=>/^\[\s*脚本类型\s*]\s*\S+/[_0x2ef2b1(0x1f0)](_0x317d24))&&_0x1680bc[_0x2ef2b1(0x1e6)](_0x5f192b=>/^\[\s*脚本名称\s*]\s*\S+/[_0x2ef2b1(0x1f0)](_0x5f192b));if(!_0x10077e)return undefined;for(const _0x115bba of _0x1680bc){if(!_0x115bba||_0x115bba['startsWith']('@')||/^\[[^\]]+]\s*/['test'](_0x115bba))continue;return _0xbd7b7f(_0x115bba);}return undefined;}export function isValidBffFunctionName(_0x344090){const _0x32ff4d=a227_0x2b606f;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x32ff4d(0x1f0)](_0x344090);}function a227_0x108f(_0x587c83,_0x2704b5){_0x587c83=_0x587c83-0x1dc;const _0x5b1886=a227_0x5b18();let _0x108f34=_0x5b1886[_0x587c83];return _0x108f34;}export function normalizeHookFunctionNode(_0x3f6774){const _0x5b7864=a227_0x2b606f;if(!_0x3f6774)return undefined;const _0x46470a=_0x3f6774['trim']()[_0x5b7864(0x1ed)]();if(_0x46470a===_0x5b7864(0x1eb)||_0x46470a===_0x5b7864(0x1e8))return _0x46470a;return undefined;}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27ff3b,_0x1ad3c1){const _0x475df8=a228_0x4e42,_0x38d5df=_0x27ff3b();while(!![]){try{const _0x40e106=parseInt(_0x475df8(0x81))/0x1*(parseInt(_0x475df8(0x69))/0x2)+parseInt(_0x475df8(0x67))/0x3*(parseInt(_0x475df8(0x70))/0x4)+parseInt(_0x475df8(0x68))/0x5+parseInt(_0x475df8(0x85))/0x6+parseInt(_0x475df8(0x84))/0x7*(-parseInt(_0x475df8(0x7d))/0x8)+parseInt(_0x475df8(0x7e))/0x9+parseInt(_0x475df8(0x6b))/0xa*(-parseInt(_0x475df8(0x72))/0xb);if(_0x40e106===_0x1ad3c1)break;else _0x38d5df['push'](_0x38d5df['shift']());}catch(_0x4d93ad){_0x38d5df['push'](_0x38d5df['shift']());}}}(a228_0x21ed,0x1bf46));import{listDatasets}from'../core/api-client.js';function a228_0x4e42(_0x2e0849,_0x2ae9bd){_0x2e0849=_0x2e0849-0x67;const _0x21ed55=a228_0x21ed();let _0x4e4218=_0x21ed55[_0x2e0849];return _0x4e4218;}const cache=new Map();export async function listDatabases(_0x4b1b73){const _0x457883=a228_0x4e42;if(cache['has'](_0x4b1b73))return cache['get'](_0x4b1b73);const _0x36a001=await listDatasets(_0x4b1b73),_0x18fc9d=new Map();for(const _0x5973df of _0x36a001){const _0x1d51eb=_0x5973df[_0x457883(0x7c)];_0x1d51eb?.['dbId']!=null&&_0x18fc9d[_0x457883(0x6a)](_0x1d51eb[_0x457883(0x6d)],_0x1d51eb[_0x457883(0x77)]??_0x457883(0x78)+_0x1d51eb[_0x457883(0x6d)]);}const _0x4da971=[..._0x18fc9d[_0x457883(0x7f)]()][_0x457883(0x83)](([_0x2452ce,_0x3e9e6a])=>({'dbId':_0x2452ce,'dbName':_0x3e9e6a}));return cache[_0x457883(0x6a)](_0x4b1b73,_0x4da971),_0x4da971;}function a228_0x21ed(){const _0x5772ae=['393990uJCWSk','118OTukWa','set','252020FLnjEA','length','dbId','\x22\x20under\x20app\x20\x22','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','1236jaZGDC','find','88DzjgmW','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','isNaN','\x22.\x20Available:\x20','dbName','db-','toLowerCase','No\x20database\x20matching\x20\x22','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','dbtableConfig','1195928EcGUBr','1378314hMALPV','entries','join','521lwTGTC','filter','map','7UAHqKe','945018hzhqab','441rruKHe'];a228_0x21ed=function(){return _0x5772ae;};return a228_0x21ed();}export async function resolveDb(_0x26bc61,_0x4e9fd0){const _0x54cc4f=a228_0x4e42,_0x565e5b=await listDatabases(_0x26bc61);if(_0x565e5b[_0x54cc4f(0x6c)]===0x0)return{'resolved':[],'error':_0x54cc4f(0x6f)+_0x26bc61+_0x54cc4f(0x7b)};if(!_0x4e9fd0)return{'resolved':_0x565e5b};const _0x4bef5b=Number(_0x4e9fd0);if(!Number[_0x54cc4f(0x75)](_0x4bef5b)){const _0x448f20=_0x565e5b['find'](_0x3db5ad=>_0x3db5ad['dbId']===_0x4bef5b);if(_0x448f20)return{'resolved':[_0x448f20]};}const _0x91a946=_0x4e9fd0['toLowerCase'](),_0x1af711=_0x565e5b[_0x54cc4f(0x82)](_0x9adc88=>_0x9adc88[_0x54cc4f(0x77)][_0x54cc4f(0x79)]()['includes'](_0x91a946));if(_0x1af711[_0x54cc4f(0x6c)]>0x0)return{'resolved':_0x1af711};const _0x17d34c=_0x565e5b['map'](_0x3f6149=>_0x3f6149['dbName']+'\x20('+_0x3f6149[_0x54cc4f(0x6d)]+')')['join'](',\x20');return{'resolved':[],'error':_0x54cc4f(0x7a)+_0x4e9fd0+_0x54cc4f(0x6e)+_0x26bc61+_0x54cc4f(0x76)+_0x17d34c+_0x54cc4f(0x74)};}export async function resolveOneDb(_0xb3c93b,_0x52fc51){const _0x1f0f7a=a228_0x4e42,{resolved:_0x2b18ea,error:_0x567bcf}=await resolveDb(_0xb3c93b,_0x52fc51);if(_0x567bcf)return{'db':null,'error':_0x567bcf};if(_0x2b18ea['length']===0x1)return{'db':_0x2b18ea[0x0]};if(!_0x52fc51){const _0x526570=_0x2b18ea[_0x1f0f7a(0x83)](_0x47fc5d=>_0x47fc5d[_0x1f0f7a(0x77)]+'\x20('+_0x47fc5d[_0x1f0f7a(0x6d)]+')')[_0x1f0f7a(0x80)](',\x20');return{'db':null,'error':_0x1f0f7a(0x73)+_0x526570};}const _0x3cbe69=_0x2b18ea[_0x1f0f7a(0x83)](_0x23e3cd=>_0x23e3cd[_0x1f0f7a(0x77)]+'\x20('+_0x23e3cd[_0x1f0f7a(0x6d)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x52fc51+'\x22\x20matches\x20multiple\x20databases:\x20'+_0x3cbe69+'.\x20Be\x20more\x20specific.'};}export async function getDbName(_0x328390,_0x41fec3){const _0x66b2b6=a228_0x4e42,_0x40415c=await listDatabases(_0x328390);return _0x40415c[_0x66b2b6(0x71)](_0x5d1f35=>_0x5d1f35[_0x66b2b6(0x6d)]===_0x41fec3)?.[_0x66b2b6(0x77)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a229_0x49e6f3=a229_0x5aca;(function(_0x184a69,_0x6a8fd5){const _0x35b592=a229_0x5aca,_0x95eb86=_0x184a69();while(!![]){try{const _0x341a7e=parseInt(_0x35b592(0xe0))/0x1*(-parseInt(_0x35b592(0xe1))/0x2)+-parseInt(_0x35b592(0xe4))/0x3+parseInt(_0x35b592(0xea))/0x4*(parseInt(_0x35b592(0xe5))/0x5)+-parseInt(_0x35b592(0xe8))/0x6+-parseInt(_0x35b592(0xe9))/0x7*(parseInt(_0x35b592(0xe3))/0x8)+parseInt(_0x35b592(0xe7))/0x9*(parseInt(_0x35b592(0xdc))/0xa)+parseInt(_0x35b592(0xdb))/0xb*(parseInt(_0x35b592(0xdd))/0xc);if(_0x341a7e===_0x6a8fd5)break;else _0x95eb86['push'](_0x95eb86['shift']());}catch(_0x2856ea){_0x95eb86['push'](_0x95eb86['shift']());}}}(a229_0x4abe,0x2174c));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x26d6d9,_0x2ff7a=process[a229_0x49e6f3(0xda)]()){const _0x1e6536=a229_0x49e6f3,_0x468f79=resolve(_0x2ff7a),_0x9c7c88=join(_0x468f79,_0x1e6536(0xe2),'page');return{'projectRoot':_0x468f79,'pagesBaseDir':_0x9c7c88,'appPagesDir':join(_0x9c7c88,_0x26d6d9),'lockFilePath':join(_0x468f79,_0x1e6536(0xe2),_0x1e6536(0xdf))};}function a229_0x4abe(){const _0x868937=['toUpperCase','45Pirplw','1092288SSrnif','1794205HWHiUb','1016LpZxgD','cwd','110858URDozq','294240LMWIAs','516qweKqj','F_OK','page.lock.json','2169rpnuVY','122mBPFBn','.rabetbase','8ESBavT','122742gtcZhR','3310kyTOYL'];a229_0x4abe=function(){return _0x868937;};return a229_0x4abe();}export function buildPageFileName(_0x1821df,_0x407534){const _0x405886=a229_0x49e6f3;return _0x1821df+'-'+String(_0x407534)[_0x405886(0xe6)]()+'.json';}export function resolvePageFilePath(_0x302fce,_0x58a12b,_0x2170ac){return join(_0x302fce['appPagesDir'],buildPageFileName(_0x58a12b,_0x2170ac));}export async function ensureParentDirectory(_0x1e917e){await mkdir(dirname(_0x1e917e),{'recursive':!![]});}function a229_0x5aca(_0x3c10de,_0x1526b2){_0x3c10de=_0x3c10de-0xda;const _0x4abe1d=a229_0x4abe();let _0x5aca26=_0x4abe1d[_0x3c10de];return _0x5aca26;}export async function fileExists(_0x487bdd){const _0x974900=a229_0x49e6f3;try{return await access(_0x487bdd,constants[_0x974900(0xde)]),!![];}catch{return![];}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x288611,_0x124cb5){const _0x5dd7c9=a230_0x1684,_0x41f612=_0x288611();while(!![]){try{const _0x771988=parseInt(_0x5dd7c9(0xeb))/0x1*(-parseInt(_0x5dd7c9(0xe7))/0x2)+-parseInt(_0x5dd7c9(0xed))/0x3+parseInt(_0x5dd7c9(0xe6))/0x4+-parseInt(_0x5dd7c9(0xe1))/0x5+-parseInt(_0x5dd7c9(0xea))/0x6*(-parseInt(_0x5dd7c9(0xdf))/0x7)+parseInt(_0x5dd7c9(0xec))/0x8*(-parseInt(_0x5dd7c9(0xef))/0x9)+-parseInt(_0x5dd7c9(0xe9))/0xa*(-parseInt(_0x5dd7c9(0xe4))/0xb);if(_0x771988===_0x124cb5)break;else _0x41f612['push'](_0x41f612['shift']());}catch(_0x513951){_0x41f612['push'](_0x41f612['shift']());}}}(a230_0x9b2e,0xdc124));import a230_0x185abe from'node:crypto';function a230_0x1684(_0x2b7edb,_0x133c01){_0x2b7edb=_0x2b7edb-0xdf;const _0x9b2ecf=a230_0x9b2e();let _0x16846b=_0x9b2ecf[_0x2b7edb];return _0x16846b;}function a230_0x9b2e(){const _0x6b44c=['265584BCPtxo','createHash','580380SyTZVS','762QrzAZX','digest','1110TbXBIu','4236oWJoQT','1511dsJqva','8wgaOiR','2745198YwpiRs','parse','2530701fMAaXZ','2996LrlvCP','update','2269445aufSJd','hex','utf8'];a230_0x9b2e=function(){return _0x6b44c;};return a230_0x9b2e();}import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x6f3a85){const _0x38b5df=a230_0x1684;return JSON['stringify'](JSON[_0x38b5df(0xee)](_0x6f3a85),null,0x2)+'\x0a';}export function computePageContentHash(_0x468f74){const _0x4e5e43=a230_0x1684;return a230_0x185abe[_0x4e5e43(0xe5)]('md5')[_0x4e5e43(0xe0)](_0x468f74)[_0x4e5e43(0xe8)](_0x4e5e43(0xe2));}export function computeSerializedSchemaHash(_0x5a9cde){return computePageContentHash(serializePageSchemaForFile(_0x5a9cde));}export async function computePageFileHash(_0x27415c){const _0x314a03=a230_0x1684,_0x4e4ef7=await readFile(_0x27415c,_0x314a03(0xe3));return computePageContentHash(_0x4e4ef7);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2052d9,_0x53e914){const _0x1125b4=a231_0x3654,_0x4e06d1=_0x2052d9();while(!![]){try{const _0x5de3b1=-parseInt(_0x1125b4(0x13f))/0x1*(parseInt(_0x1125b4(0x14c))/0x2)+-parseInt(_0x1125b4(0x14e))/0x3+parseInt(_0x1125b4(0x144))/0x4*(-parseInt(_0x1125b4(0x143))/0x5)+parseInt(_0x1125b4(0x147))/0x6*(parseInt(_0x1125b4(0x140))/0x7)+-parseInt(_0x1125b4(0x13b))/0x8+parseInt(_0x1125b4(0x142))/0x9*(-parseInt(_0x1125b4(0x145))/0xa)+parseInt(_0x1125b4(0x146))/0xb;if(_0x5de3b1===_0x53e914)break;else _0x4e06d1['push'](_0x4e06d1['shift']());}catch(_0x19dfe2){_0x4e06d1['push'](_0x4e06d1['shift']());}}}(a231_0x5c3f,0x37d6f));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a231_0x5c3f(){const _0x5dbc51=['ENOENT','utf8','718mzElkZ','apps','965253bsGONU','lastSync','2295440XcPist','code','stringify','object','11hpXFkc','7kYKYGm','parse','9CxCdoV','10LRspNl','446584wXJmEc','3834910qFZuVZ','12188165FubdPd','2040702RmdFVp','pages','Failed\x20to\x20read\x20page\x20lock\x20file:\x20'];a231_0x5c3f=function(){return _0x5dbc51;};return a231_0x5c3f();}export function ensurePageLockScope(_0x229985,_0x147dec){const _0x56a0bd=a231_0x3654,_0x1e8abe={'apps':_0x229985[_0x56a0bd(0x14d)]&&typeof _0x229985['apps']===_0x56a0bd(0x13e)?_0x229985[_0x56a0bd(0x14d)]:{}};let _0x235221=_0x1e8abe[_0x56a0bd(0x14d)][_0x147dec];if(!_0x235221)return _0x235221={'lastSync':'','pages':{}},_0x1e8abe[_0x56a0bd(0x14d)][_0x147dec]=_0x235221,{'lockData':_0x1e8abe,'appLock':_0x235221};return!_0x235221[_0x56a0bd(0x14f)]&&(_0x235221[_0x56a0bd(0x14f)]=''),(!_0x235221['pages']||typeof _0x235221[_0x56a0bd(0x148)]!==_0x56a0bd(0x13e))&&(_0x235221['pages']={}),{'lockData':_0x1e8abe,'appLock':_0x235221};}export async function readPageLockFile(_0x670768){const _0x30c134=a231_0x3654;try{const _0x541793=await readFile(_0x670768,_0x30c134(0x14b)),_0x2a9d63=JSON[_0x30c134(0x141)](_0x541793);return{'apps':_0x2a9d63[_0x30c134(0x14d)]&&typeof _0x2a9d63['apps']===_0x30c134(0x13e)?_0x2a9d63[_0x30c134(0x14d)]:{}};}catch(_0x4795a2){if(_0x4795a2[_0x30c134(0x13c)]===_0x30c134(0x14a))return null;throw new Error(_0x30c134(0x149)+String(_0x4795a2));}}function a231_0x3654(_0x1749be,_0x10f35b){_0x1749be=_0x1749be-0x13b;const _0x5c3f1a=a231_0x5c3f();let _0x365464=_0x5c3f1a[_0x1749be];return _0x365464;}export async function writePageLockFile(_0x761bcf,_0x2a5122){const _0x56308d=a231_0x3654;await mkdir(dirname(_0x761bcf),{'recursive':!![]}),await writeFile(_0x761bcf,JSON[_0x56308d(0x13d)](_0x2a5122,null,0x2),'utf8');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1c9750,_0x2a8b77){const _0x3f315d=a233_0x3153,_0xdaea69=_0x1c9750();while(!![]){try{const _0x5164a5=parseInt(_0x3f315d(0x119))/0x1*(-parseInt(_0x3f315d(0x127))/0x2)+parseInt(_0x3f315d(0x10c))/0x3*(parseInt(_0x3f315d(0x13c))/0x4)+parseInt(_0x3f315d(0xf4))/0x5*(parseInt(_0x3f315d(0x133))/0x6)+parseInt(_0x3f315d(0x11e))/0x7*(parseInt(_0x3f315d(0x11b))/0x8)+parseInt(_0x3f315d(0x118))/0x9+-parseInt(_0x3f315d(0x123))/0xa+-parseInt(_0x3f315d(0xf9))/0xb;if(_0x5164a5===_0x2a8b77)break;else _0xdaea69['push'](_0xdaea69['shift']());}catch(_0xe1105c){_0xdaea69['push'](_0xdaea69['shift']());}}}(a233_0x1dc3,0xad5cd));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x5d8286,_0x58b0b9){const _0x2f5d5e=a233_0x3153,_0xc01745=[],_0x27bb8e=normalizeSqlForStaticAnalysis(_0x5d8286),_0x2cb188=(_0x27bb8e[_0x2f5d5e(0x101)]?[]:extractJoinFacts(_0x27bb8e[_0x2f5d5e(0x108)]))[_0x2f5d5e(0x111)](_0x1c1182=>{const _0x553b94=_0x2f5d5e;if(_0x1c1182['unsupportedPredicate']||_0x1c1182[_0x553b94(0x12e)][_0x553b94(0x116)]===0x0)return _0xc01745[_0x553b94(0x12d)]({'code':_0x553b94(0x11f),'table':_0x1c1182[_0x553b94(0x12b)],'alias':_0x1c1182['alias'],'columns':_0x1c1182[_0x553b94(0x12e)],'reason':_0x1c1182['unsupportedReason']??'Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.'}),{'table':_0x1c1182[_0x553b94(0x12b)],'alias':_0x1c1182[_0x553b94(0xfe)],'columns':_0x1c1182[_0x553b94(0x12e)],'status':_0x553b94(0x107)};const _0x56f376=resolveTableMetadata(_0x58b0b9,_0x1c1182[_0x553b94(0x12b)]),_0x4d249c=(_0x56f376?.[_0x553b94(0x11d)]??[])[_0x553b94(0x111)](_0xcbd6bc=>({'index':_0xcbd6bc,'matchedPrefix':findEqualityPrefix(_0xcbd6bc['columns'],_0x1c1182[_0x553b94(0x12e)])}))[_0x553b94(0x102)](_0x2f0618=>_0x2f0618[_0x553b94(0xf7)][_0x553b94(0x116)]>0x0),_0x575110=_0x4d249c[_0x553b94(0x122)]((_0x521f4b,_0x31819f)=>!_0x521f4b||_0x31819f[_0x553b94(0xf7)]['length']>_0x521f4b[_0x553b94(0xf7)][_0x553b94(0x116)]?_0x31819f:_0x521f4b,_0x4d249c[0x0]);if(_0x575110)return{'table':_0x1c1182[_0x553b94(0x12b)],'alias':_0x1c1182[_0x553b94(0xfe)],'columns':_0x1c1182[_0x553b94(0x12e)],'status':_0x553b94(0x138),'matchedIndex':{..._0x575110[_0x553b94(0x113)],'matchedPrefix':_0x575110[_0x553b94(0xf7)]}};const _0x128d55=_0x56f376?.[_0x553b94(0x11d)][_0x553b94(0x102)](_0x1c1e66=>_0x1c1e66[_0x553b94(0x12e)][_0x553b94(0xf8)](_0x21cc2f=>_0x1c1182[_0x553b94(0x12e)][_0x553b94(0xf8)](_0x2dbc72=>columnNamesMatch(_0x21cc2f,_0x2dbc72))))??[];if(_0x128d55[_0x553b94(0x116)]>0x0)return _0xc01745[_0x553b94(0x12d)]({'code':_0x553b94(0xf5),'table':_0x1c1182[_0x553b94(0x12b)],'alias':_0x1c1182[_0x553b94(0xfe)],'columns':_0x1c1182['columns'],'reason':_0x553b94(0x11c)}),{'table':_0x1c1182[_0x553b94(0x12b)],'alias':_0x1c1182[_0x553b94(0xfe)],'columns':_0x1c1182['columns'],'status':_0x553b94(0x13a),'candidateIndexes':_0x128d55};if(_0x56f376&&_0x56f376[_0x553b94(0x105)]!==![]&&_0x56f376[_0x553b94(0x11d)][_0x553b94(0x116)]>0x0&&_0x1c1182['columns'][_0x553b94(0x116)]>0x0)return _0xc01745[_0x553b94(0x12d)]({'code':_0x553b94(0x130),'table':_0x1c1182[_0x553b94(0x12b)],'alias':_0x1c1182[_0x553b94(0xfe)],'columns':_0x1c1182[_0x553b94(0x12e)],'reason':_0x553b94(0x13e)}),{'table':_0x1c1182['table'],'alias':_0x1c1182[_0x553b94(0xfe)],'columns':_0x1c1182['columns'],'status':_0x553b94(0x13a)};return _0xc01745[_0x553b94(0x12d)]({'code':_0x553b94(0x10a),'table':_0x1c1182[_0x553b94(0x12b)],'alias':_0x1c1182[_0x553b94(0xfe)],'columns':_0x1c1182[_0x553b94(0x12e)],'reason':_0x56f376?_0x553b94(0xfd):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x1c1182[_0x553b94(0x12b)],'alias':_0x1c1182[_0x553b94(0xfe)],'columns':_0x1c1182['columns'],'status':_0x553b94(0x107)};});return{'checked':_0x2cb188[_0x2f5d5e(0x116)]>0x0,'joins':_0x2cb188,'warnings':_0xc01745};}function extractJoinFacts(_0xaf8dfc){const _0x1b2117=a233_0x3153,_0x41cedd=maskNestedQueries(stripSqlNoise(_0xaf8dfc)),_0x33aa1c=maskQuotedIdentifiers(_0x41cedd),_0x595a45=[],_0x5203d6=new Set(),_0x3438c5=/\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 _0x439f0f of _0x41cedd[_0x1b2117(0xfc)](_0x3438c5)){const _0x28c05b=_0x439f0f['index']??0x0,_0x2ac04c=_0x439f0f[0x0]['search'](/\bJOIN\b/i),_0x1c5bdb=_0x28c05b+Math['max'](0x0,_0x2ac04c);if(!/^JOIN\b/i[_0x1b2117(0xf6)](_0x33aa1c[_0x1b2117(0x12f)](_0x1c5bdb)))continue;_0x5203d6['add'](_0x1c5bdb);const _0x30680b=normalizeIdentifier(_0x439f0f[0x1]||_0x1b2117(0x121)),_0x50c885=normalizeIdentifier(_0x439f0f[0x2]??''),_0x38b9e0=normalizeIdentifier(_0x439f0f[0x3]||_0x50c885[_0x1b2117(0xfa)]('.')['at'](-0x1)||_0x50c885),_0x5d4172=[],_0x2e34e4=_0x50c885===_0x1b2117(0x136);let _0x10aa5c=_0x30680b===_0x1b2117(0x135)||_0x30680b===_0x1b2117(0x139)||_0x2e34e4,_0x4241bc=_0x10aa5c?_0x2e34e4?'Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.':_0x30680b[_0x1b2117(0x10e)]()+_0x1b2117(0x128):undefined;const _0x4d3268=stripOuterParentheses(_0x439f0f[0x4]??''),_0x344549=_0x4d3268[_0x1b2117(0x120)](MYBATIS_DYNAMIC_START_MARKER)||_0x4d3268[_0x1b2117(0x120)](MYBATIS_DYNAMIC_END_MARKER),_0x168ac4=_0x4d3268[_0x1b2117(0x120)](MYBATIS_INCLUDE_MARKER);_0x344549&&(_0x10aa5c=!![],_0x4241bc??='MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.');_0x168ac4&&(_0x10aa5c=!![],_0x4241bc??=_0x1b2117(0x124));const _0x3aac02=_0x4d3268[_0x1b2117(0x10b)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x1b2117(0x10b)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x3aac02,'OR')&&(_0x10aa5c=!![],_0x4241bc??=_0x1b2117(0x104));for(const _0x537753 of splitTopLevelAnd(_0x3aac02)){const _0x195b3a=stripOuterParentheses(_0x537753);if(hasTopLevelKeyword(_0x195b3a,'OR')){_0x10aa5c=!![],_0x4241bc??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x29a20d=splitEquality(_0x195b3a);if(!_0x29a20d){containsColumnReference(_0x537753,_0x38b9e0)&&(_0x10aa5c=!![]);continue;}const _0xfc9dc6=parseDirectColumnReference(_0x29a20d[0x0],_0x38b9e0),_0x4478d4=parseDirectColumnReference(_0x29a20d[0x1],_0x38b9e0),_0x56900a=containsColumnReference(_0x29a20d[0x0],_0x38b9e0),_0x1a1214=containsColumnReference(_0x29a20d[0x1],_0x38b9e0),_0x2e173b=_0xfc9dc6&&!_0x1a1214?_0xfc9dc6:_0x4478d4&&!_0x56900a?_0x4478d4:null;if(_0x2e173b&&!_0x5d4172[_0x1b2117(0x120)](_0x2e173b))_0x5d4172[_0x1b2117(0x12d)](_0x2e173b);else!_0x2e173b&&containsColumnReference(_0x537753,_0x38b9e0)&&(_0x10aa5c=!![]);}_0x595a45[_0x1b2117(0x12d)]({'table':_0x50c885,'alias':_0x38b9e0,'columns':_0x5d4172,'unsupportedPredicate':_0x10aa5c,'unsupportedReason':_0x4241bc,'containsUnresolvedInclude':_0x168ac4,'position':_0x1c5bdb});}for(const _0x3b0843 of _0x33aa1c[_0x1b2117(0xfc)](/\bJOIN\b/gi)){const _0x2fa105=_0x3b0843[_0x1b2117(0x113)]??0x0;if(_0x5203d6[_0x1b2117(0xfb)](_0x2fa105))continue;const _0x265317=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x1b2117(0x112)](_0x41cedd[_0x1b2117(0x12f)](_0x2fa105+_0x3b0843[0x0][_0x1b2117(0x116)])),_0x302863=normalizeIdentifier(_0x265317?.[0x1]||_0x1b2117(0xff)),_0x344748=normalizeIdentifier(_0x265317?.[0x2]||''),_0x336df0=isSqlClauseKeyword(_0x344748)?_0x302863['split']('.')['at'](-0x1)||_0x302863:_0x344748||_0x302863[_0x1b2117(0xfa)]('.')['at'](-0x1)||_0x302863;_0x595a45['push']({'table':_0x302863,'alias':_0x336df0,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1b2117(0x10d),'position':_0x2fa105});}const _0x274a9a=_0x33aa1c[_0x1b2117(0x117)](MYBATIS_INCLUDE_MARKER);return _0x274a9a>=0x0&&!_0x595a45[_0x1b2117(0xf8)](_0x448488=>_0x448488[_0x1b2117(0x126)])&&_0x595a45['push']({'table':_0x1b2117(0xff),'alias':'unknown','columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1b2117(0x13b),'containsUnresolvedInclude':!![],'position':_0x274a9a}),_0x595a45['sort']((_0x329870,_0xc0015c)=>_0x329870['position']-_0xc0015c[_0x1b2117(0x134)]);}function stripSqlNoise(_0x1c265b){const _0x8aec53=a233_0x3153,_0x1fb583=Array[_0x8aec53(0x12c)](_0x1c265b),_0x575e81=(_0x1aabd2,_0x3ded7c)=>{for(let _0x5d4b85=_0x1aabd2;_0x5d4b85<_0x3ded7c;_0x5d4b85+=0x1){_0x1fb583[_0x5d4b85]!=='\x0a'&&_0x1fb583[_0x5d4b85]!=='\x0d'&&(_0x1fb583[_0x5d4b85]='\x20');}};for(let _0x107d6a=0x0;_0x107d6a<_0x1fb583[_0x8aec53(0x116)];_0x107d6a+=0x1){const _0x31a238=_0x1fb583[_0x107d6a],_0x43689b=_0x1fb583[_0x107d6a+0x1];if(_0x31a238==='\x27'||_0x31a238==='\x22'||_0x31a238==='`'){const _0x51e0e8=_0x31a238,_0xb9507d=_0x107d6a;_0x107d6a+=0x1;while(_0x107d6a<_0x1fb583['length']){if(_0x1fb583[_0x107d6a]==='\x5c'&&_0x107d6a+0x1<_0x1fb583[_0x8aec53(0x116)]){_0x107d6a+=0x2;continue;}if(_0x1fb583[_0x107d6a]!==_0x51e0e8){_0x107d6a+=0x1;continue;}if(_0x1fb583[_0x107d6a+0x1]===_0x51e0e8){_0x107d6a+=0x2;continue;}break;}if(_0x51e0e8==='\x27')_0x575e81(_0xb9507d,Math['min'](_0x107d6a+0x1,_0x1fb583[_0x8aec53(0x116)]));continue;}if(_0x31a238==='-'&&_0x43689b==='-'){const _0xfc7df0=_0x107d6a;while(_0x107d6a<_0x1fb583[_0x8aec53(0x116)]&&_0x1fb583[_0x107d6a]!=='\x0a')_0x107d6a+=0x1;_0x575e81(_0xfc7df0,_0x107d6a);continue;}if(_0x31a238==='/'&&_0x43689b==='*'){const _0x33cd0c=_0x107d6a;_0x107d6a+=0x2;while(_0x107d6a<_0x1fb583[_0x8aec53(0x116)]&&!(_0x1fb583[_0x107d6a]==='*'&&_0x1fb583[_0x107d6a+0x1]==='/')){_0x107d6a+=0x1;}_0x107d6a=Math[_0x8aec53(0x137)](_0x107d6a+0x1,_0x1fb583[_0x8aec53(0x116)]-0x1),_0x575e81(_0x33cd0c,_0x107d6a+0x1);continue;}if(_0x31a238==='#'&&_0x43689b!=='{'){const _0x2ffc72=_0x107d6a;while(_0x107d6a<_0x1fb583[_0x8aec53(0x116)]&&_0x1fb583[_0x107d6a]!=='\x0a')_0x107d6a+=0x1;_0x575e81(_0x2ffc72,_0x107d6a);continue;}if((_0x31a238==='#'||_0x31a238==='$')&&_0x43689b==='{'){const _0xc008f6=_0x107d6a;_0x107d6a+=0x2;while(_0x107d6a<_0x1fb583[_0x8aec53(0x116)]&&_0x1fb583[_0x107d6a]!=='}')_0x107d6a+=0x1;_0x575e81(_0xc008f6,Math[_0x8aec53(0x137)](_0x107d6a+0x1,_0x1fb583[_0x8aec53(0x116)]));}}return _0x1fb583[_0x8aec53(0x125)]('');}function maskQuotedIdentifiers(_0x347b07){const _0x3dc133=a233_0x3153,_0x5d8bfd=Array['from'](_0x347b07);for(let _0x138d89=0x0;_0x138d89<_0x5d8bfd[_0x3dc133(0x116)];_0x138d89+=0x1){const _0x3e4067=_0x5d8bfd[_0x138d89];if(_0x3e4067!=='\x22'&&_0x3e4067!=='`')continue;_0x138d89+=0x1;while(_0x138d89<_0x5d8bfd[_0x3dc133(0x116)]){if(_0x5d8bfd[_0x138d89]===_0x3e4067){if(_0x5d8bfd[_0x138d89+0x1]===_0x3e4067){_0x5d8bfd[_0x138d89]='\x20',_0x5d8bfd[_0x138d89+0x1]='\x20',_0x138d89+=0x2;continue;}break;}_0x5d8bfd[_0x138d89]='\x20',_0x138d89+=0x1;}}return _0x5d8bfd['join']('');}function maskNestedQueries(_0x36c449){const _0x35c428=a233_0x3153,_0x2dc003=Array[_0x35c428(0x12c)](_0x36c449);for(let _0x2a87c8=0x0;_0x2a87c8<_0x2dc003[_0x35c428(0x116)];_0x2a87c8+=0x1){if(_0x2dc003[_0x2a87c8]!=='(')continue;const _0x495269=_0x36c449[_0x35c428(0x12f)](_0x2a87c8+0x1);if(!/^\s*(?:SELECT|WITH)\b/i['test'](_0x495269))continue;let _0x234315=0x1,_0x51c834=_0x2a87c8+0x1;for(;_0x51c834<_0x2dc003[_0x35c428(0x116)]&&_0x234315>0x0;_0x51c834+=0x1){if(_0x2dc003[_0x51c834]==='(')_0x234315+=0x1;if(_0x2dc003[_0x51c834]===')')_0x234315-=0x1;}if(_0x234315!==0x0)continue;for(let _0x5a2e28=_0x2a87c8;_0x5a2e28<_0x51c834;_0x5a2e28+=0x1){_0x2dc003[_0x5a2e28]='\x20';}const _0x2ad175=_0x35c428(0x136);for(let _0x283837=0x0;_0x283837<_0x2ad175[_0x35c428(0x116)]&&_0x2a87c8+_0x283837<_0x51c834;_0x283837+=0x1){_0x2dc003[_0x2a87c8+_0x283837]=_0x2ad175[_0x283837];}_0x2a87c8=_0x51c834-0x1;}return _0x2dc003['join']('');}function splitTopLevelAnd(_0x1455a2){const _0x4f85ed=a233_0x3153,_0x21e2a1=[];let _0x876ab9=0x0,_0x1a5ec6=0x0;for(let _0x3dc23a=0x0;_0x3dc23a<_0x1455a2[_0x4f85ed(0x116)];_0x3dc23a+=0x1){const _0x410603=_0x1455a2[_0x3dc23a];if(_0x410603==='(')_0x876ab9+=0x1;if(_0x410603===')')_0x876ab9=Math[_0x4f85ed(0x114)](0x0,_0x876ab9-0x1);_0x876ab9===0x0&&_0x1455a2[_0x4f85ed(0x12f)](_0x3dc23a)[_0x4f85ed(0x115)](/^AND\b/i)&&(_0x3dc23a===0x0||/\s/[_0x4f85ed(0xf6)](_0x1455a2[_0x3dc23a-0x1]??''))&&(_0x21e2a1[_0x4f85ed(0x12d)](_0x1455a2[_0x4f85ed(0x12f)](_0x1a5ec6,_0x3dc23a)[_0x4f85ed(0x12a)]()),_0x3dc23a+=0x2,_0x1a5ec6=_0x3dc23a+0x1);}const _0x50da5b=_0x1455a2[_0x4f85ed(0x12f)](_0x1a5ec6)[_0x4f85ed(0x12a)]();if(_0x50da5b)_0x21e2a1[_0x4f85ed(0x12d)](_0x50da5b);return _0x21e2a1;}function a233_0x1dc3(){const _0x5f0b13=['alias','unknown','tableName','error','filter','left','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','metadataAvailable','replace','unavailable','sql','\x5c$&','INDEX_METADATA_UNAVAILABLE','replaceAll','3hZSAte','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','toUpperCase','endsWith','toLowerCase','map','exec','index','max','match','length','indexOf','12176874RjGOkr','4081BdmgQF','where','2504zhMmQs','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','indexes','26971hAmBmX','JOIN_PREDICATE_UNSUPPORTED','includes','INNER','reduce','2691790jrtpeB','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','join','containsUnresolvedInclude','632dDGETf','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','using','trim','table','from','push','columns','slice','JOIN_INDEX_MISSING','natural','\x5cs*\x5c.\x5cs*[\x5cw$]+','6QvraXh','position','right','__sq__','min','covered','full','warning','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','116436LWfozA','(?:^|[^\x5cw$])','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','1730650Gzydet','JOIN_INDEX_NOT_USABLE','test','matchedPrefix','some','7318806CZkjxk','split','has','matchAll','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.'];a233_0x1dc3=function(){return _0x5f0b13;};return a233_0x1dc3();}function hasTopLevelKeyword(_0x27b855,_0x4482a6){const _0x1b1ef2=a233_0x3153;let _0x50b492=0x0;for(let _0x1ceead=0x0;_0x1ceead<_0x27b855[_0x1b1ef2(0x116)];_0x1ceead+=0x1){const _0x5bef3c=_0x27b855[_0x1ceead];if(_0x5bef3c==='(')_0x50b492+=0x1;if(_0x5bef3c===')')_0x50b492=Math['max'](0x0,_0x50b492-0x1);if(_0x50b492!==0x0)continue;const _0x23fc4b=_0x27b855[_0x1b1ef2(0x12f)](_0x1ceead,_0x1ceead+_0x4482a6[_0x1b1ef2(0x116)]),_0x49d354=_0x27b855[_0x1ceead-0x1]??'\x20',_0x497651=_0x27b855[_0x1ceead+_0x4482a6[_0x1b1ef2(0x116)]]??'\x20';if(_0x23fc4b[_0x1b1ef2(0x10e)]()===_0x4482a6[_0x1b1ef2(0x10e)]()&&!/[\w$]/[_0x1b1ef2(0xf6)](_0x49d354)&&!/[\w$]/[_0x1b1ef2(0xf6)](_0x497651))return!![];}return![];}function splitEquality(_0x20a0cd){const _0x39c48a=a233_0x3153,_0x45142e=stripOuterParentheses(_0x20a0cd);let _0x3bbe83=0x0,_0x2d2366;for(let _0x3644af=0x0;_0x3644af<_0x45142e[_0x39c48a(0x116)];_0x3644af+=0x1){const _0xdf7dcd=_0x45142e[_0x3644af];if(_0xdf7dcd==='(')_0x3bbe83+=0x1;if(_0xdf7dcd===')')_0x3bbe83=Math[_0x39c48a(0x114)](0x0,_0x3bbe83-0x1);const _0x1e8601=_0x45142e[_0x3644af-0x1]??'',_0x3f8266=_0x45142e[_0x3644af+0x1]??'';if(_0xdf7dcd==='='&&_0x3bbe83===0x0&&!/[!<>=:]/[_0x39c48a(0xf6)](_0x1e8601)&&_0x3f8266!=='='){if(_0x2d2366!==undefined)return null;_0x2d2366=_0x3644af;}}return _0x2d2366===undefined?null:[_0x45142e[_0x39c48a(0x12f)](0x0,_0x2d2366)[_0x39c48a(0x12a)](),_0x45142e[_0x39c48a(0x12f)](_0x2d2366+0x1)[_0x39c48a(0x12a)]()];}function parseDirectColumnReference(_0x5e0da7,_0x338f1a){const _0x23e046=a233_0x3153,_0x2f33f1=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x23e046(0x112)](stripOuterParentheses(_0x5e0da7));if(!_0x2f33f1)return null;if(normalizeIdentifier(_0x2f33f1[0x1]??'')!==normalizeIdentifier(_0x338f1a))return null;return normalizeIdentifier(_0x2f33f1[0x2]??'');}function containsColumnReference(_0x4f6650,_0xb4c44e){const _0x525d82=a233_0x3153,_0x423f7c=_0x4f6650[_0x525d82(0x106)](/[`"]/g,''),_0x2e127a=_0xb4c44e[_0x525d82(0x106)](/[.*+?^${}()|[\]\\]/g,_0x525d82(0x109));return new RegExp(_0x525d82(0x13d)+_0x2e127a+_0x525d82(0x132),'i')[_0x525d82(0xf6)](_0x423f7c);}function findEqualityPrefix(_0x3e5e23,_0x84fe77){const _0x16dd2b=a233_0x3153,_0x3ebe85=new Set(_0x84fe77['map'](normalizeIdentifier)),_0x15667b=[];for(const _0x2a38d8 of _0x3e5e23){if(!_0x3ebe85[_0x16dd2b(0xfb)](normalizeIdentifier(_0x2a38d8)))break;_0x15667b[_0x16dd2b(0x12d)](_0x2a38d8);}return _0x15667b;}function resolveTableMetadata(_0x1a7b17,_0x7db5c5){const _0x52fbb9=a233_0x3153,_0x39d501=normalizeIdentifier(_0x7db5c5),_0x40eeec=_0x1a7b17['filter'](_0x534143=>normalizeIdentifier(_0x534143[_0x52fbb9(0x100)])===_0x39d501);if(_0x40eeec[_0x52fbb9(0x116)]===0x1)return _0x40eeec[0x0];const _0x5960e5=_0x39d501[_0x52fbb9(0x120)]('.'),_0x436ced=_0x39d501[_0x52fbb9(0xfa)]('.')['at'](-0x1),_0x2b9a62=_0x1a7b17['filter'](_0x299b50=>{const _0x8a25ff=_0x52fbb9,_0x2ae045=normalizeIdentifier(_0x299b50['tableName']);if(_0x5960e5&&_0x2ae045[_0x8a25ff(0x120)]('.'))return![];return _0x2ae045[_0x8a25ff(0xfa)]('.')['at'](-0x1)===_0x436ced;});return _0x2b9a62[_0x52fbb9(0x116)]===0x1?_0x2b9a62[0x0]:undefined;}function columnNamesMatch(_0x1f4e9e,_0x4b18dc){return normalizeIdentifier(_0x1f4e9e)===normalizeIdentifier(_0x4b18dc);}function normalizeIdentifier(_0x51dedd){const _0x532541=a233_0x3153;return _0x51dedd[_0x532541(0x106)](/[`"]/g,'')[_0x532541(0x12a)]()[_0x532541(0x110)]();}function isSqlClauseKeyword(_0x57cb21){const _0x4fc9fc=a233_0x3153;return new Set(['on',_0x4fc9fc(0x129),_0x4fc9fc(0x11a),'join','inner',_0x4fc9fc(0x103),_0x4fc9fc(0x135),_0x4fc9fc(0x139),'cross',_0x4fc9fc(0x131)])['has'](_0x57cb21);}function a233_0x3153(_0x3c84f0,_0x405cb8){_0x3c84f0=_0x3c84f0-0xf4;const _0x1dc322=a233_0x1dc3();let _0x3153e3=_0x1dc322[_0x3c84f0];return _0x3153e3;}function stripOuterParentheses(_0x4dcee2){const _0x562ae5=a233_0x3153;let _0x40439a=_0x4dcee2[_0x562ae5(0x12a)]();while(_0x40439a['startsWith']('(')&&_0x40439a[_0x562ae5(0x10f)](')')){let _0x39b8eb=0x0,_0x3b8486=!![];for(let _0x34fb84=0x0;_0x34fb84<_0x40439a['length'];_0x34fb84+=0x1){if(_0x40439a[_0x34fb84]==='(')_0x39b8eb+=0x1;if(_0x40439a[_0x34fb84]===')')_0x39b8eb-=0x1;if(_0x39b8eb===0x0&&_0x34fb84<_0x40439a[_0x562ae5(0x116)]-0x1){_0x3b8486=![];break;}}if(!_0x3b8486||_0x39b8eb!==0x0)break;_0x40439a=_0x40439a[_0x562ae5(0x12f)](0x1,-0x1)[_0x562ae5(0x12a)]();}return _0x40439a;}
|
|
1
|
+
(function(_0x5b4f57,_0x3823e0){const _0x456686=a233_0x16f7,_0x33b388=_0x5b4f57();while(!![]){try{const _0x4a84ad=-parseInt(_0x456686(0x17b))/0x1+parseInt(_0x456686(0x13d))/0x2*(parseInt(_0x456686(0x16c))/0x3)+parseInt(_0x456686(0x17e))/0x4*(parseInt(_0x456686(0x14f))/0x5)+parseInt(_0x456686(0x184))/0x6+-parseInt(_0x456686(0x180))/0x7+parseInt(_0x456686(0x148))/0x8+parseInt(_0x456686(0x177))/0x9*(parseInt(_0x456686(0x141))/0xa);if(_0x4a84ad===_0x3823e0)break;else _0x33b388['push'](_0x33b388['shift']());}catch(_0x37540e){_0x33b388['push'](_0x33b388['shift']());}}}(a233_0x4b93,0x3fae2));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x1da526,_0x1d02cf){const _0x1ccea4=a233_0x16f7,_0x3da808=[],_0x1e2bf4=normalizeSqlForStaticAnalysis(_0x1da526),_0x3b33be=(_0x1e2bf4[_0x1ccea4(0x168)]?[]:extractJoinFacts(_0x1e2bf4[_0x1ccea4(0x14e)]))['map'](_0xddb5da=>{const _0x2c6681=_0x1ccea4;if(_0xddb5da['unsupportedPredicate']||_0xddb5da['columns'][_0x2c6681(0x16f)]===0x0)return _0x3da808[_0x2c6681(0x17d)]({'code':_0x2c6681(0x174),'table':_0xddb5da[_0x2c6681(0x160)],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'reason':_0xddb5da[_0x2c6681(0x162)]??_0x2c6681(0x165)}),{'table':_0xddb5da[_0x2c6681(0x160)],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'status':_0x2c6681(0x14d)};const _0xf01562=resolveTableMetadata(_0x1d02cf,_0xddb5da[_0x2c6681(0x160)]),_0x5a05d7=(_0xf01562?.[_0x2c6681(0x145)]??[])[_0x2c6681(0x144)](_0x21ff7b=>({'index':_0x21ff7b,'matchedPrefix':findEqualityPrefix(_0x21ff7b[_0x2c6681(0x172)],_0xddb5da['columns'])}))[_0x2c6681(0x149)](_0xc1112c=>_0xc1112c['matchedPrefix']['length']>0x0),_0x593142=_0x5a05d7['reduce']((_0x402793,_0x3ef68d)=>!_0x402793||_0x3ef68d['matchedPrefix'][_0x2c6681(0x16f)]>_0x402793['matchedPrefix']['length']?_0x3ef68d:_0x402793,_0x5a05d7[0x0]);if(_0x593142)return{'table':_0xddb5da['table'],'alias':_0xddb5da['alias'],'columns':_0xddb5da['columns'],'status':_0x2c6681(0x173),'matchedIndex':{..._0x593142[_0x2c6681(0x154)],'matchedPrefix':_0x593142['matchedPrefix']}};const _0x132cd8=_0xf01562?.[_0x2c6681(0x145)]['filter'](_0x25e24c=>_0x25e24c[_0x2c6681(0x172)][_0x2c6681(0x147)](_0x44e86d=>_0xddb5da[_0x2c6681(0x172)][_0x2c6681(0x147)](_0x530422=>columnNamesMatch(_0x44e86d,_0x530422))))??[];if(_0x132cd8[_0x2c6681(0x16f)]>0x0)return _0x3da808[_0x2c6681(0x17d)]({'code':_0x2c6681(0x17a),'table':_0xddb5da[_0x2c6681(0x160)],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'reason':_0x2c6681(0x158)}),{'table':_0xddb5da['table'],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da['columns'],'status':_0x2c6681(0x16d),'candidateIndexes':_0x132cd8};if(_0xf01562&&_0xf01562[_0x2c6681(0x14b)]!==![]&&_0xf01562[_0x2c6681(0x145)]['length']>0x0&&_0xddb5da[_0x2c6681(0x172)][_0x2c6681(0x16f)]>0x0)return _0x3da808[_0x2c6681(0x17d)]({'code':_0x2c6681(0x140),'table':_0xddb5da[_0x2c6681(0x160)],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'reason':_0x2c6681(0x163)}),{'table':_0xddb5da[_0x2c6681(0x160)],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'status':_0x2c6681(0x16d)};return _0x3da808[_0x2c6681(0x17d)]({'code':_0x2c6681(0x16e),'table':_0xddb5da['table'],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'reason':_0xf01562?_0x2c6681(0x14c):_0x2c6681(0x161)}),{'table':_0xddb5da[_0x2c6681(0x160)],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'status':_0x2c6681(0x14d)};});return{'checked':_0x3b33be['length']>0x0,'joins':_0x3b33be,'warnings':_0x3da808};}function extractJoinFacts(_0x44ac44){const _0xc6680f=a233_0x16f7,_0x48b56e=maskNestedQueries(stripSqlNoise(_0x44ac44)),_0x44a17a=maskQuotedIdentifiers(_0x48b56e),_0x187673=[],_0x2f5730=new Set(),_0x2f3679=/\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 _0x8e4880 of _0x48b56e[_0xc6680f(0x143)](_0x2f3679)){const _0x1be0c0=_0x8e4880[_0xc6680f(0x154)]??0x0,_0x3b7a85=_0x8e4880[0x0][_0xc6680f(0x17c)](/\bJOIN\b/i),_0x2b8635=_0x1be0c0+Math[_0xc6680f(0x13e)](0x0,_0x3b7a85);if(!/^JOIN\b/i[_0xc6680f(0x15f)](_0x44a17a[_0xc6680f(0x179)](_0x2b8635)))continue;_0x2f5730['add'](_0x2b8635);const _0xaa0e43=normalizeIdentifier(_0x8e4880[0x1]||'INNER'),_0x242b2d=normalizeIdentifier(_0x8e4880[0x2]??''),_0xa0f5b7=normalizeIdentifier(_0x8e4880[0x3]||_0x242b2d['split']('.')['at'](-0x1)||_0x242b2d),_0xbe8a39=[],_0x5dd866=_0x242b2d===_0xc6680f(0x142);let _0x3d5fa7=_0xaa0e43==='right'||_0xaa0e43===_0xc6680f(0x16b)||_0x5dd866,_0x3865d3=_0x3d5fa7?_0x5dd866?_0xc6680f(0x178):_0xaa0e43['toUpperCase']()+_0xc6680f(0x15a):undefined;const _0x3d4826=stripOuterParentheses(_0x8e4880[0x4]??''),_0xd95ab6=_0x3d4826[_0xc6680f(0x181)](MYBATIS_DYNAMIC_START_MARKER)||_0x3d4826[_0xc6680f(0x181)](MYBATIS_DYNAMIC_END_MARKER),_0x3baf82=_0x3d4826[_0xc6680f(0x181)](MYBATIS_INCLUDE_MARKER);_0xd95ab6&&(_0x3d5fa7=!![],_0x3865d3??='MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.');_0x3baf82&&(_0x3d5fa7=!![],_0x3865d3??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0x16ecfe=_0x3d4826[_0xc6680f(0x151)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0xc6680f(0x151)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0xc6680f(0x151)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x16ecfe,'OR')&&(_0x3d5fa7=!![],_0x3865d3??=_0xc6680f(0x182));for(const _0x2d35d4 of splitTopLevelAnd(_0x16ecfe)){const _0x20d358=stripOuterParentheses(_0x2d35d4);if(hasTopLevelKeyword(_0x20d358,'OR')){_0x3d5fa7=!![],_0x3865d3??=_0xc6680f(0x182);continue;}const _0x145068=splitEquality(_0x20d358);if(!_0x145068){containsColumnReference(_0x2d35d4,_0xa0f5b7)&&(_0x3d5fa7=!![]);continue;}const _0x445743=parseDirectColumnReference(_0x145068[0x0],_0xa0f5b7),_0x412044=parseDirectColumnReference(_0x145068[0x1],_0xa0f5b7),_0x34fd3a=containsColumnReference(_0x145068[0x0],_0xa0f5b7),_0x2ac37e=containsColumnReference(_0x145068[0x1],_0xa0f5b7),_0x55f9be=_0x445743&&!_0x2ac37e?_0x445743:_0x412044&&!_0x34fd3a?_0x412044:null;if(_0x55f9be&&!_0xbe8a39[_0xc6680f(0x181)](_0x55f9be))_0xbe8a39[_0xc6680f(0x17d)](_0x55f9be);else!_0x55f9be&&containsColumnReference(_0x2d35d4,_0xa0f5b7)&&(_0x3d5fa7=!![]);}_0x187673['push']({'table':_0x242b2d,'alias':_0xa0f5b7,'columns':_0xbe8a39,'unsupportedPredicate':_0x3d5fa7,'unsupportedReason':_0x3865d3,'containsUnresolvedInclude':_0x3baf82,'position':_0x2b8635});}for(const _0x138b12 of _0x44a17a['matchAll'](/\bJOIN\b/gi)){const _0x4ddd3d=_0x138b12[_0xc6680f(0x154)]??0x0;if(_0x2f5730[_0xc6680f(0x167)](_0x4ddd3d))continue;const _0x33d96c=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0xc6680f(0x14a)](_0x48b56e['slice'](_0x4ddd3d+_0x138b12[0x0][_0xc6680f(0x16f)])),_0x3ad1e9=normalizeIdentifier(_0x33d96c?.[0x1]||'unknown'),_0xf20fd=normalizeIdentifier(_0x33d96c?.[0x2]||''),_0x364483=isSqlClauseKeyword(_0xf20fd)?_0x3ad1e9[_0xc6680f(0x15e)]('.')['at'](-0x1)||_0x3ad1e9:_0xf20fd||_0x3ad1e9[_0xc6680f(0x15e)]('.')['at'](-0x1)||_0x3ad1e9;_0x187673[_0xc6680f(0x17d)]({'table':_0x3ad1e9,'alias':_0x364483,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0xc6680f(0x157),'position':_0x4ddd3d});}const _0x417801=_0x44a17a[_0xc6680f(0x16a)](MYBATIS_INCLUDE_MARKER);return _0x417801>=0x0&&!_0x187673[_0xc6680f(0x147)](_0x1de1a8=>_0x1de1a8[_0xc6680f(0x166)])&&_0x187673[_0xc6680f(0x17d)]({'table':_0xc6680f(0x15d),'alias':_0xc6680f(0x15d),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','containsUnresolvedInclude':!![],'position':_0x417801}),_0x187673[_0xc6680f(0x13c)]((_0x375a0d,_0x165196)=>_0x375a0d[_0xc6680f(0x17f)]-_0x165196[_0xc6680f(0x17f)]);}function a233_0x16f7(_0x3a60a2,_0x34eead){_0x3a60a2=_0x3a60a2-0x13c;const _0x4b9319=a233_0x4b93();let _0x16f7c0=_0x4b9319[_0x3a60a2];return _0x16f7c0;}function stripSqlNoise(_0x452e6a){const _0x13618e=a233_0x16f7,_0x30d856=Array[_0x13618e(0x13f)](_0x452e6a),_0x297ad5=(_0x1dcb78,_0x5cb4dc)=>{for(let _0x18cc8a=_0x1dcb78;_0x18cc8a<_0x5cb4dc;_0x18cc8a+=0x1){_0x30d856[_0x18cc8a]!=='\x0a'&&_0x30d856[_0x18cc8a]!=='\x0d'&&(_0x30d856[_0x18cc8a]='\x20');}};for(let _0x3966b8=0x0;_0x3966b8<_0x30d856[_0x13618e(0x16f)];_0x3966b8+=0x1){const _0x3c0754=_0x30d856[_0x3966b8],_0x4554de=_0x30d856[_0x3966b8+0x1];if(_0x3c0754==='\x27'||_0x3c0754==='\x22'||_0x3c0754==='`'){const _0x51068f=_0x3c0754,_0x3666bd=_0x3966b8;_0x3966b8+=0x1;while(_0x3966b8<_0x30d856['length']){if(_0x30d856[_0x3966b8]==='\x5c'&&_0x3966b8+0x1<_0x30d856[_0x13618e(0x16f)]){_0x3966b8+=0x2;continue;}if(_0x30d856[_0x3966b8]!==_0x51068f){_0x3966b8+=0x1;continue;}if(_0x30d856[_0x3966b8+0x1]===_0x51068f){_0x3966b8+=0x2;continue;}break;}if(_0x51068f==='\x27')_0x297ad5(_0x3666bd,Math[_0x13618e(0x183)](_0x3966b8+0x1,_0x30d856['length']));continue;}if(_0x3c0754==='-'&&_0x4554de==='-'){const _0x31c0a6=_0x3966b8;while(_0x3966b8<_0x30d856['length']&&_0x30d856[_0x3966b8]!=='\x0a')_0x3966b8+=0x1;_0x297ad5(_0x31c0a6,_0x3966b8);continue;}if(_0x3c0754==='/'&&_0x4554de==='*'){const _0x38b4ff=_0x3966b8;_0x3966b8+=0x2;while(_0x3966b8<_0x30d856['length']&&!(_0x30d856[_0x3966b8]==='*'&&_0x30d856[_0x3966b8+0x1]==='/')){_0x3966b8+=0x1;}_0x3966b8=Math['min'](_0x3966b8+0x1,_0x30d856['length']-0x1),_0x297ad5(_0x38b4ff,_0x3966b8+0x1);continue;}if(_0x3c0754==='#'&&_0x4554de!=='{'){const _0x3059ff=_0x3966b8;while(_0x3966b8<_0x30d856[_0x13618e(0x16f)]&&_0x30d856[_0x3966b8]!=='\x0a')_0x3966b8+=0x1;_0x297ad5(_0x3059ff,_0x3966b8);continue;}if((_0x3c0754==='#'||_0x3c0754==='$')&&_0x4554de==='{'){const _0x5587a0=_0x3966b8;_0x3966b8+=0x2;while(_0x3966b8<_0x30d856[_0x13618e(0x16f)]&&_0x30d856[_0x3966b8]!=='}')_0x3966b8+=0x1;_0x297ad5(_0x5587a0,Math[_0x13618e(0x183)](_0x3966b8+0x1,_0x30d856[_0x13618e(0x16f)]));}}return _0x30d856[_0x13618e(0x150)]('');}function maskQuotedIdentifiers(_0x457096){const _0x31618e=a233_0x16f7,_0x1bdb02=Array[_0x31618e(0x13f)](_0x457096);for(let _0x2cc6aa=0x0;_0x2cc6aa<_0x1bdb02[_0x31618e(0x16f)];_0x2cc6aa+=0x1){const _0x6eff26=_0x1bdb02[_0x2cc6aa];if(_0x6eff26!=='\x22'&&_0x6eff26!=='`')continue;_0x2cc6aa+=0x1;while(_0x2cc6aa<_0x1bdb02['length']){if(_0x1bdb02[_0x2cc6aa]===_0x6eff26){if(_0x1bdb02[_0x2cc6aa+0x1]===_0x6eff26){_0x1bdb02[_0x2cc6aa]='\x20',_0x1bdb02[_0x2cc6aa+0x1]='\x20',_0x2cc6aa+=0x2;continue;}break;}_0x1bdb02[_0x2cc6aa]='\x20',_0x2cc6aa+=0x1;}}return _0x1bdb02[_0x31618e(0x150)]('');}function maskNestedQueries(_0xf4f564){const _0x41202d=a233_0x16f7,_0x47ddd5=Array[_0x41202d(0x13f)](_0xf4f564);for(let _0x20de3d=0x0;_0x20de3d<_0x47ddd5[_0x41202d(0x16f)];_0x20de3d+=0x1){if(_0x47ddd5[_0x20de3d]!=='(')continue;const _0x5b1697=_0xf4f564[_0x41202d(0x179)](_0x20de3d+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x41202d(0x15f)](_0x5b1697))continue;let _0xb2a20a=0x1,_0x254bea=_0x20de3d+0x1;for(;_0x254bea<_0x47ddd5['length']&&_0xb2a20a>0x0;_0x254bea+=0x1){if(_0x47ddd5[_0x254bea]==='(')_0xb2a20a+=0x1;if(_0x47ddd5[_0x254bea]===')')_0xb2a20a-=0x1;}if(_0xb2a20a!==0x0)continue;for(let _0x3927c8=_0x20de3d;_0x3927c8<_0x254bea;_0x3927c8+=0x1){_0x47ddd5[_0x3927c8]='\x20';}const _0x4b6b9f=_0x41202d(0x142);for(let _0x3b4710=0x0;_0x3b4710<_0x4b6b9f[_0x41202d(0x16f)]&&_0x20de3d+_0x3b4710<_0x254bea;_0x3b4710+=0x1){_0x47ddd5[_0x20de3d+_0x3b4710]=_0x4b6b9f[_0x3b4710];}_0x20de3d=_0x254bea-0x1;}return _0x47ddd5[_0x41202d(0x150)]('');}function splitTopLevelAnd(_0x32dc19){const _0x321c9b=a233_0x16f7,_0x547c68=[];let _0x4239ef=0x0,_0x5caec9=0x0;for(let _0x50e0c9=0x0;_0x50e0c9<_0x32dc19[_0x321c9b(0x16f)];_0x50e0c9+=0x1){const _0x19123a=_0x32dc19[_0x50e0c9];if(_0x19123a==='(')_0x4239ef+=0x1;if(_0x19123a===')')_0x4239ef=Math[_0x321c9b(0x13e)](0x0,_0x4239ef-0x1);_0x4239ef===0x0&&_0x32dc19['slice'](_0x50e0c9)['match'](/^AND\b/i)&&(_0x50e0c9===0x0||/\s/[_0x321c9b(0x15f)](_0x32dc19[_0x50e0c9-0x1]??''))&&(_0x547c68[_0x321c9b(0x17d)](_0x32dc19[_0x321c9b(0x179)](_0x5caec9,_0x50e0c9)['trim']()),_0x50e0c9+=0x2,_0x5caec9=_0x50e0c9+0x1);}const _0x5784a4=_0x32dc19['slice'](_0x5caec9)[_0x321c9b(0x171)]();if(_0x5784a4)_0x547c68['push'](_0x5784a4);return _0x547c68;}function hasTopLevelKeyword(_0x5c5fe9,_0x597ec4){const _0x1ad67c=a233_0x16f7;let _0xf744cf=0x0;for(let _0x5d3301=0x0;_0x5d3301<_0x5c5fe9[_0x1ad67c(0x16f)];_0x5d3301+=0x1){const _0x412f99=_0x5c5fe9[_0x5d3301];if(_0x412f99==='(')_0xf744cf+=0x1;if(_0x412f99===')')_0xf744cf=Math[_0x1ad67c(0x13e)](0x0,_0xf744cf-0x1);if(_0xf744cf!==0x0)continue;const _0x5161bf=_0x5c5fe9[_0x1ad67c(0x179)](_0x5d3301,_0x5d3301+_0x597ec4[_0x1ad67c(0x16f)]),_0x44b73b=_0x5c5fe9[_0x5d3301-0x1]??'\x20',_0x556f5f=_0x5c5fe9[_0x5d3301+_0x597ec4[_0x1ad67c(0x16f)]]??'\x20';if(_0x5161bf[_0x1ad67c(0x169)]()===_0x597ec4[_0x1ad67c(0x169)]()&&!/[\w$]/[_0x1ad67c(0x15f)](_0x44b73b)&&!/[\w$]/[_0x1ad67c(0x15f)](_0x556f5f))return!![];}return![];}function splitEquality(_0x77a357){const _0x2184a3=a233_0x16f7,_0x193e41=stripOuterParentheses(_0x77a357);let _0x522643=0x0,_0x1a1505;for(let _0x10a9f4=0x0;_0x10a9f4<_0x193e41[_0x2184a3(0x16f)];_0x10a9f4+=0x1){const _0x3ad622=_0x193e41[_0x10a9f4];if(_0x3ad622==='(')_0x522643+=0x1;if(_0x3ad622===')')_0x522643=Math[_0x2184a3(0x13e)](0x0,_0x522643-0x1);const _0x32005=_0x193e41[_0x10a9f4-0x1]??'',_0x183573=_0x193e41[_0x10a9f4+0x1]??'';if(_0x3ad622==='='&&_0x522643===0x0&&!/[!<>=:]/['test'](_0x32005)&&_0x183573!=='='){if(_0x1a1505!==undefined)return null;_0x1a1505=_0x10a9f4;}}return _0x1a1505===undefined?null:[_0x193e41['slice'](0x0,_0x1a1505)[_0x2184a3(0x171)](),_0x193e41[_0x2184a3(0x179)](_0x1a1505+0x1)[_0x2184a3(0x171)]()];}function parseDirectColumnReference(_0x237b1a,_0x2fb02c){const _0xa19ffc=a233_0x16f7,_0x138a99=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0xa19ffc(0x14a)](stripOuterParentheses(_0x237b1a));if(!_0x138a99)return null;if(normalizeIdentifier(_0x138a99[0x1]??'')!==normalizeIdentifier(_0x2fb02c))return null;return normalizeIdentifier(_0x138a99[0x2]??'');}function containsColumnReference(_0x3fcfae,_0x273bcc){const _0x345bc8=a233_0x16f7,_0x3fefea=_0x3fcfae[_0x345bc8(0x146)](/[`"]/g,''),_0x1b3ea6=_0x273bcc[_0x345bc8(0x146)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x345bc8(0x159)+_0x1b3ea6+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x345bc8(0x15f)](_0x3fefea);}function findEqualityPrefix(_0x46923b,_0x5a77b3){const _0x3834f3=a233_0x16f7,_0x288023=new Set(_0x5a77b3[_0x3834f3(0x144)](normalizeIdentifier)),_0x5486f8=[];for(const _0x2b35e8 of _0x46923b){if(!_0x288023[_0x3834f3(0x167)](normalizeIdentifier(_0x2b35e8)))break;_0x5486f8[_0x3834f3(0x17d)](_0x2b35e8);}return _0x5486f8;}function resolveTableMetadata(_0x4592c0,_0x3b9255){const _0x920cbf=a233_0x16f7,_0x298d82=normalizeIdentifier(_0x3b9255),_0x2dcdf0=_0x4592c0[_0x920cbf(0x149)](_0x152556=>normalizeIdentifier(_0x152556[_0x920cbf(0x155)])===_0x298d82);if(_0x2dcdf0[_0x920cbf(0x16f)]===0x1)return _0x2dcdf0[0x0];const _0x61f7eb=_0x298d82[_0x920cbf(0x181)]('.'),_0x5af834=_0x298d82['split']('.')['at'](-0x1),_0x57c763=_0x4592c0[_0x920cbf(0x149)](_0x5b6d18=>{const _0x82d337=_0x920cbf,_0x7fcc5d=normalizeIdentifier(_0x5b6d18[_0x82d337(0x155)]);if(_0x61f7eb&&_0x7fcc5d[_0x82d337(0x181)]('.'))return![];return _0x7fcc5d[_0x82d337(0x15e)]('.')['at'](-0x1)===_0x5af834;});return _0x57c763[_0x920cbf(0x16f)]===0x1?_0x57c763[0x0]:undefined;}function columnNamesMatch(_0x476a0d,_0x44ad28){return normalizeIdentifier(_0x476a0d)===normalizeIdentifier(_0x44ad28);}function normalizeIdentifier(_0x19cd25){const _0x991270=a233_0x16f7;return _0x19cd25[_0x991270(0x146)](/[`"]/g,'')[_0x991270(0x171)]()[_0x991270(0x152)]();}function isSqlClauseKeyword(_0x260cfa){const _0x1631f4=a233_0x16f7;return new Set(['on',_0x1631f4(0x170),_0x1631f4(0x156),_0x1631f4(0x150),_0x1631f4(0x176),'left',_0x1631f4(0x175),'full','cross',_0x1631f4(0x15c)])[_0x1631f4(0x167)](_0x260cfa);}function a233_0x4b93(){const _0x57465d=['3UlCSXS','warning','INDEX_METADATA_UNAVAILABLE','length','using','trim','columns','covered','JOIN_PREDICATE_UNSUPPORTED','right','inner','234iofItX','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','slice','JOIN_INDEX_NOT_USABLE','509503jEYIDq','search','push','639880nSEIOW','position','2974825spbXwC','includes','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','min','619452DUJrfM','sort','80980UFGRfS','max','from','JOIN_INDEX_MISSING','98770fCfXGr','__sq__','matchAll','map','indexes','replace','some','2518944MChhGM','filter','exec','metadataAvailable','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','unavailable','sql','15bjGOrJ','join','replaceAll','toLowerCase','startsWith','index','tableName','where','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','(?:^|[^\x5cw$])','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','endsWith','natural','unknown','split','test','table','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','unsupportedReason','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','alias','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','containsUnresolvedInclude','has','error','toUpperCase','indexOf','full'];a233_0x4b93=function(){return _0x57465d;};return a233_0x4b93();}function stripOuterParentheses(_0x1f3ffd){const _0x167c57=a233_0x16f7;let _0x26b6f2=_0x1f3ffd[_0x167c57(0x171)]();while(_0x26b6f2[_0x167c57(0x153)]('(')&&_0x26b6f2[_0x167c57(0x15b)](')')){let _0x534f09=0x0,_0x16d6d7=!![];for(let _0x154b4f=0x0;_0x154b4f<_0x26b6f2[_0x167c57(0x16f)];_0x154b4f+=0x1){if(_0x26b6f2[_0x154b4f]==='(')_0x534f09+=0x1;if(_0x26b6f2[_0x154b4f]===')')_0x534f09-=0x1;if(_0x534f09===0x0&&_0x154b4f<_0x26b6f2[_0x167c57(0x16f)]-0x1){_0x16d6d7=![];break;}}if(!_0x16d6d7||_0x534f09!==0x0)break;_0x26b6f2=_0x26b6f2[_0x167c57(0x179)](0x1,-0x1)[_0x167c57(0x171)]();}return _0x26b6f2;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a234_0x2d2d16=a234_0x32ae;(function(_0x18181b,_0x2d2079){const _0x2285f1=a234_0x32ae,_0x1f53bb=_0x18181b();while(!![]){try{const _0x20b497=-parseInt(_0x2285f1(0x1f6))/0x1+parseInt(_0x2285f1(0x1f5))/0x2+parseInt(_0x2285f1(0x1f4))/0x3+-parseInt(_0x2285f1(0x1fb))/0x4*(-parseInt(_0x2285f1(0x200))/0x5)+-parseInt(_0x2285f1(0x1fa))/0x6*(-parseInt(_0x2285f1(0x1ff))/0x7)+-parseInt(_0x2285f1(0x1fe))/0x8*(parseInt(_0x2285f1(0x1fc))/0x9)+parseInt(_0x2285f1(0x1f9))/0xa;if(_0x20b497===_0x2d2079)break;else _0x1f53bb['push'](_0x1f53bb['shift']());}catch(_0x1f9d77){_0x1f53bb['push'](_0x1f53bb['shift']());}}}(a234_0x2660,0x1a578));import{resolve}from'node:path';function a234_0x32ae(_0x3d8edd,_0x433948){_0x3d8edd=_0x3d8edd-0x1f4;const _0x2660c5=a234_0x2660();let _0x32aede=_0x2660c5[_0x3d8edd];return _0x32aede;}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a234_0x2d2d16(0x1f8),TRASH_DIR_NAME=a234_0x2d2d16(0x201);export function loadSqlProjectConfig(_0x7d4ca4,_0xf2c561){const _0x2e5396=a234_0x2d2d16,_0x6df2ca=resolve(_0xf2c561??findProjectRootDirectory()),_0x34177a=DOT_DIR+_0x2e5396(0x1fd),_0x3dacec=_0x34177a+'/'+_0x7d4ca4;return{'projectRoot':_0x6df2ca,'appCode':_0x7d4ca4,'sqlWorkspaceRoot':_0x34177a,'sqlRoot':_0x3dacec,'sqlRootDir':resolve(_0x6df2ca,DOT_DIR,_0x2e5396(0x1f7),_0x7d4ca4),'lockFilePath':resolve(_0x6df2ca,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x6df2ca,DOT_DIR,TRASH_DIR_NAME)};}function a234_0x2660(){const _0x7dcaf2=['26716ckbvJS','9JNmmow','/sql','506008qlNZWT','63hzgMBC','50JHyuBh','sql-trash','32220QiEspw','145988YVfaMC','206148XGXQDW','sql','sql.lock.json','518740sMVIbe','116598oLWoUe'];a234_0x2660=function(){return _0x7dcaf2;};return a234_0x2660();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x16d1dc,_0x13f5f9){const _0x756fe2=a235_0x37f5,_0x1d440a=_0x16d1dc();while(!![]){try{const _0x27ac75=parseInt(_0x756fe2(0x1bf))/0x1+parseInt(_0x756fe2(0x1a8))/0x2*(-parseInt(_0x756fe2(0x1b1))/0x3)+parseInt(_0x756fe2(0x1ad))/0x4*(parseInt(_0x756fe2(0x1b0))/0x5)+-parseInt(_0x756fe2(0x1be))/0x6*(parseInt(_0x756fe2(0x1a9))/0x7)+parseInt(_0x756fe2(0x1aa))/0x8+parseInt(_0x756fe2(0x1b4))/0x9*(-parseInt(_0x756fe2(0x1ab))/0xa)+-parseInt(_0x756fe2(0x1ac))/0xb;if(_0x27ac75===_0x13f5f9)break;else _0x1d440a['push'](_0x1d440a['shift']());}catch(_0x58ce12){_0x1d440a['push'](_0x1d440a['shift']());}}}(a235_0x14a0,0x947f7));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function a235_0x14a0(){const _0x3790e8=['9BvJgsg','ENOENT','path','toLowerCase','slice','sqlName','mybatisXml','length','sqlCode','.sql','228ybGPZK','694572CFNBcj','name','filter','dbId','split','.xml','isDirectory','indexOf','dbName','sqlRootDir','mode','2798iRHFPE','62384SUAOeH','8390648EoAwXq','6768830XtGDVB','10740719Hkoddy','4137940XtIEpB','replace','sql','5btUAFt','381weAZtP','test','code'];a235_0x14a0=function(){return _0x3790e8;};return a235_0x14a0();}function extensionToMode(_0x43ae80){const _0x1e9031=a235_0x37f5;if(_0x43ae80===_0x1e9031(0x1bd))return'sql';if(_0x43ae80===_0x1e9031(0x1c4))return _0x1e9031(0x1ba);return undefined;}async function scanSqlFilesRecursively(_0x544f20,_0x32c42f){const _0x5c1e8c=a235_0x37f5,_0x7d9f47=[];try{const _0x349f12=await readdir(_0x544f20,{'withFileTypes':!![]});for(const _0x3afc87 of _0x349f12){const _0x47a5eb=join(_0x544f20,_0x3afc87[_0x5c1e8c(0x1c0)]);if(_0x3afc87[_0x5c1e8c(0x1c5)]()){_0x7d9f47['push'](...await scanSqlFilesRecursively(_0x47a5eb,_0x32c42f));continue;}if(!_0x3afc87['isFile']())continue;const _0x22fafb=extname(_0x3afc87[_0x5c1e8c(0x1c0)])[_0x5c1e8c(0x1b7)](),_0x305995=extensionToMode(_0x22fafb);if(!_0x305995)continue;const _0x284b6b=relative(_0x32c42f,_0x47a5eb)[_0x5c1e8c(0x1ae)](/\\/g,'/'),_0x5673d2=_0x284b6b[_0x5c1e8c(0x1c3)]('/')[_0x5c1e8c(0x1c1)](Boolean),_0x3df565=parseSqlPath(_0x5673d2,_0x3afc87[_0x5c1e8c(0x1c0)],_0x22fafb);if(!_0x3df565)continue;_0x7d9f47['push']({'sqlCode':_0x3df565[_0x5c1e8c(0x1bc)],'sqlName':_0x3df565[_0x5c1e8c(0x1b9)],'dbDirectory':_0x5673d2[0x0],'filePath':_0x47a5eb,'relativePath':_0x284b6b,'lockKey':_0x3df565[_0x5c1e8c(0x1bc)],'mode':_0x305995});}}catch(_0x2d4711){if(_0x2d4711[_0x5c1e8c(0x1b3)]!==_0x5c1e8c(0x1b5))throw _0x2d4711;}return _0x7d9f47;}export async function scanLocalSqlQueries(_0xd43231){const _0x396b50=a235_0x37f5;return scanSqlFilesRecursively(_0xd43231[_0x396b50(0x1a6)],_0xd43231['sqlRootDir']);}export function resolveLocalSqlFilePath(_0xbd8e69,_0x2270e3,_0x25d954){const _0x17f132=a235_0x37f5,_0x58498d=_0x25d954?.[_0x17f132(0x1b6)]||(_0x25d954?.[_0x17f132(0x1b9)]||_0x25d954?.['dbName']?buildSqlRelativePath(_0x2270e3,_0x25d954?.[_0x17f132(0x1b9)],_0x25d954?.[_0x17f132(0x1c7)],_0x25d954?.[_0x17f132(0x1a7)]||_0x17f132(0x1af),_0x25d954?.[_0x17f132(0x1c2)]):buildDefaultSqlFileName(_0x2270e3,_0x25d954?.[_0x17f132(0x1a7)]||_0x17f132(0x1af)));return join(_0xbd8e69[_0x17f132(0x1a6)],_0x58498d);}export async function directoryExists(_0x44474a){const _0x43a557=a235_0x37f5;try{const _0x422940=await stat(_0x44474a);return _0x422940[_0x43a557(0x1c5)]();}catch{return![];}}function a235_0x37f5(_0x33615d,_0x5bd907){_0x33615d=_0x33615d-0x1a6;const _0x14a0ac=a235_0x14a0();let _0x37f57f=_0x14a0ac[_0x33615d];return _0x37f57f;}function parseSqlPath(_0x5ec394,_0xf7652c,_0x2e38ac){const _0x425147=a235_0x37f5,_0x267a83=_0xf7652c[_0x425147(0x1b8)](0x0,-_0x2e38ac[_0x425147(0x1bb)]);if(_0x5ec394[_0x425147(0x1bb)]<0x2)return null;const _0xad9ce=_0x267a83[_0x425147(0x1c6)]('_');if(_0xad9ce<=0x0||_0xad9ce>=_0x267a83[_0x425147(0x1bb)]-0x1)return null;const _0x4dff9e=_0x267a83['slice'](0x0,_0xad9ce);if(!isLikelySqlCode(_0x4dff9e))return null;return{'sqlCode':_0x4dff9e,'sqlName':_0x267a83[_0x425147(0x1b8)](_0xad9ce+0x1)};}function isLikelySqlCode(_0x2164d5){const _0x1fa4ea=a235_0x37f5;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x1fa4ea(0x1b2)](_0x2164d5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b6bc9,_0xa40eb4){const _0x3c7d23=a236_0x30bf,_0x176916=_0x1b6bc9();while(!![]){try{const _0x545a45=parseInt(_0x3c7d23(0x1a4))/0x1*(parseInt(_0x3c7d23(0x19e))/0x2)+-parseInt(_0x3c7d23(0x1a2))/0x3*(parseInt(_0x3c7d23(0x19c))/0x4)+parseInt(_0x3c7d23(0x1a3))/0x5+-parseInt(_0x3c7d23(0x19b))/0x6+-parseInt(_0x3c7d23(0x1a1))/0x7+parseInt(_0x3c7d23(0x1a5))/0x8*(-parseInt(_0x3c7d23(0x1a0))/0x9)+-parseInt(_0x3c7d23(0x19d))/0xa*(-parseInt(_0x3c7d23(0x1a7))/0xb);if(_0x545a45===_0xa40eb4)break;else _0x176916['push'](_0x176916['shift']());}catch(_0x11fa1){_0x176916['push'](_0x176916['shift']());}}}(a236_0x965c,0x563d9));import{readFile}from'node:fs/promises';import a236_0x70f7c0 from'node:crypto';function a236_0x965c(){const _0x38fcc6=['1070lmCZyD','2ozEdnH','hex','4863087rjJhyC','2077999wWgOKZ','86613pAFHfo','2721360OuQJvN','324167XFHbkG','8FVRccb','update','104159BvaVPt','md5','3973860Foxzrx','4DreviH'];a236_0x965c=function(){return _0x38fcc6;};return a236_0x965c();}function a236_0x30bf(_0x1d25ac,_0x48b710){_0x1d25ac=_0x1d25ac-0x19a;const _0x965cf=a236_0x965c();let _0x30bfa0=_0x965cf[_0x1d25ac];return _0x30bfa0;}export function computeSqlContentHash(_0x381ba0){const _0x42d625=a236_0x30bf;return a236_0x70f7c0['createHash'](_0x42d625(0x19a))[_0x42d625(0x1a6)](_0x381ba0)['digest'](_0x42d625(0x19f));}export async function computeSqlFileHash(_0x3bd06f){const _0x4cd369=await readFile(_0x3bd06f,'utf8');return computeSqlContentHash(_0x4cd369);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x441d69,_0x4e608a){const _0xa86995=a237_0x3f8b,_0x264f18=_0x441d69();while(!![]){try{const _0x172307=parseInt(_0xa86995(0x168))/0x1*(-parseInt(_0xa86995(0x173))/0x2)+parseInt(_0xa86995(0x16c))/0x3+-parseInt(_0xa86995(0x175))/0x4*(-parseInt(_0xa86995(0x171))/0x5)+-parseInt(_0xa86995(0x16f))/0x6*(-parseInt(_0xa86995(0x166))/0x7)+-parseInt(_0xa86995(0x161))/0x8*(-parseInt(_0xa86995(0x172))/0x9)+-parseInt(_0xa86995(0x16a))/0xa+-parseInt(_0xa86995(0x170))/0xb;if(_0x172307===_0x4e608a)break;else _0x264f18['push'](_0x264f18['shift']());}catch(_0xa4addd){_0x264f18['push'](_0x264f18['shift']());}}}(a237_0x19e8,0x196b2));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a237_0x3f8b(_0x5ea71f,_0x369355){_0x5ea71f=_0x5ea71f-0x160;const _0x19e8ef=a237_0x19e8();let _0x3f8bb7=_0x19e8ef[_0x5ea71f];return _0x3f8bb7;}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x595f86,_0x359e02,_0x1bbe8f,_0x146314){const _0xaa253e=a237_0x3f8b,_0x500e83=_0x595f86??createEmptySqlLock();let _0x1f2423=_0x500e83[_0xaa253e(0x167)][_0x359e02];if(!_0x1f2423)return _0x1f2423={'sqlRoot':_0x1bbe8f,'lastSync':'','sqls':{}},_0x500e83['apps'][_0x359e02]=_0x1f2423,{'lockData':_0x500e83,'appLock':_0x1f2423};if(!_0x1f2423['sqlRoot'])_0x1f2423[_0xaa253e(0x162)]=_0x1bbe8f;else{if(_0x1f2423[_0xaa253e(0x162)]!==_0x1bbe8f)throw new Error(_0x146314+_0xaa253e(0x16d)+_0x1bbe8f+_0xaa253e(0x16e)+_0x1f2423['sqlRoot']+'\x22.\x20'+_0xaa253e(0x16b));}return!_0x1f2423['sqls']&&(_0x1f2423[_0xaa253e(0x165)]={}),!_0x1f2423[_0xaa253e(0x164)]&&(_0x1f2423[_0xaa253e(0x164)]=''),{'lockData':_0x500e83,'appLock':_0x1f2423};}export async function readSqlLockFile(_0x120a36){const _0xa91680=a237_0x3f8b;try{const _0xff83e9=await readFile(_0x120a36,_0xa91680(0x163));return JSON[_0xa91680(0x174)](_0xff83e9);}catch(_0x11a068){if(_0x11a068[_0xa91680(0x160)]==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x11a068));}}export async function writeSqlLockFile(_0x398f5b,_0x1c61cb){const _0x126065=a237_0x3f8b;await mkdir(dirname(_0x398f5b),{'recursive':!![]}),await writeFile(_0x398f5b,JSON[_0x126065(0x169)](_0x1c61cb,null,0x2),'utf8');}function a237_0x19e8(){const _0x2dd171=['apps','1xsbsnc','stringify','1788730WczBql','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','487563YbpDHp',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','\x22\x20vs\x20lock\x20\x22','945006hBsBxE','1118502ycdRgg','224530ZYXemT','18162ikEzQR','65454Pasbuf','parse','4BfOyqj','code','208oCDRzP','sqlRoot','utf8','lastSync','sqls','7UrKMVA'];a237_0x19e8=function(){return _0x2dd171;};return a237_0x19e8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a239_0x5c55(_0x58d24b,_0x1b1966){_0x58d24b=_0x58d24b-0xb8;const _0xd11bb0=a239_0xd11b();let _0x5c55ed=_0xd11bb0[_0x58d24b];return _0x5c55ed;}(function(_0x2a4e01,_0x1b8761){const _0x172821=a239_0x5c55,_0x1322a5=_0x2a4e01();while(!![]){try{const _0x450b74=-parseInt(_0x172821(0xb9))/0x1*(parseInt(_0x172821(0xc1))/0x2)+parseInt(_0x172821(0xbe))/0x3+-parseInt(_0x172821(0xbf))/0x4*(-parseInt(_0x172821(0xbb))/0x5)+parseInt(_0x172821(0xc7))/0x6+parseInt(_0x172821(0xc3))/0x7+-parseInt(_0x172821(0xb8))/0x8+-parseInt(_0x172821(0xc0))/0x9;if(_0x450b74===_0x1b8761)break;else _0x1322a5['push'](_0x1322a5['shift']());}catch(_0x1ad447){_0x1322a5['push'](_0x1322a5['shift']());}}}(a239_0xd11b,0xd6fb2));export function detectSqlMode(_0x5b85de){const _0x2ea857=a239_0x5c55,_0xd075af=_0x5b85de[_0x2ea857(0xc2)]();if(/^<(select|insert|update|delete)\b/i[_0x2ea857(0xc6)](_0xd075af))return _0x2ea857(0xbc);return _0x2ea857(0xba);}export function getSqlFileExtension(_0x2cffa8){const _0xe204ec=a239_0x5c55;return _0x2cffa8===_0xe204ec(0xbc)?_0xe204ec(0xc5):'.sql';}export function buildDefaultSqlFileName(_0x3ab03c,_0x397ab3){return''+_0x3ab03c+getSqlFileExtension(_0x397ab3);}export function sanitizeSqlPathSegment(_0x22a388,_0x137936){const _0x1a5ff0=a239_0x5c55,_0x6683a8=String(_0x22a388??'')[_0x1a5ff0(0xc4)](),_0xf198b1=_0x6683a8[_0x1a5ff0(0xc9)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')['replace'](/\s+/g,'-')[_0x1a5ff0(0xc9)](/-+/g,'-')[_0x1a5ff0(0xc9)](/^\.+/,'')[_0x1a5ff0(0xc9)](/\.+$/,'')['replace'](/^-+/,'')[_0x1a5ff0(0xc9)](/-+$/,'');return _0xf198b1||_0x137936;}export function buildDbDirectoryName(_0x262078,_0x288926){const _0x4c1a7c=a239_0x5c55;return sanitizeSqlPathSegment(_0x262078,_0x288926!=null?_0x4c1a7c(0xbd)+_0x288926:'unknown-db');}export function buildSqlRelativePath(_0x48c5df,_0x519bdc,_0x3a59f9,_0x4ad357,_0x27132f){const _0x37a152=a239_0x5c55,_0x5f5034=buildDbDirectoryName(_0x3a59f9,_0x27132f),_0xdec514=sanitizeSqlPathSegment(_0x48c5df,_0x37a152(0xc8)),_0x211f51=sanitizeSqlPathSegment(_0x519bdc,_0xdec514);return _0x5f5034+'/'+_0xdec514+'_'+_0x211f51+getSqlFileExtension(_0x4ad357);}function a239_0xd11b(){const _0x5c43d2=['385057JGPkts','sql','5PcKkmt','mybatisXml','db-','3903813hVeBvF','5730972lRgaXW','23000220wrmbgb','2mkaxMo','trimStart','6669439zTVWdB','trim','.xml','test','5398260qkzFKe','unknown-sql','replace','6122416HDhGLl'];a239_0xd11b=function(){return _0x5c43d2;};return a239_0xd11b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a240_0x1111c7=a240_0x3094;(function(_0x6fef45,_0x18b9d2){const _0x5a3358=a240_0x3094,_0x18afa1=_0x6fef45();while(!![]){try{const _0x4dc721=-parseInt(_0x5a3358(0x1ff))/0x1+-parseInt(_0x5a3358(0x206))/0x2*(parseInt(_0x5a3358(0x1f9))/0x3)+-parseInt(_0x5a3358(0x1ec))/0x4+parseInt(_0x5a3358(0x1f5))/0x5*(parseInt(_0x5a3358(0x222))/0x6)+parseInt(_0x5a3358(0x1e9))/0x7*(parseInt(_0x5a3358(0x204))/0x8)+parseInt(_0x5a3358(0x1f4))/0x9*(parseInt(_0x5a3358(0x1da))/0xa)+-parseInt(_0x5a3358(0x1e5))/0xb*(-parseInt(_0x5a3358(0x1dc))/0xc);if(_0x4dc721===_0x18b9d2)break;else _0x18afa1['push'](_0x18afa1['shift']());}catch(_0x1782b6){_0x18afa1['push'](_0x18afa1['shift']());}}}(a240_0x5ab5,0x1f5ed));const MYBATIS_OUTER_TAGS=new Map([[a240_0x1111c7(0x207),'SELECT'],[a240_0x1111c7(0x1e4),a240_0x1111c7(0x215)],[a240_0x1111c7(0x1ed),a240_0x1111c7(0x1fe)],[a240_0x1111c7(0x1f3),'DELETE']]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a240_0x1111c7(0x1d9),a240_0x1111c7(0x1fb),a240_0x1111c7(0x216),'when',a240_0x1111c7(0x1f1),a240_0x1111c7(0x212),a240_0x1111c7(0x200),a240_0x1111c7(0x1d8),'include','property']),MYBATIS_BRANCH_TAGS=new Set(['if',a240_0x1111c7(0x1fb),a240_0x1111c7(0x216),a240_0x1111c7(0x1f7),a240_0x1111c7(0x1f1)]);export const MYBATIS_DYNAMIC_START_MARKER='__RABETBASE_MYBATIS_DYNAMIC_START__';export const MYBATIS_DYNAMIC_END_MARKER=a240_0x1111c7(0x201);export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT=a240_0x1111c7(0x205),MYBATIS_OUTER_TAG_PATTERN=new RegExp('^<\x5cs*(?:'+[...MYBATIS_OUTER_TAGS['keys']()][a240_0x1111c7(0x1d3)]('|')+')\x5cb','i');function a240_0x3094(_0x1d8219,_0x534611){_0x1d8219=_0x1d8219-0x1c4;const _0x5ab55e=a240_0x5ab5();let _0x3094a6=_0x5ab55e[_0x1d8219];return _0x3094a6;}export function normalizeSqlForStaticAnalysis(_0x137c1a){const _0x173086=a240_0x1111c7,_0x2aa288=typeof _0x137c1a===_0x173086(0x1e7)?_0x137c1a:'';if(!startsWithMybatisStatementWrapper(_0x2aa288))return{'sql':_0x2aa288,'mode':_0x173086(0x1de)};let _0x88d21e=0x0,_0x731bde='',_0x81dd57,_0x9be2de=![],_0x4a7271=![];const _0x47591c=[];while(_0x88d21e<_0x2aa288['length']){if(_0x2aa288[_0x173086(0x1fc)](_0x173086(0x1d5),_0x88d21e)){const _0x3b9ff8=_0x2aa288[_0x173086(0x20f)](_0x173086(0x210),_0x88d21e+0x4);if(_0x3b9ff8<0x0)return invalidMybatisSource(_0x173086(0x203));_0x731bde+='\x20',_0x88d21e=_0x3b9ff8+0x3;continue;}if(_0x2aa288[_0x173086(0x1fc)](_0x173086(0x214),_0x88d21e)){if(!_0x9be2de||_0x4a7271)return invalidMybatisSource('CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');const _0x1daf87=_0x2aa288[_0x173086(0x20f)](']]>',_0x88d21e+0x9);if(_0x1daf87<0x0)return invalidMybatisSource(_0x173086(0x1e8));_0x731bde+=_0x2aa288['slice'](_0x88d21e+0x9,_0x1daf87),_0x88d21e=_0x1daf87+0x3;continue;}if(_0x2aa288[_0x173086(0x1fc)]('<?',_0x88d21e)){if(_0x9be2de)return invalidMybatisSource(_0x173086(0x20e));const _0xbc0e4e=_0x2aa288[_0x173086(0x20f)]('?>',_0x88d21e+0x2);if(_0xbc0e4e<0x0)return invalidMybatisSource(_0x173086(0x20d));_0x731bde+='\x20',_0x88d21e=_0xbc0e4e+0x2;continue;}if(_0x2aa288[_0x88d21e]!=='<'){const _0x14963e=_0x2aa288[_0x173086(0x20f)]('<',_0x88d21e),_0x3ed956=_0x14963e<0x0?_0x2aa288['length']:_0x14963e,_0x473a7f=_0x2aa288[_0x173086(0x1e3)](_0x88d21e,_0x3ed956);if((!_0x9be2de||_0x4a7271)&&_0x473a7f['trim']())return invalidMybatisSource(_0x173086(0x20c));if(_0x9be2de&&!_0x4a7271){const _0x5d9df9=decodeXmlEntities(_0x473a7f);if(_0x5d9df9===null)return invalidMybatisSource(_0x173086(0x21b));_0x731bde+=_0x5d9df9;}else _0x731bde+='\x20';_0x88d21e=_0x3ed956;continue;}const _0x1d3e34=findXmlTagEnd(_0x2aa288,_0x88d21e);if(_0x1d3e34<0x0)return invalidMybatisSource('Unterminated\x20MyBatis\x20XML\x20tag.');const _0x5f0db8=_0x2aa288['slice'](_0x88d21e,_0x1d3e34+0x1),_0xaf1629=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x173086(0x1dd)](_0x5f0db8);if(!_0xaf1629)return invalidMybatisSource(_0x173086(0x1cb));const _0x3fa580=_0xaf1629[0x1]==='/',_0x16a3c8=_0xaf1629[0x2]??'',_0x41c27d=_0x16a3c8[_0x173086(0x1db)](),_0x1fe2ca=_0xaf1629[0x3]??'',_0x36cc65=_0xaf1629[0x4]==='/',_0xb27d50=MYBATIS_OUTER_TAGS[_0x173086(0x1f6)](_0x41c27d);if(!_0xb27d50&&!MYBATIS_DYNAMIC_TAGS[_0x173086(0x1cd)](_0x41c27d))return invalidMybatisSource(_0x173086(0x1e6)+_0x41c27d+'>.');if(!_0xb27d50&&_0x16a3c8!==_0x41c27d)return invalidMybatisSource(_0x173086(0x217)+_0x16a3c8+'>.');if(_0x3fa580){if(_0x1fe2ca[_0x173086(0x212)]()||_0x36cc65)return invalidMybatisSource(_0x173086(0x209)+_0x16a3c8+'>.');const _0x1ac4a2=_0x47591c['at'](-0x1);if(!_0x1ac4a2||(_0x1ac4a2[_0x173086(0x21f)]?_0x1ac4a2[_0x173086(0x1ce)]!==_0x41c27d:_0x1ac4a2[_0x173086(0x21a)]!==_0x16a3c8))return invalidMybatisSource(_0x173086(0x224)+_0x16a3c8+'>.');_0x47591c[_0x173086(0x1e2)]();if(_0x1ac4a2[_0x173086(0x21f)])_0x4a7271=!![];_0x731bde+=MYBATIS_BRANCH_TAGS[_0x173086(0x1cd)](_0x41c27d)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x1fe2ca))return invalidMybatisSource(_0x173086(0x1c7)+_0x16a3c8+'>.');if(_0x41c27d===_0x173086(0x1d6)&&(!_0x36cc65||_0x47591c['at'](-0x1)?.[_0x173086(0x1ce)]!=='include'))return invalidMybatisSource('MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.');if(_0xb27d50){if(_0x9be2de||_0x47591c[_0x173086(0x20b)]>0x0)return invalidMybatisSource(_0x173086(0x1d0));_0x9be2de=!![],_0x4a7271=_0x36cc65,_0x81dd57=_0xb27d50;}else{if(!_0x9be2de||_0x4a7271)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<'+_0x16a3c8+'>.');}_0x731bde+=_0x41c27d==='where'?_0x173086(0x1c5):_0x41c27d===_0x173086(0x200)?_0x173086(0x1f2):_0x41c27d===_0x173086(0x1eb)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS['has'](_0x41c27d)&&!_0x36cc65?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x36cc65&&_0x47591c['push']({'rawName':_0x16a3c8,'tagName':_0x41c27d,'outer':!!_0xb27d50});}_0x88d21e=_0x1d3e34+0x1;}if(_0x47591c[_0x173086(0x20b)]>0x0)return invalidMybatisSource(_0x173086(0x219)+_0x47591c['at'](-0x1)?.[_0x173086(0x21a)]+'>.');if(!_0x9be2de||!_0x4a7271)return invalidMybatisSource(_0x173086(0x1c9));return{'sql':_0x731bde[_0x173086(0x212)](),'mode':'mybatisXml',..._0x81dd57?{'statementType':_0x81dd57}:{}};}function hasWellFormedXmlAttributes(_0x2f00f0){const _0x581af3=a240_0x1111c7;let _0x1119e5=0x0;const _0x408faf=new Set();while(_0x1119e5<_0x2f00f0['length']){while(_0x1119e5<_0x2f00f0[_0x581af3(0x20b)]&&/\s/[_0x581af3(0x20a)](_0x2f00f0[_0x1119e5]??''))_0x1119e5+=0x1;if(_0x1119e5>=_0x2f00f0['length'])return!![];const _0x50136c=/^[A-Za-z_:][\w:.-]*/[_0x581af3(0x1dd)](_0x2f00f0[_0x581af3(0x1e3)](_0x1119e5)),_0x2a5d45=_0x50136c?.[0x0];if(!_0x2a5d45||_0x408faf['has'](_0x2a5d45))return![];_0x408faf[_0x581af3(0x1ee)](_0x2a5d45),_0x1119e5+=_0x2a5d45[_0x581af3(0x20b)];while(_0x1119e5<_0x2f00f0[_0x581af3(0x20b)]&&/\s/[_0x581af3(0x20a)](_0x2f00f0[_0x1119e5]??''))_0x1119e5+=0x1;if(_0x2f00f0[_0x1119e5]!=='=')return![];_0x1119e5+=0x1;while(_0x1119e5<_0x2f00f0['length']&&/\s/[_0x581af3(0x20a)](_0x2f00f0[_0x1119e5]??''))_0x1119e5+=0x1;const _0x21afff=_0x2f00f0[_0x1119e5];if(_0x21afff!=='\x22'&&_0x21afff!=='\x27')return![];_0x1119e5+=0x1;const _0x25708c=_0x2f00f0['indexOf'](_0x21afff,_0x1119e5);if(_0x25708c<0x0)return![];if(decodeXmlEntities(_0x2f00f0[_0x581af3(0x1e3)](_0x1119e5,_0x25708c))===null)return![];_0x1119e5=_0x25708c+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x7495e6){const _0xb6c37=a240_0x1111c7;let _0x4e8a55=0x0;const _0x401375=()=>{const _0x45b359=a240_0x3094;while(_0x4e8a55<_0x7495e6['length']&&/\s/[_0x45b359(0x20a)](_0x7495e6[_0x4e8a55]??''))_0x4e8a55+=0x1;};_0x401375();while(_0x4e8a55<_0x7495e6['length']){if(_0x7495e6[_0xb6c37(0x1fc)]('<!--',_0x4e8a55)){const _0x5a472f=_0x7495e6[_0xb6c37(0x20f)](_0xb6c37(0x210),_0x4e8a55+0x4);if(_0x5a472f<0x0)return!![];_0x4e8a55=_0x5a472f+0x3,_0x401375();continue;}if(_0x7495e6[_0xb6c37(0x1fc)]('<?',_0x4e8a55)){const _0xaf99ef=_0x7495e6[_0xb6c37(0x20f)]('?>',_0x4e8a55+0x2);if(_0xaf99ef<0x0)return!![];_0x4e8a55=_0xaf99ef+0x2,_0x401375();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0xb6c37(0x20a)](_0x7495e6[_0xb6c37(0x1e3)](_0x4e8a55));}function invalidMybatisSource(_0x59b86a){const _0x451d89=a240_0x1111c7;return{'sql':'','mode':_0x451d89(0x21e),'error':_0x59b86a};}function findXmlTagEnd(_0xc65bbe,_0x4c9f69){const _0xec8bc6=a240_0x1111c7;let _0x28fdcc;for(let _0x2da6d4=_0x4c9f69+0x1;_0x2da6d4<_0xc65bbe[_0xec8bc6(0x20b)];_0x2da6d4+=0x1){const _0x430ca3=_0xc65bbe[_0x2da6d4];if(_0x28fdcc){if(_0x430ca3===_0x28fdcc)_0x28fdcc=undefined;continue;}if(_0x430ca3==='\x22'||_0x430ca3==='\x27'){_0x28fdcc=_0x430ca3;continue;}if(_0x430ca3==='>')return _0x2da6d4;}return-0x1;}function decodeXmlEntities(_0x528a6f){const _0x2e430c=a240_0x1111c7;let _0x26bd2e=![];const _0x4d3d9e=_0x528a6f[_0x2e430c(0x21d)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x3aac28=>{const _0x873a50=_0x2e430c;if(_0x3aac28===_0x873a50(0x1fd))return'<';if(_0x3aac28===_0x873a50(0x1df))return'>';if(_0x3aac28===_0x873a50(0x1e0))return'\x22';if(_0x3aac28===''')return'\x27';if(_0x3aac28==='&')return'&';const _0x100314=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x873a50(0x1dd)](_0x3aac28);if(_0x100314){const _0x243b42=_0x100314[0x1],_0xebc7cf=_0x100314[0x2],_0x2e6801=Number[_0x873a50(0x1ef)](_0x243b42??_0xebc7cf??'',_0x243b42?0x10:0xa);if(isValidXmlCharacter(_0x2e6801))return String[_0x873a50(0x1d1)](_0x2e6801);}return _0x26bd2e=!![],'';});return _0x26bd2e?null:_0x4d3d9e;}function a240_0x5ab5(){const _0xc27b1b=['3bHyTcB','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','foreach','startsWith','<','UPDATE','230912PCAoLy','set','__RABETBASE_MYBATIS_DYNAMIC_END__','reason','Unterminated\x20XML\x20comment.','16JbDYZs','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','14156VGqrmQ','select','replaceAll','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','test','length','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','Unterminated\x20XML\x20declaration.','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','indexOf','-->','matchAll','trim','match','<![CDATA[','INSERT','choose','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','DELETE','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','rawName','Invalid\x20XML\x20entity\x20reference.','from','replace','mybatisXml','outer','DDL','UNKNOWN','1230942eHVzLr','isDangerous','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','push','\x20WHERE\x20','SELECT','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','type','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','WITH','Invalid\x20MyBatis\x20XML\x20tag.','Unable\x20to\x20detect\x20SQL\x20type.\x20','has','tagName','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','fromCodePoint','unknown\x20table(s)','join','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','<!--','property','\x20with\x20parameters:\x20','bind','where','30aaBWGR','toLowerCase','15084XdVdSP','exec','sql','>','"','error','pop','slice','insert','1430jrwJbG','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','string','Unterminated\x20CDATA\x20section.','471968FXfeMC','\x20query\x20targeting\x20','include','652344gGHjer','update','add','parseInt','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','otherwise','\x20SET\x20','delete','78462hcgvtS','5ZrdGah','get','when','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save'];a240_0x5ab5=function(){return _0xc27b1b;};return a240_0x5ab5();}function isValidXmlCharacter(_0x8f6bf9){return _0x8f6bf9===0x9||_0x8f6bf9===0xa||_0x8f6bf9===0xd||_0x8f6bf9>=0x20&&_0x8f6bf9<=0xd7ff||_0x8f6bf9>=0xe000&&_0x8f6bf9<=0xfffd||_0x8f6bf9>=0x10000&&_0x8f6bf9<=0x10ffff;}export function detectSqlType(_0x4d23d2){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x4d23d2));}function detectNormalizedSqlType(_0xd82c18){const _0x27d4e1=a240_0x1111c7;if(_0xd82c18[_0x27d4e1(0x1e1)])return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0xd82c18['error']};if(!_0xd82c18[_0x27d4e1(0x1de)][_0x27d4e1(0x212)]())return{'type':_0x27d4e1(0x221),'isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0x5d7dd2=stripStaticAnalysisMarkers(_0xd82c18[_0x27d4e1(0x1de)])[_0x27d4e1(0x21d)](/#\{[^}]*\}/g,'?')[_0x27d4e1(0x21d)](/\$\{[^}]*\}/g,'?')[_0x27d4e1(0x21d)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x27d4e1(0x21d)](/\/\*[\s\S]*?\*\//g,'')[_0x27d4e1(0x212)](),_0x320396=_0x5d7dd2['split']('\x0a');let _0x530eb0='';for(const _0x2732b6 of _0x320396){const _0x38cf16=_0x2732b6[_0x27d4e1(0x212)]();if(!_0x38cf16||_0x38cf16[_0x27d4e1(0x1fc)]('--')||_0x38cf16[_0x27d4e1(0x1fc)]('/*'))continue;_0x530eb0=_0x38cf16;break;}const _0x43d3f9=_0x530eb0['toUpperCase'](),_0x2612c0=_0xd82c18['statementType'],_0x178b28=maskSqlTextForBlockedKeywordScan(_0x5d7dd2),_0x3c67e1=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x27d4e1(0x20a)](_0x178b28);if(_0x2612c0===_0x27d4e1(0x1c6)||!_0x2612c0&&(_0x43d3f9['startsWith'](_0x27d4e1(0x1c6))||_0x43d3f9[_0x27d4e1(0x1fc)](_0x27d4e1(0x1ca)))){const _0x33dc5b=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x27d4e1(0x20a)](_0x5d7dd2);return{'type':_0x27d4e1(0x1c6),'isSelectOnly':!_0x33dc5b,'isDangerous':_0x33dc5b,'reason':_0x33dc5b?_0x27d4e1(0x1cf):undefined};}if(_0x2612c0===_0x27d4e1(0x215)||!_0x2612c0&&_0x43d3f9[_0x27d4e1(0x1fc)](_0x27d4e1(0x215)))return{'type':_0x27d4e1(0x215),'isSelectOnly':![],'isDangerous':_0x3c67e1,'reason':_0x3c67e1?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x2612c0===_0x27d4e1(0x1fe)||!_0x2612c0&&_0x43d3f9[_0x27d4e1(0x1fc)](_0x27d4e1(0x1fe)))return{'type':_0x27d4e1(0x1fe),'isSelectOnly':![],'isDangerous':_0x3c67e1,'reason':_0x3c67e1?_0x27d4e1(0x1f0):undefined};if(_0x2612c0==='DELETE'||!_0x2612c0&&_0x43d3f9['startsWith'](_0x27d4e1(0x218)))return{'type':_0x27d4e1(0x218),'isSelectOnly':![],'isDangerous':!![],'reason':'DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save'};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x27d4e1(0x20a)](_0x43d3f9))return{'type':_0x27d4e1(0x220),'isSelectOnly':![],'isDangerous':!![],'reason':_0x27d4e1(0x1f8)};return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x162a62){const _0x2b19f8=a240_0x1111c7;return _0x162a62['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x2b19f8(0x208)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x2b19f8(0x208)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x23f8d9){const _0x3173c2=a240_0x1111c7;return _0x23f8d9[_0x3173c2(0x21d)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x3173c2(0x21d)](/"(?:""|\\.|[^"])*"/g,'\x20')['replace'](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x3173c2(0x21d)](/--.*$/gm,'\x20')['replace'](/#.*$/gm,'\x20')['replace'](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x2f17cc){const _0x3a83b4=a240_0x1111c7,_0x3bfe17=_0x2f17cc[_0x3a83b4(0x21d)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x3a83b4(0x21d)](/'[^']*'/g,'\x27\x27')[_0x3a83b4(0x21d)](/--.*$/gm,'')[_0x3a83b4(0x21d)](/\/\*[\s\S]*?\*\//g,''),_0x40f5fc=[],_0x1a7928=_0x3bfe17[_0x3a83b4(0x213)](/FROM\s+([^\s,)(]+)/i);addTable(_0x40f5fc,_0x1a7928?.[0x1]);for(const _0x4b8402 of _0x3bfe17[_0x3a83b4(0x211)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x40f5fc,_0x4b8402[0x1]);}const _0x54ab13=_0x3bfe17[_0x3a83b4(0x213)](/INTO\s+([^\s(]+)/i);addTable(_0x40f5fc,_0x54ab13?.[0x1]);const _0x32e272=_0x3bfe17[_0x3a83b4(0x213)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x40f5fc,_0x32e272?.[0x1]),_0x40f5fc;}function addTable(_0x3aa9a6,_0xd7ea27){const _0xfddd66=a240_0x1111c7,_0x2f25b9=_0xd7ea27?.['replace'](/[`"]/g,'');_0x2f25b9&&_0x2f25b9!==UNRESOLVED_SQL_FRAGMENT&&!_0x3aa9a6['includes'](_0x2f25b9)&&_0x3aa9a6[_0xfddd66(0x1c4)](_0x2f25b9);}function extractParameters(_0x4d30fc){const _0x1abbd2=a240_0x1111c7,_0x1ccd6b=new Set();for(const _0x3bfc0c of _0x4d30fc[_0x1abbd2(0x211)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x3bfc0c[0x1])_0x1ccd6b[_0x1abbd2(0x1ee)](_0x3bfc0c[0x1]);}return Array[_0x1abbd2(0x21c)](_0x1ccd6b);}export function validateSql(_0x138ad3){const _0x24f709=a240_0x1111c7,_0x11fe44=normalizeSqlForStaticAnalysis(_0x138ad3),_0x47dd7e=detectNormalizedSqlType(_0x11fe44),_0x299113=stripStaticAnalysisMarkers(_0x11fe44[_0x24f709(0x1de)]),_0x1b6d5f=_0x11fe44[_0x24f709(0x1e1)]?[]:extractTables(_0x299113),_0x25ea05=_0x11fe44['error']?[]:extractParameters(_0x299113);if(_0x47dd7e[_0x24f709(0x223)])return{'valid':![],'sqlType':_0x47dd7e,'tables':_0x1b6d5f,'parameters':_0x25ea05,'message':_0x47dd7e[_0x24f709(0x202)]||_0x47dd7e['type']+_0x24f709(0x1d4)};if(_0x47dd7e['type']===_0x24f709(0x221))return{'valid':![],'sqlType':_0x47dd7e,'tables':_0x1b6d5f,'parameters':_0x25ea05,'message':_0x11fe44[_0x24f709(0x1e1)]?_0x24f709(0x1cc)+_0x11fe44['error']:_0x24f709(0x1fa)};return{'valid':!![],'sqlType':_0x47dd7e,'tables':_0x1b6d5f,'parameters':_0x25ea05,'message':_0x47dd7e[_0x24f709(0x1c8)]+_0x24f709(0x1ea)+(_0x1b6d5f[_0x24f709(0x20b)]?_0x1b6d5f[_0x24f709(0x1d3)](',\x20'):_0x24f709(0x1d2))+(_0x25ea05[_0x24f709(0x20b)]?_0x24f709(0x1d7)+_0x25ea05[_0x24f709(0x1d3)](',\x20'):'')};}
|
|
1
|
+
const a240_0x417021=a240_0x132d;(function(_0x2c6ebe,_0x47ab6b){const _0x155c32=a240_0x132d,_0x51297d=_0x2c6ebe();while(!![]){try{const _0x545c7a=-parseInt(_0x155c32(0x209))/0x1*(-parseInt(_0x155c32(0x236))/0x2)+-parseInt(_0x155c32(0x237))/0x3+parseInt(_0x155c32(0x20a))/0x4*(parseInt(_0x155c32(0x22d))/0x5)+-parseInt(_0x155c32(0x231))/0x6*(-parseInt(_0x155c32(0x21d))/0x7)+parseInt(_0x155c32(0x202))/0x8+-parseInt(_0x155c32(0x1f5))/0x9+parseInt(_0x155c32(0x230))/0xa;if(_0x545c7a===_0x47ab6b)break;else _0x51297d['push'](_0x51297d['shift']());}catch(_0x398472){_0x51297d['push'](_0x51297d['shift']());}}}(a240_0x4956,0x706f0));const MYBATIS_OUTER_TAGS=new Map([[a240_0x417021(0x243),a240_0x417021(0x201)],[a240_0x417021(0x234),'INSERT'],[a240_0x417021(0x223),a240_0x417021(0x23c)],['delete',a240_0x417021(0x23a)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if','where',a240_0x417021(0x220),'choose','when','otherwise',a240_0x417021(0x20c),'set','bind','include',a240_0x417021(0x1fe)]),MYBATIS_BRANCH_TAGS=new Set(['if','foreach',a240_0x417021(0x1ee),a240_0x417021(0x232),'otherwise']);function a240_0x4956(){const _0x37b38c=['length','mybatisXml','from','string','select','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','SQL\x20content\x20is\x20empty','Invalid\x20XML\x20entity\x20reference.','startsWith','push','sql','has','choose','replace','get','pop','type','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','Invalid\x20MyBatis\x20XML\x20tag.','5980671PBwOEu','&','WITH','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','"',''','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','matchAll','match','property','exec',')\x5cb','SELECT','1769312YVnMaJ','-->','\x20with\x20parameters:\x20','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','slice','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','indexOf','351553RyYJuD','919120DhIXWC','<![CDATA[','trim','<!--','Unterminated\x20MyBatis\x20XML\x20tag.','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','^<\x5cs*(?:','toUpperCase','<','Unterminated\x20XML\x20comment.','error','isDangerous','outer','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','fromCodePoint','reason','UNKNOWN','rawName','Unterminated\x20XML\x20declaration.','7yMvvgB','split','>','foreach','parseInt','__RABETBASE_MYBATIS_DYNAMIC_START__','update','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','unknown\x20table(s)','\x20query\x20targeting\x20','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','tagName','includes','include','INSERT','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','5QoLTNg','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','Unable\x20to\x20detect\x20SQL\x20type.\x20','1796390XjuTrQ','3774204UDZFSD','when','test','insert','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','2DXiVhT','1458369OYttdx','add','__RABETBASE_MYBATIS_DYNAMIC_END__','DELETE','replaceAll','UPDATE','join','DDL'];a240_0x4956=function(){return _0x37b38c;};return a240_0x4956();}export const MYBATIS_DYNAMIC_START_MARKER=a240_0x417021(0x222);export const MYBATIS_DYNAMIC_END_MARKER=a240_0x417021(0x239);export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT='__RABETBASE_UNRESOLVED_SQL_FRAGMENT__',MYBATIS_OUTER_TAG_PATTERN=new RegExp(a240_0x417021(0x210)+[...MYBATIS_OUTER_TAGS['keys']()][a240_0x417021(0x23d)]('|')+a240_0x417021(0x200),'i');export function normalizeSqlForStaticAnalysis(_0x498430){const _0x4595e0=a240_0x417021,_0x4d1536=typeof _0x498430===_0x4595e0(0x242)?_0x498430:'';if(!startsWithMybatisStatementWrapper(_0x4d1536))return{'sql':_0x4d1536,'mode':'sql'};let _0x333f37=0x0,_0x4df0e3='',_0x2b1612,_0x57484b=![],_0x427f72=![];const _0x489ce3=[];while(_0x333f37<_0x4d1536[_0x4595e0(0x23f)]){if(_0x4d1536[_0x4595e0(0x248)](_0x4595e0(0x20d),_0x333f37)){const _0x37bb92=_0x4d1536['indexOf']('-->',_0x333f37+0x4);if(_0x37bb92<0x0)return invalidMybatisSource(_0x4595e0(0x213));_0x4df0e3+='\x20',_0x333f37=_0x37bb92+0x3;continue;}if(_0x4d1536[_0x4595e0(0x248)](_0x4595e0(0x20b),_0x333f37)){if(!_0x57484b||_0x427f72)return invalidMybatisSource(_0x4595e0(0x20f));const _0x38425b=_0x4d1536[_0x4595e0(0x208)](']]>',_0x333f37+0x9);if(_0x38425b<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x4df0e3+=_0x4d1536[_0x4595e0(0x206)](_0x333f37+0x9,_0x38425b),_0x333f37=_0x38425b+0x3;continue;}if(_0x4d1536[_0x4595e0(0x248)]('<?',_0x333f37)){if(_0x57484b)return invalidMybatisSource(_0x4595e0(0x1fb));const _0xab7ec9=_0x4d1536['indexOf']('?>',_0x333f37+0x2);if(_0xab7ec9<0x0)return invalidMybatisSource(_0x4595e0(0x21c));_0x4df0e3+='\x20',_0x333f37=_0xab7ec9+0x2;continue;}if(_0x4d1536[_0x333f37]!=='<'){const _0x55e230=_0x4d1536[_0x4595e0(0x208)]('<',_0x333f37),_0x938ca2=_0x55e230<0x0?_0x4d1536[_0x4595e0(0x23f)]:_0x55e230,_0x58e303=_0x4d1536['slice'](_0x333f37,_0x938ca2);if((!_0x57484b||_0x427f72)&&_0x58e303['trim']())return invalidMybatisSource('SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');if(_0x57484b&&!_0x427f72){const _0x39ae5d=decodeXmlEntities(_0x58e303);if(_0x39ae5d===null)return invalidMybatisSource(_0x4595e0(0x247));_0x4df0e3+=_0x39ae5d;}else _0x4df0e3+='\x20';_0x333f37=_0x938ca2;continue;}const _0xb556cd=findXmlTagEnd(_0x4d1536,_0x333f37);if(_0xb556cd<0x0)return invalidMybatisSource(_0x4595e0(0x20e));const _0x3cf42e=_0x4d1536[_0x4595e0(0x206)](_0x333f37,_0xb556cd+0x1),_0x5dade9=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/['exec'](_0x3cf42e);if(!_0x5dade9)return invalidMybatisSource(_0x4595e0(0x1f4));const _0x1d61fc=_0x5dade9[0x1]==='/',_0x2a6783=_0x5dade9[0x2]??'',_0x278bd6=_0x2a6783['toLowerCase'](),_0x63e5fd=_0x5dade9[0x3]??'',_0x2f8778=_0x5dade9[0x4]==='/',_0x108128=MYBATIS_OUTER_TAGS[_0x4595e0(0x1f0)](_0x278bd6);if(!_0x108128&&!MYBATIS_DYNAMIC_TAGS[_0x4595e0(0x1ed)](_0x278bd6))return invalidMybatisSource(_0x4595e0(0x245)+_0x278bd6+'>.');if(!_0x108128&&_0x2a6783!==_0x278bd6)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<'+_0x2a6783+'>.');if(_0x1d61fc){if(_0x63e5fd[_0x4595e0(0x20c)]()||_0x2f8778)return invalidMybatisSource(_0x4595e0(0x1f3)+_0x2a6783+'>.');const _0x2a770d=_0x489ce3['at'](-0x1);if(!_0x2a770d||(_0x2a770d[_0x4595e0(0x216)]?_0x2a770d[_0x4595e0(0x228)]!==_0x278bd6:_0x2a770d['rawName']!==_0x2a6783))return invalidMybatisSource(_0x4595e0(0x227)+_0x2a6783+'>.');_0x489ce3[_0x4595e0(0x1f1)]();if(_0x2a770d[_0x4595e0(0x216)])_0x427f72=!![];_0x4df0e3+=MYBATIS_BRANCH_TAGS[_0x4595e0(0x1ed)](_0x278bd6)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x63e5fd))return invalidMybatisSource(_0x4595e0(0x205)+_0x2a6783+'>.');if(_0x278bd6==='property'&&(!_0x2f8778||_0x489ce3['at'](-0x1)?.['tagName']!==_0x4595e0(0x22a)))return invalidMybatisSource('MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.');if(_0x108128){if(_0x57484b||_0x489ce3[_0x4595e0(0x23f)]>0x0)return invalidMybatisSource(_0x4595e0(0x235));_0x57484b=!![],_0x427f72=_0x2f8778,_0x2b1612=_0x108128;}else{if(!_0x57484b||_0x427f72)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<'+_0x2a6783+'>.');}_0x4df0e3+=_0x278bd6==='where'?'\x20WHERE\x20':_0x278bd6==='set'?'\x20SET\x20':_0x278bd6===_0x4595e0(0x22a)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x4595e0(0x1ed)](_0x278bd6)&&!_0x2f8778?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x2f8778&&_0x489ce3[_0x4595e0(0x249)]({'rawName':_0x2a6783,'tagName':_0x278bd6,'outer':!!_0x108128});}_0x333f37=_0xb556cd+0x1;}if(_0x489ce3[_0x4595e0(0x23f)]>0x0)return invalidMybatisSource(_0x4595e0(0x244)+_0x489ce3['at'](-0x1)?.[_0x4595e0(0x21b)]+'>.');if(!_0x57484b||!_0x427f72)return invalidMybatisSource(_0x4595e0(0x207));return{'sql':_0x4df0e3[_0x4595e0(0x20c)](),'mode':'mybatisXml',..._0x2b1612?{'statementType':_0x2b1612}:{}};}function hasWellFormedXmlAttributes(_0x8d4196){const _0x5d45fc=a240_0x417021;let _0x456e84=0x0;const _0x435a3b=new Set();while(_0x456e84<_0x8d4196[_0x5d45fc(0x23f)]){while(_0x456e84<_0x8d4196[_0x5d45fc(0x23f)]&&/\s/[_0x5d45fc(0x233)](_0x8d4196[_0x456e84]??''))_0x456e84+=0x1;if(_0x456e84>=_0x8d4196[_0x5d45fc(0x23f)])return!![];const _0x29d297=/^[A-Za-z_:][\w:.-]*/['exec'](_0x8d4196['slice'](_0x456e84)),_0x207adf=_0x29d297?.[0x0];if(!_0x207adf||_0x435a3b[_0x5d45fc(0x1ed)](_0x207adf))return![];_0x435a3b['add'](_0x207adf),_0x456e84+=_0x207adf[_0x5d45fc(0x23f)];while(_0x456e84<_0x8d4196[_0x5d45fc(0x23f)]&&/\s/[_0x5d45fc(0x233)](_0x8d4196[_0x456e84]??''))_0x456e84+=0x1;if(_0x8d4196[_0x456e84]!=='=')return![];_0x456e84+=0x1;while(_0x456e84<_0x8d4196[_0x5d45fc(0x23f)]&&/\s/[_0x5d45fc(0x233)](_0x8d4196[_0x456e84]??''))_0x456e84+=0x1;const _0x52a610=_0x8d4196[_0x456e84];if(_0x52a610!=='\x22'&&_0x52a610!=='\x27')return![];_0x456e84+=0x1;const _0x4e90b5=_0x8d4196[_0x5d45fc(0x208)](_0x52a610,_0x456e84);if(_0x4e90b5<0x0)return![];if(decodeXmlEntities(_0x8d4196['slice'](_0x456e84,_0x4e90b5))===null)return![];_0x456e84=_0x4e90b5+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x2390b8){const _0x6fe5dc=a240_0x417021;let _0x1acb46=0x0;const _0x168fe6=()=>{const _0x535c14=a240_0x132d;while(_0x1acb46<_0x2390b8['length']&&/\s/[_0x535c14(0x233)](_0x2390b8[_0x1acb46]??''))_0x1acb46+=0x1;};_0x168fe6();while(_0x1acb46<_0x2390b8['length']){if(_0x2390b8[_0x6fe5dc(0x248)](_0x6fe5dc(0x20d),_0x1acb46)){const _0x2490c5=_0x2390b8[_0x6fe5dc(0x208)](_0x6fe5dc(0x203),_0x1acb46+0x4);if(_0x2490c5<0x0)return!![];_0x1acb46=_0x2490c5+0x3,_0x168fe6();continue;}if(_0x2390b8[_0x6fe5dc(0x248)]('<?',_0x1acb46)){const _0x6f7c58=_0x2390b8[_0x6fe5dc(0x208)]('?>',_0x1acb46+0x2);if(_0x6f7c58<0x0)return!![];_0x1acb46=_0x6f7c58+0x2,_0x168fe6();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x6fe5dc(0x233)](_0x2390b8[_0x6fe5dc(0x206)](_0x1acb46));}function invalidMybatisSource(_0x81a4e5){const _0x4a68e5=a240_0x417021;return{'sql':'','mode':_0x4a68e5(0x240),'error':_0x81a4e5};}function findXmlTagEnd(_0x1c160b,_0x2e8f43){const _0x3e3684=a240_0x417021;let _0x51600f;for(let _0x4bd3e4=_0x2e8f43+0x1;_0x4bd3e4<_0x1c160b[_0x3e3684(0x23f)];_0x4bd3e4+=0x1){const _0x43787d=_0x1c160b[_0x4bd3e4];if(_0x51600f){if(_0x43787d===_0x51600f)_0x51600f=undefined;continue;}if(_0x43787d==='\x22'||_0x43787d==='\x27'){_0x51600f=_0x43787d;continue;}if(_0x43787d==='>')return _0x4bd3e4;}return-0x1;}function a240_0x132d(_0x15f0bc,_0x5d77c3){_0x15f0bc=_0x15f0bc-0x1ec;const _0x4956dc=a240_0x4956();let _0x132d5c=_0x4956dc[_0x15f0bc];return _0x132d5c;}function decodeXmlEntities(_0x44c20d){const _0x5e62e1=a240_0x417021;let _0x18a851=![];const _0x20db1e=_0x44c20d[_0x5e62e1(0x1ef)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x1f05db=>{const _0x593213=_0x5e62e1;if(_0x1f05db===_0x593213(0x212))return'<';if(_0x1f05db===_0x593213(0x21f))return'>';if(_0x1f05db===_0x593213(0x1f9))return'\x22';if(_0x1f05db===_0x593213(0x1fa))return'\x27';if(_0x1f05db===_0x593213(0x1f6))return'&';const _0x191303=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x593213(0x1ff)](_0x1f05db);if(_0x191303){const _0x36ff8b=_0x191303[0x1],_0x500c7e=_0x191303[0x2],_0x5110c0=Number[_0x593213(0x221)](_0x36ff8b??_0x500c7e??'',_0x36ff8b?0x10:0xa);if(isValidXmlCharacter(_0x5110c0))return String[_0x593213(0x218)](_0x5110c0);}return _0x18a851=!![],'';});return _0x18a851?null:_0x20db1e;}function isValidXmlCharacter(_0x2b2177){return _0x2b2177===0x9||_0x2b2177===0xa||_0x2b2177===0xd||_0x2b2177>=0x20&&_0x2b2177<=0xd7ff||_0x2b2177>=0xe000&&_0x2b2177<=0xfffd||_0x2b2177>=0x10000&&_0x2b2177<=0x10ffff;}export function detectSqlType(_0x233cff){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x233cff));}function detectNormalizedSqlType(_0x4c8393){const _0x2af8d5=a240_0x417021;if(_0x4c8393[_0x2af8d5(0x214)])return{'type':_0x2af8d5(0x21a),'isSelectOnly':![],'isDangerous':![],'reason':_0x4c8393[_0x2af8d5(0x214)]};if(!_0x4c8393['sql'][_0x2af8d5(0x20c)]())return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x2af8d5(0x246)};const _0x57cbfd=stripStaticAnalysisMarkers(_0x4c8393[_0x2af8d5(0x1ec)])[_0x2af8d5(0x1ef)](/#\{[^}]*\}/g,'?')[_0x2af8d5(0x1ef)](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x2af8d5(0x1ef)](/\/\*[\s\S]*?\*\//g,'')[_0x2af8d5(0x20c)](),_0xbbd47b=_0x57cbfd[_0x2af8d5(0x21e)]('\x0a');let _0xda1a2='';for(const _0xf3c479 of _0xbbd47b){const _0x4b77dd=_0xf3c479[_0x2af8d5(0x20c)]();if(!_0x4b77dd||_0x4b77dd[_0x2af8d5(0x248)]('--')||_0x4b77dd['startsWith']('/*'))continue;_0xda1a2=_0x4b77dd;break;}const _0x46c37f=_0xda1a2[_0x2af8d5(0x211)](),_0x1672fc=_0x4c8393['statementType'],_0x2d781b=maskSqlTextForBlockedKeywordScan(_0x57cbfd),_0x2b0a4a=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x2af8d5(0x233)](_0x2d781b);if(_0x1672fc===_0x2af8d5(0x201)||!_0x1672fc&&(_0x46c37f['startsWith'](_0x2af8d5(0x201))||_0x46c37f[_0x2af8d5(0x248)](_0x2af8d5(0x1f7)))){const _0x27b8c3=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x2af8d5(0x233)](_0x57cbfd);return{'type':_0x2af8d5(0x201),'isSelectOnly':!_0x27b8c3,'isDangerous':_0x27b8c3,'reason':_0x27b8c3?_0x2af8d5(0x1f8):undefined};}if(_0x1672fc===_0x2af8d5(0x22b)||!_0x1672fc&&_0x46c37f[_0x2af8d5(0x248)]('INSERT'))return{'type':_0x2af8d5(0x22b),'isSelectOnly':![],'isDangerous':_0x2b0a4a,'reason':_0x2b0a4a?_0x2af8d5(0x22c):undefined};if(_0x1672fc===_0x2af8d5(0x23c)||!_0x1672fc&&_0x46c37f[_0x2af8d5(0x248)](_0x2af8d5(0x23c)))return{'type':_0x2af8d5(0x23c),'isSelectOnly':![],'isDangerous':_0x2b0a4a,'reason':_0x2b0a4a?_0x2af8d5(0x22c):undefined};if(_0x1672fc==='DELETE'||!_0x1672fc&&_0x46c37f['startsWith'](_0x2af8d5(0x23a)))return{'type':_0x2af8d5(0x23a),'isSelectOnly':![],'isDangerous':!![],'reason':_0x2af8d5(0x224)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x2af8d5(0x233)](_0x46c37f))return{'type':_0x2af8d5(0x23e),'isSelectOnly':![],'isDangerous':!![],'reason':_0x2af8d5(0x217)};return{'type':_0x2af8d5(0x21a),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x2a9c7b){const _0x20c9c4=a240_0x417021;return _0x2a9c7b[_0x20c9c4(0x23b)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x20c9c4(0x23b)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x20c9c4(0x23b)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x213eea){const _0xd7aa67=a240_0x417021;return _0x213eea[_0xd7aa67(0x1ef)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0xd7aa67(0x1ef)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0xd7aa67(0x1ef)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0xd7aa67(0x1ef)](/--.*$/gm,'\x20')[_0xd7aa67(0x1ef)](/#.*$/gm,'\x20')[_0xd7aa67(0x1ef)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x10085d){const _0x54b9a5=a240_0x417021,_0x54fa02=_0x10085d[_0x54b9a5(0x1ef)](/#\{[^}]*\}/g,'?')[_0x54b9a5(0x1ef)](/\$\{[^}]*\}/g,'?')[_0x54b9a5(0x1ef)](/'[^']*'/g,'\x27\x27')[_0x54b9a5(0x1ef)](/--.*$/gm,'')[_0x54b9a5(0x1ef)](/\/\*[\s\S]*?\*\//g,''),_0x3b57d6=[],_0x1b4ac4=_0x54fa02[_0x54b9a5(0x1fd)](/FROM\s+([^\s,)(]+)/i);addTable(_0x3b57d6,_0x1b4ac4?.[0x1]);for(const _0x5534b1 of _0x54fa02[_0x54b9a5(0x1fc)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x3b57d6,_0x5534b1[0x1]);}const _0x1f2c1c=_0x54fa02['match'](/INTO\s+([^\s(]+)/i);addTable(_0x3b57d6,_0x1f2c1c?.[0x1]);const _0x42c5c8=_0x54fa02[_0x54b9a5(0x1fd)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x3b57d6,_0x42c5c8?.[0x1]),_0x3b57d6;}function addTable(_0x5ea236,_0x182cd2){const _0x4bc8db=a240_0x417021,_0x38c5ca=_0x182cd2?.[_0x4bc8db(0x1ef)](/[`"]/g,'');_0x38c5ca&&_0x38c5ca!==UNRESOLVED_SQL_FRAGMENT&&!_0x5ea236[_0x4bc8db(0x229)](_0x38c5ca)&&_0x5ea236[_0x4bc8db(0x249)](_0x38c5ca);}function extractParameters(_0x4f32cd){const _0x4fb04f=a240_0x417021,_0x542d74=new Set();for(const _0x4dc8ad of _0x4f32cd['matchAll'](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x4dc8ad[0x1])_0x542d74[_0x4fb04f(0x238)](_0x4dc8ad[0x1]);}return Array[_0x4fb04f(0x241)](_0x542d74);}export function validateSql(_0x3cab73){const _0x55102c=a240_0x417021,_0x3973f6=normalizeSqlForStaticAnalysis(_0x3cab73),_0x4f62a2=detectNormalizedSqlType(_0x3973f6),_0x2e4a66=stripStaticAnalysisMarkers(_0x3973f6['sql']),_0x4081c5=_0x3973f6[_0x55102c(0x214)]?[]:extractTables(_0x2e4a66),_0x31656f=_0x3973f6[_0x55102c(0x214)]?[]:extractParameters(_0x2e4a66);if(_0x4f62a2[_0x55102c(0x215)])return{'valid':![],'sqlType':_0x4f62a2,'tables':_0x4081c5,'parameters':_0x31656f,'message':_0x4f62a2[_0x55102c(0x219)]||_0x4f62a2[_0x55102c(0x1f2)]+'\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.'};if(_0x4f62a2[_0x55102c(0x1f2)]===_0x55102c(0x21a))return{'valid':![],'sqlType':_0x4f62a2,'tables':_0x4081c5,'parameters':_0x31656f,'message':_0x3973f6[_0x55102c(0x214)]?_0x55102c(0x22f)+_0x3973f6['error']:_0x55102c(0x22e)};return{'valid':!![],'sqlType':_0x4f62a2,'tables':_0x4081c5,'parameters':_0x31656f,'message':_0x4f62a2[_0x55102c(0x1f2)]+_0x55102c(0x226)+(_0x4081c5[_0x55102c(0x23f)]?_0x4081c5[_0x55102c(0x23d)](',\x20'):_0x55102c(0x225))+(_0x31656f[_0x55102c(0x23f)]?_0x55102c(0x204)+_0x31656f['join'](',\x20'):'')};}
|
package/lib/errors.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import { CliError } from "@lovrabet/cli-framework";
|
|
2
2
|
export { CliError };
|
|
3
|
-
export declare const CliErrors:
|
|
3
|
+
export declare const CliErrors: {
|
|
4
|
+
authRequired(hint?: string): CliError;
|
|
5
|
+
configMissing(hint?: string): CliError;
|
|
6
|
+
notInProject(): CliError;
|
|
7
|
+
apiError(message: string, hint?: string): CliError;
|
|
8
|
+
networkError(message: string): CliError;
|
|
9
|
+
unknownCommand(cmd: string): CliError;
|
|
10
|
+
flagMissing(flagName: string, hint?: string): CliError;
|
|
11
|
+
validation(message: string, hint?: string): CliError;
|
|
12
|
+
cancelled(message?: string): CliError;
|
|
13
|
+
};
|