@lovrabet/rabetbase-cli 2.5.3 → 2.5.4-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/README.md +11 -0
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.d.ts +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.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/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.d.ts +2 -0
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.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/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/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.d.ts +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.d.ts +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.d.ts +4 -0
- 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 +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.d.ts +14 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.d.ts +1 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.d.ts +11 -10
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.d.ts +7 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.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.d.ts +5 -2
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.d.ts +15 -3
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +2 -2
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +5 -0
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +31 -17
- package/skills/rabetbase/guides/approval-flow-development-workflow.md +33 -11
- package/skills/rabetbase/guides/best-practices.md +1 -1
- package/skills/rabetbase/guides/conflict-detection.md +44 -92
- package/skills/rabetbase/guides/custom-page-flow-sdk.md +642 -0
- package/skills/rabetbase/guides/custom-page-flow-timeline-display.md +289 -0
- package/skills/rabetbase/guides/custom-page-workflow.md +12 -3
- package/skills/rabetbase/guides/sql-creation-workflow.md +44 -26
- package/skills/rabetbase/guides/sql-mybatis.md +18 -49
- package/skills/rabetbase/guides/typescript-sdk.md +18 -0
- package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +22 -6
- package/skills/rabetbase/knowledge/components.md +34 -28
- package/skills/rabetbase/knowledge/custom-page/generation-standards.md +2 -0
- package/skills/rabetbase/references/rabetbase-config.md +6 -4
- package/skills/rabetbase/references/rabetbase-flow-commands.md +8 -4
- package/skills/rabetbase/references/rabetbase-flow-resources.md +3 -3
- package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +2 -0
- package/skills/rabetbase/references/rabetbase-init.md +7 -5
- package/skills/rabetbase/references/rabetbase-kb.md +14 -4
- package/skills/rabetbase/references/rabetbase-page-custom-detail.md +3 -1
- package/skills/rabetbase/references/rabetbase-page-custom-list.md +3 -0
- package/skills/rabetbase/references/rabetbase-sql-push.md +5 -0
- package/skills/rabetbase/references/rabetbase-sql-validate.md +12 -6
- package/skills/rabetbase.manifest.json +5 -3
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2114cc,_0x4d626a){const _0xd1fce5=a286_0xc252,_0x15759c=_0x2114cc();while(!![]){try{const _0x32d9fb=parseInt(_0xd1fce5(0x1f2))/0x1*(parseInt(_0xd1fce5(0x1e9))/0x2)+parseInt(_0xd1fce5(0x1ee))/0x3*(-parseInt(_0xd1fce5(0x1f6))/0x4)+parseInt(_0xd1fce5(0x1f0))/0x5*(parseInt(_0xd1fce5(0x1f8))/0x6)+-parseInt(_0xd1fce5(0x1f9))/0x7+parseInt(_0xd1fce5(0x1e8))/0x8*(parseInt(_0xd1fce5(0x1f1))/0x9)+-parseInt(_0xd1fce5(0x1eb))/0xa*(parseInt(_0xd1fce5(0x1ed))/0xb)+parseInt(_0xd1fce5(0x1f3))/0xc*(parseInt(_0xd1fce5(0x1f7))/0xd);if(_0x32d9fb===_0x4d626a)break;else _0x15759c['push'](_0x15759c['shift']());}catch(_0x361cf4){_0x15759c['push'](_0x15759c['shift']());}}}(a286_0x4716,0xe6a74));import{mkdir,readFile,writeFile}from'node:fs/promises';function a286_0x4716(){const _0x24efc4=['12IMCmKm','lastSync','object','528952YBTXhH','5005481IzUWfV','6160254IbHFEd','11239158UyfisF','code','stringify','apps','8eVJJKF','24788jeduRa','pages','247330GCewDo','utf8','33OqvsGn','15vpcCPU','ENOENT','5MOdBDW','4149693OyQooR','114btcWdK'];a286_0x4716=function(){return _0x24efc4;};return a286_0x4716();}function a286_0xc252(_0x649774,_0x5b74b2){_0x649774=_0x649774-0x1e6;const _0x4716d9=a286_0x4716();let _0xc25208=_0x4716d9[_0x649774];return _0xc25208;}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x1486b2,_0x551c8f){const _0x4d3025=a286_0xc252,_0x37c6b9={'apps':_0x1486b2['apps']&&typeof _0x1486b2[_0x4d3025(0x1e7)]===_0x4d3025(0x1f5)?_0x1486b2['apps']:{}};let _0x2c2843=_0x37c6b9['apps'][_0x551c8f];if(!_0x2c2843)return _0x2c2843={'lastSync':'','pages':{}},_0x37c6b9[_0x4d3025(0x1e7)][_0x551c8f]=_0x2c2843,{'lockData':_0x37c6b9,'appLock':_0x2c2843};return!_0x2c2843[_0x4d3025(0x1f4)]&&(_0x2c2843[_0x4d3025(0x1f4)]=''),(!_0x2c2843[_0x4d3025(0x1ea)]||typeof _0x2c2843['pages']!==_0x4d3025(0x1f5))&&(_0x2c2843[_0x4d3025(0x1ea)]={}),{'lockData':_0x37c6b9,'appLock':_0x2c2843};}export async function readPageLockFile(_0x4359a1){const _0x2c5cd2=a286_0xc252;try{const _0x344ce1=await readFile(_0x4359a1,_0x2c5cd2(0x1ec)),_0xb027f9=JSON['parse'](_0x344ce1);return{'apps':_0xb027f9[_0x2c5cd2(0x1e7)]&&typeof _0xb027f9[_0x2c5cd2(0x1e7)]===_0x2c5cd2(0x1f5)?_0xb027f9[_0x2c5cd2(0x1e7)]:{}};}catch(_0xad0b4d){if(_0xad0b4d[_0x2c5cd2(0x1fa)]===_0x2c5cd2(0x1ef))return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0xad0b4d));}}export async function writePageLockFile(_0x1c3bc8,_0x1274c7){const _0x26673c=a286_0xc252;await mkdir(dirname(_0x1c3bc8),{'recursive':!![]}),await writeFile(_0x1c3bc8,JSON[_0x26673c(0x1e6)](_0x1274c7,null,0x2),_0x26673c(0x1ec));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a287_0x576c(){const _0x13ec0e=['validation','39906mnwved','remote','stringify','LrSmartJsx\x20node\x20\x22','LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22','\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.','3ZQzxrR','entries','isArray','2710824qvgGYL','object','Invalid\x20JSON\x20in\x20','7486DGAfQj','parse','this','id:','JSExpression','921148euaEGB','get','1ePYcJS','570HJaRxK','render','type','length','label','Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.','906PhoYha','map','componentName','5711629sBcCgh','forEach','LrSmartJsx','1398901euvHBe','key','value','Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.','\x22\x20has\x20a\x20manually\x20changed\x20render.value.','\x20page\x20schema.','6160xUoZRP','\x22\x20has\x20missing\x20or\x20invalid\x20props.','Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.','string','local','apiError','JSFunction','props'];a287_0x576c=function(){return _0x13ec0e;};return a287_0x576c();}(function(_0x38e32b,_0xa9f65c){const _0x435472=a287_0x5448,_0x3bfb50=_0x38e32b();while(!![]){try{const _0x288fbf=parseInt(_0x435472(0x18b))/0x1*(parseInt(_0x435472(0x184))/0x2)+parseInt(_0x435472(0x17e))/0x3*(parseInt(_0x435472(0x189))/0x4)+parseInt(_0x435472(0x19e))/0x5*(-parseInt(_0x435472(0x192))/0x6)+parseInt(_0x435472(0x198))/0x7+-parseInt(_0x435472(0x181))/0x8+-parseInt(_0x435472(0x178))/0x9*(parseInt(_0x435472(0x18c))/0xa)+parseInt(_0x435472(0x195))/0xb;if(_0x288fbf===_0xa9f65c)break;else _0x3bfb50['push'](_0x3bfb50['shift']());}catch(_0x5c83c5){_0x3bfb50['push'](_0x3bfb50['shift']());}}}(a287_0x576c,0x2ad81));import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0x12f166,_0x41bb47,_0x10b28e){const _0x34f616=a287_0x5448,_0x4d6b35=parseSchema(_0x12f166,_0x34f616(0x1a2)),_0x5122b7=parseSchema(_0x41bb47,_0x34f616(0x179)),_0x28ab4e=collectLrSmartJsx(_0x4d6b35,!![]);if(_0x28ab4e[_0x34f616(0x18f)]===0x0)return{'content':_0x12f166,'compiledNodes':0x0,'normalizedNodes':0x0};const _0x24a568=new Map(collectLrSmartJsx(_0x5122b7)[_0x34f616(0x193)](_0xb4c46a=>[_0xb4c46a['key'],_0xb4c46a]));let _0x2db05e=0x0,_0x3378a2=0x0;for(const _0x25458a of _0x28ab4e){const _0x495cc0=readNonEmptyString(_0x25458a[_0x34f616(0x18d)]['source']),_0x146879=readNonEmptyString(_0x25458a[_0x34f616(0x18d)][_0x34f616(0x19a)]),_0x448a21=_0x24a568[_0x34f616(0x18a)](_0x25458a[_0x34f616(0x199)]),_0x1d66ce=readNonEmptyString(_0x448a21?.[_0x34f616(0x18d)]['source']),_0x2d5003=readNonEmptyString(_0x448a21?.[_0x34f616(0x18d)][_0x34f616(0x19a)]);let _0x3a4f96=![];_0x25458a[_0x34f616(0x18d)][_0x34f616(0x18e)]!==_0x34f616(0x1a4)&&(_0x25458a[_0x34f616(0x18d)][_0x34f616(0x18e)]='JSFunction',_0x3a4f96=!![]);!isPageContextExpression(_0x25458a[_0x34f616(0x1a5)]['_context'])&&(_0x25458a[_0x34f616(0x1a5)]['_context']={'type':_0x34f616(0x188),'value':_0x34f616(0x186)},_0x3a4f96=!![]);if(!_0x495cc0){if(!_0x146879)throw CliErrors[_0x34f616(0x1a6)](_0x34f616(0x17b)+_0x25458a[_0x34f616(0x190)]+_0x34f616(0x17d),'Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.');if(_0x3a4f96)_0x3378a2+=0x1;continue;}const _0x4a6809=!_0x448a21||_0x495cc0!==_0x1d66ce,_0x40cdb6=!_0x146879;if(!_0x4a6809&&_0x146879&&_0x2d5003&&_0x146879!==_0x2d5003)throw CliErrors['validation']('LrSmartJsx\x20node\x20\x22'+_0x25458a[_0x34f616(0x190)]+_0x34f616(0x19c),_0x34f616(0x191));if(_0x4a6809||_0x40cdb6||!_0x2d5003){const _0x4d032c=readNonEmptyString(await _0x10b28e(_0x495cc0));if(!_0x4d032c)throw CliErrors[_0x34f616(0x1a3)](_0x34f616(0x17c)+_0x25458a['label']+'\x22.');_0x25458a[_0x34f616(0x18d)]['value']=_0x4d032c,_0x2db05e+=0x1,_0x3a4f96=!![];}if(_0x3a4f96)_0x3378a2+=0x1;}if(_0x3378a2===0x0)return{'content':_0x12f166,'compiledNodes':_0x2db05e,'normalizedNodes':_0x3378a2};return{'content':JSON[_0x34f616(0x17a)](_0x4d6b35),'compiledNodes':_0x2db05e,'normalizedNodes':_0x3378a2};}function parseSchema(_0x219031,_0x16ccee){const _0xc0ad6=a287_0x5448;try{return JSON[_0xc0ad6(0x185)](_0x219031);}catch{throw CliErrors[_0xc0ad6(0x1a6)](_0xc0ad6(0x183)+_0x16ccee+_0xc0ad6(0x19d));}}function collectLrSmartJsx(_0x180549,_0x26acf7=![]){const _0x147cc3=[],_0x581b52=(_0x3755bc,_0x13953c)=>{const _0x564fb7=a287_0x5448;if(Array[_0x564fb7(0x180)](_0x3755bc)){_0x3755bc[_0x564fb7(0x196)]((_0x2bf998,_0xcc5012)=>_0x581b52(_0x2bf998,_0x13953c+'['+_0xcc5012+']'));return;}if(!isObject(_0x3755bc))return;if(_0x3755bc[_0x564fb7(0x194)]===_0x564fb7(0x197)){const _0x211168=readNonEmptyString(_0x3755bc['id']),_0x408cdf=_0x211168||_0x13953c,_0x370d31=isObject(_0x3755bc[_0x564fb7(0x1a5)])?_0x3755bc['props']:undefined;if(!_0x370d31){if(_0x26acf7)throw CliErrors[_0x564fb7(0x1a6)](_0x564fb7(0x17b)+_0x408cdf+_0x564fb7(0x19f),_0x564fb7(0x19b));return;}const _0x134d29=isObject(_0x370d31[_0x564fb7(0x18d)])?_0x370d31[_0x564fb7(0x18d)]:undefined;if(!_0x134d29){if(_0x26acf7)throw CliErrors[_0x564fb7(0x1a6)](_0x564fb7(0x17b)+_0x408cdf+'\x22\x20has\x20missing\x20or\x20invalid\x20props.render.',_0x564fb7(0x1a0));return;}_0x147cc3['push']({'key':_0x211168?_0x564fb7(0x187)+_0x211168:'path:'+_0x13953c,'label':_0x408cdf,'props':_0x370d31,'render':_0x134d29});}for(const [_0x1c3d07,_0x40eea8]of Object[_0x564fb7(0x17f)](_0x3755bc)){if(_0x1c3d07===_0x564fb7(0x1a5)&&_0x3755bc['componentName']===_0x564fb7(0x197))continue;_0x581b52(_0x40eea8,_0x13953c+'.'+_0x1c3d07);}};return _0x581b52(_0x180549,'$'),_0x147cc3;}function isObject(_0x448e32){const _0x41c10d=a287_0x5448;return Boolean(_0x448e32)&&typeof _0x448e32===_0x41c10d(0x182)&&!Array[_0x41c10d(0x180)](_0x448e32);}function a287_0x5448(_0xb4dc13,_0x5b6f68){_0xb4dc13=_0xb4dc13-0x178;const _0x576c70=a287_0x576c();let _0x544827=_0x576c70[_0xb4dc13];return _0x544827;}function readNonEmptyString(_0x1ce9c1){const _0xf5ca73=a287_0x5448;return typeof _0x1ce9c1===_0xf5ca73(0x1a1)&&_0x1ce9c1['trim']()?_0x1ce9c1:undefined;}function isPageContextExpression(_0x349dee){const _0x202b86=a287_0x5448;return isObject(_0x349dee)&&_0x349dee['type']===_0x202b86(0x188)&&_0x349dee[_0x202b86(0x19a)]==='this';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x46fcb8,_0x230bc2){const _0x3aed57=a289_0x1224,_0x209265=_0x46fcb8();while(!![]){try{const _0x1dd237=parseInt(_0x3aed57(0x1c7))/0x1+-parseInt(_0x3aed57(0x1b8))/0x2+parseInt(_0x3aed57(0x1e3))/0x3*(parseInt(_0x3aed57(0x1b3))/0x4)+-parseInt(_0x3aed57(0x1ef))/0x5*(parseInt(_0x3aed57(0x1ca))/0x6)+parseInt(_0x3aed57(0x1e0))/0x7+parseInt(_0x3aed57(0x1e6))/0x8*(-parseInt(_0x3aed57(0x1eb))/0x9)+parseInt(_0x3aed57(0x1b6))/0xa;if(_0x1dd237===_0x230bc2)break;else _0x209265['push'](_0x209265['shift']());}catch(_0x261639){_0x209265['push'](_0x209265['shift']());}}}(a289_0x4019,0x6afa2));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';function a289_0x1224(_0x41491d,_0x140de4){_0x41491d=_0x41491d-0x1ad;const _0x4019e6=a289_0x4019();let _0x12246e=_0x4019e6[_0x41491d];return _0x12246e;}export function auditSqlJoinIndexes(_0x3d2768,_0x216ffe){const _0x107de6=a289_0x1224,_0xab6b00=[],_0x16e2f3=normalizeSqlForStaticAnalysis(_0x3d2768),_0x442993=(_0x16e2f3['error']?[]:extractJoinFacts(_0x16e2f3['sql']))[_0x107de6(0x1c9)](_0x3b22a2=>{const _0x540afa=_0x107de6;if(_0x3b22a2['unsupportedPredicate']||_0x3b22a2[_0x540afa(0x1cf)][_0x540afa(0x1b5)]===0x0)return _0xab6b00[_0x540afa(0x1e1)]({'code':_0x540afa(0x1c6),'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2['columns'],'reason':_0x3b22a2['unsupportedReason']??_0x540afa(0x1af)}),{'table':_0x3b22a2['table'],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2[_0x540afa(0x1cf)],'status':'unavailable'};const _0x22df93=resolveTableMetadata(_0x216ffe,_0x3b22a2['table']),_0x30a130=(_0x22df93?.[_0x540afa(0x1bf)]??[])['map'](_0x4aa9ef=>({'index':_0x4aa9ef,'matchedPrefix':findEqualityPrefix(_0x4aa9ef[_0x540afa(0x1cf)],_0x3b22a2[_0x540afa(0x1cf)])}))[_0x540afa(0x1b2)](_0x9ce566=>_0x9ce566[_0x540afa(0x1e9)][_0x540afa(0x1b5)]>0x0),_0x38cac3=_0x30a130[_0x540afa(0x1b7)]((_0x11bfab,_0x4de3a7)=>!_0x11bfab||_0x4de3a7['matchedPrefix'][_0x540afa(0x1b5)]>_0x11bfab[_0x540afa(0x1e9)]['length']?_0x4de3a7:_0x11bfab,_0x30a130[0x0]);if(_0x38cac3)return{'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2[_0x540afa(0x1cf)],'status':_0x540afa(0x1c1),'matchedIndex':{..._0x38cac3[_0x540afa(0x1d5)],'matchedPrefix':_0x38cac3[_0x540afa(0x1e9)]}};const _0xde8369=_0x22df93?.[_0x540afa(0x1bf)][_0x540afa(0x1b2)](_0x20fd11=>_0x20fd11[_0x540afa(0x1cf)]['some'](_0x53440b=>_0x3b22a2['columns'][_0x540afa(0x1ad)](_0x5953ea=>columnNamesMatch(_0x53440b,_0x5953ea))))??[];if(_0xde8369[_0x540afa(0x1b5)]>0x0)return _0xab6b00[_0x540afa(0x1e1)]({'code':_0x540afa(0x1b9),'table':_0x3b22a2['table'],'alias':_0x3b22a2['alias'],'columns':_0x3b22a2['columns'],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2[_0x540afa(0x1cf)],'status':_0x540afa(0x1ba),'candidateIndexes':_0xde8369};if(_0x22df93&&_0x22df93[_0x540afa(0x1ee)]!==![]&&_0x22df93[_0x540afa(0x1bf)][_0x540afa(0x1b5)]>0x0&&_0x3b22a2[_0x540afa(0x1cf)][_0x540afa(0x1b5)]>0x0)return _0xab6b00[_0x540afa(0x1e1)]({'code':_0x540afa(0x1d8),'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2[_0x540afa(0x1cf)],'reason':_0x540afa(0x1e7)}),{'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2[_0x540afa(0x1cf)],'status':_0x540afa(0x1ba)};return _0xab6b00[_0x540afa(0x1e1)]({'code':_0x540afa(0x1dc),'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2[_0x540afa(0x1cf)],'reason':_0x22df93?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2['alias'],'columns':_0x3b22a2[_0x540afa(0x1cf)],'status':'unavailable'};});return{'checked':_0x442993['length']>0x0,'joins':_0x442993,'warnings':_0xab6b00};}function extractJoinFacts(_0x2b8cb5){const _0x10a119=a289_0x1224,_0xa2aa4e=maskNestedQueries(stripSqlNoise(_0x2b8cb5)),_0x4e32ce=maskQuotedIdentifiers(_0xa2aa4e),_0x1397b0=[],_0x481f78=new Set(),_0x3ceee3=/\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 _0x51a5ae of _0xa2aa4e[_0x10a119(0x1cb)](_0x3ceee3)){const _0x530aee=_0x51a5ae['index']??0x0,_0x203743=_0x51a5ae[0x0]['search'](/\bJOIN\b/i),_0x3fa82b=_0x530aee+Math[_0x10a119(0x1ae)](0x0,_0x203743);if(!/^JOIN\b/i[_0x10a119(0x1dd)](_0x4e32ce['slice'](_0x3fa82b)))continue;_0x481f78[_0x10a119(0x1bd)](_0x3fa82b);const _0x4aadb2=normalizeIdentifier(_0x51a5ae[0x1]||_0x10a119(0x1c2)),_0x491a21=normalizeIdentifier(_0x51a5ae[0x2]??''),_0x3daf6e=normalizeIdentifier(_0x51a5ae[0x3]||_0x491a21['split']('.')['at'](-0x1)||_0x491a21),_0x229bf4=[],_0x35a367=_0x491a21==='__sq__';let _0x2c5ce7=_0x4aadb2==='right'||_0x4aadb2===_0x10a119(0x1ed)||_0x35a367,_0x946e21=_0x2c5ce7?_0x35a367?_0x10a119(0x1ce):_0x4aadb2[_0x10a119(0x1be)]()+_0x10a119(0x1b0):undefined;const _0x5cd7c1=stripOuterParentheses(_0x51a5ae[0x4]??''),_0x55be7c=_0x5cd7c1[_0x10a119(0x1e8)](MYBATIS_DYNAMIC_START_MARKER)||_0x5cd7c1[_0x10a119(0x1e8)](MYBATIS_DYNAMIC_END_MARKER),_0x561b25=_0x5cd7c1[_0x10a119(0x1e8)](MYBATIS_INCLUDE_MARKER);_0x55be7c&&(_0x2c5ce7=!![],_0x946e21??='MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.');_0x561b25&&(_0x2c5ce7=!![],_0x946e21??=_0x10a119(0x1bc));const _0x37ce9a=_0x5cd7c1[_0x10a119(0x1e4)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x10a119(0x1e4)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x10a119(0x1e4)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x37ce9a,'OR')&&(_0x2c5ce7=!![],_0x946e21??=_0x10a119(0x1e5));for(const _0x1540e8 of splitTopLevelAnd(_0x37ce9a)){const _0xc12a19=stripOuterParentheses(_0x1540e8);if(hasTopLevelKeyword(_0xc12a19,'OR')){_0x2c5ce7=!![],_0x946e21??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x196f19=splitEquality(_0xc12a19);if(!_0x196f19){containsColumnReference(_0x1540e8,_0x3daf6e)&&(_0x2c5ce7=!![]);continue;}const _0x3a8456=parseDirectColumnReference(_0x196f19[0x0],_0x3daf6e),_0xc9291a=parseDirectColumnReference(_0x196f19[0x1],_0x3daf6e),_0x20d720=containsColumnReference(_0x196f19[0x0],_0x3daf6e),_0x53c081=containsColumnReference(_0x196f19[0x1],_0x3daf6e),_0xb6896a=_0x3a8456&&!_0x53c081?_0x3a8456:_0xc9291a&&!_0x20d720?_0xc9291a:null;if(_0xb6896a&&!_0x229bf4[_0x10a119(0x1e8)](_0xb6896a))_0x229bf4[_0x10a119(0x1e1)](_0xb6896a);else!_0xb6896a&&containsColumnReference(_0x1540e8,_0x3daf6e)&&(_0x2c5ce7=!![]);}_0x1397b0[_0x10a119(0x1e1)]({'table':_0x491a21,'alias':_0x3daf6e,'columns':_0x229bf4,'unsupportedPredicate':_0x2c5ce7,'unsupportedReason':_0x946e21,'containsUnresolvedInclude':_0x561b25,'position':_0x3fa82b});}for(const _0x3b7cdb of _0x4e32ce[_0x10a119(0x1cb)](/\bJOIN\b/gi)){const _0x225019=_0x3b7cdb[_0x10a119(0x1d5)]??0x0;if(_0x481f78[_0x10a119(0x1b1)](_0x225019))continue;const _0xb264d5=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/['exec'](_0xa2aa4e[_0x10a119(0x1c4)](_0x225019+_0x3b7cdb[0x0][_0x10a119(0x1b5)])),_0x4aa919=normalizeIdentifier(_0xb264d5?.[0x1]||_0x10a119(0x1d9)),_0x4bffb3=normalizeIdentifier(_0xb264d5?.[0x2]||''),_0x47e268=isSqlClauseKeyword(_0x4bffb3)?_0x4aa919['split']('.')['at'](-0x1)||_0x4aa919:_0x4bffb3||_0x4aa919[_0x10a119(0x1bb)]('.')['at'](-0x1)||_0x4aa919;_0x1397b0[_0x10a119(0x1e1)]({'table':_0x4aa919,'alias':_0x47e268,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x225019});}const _0x51579f=_0x4e32ce['indexOf'](MYBATIS_INCLUDE_MARKER);return _0x51579f>=0x0&&!_0x1397b0[_0x10a119(0x1ad)](_0x1f38cc=>_0x1f38cc['containsUnresolvedInclude'])&&_0x1397b0[_0x10a119(0x1e1)]({'table':_0x10a119(0x1d9),'alias':_0x10a119(0x1d9),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x10a119(0x1e2),'containsUnresolvedInclude':!![],'position':_0x51579f}),_0x1397b0[_0x10a119(0x1cd)]((_0x308a80,_0x398e20)=>_0x308a80['position']-_0x398e20['position']);}function stripSqlNoise(_0x22ec28){const _0x1cc5b9=a289_0x1224,_0xba46a8=Array[_0x1cc5b9(0x1db)](_0x22ec28),_0x5b6a83=(_0x228756,_0x15b7fc)=>{for(let _0x2838e0=_0x228756;_0x2838e0<_0x15b7fc;_0x2838e0+=0x1){_0xba46a8[_0x2838e0]!=='\x0a'&&_0xba46a8[_0x2838e0]!=='\x0d'&&(_0xba46a8[_0x2838e0]='\x20');}};for(let _0x26e1f0=0x0;_0x26e1f0<_0xba46a8['length'];_0x26e1f0+=0x1){const _0x574681=_0xba46a8[_0x26e1f0],_0x54f89c=_0xba46a8[_0x26e1f0+0x1];if(_0x574681==='\x27'||_0x574681==='\x22'||_0x574681==='`'){const _0x17ca60=_0x574681,_0x4eac0f=_0x26e1f0;_0x26e1f0+=0x1;while(_0x26e1f0<_0xba46a8[_0x1cc5b9(0x1b5)]){if(_0xba46a8[_0x26e1f0]==='\x5c'&&_0x26e1f0+0x1<_0xba46a8[_0x1cc5b9(0x1b5)]){_0x26e1f0+=0x2;continue;}if(_0xba46a8[_0x26e1f0]!==_0x17ca60){_0x26e1f0+=0x1;continue;}if(_0xba46a8[_0x26e1f0+0x1]===_0x17ca60){_0x26e1f0+=0x2;continue;}break;}if(_0x17ca60==='\x27')_0x5b6a83(_0x4eac0f,Math[_0x1cc5b9(0x1de)](_0x26e1f0+0x1,_0xba46a8[_0x1cc5b9(0x1b5)]));continue;}if(_0x574681==='-'&&_0x54f89c==='-'){const _0x1bde36=_0x26e1f0;while(_0x26e1f0<_0xba46a8['length']&&_0xba46a8[_0x26e1f0]!=='\x0a')_0x26e1f0+=0x1;_0x5b6a83(_0x1bde36,_0x26e1f0);continue;}if(_0x574681==='/'&&_0x54f89c==='*'){const _0x254f2a=_0x26e1f0;_0x26e1f0+=0x2;while(_0x26e1f0<_0xba46a8[_0x1cc5b9(0x1b5)]&&!(_0xba46a8[_0x26e1f0]==='*'&&_0xba46a8[_0x26e1f0+0x1]==='/')){_0x26e1f0+=0x1;}_0x26e1f0=Math[_0x1cc5b9(0x1de)](_0x26e1f0+0x1,_0xba46a8[_0x1cc5b9(0x1b5)]-0x1),_0x5b6a83(_0x254f2a,_0x26e1f0+0x1);continue;}if(_0x574681==='#'&&_0x54f89c!=='{'){const _0x20a04d=_0x26e1f0;while(_0x26e1f0<_0xba46a8[_0x1cc5b9(0x1b5)]&&_0xba46a8[_0x26e1f0]!=='\x0a')_0x26e1f0+=0x1;_0x5b6a83(_0x20a04d,_0x26e1f0);continue;}if((_0x574681==='#'||_0x574681==='$')&&_0x54f89c==='{'){const _0x4f3ffe=_0x26e1f0;_0x26e1f0+=0x2;while(_0x26e1f0<_0xba46a8[_0x1cc5b9(0x1b5)]&&_0xba46a8[_0x26e1f0]!=='}')_0x26e1f0+=0x1;_0x5b6a83(_0x4f3ffe,Math['min'](_0x26e1f0+0x1,_0xba46a8['length']));}}return _0xba46a8[_0x1cc5b9(0x1ec)]('');}function maskQuotedIdentifiers(_0x4c0851){const _0x4fdd1f=a289_0x1224,_0x3aea56=Array[_0x4fdd1f(0x1db)](_0x4c0851);for(let _0x2f657f=0x0;_0x2f657f<_0x3aea56['length'];_0x2f657f+=0x1){const _0x2f3947=_0x3aea56[_0x2f657f];if(_0x2f3947!=='\x22'&&_0x2f3947!=='`')continue;_0x2f657f+=0x1;while(_0x2f657f<_0x3aea56[_0x4fdd1f(0x1b5)]){if(_0x3aea56[_0x2f657f]===_0x2f3947){if(_0x3aea56[_0x2f657f+0x1]===_0x2f3947){_0x3aea56[_0x2f657f]='\x20',_0x3aea56[_0x2f657f+0x1]='\x20',_0x2f657f+=0x2;continue;}break;}_0x3aea56[_0x2f657f]='\x20',_0x2f657f+=0x1;}}return _0x3aea56[_0x4fdd1f(0x1ec)]('');}function a289_0x4019(){const _0x5e2b1d=['JOIN_PREDICATE_UNSUPPORTED','586332jaCxqG','right','map','65742FmvsYI','matchAll','natural','sort','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','columns','trim','where','replace','__sq__','alias','index','\x5c$&','\x5cs*\x5c.\x5cs*[\x5cw$]+','JOIN_INDEX_MISSING','unknown','table','from','INDEX_METADATA_UNAVAILABLE','test','min','(?:^|[^\x5cw$])','4037278HOznEc','push','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','30nwEcLg','replaceAll','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','406576vZJRRy','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','includes','matchedPrefix','endsWith','144gaupOo','join','full','metadataAvailable','245uvcOFh','tableName','some','max','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','has','filter','33828HFgbDT','exec','length','5604860WTdpQB','reduce','39838lrarFz','JOIN_INDEX_NOT_USABLE','warning','split','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','add','toUpperCase','indexes','startsWith','covered','INNER','using','slice','inner'];a289_0x4019=function(){return _0x5e2b1d;};return a289_0x4019();}function maskNestedQueries(_0x2016e2){const _0x4c9e7c=a289_0x1224,_0x3f6af0=Array[_0x4c9e7c(0x1db)](_0x2016e2);for(let _0xfae532=0x0;_0xfae532<_0x3f6af0[_0x4c9e7c(0x1b5)];_0xfae532+=0x1){if(_0x3f6af0[_0xfae532]!=='(')continue;const _0x51e405=_0x2016e2['slice'](_0xfae532+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x4c9e7c(0x1dd)](_0x51e405))continue;let _0x28c30d=0x1,_0x2d8e7c=_0xfae532+0x1;for(;_0x2d8e7c<_0x3f6af0[_0x4c9e7c(0x1b5)]&&_0x28c30d>0x0;_0x2d8e7c+=0x1){if(_0x3f6af0[_0x2d8e7c]==='(')_0x28c30d+=0x1;if(_0x3f6af0[_0x2d8e7c]===')')_0x28c30d-=0x1;}if(_0x28c30d!==0x0)continue;for(let _0x40b25e=_0xfae532;_0x40b25e<_0x2d8e7c;_0x40b25e+=0x1){_0x3f6af0[_0x40b25e]='\x20';}const _0x3332a=_0x4c9e7c(0x1d3);for(let _0x91a75d=0x0;_0x91a75d<_0x3332a[_0x4c9e7c(0x1b5)]&&_0xfae532+_0x91a75d<_0x2d8e7c;_0x91a75d+=0x1){_0x3f6af0[_0xfae532+_0x91a75d]=_0x3332a[_0x91a75d];}_0xfae532=_0x2d8e7c-0x1;}return _0x3f6af0[_0x4c9e7c(0x1ec)]('');}function splitTopLevelAnd(_0x551dda){const _0x321ece=a289_0x1224,_0x329010=[];let _0x15ca71=0x0,_0x19fdcc=0x0;for(let _0x2da8ce=0x0;_0x2da8ce<_0x551dda[_0x321ece(0x1b5)];_0x2da8ce+=0x1){const _0x257df1=_0x551dda[_0x2da8ce];if(_0x257df1==='(')_0x15ca71+=0x1;if(_0x257df1===')')_0x15ca71=Math[_0x321ece(0x1ae)](0x0,_0x15ca71-0x1);_0x15ca71===0x0&&_0x551dda['slice'](_0x2da8ce)['match'](/^AND\b/i)&&(_0x2da8ce===0x0||/\s/[_0x321ece(0x1dd)](_0x551dda[_0x2da8ce-0x1]??''))&&(_0x329010[_0x321ece(0x1e1)](_0x551dda[_0x321ece(0x1c4)](_0x19fdcc,_0x2da8ce)[_0x321ece(0x1d0)]()),_0x2da8ce+=0x2,_0x19fdcc=_0x2da8ce+0x1);}const _0x2ef198=_0x551dda['slice'](_0x19fdcc)[_0x321ece(0x1d0)]();if(_0x2ef198)_0x329010[_0x321ece(0x1e1)](_0x2ef198);return _0x329010;}function hasTopLevelKeyword(_0x3e9749,_0x5b0ee8){const _0x6a51b9=a289_0x1224;let _0x241c9f=0x0;for(let _0x11cea9=0x0;_0x11cea9<_0x3e9749[_0x6a51b9(0x1b5)];_0x11cea9+=0x1){const _0x15a27b=_0x3e9749[_0x11cea9];if(_0x15a27b==='(')_0x241c9f+=0x1;if(_0x15a27b===')')_0x241c9f=Math['max'](0x0,_0x241c9f-0x1);if(_0x241c9f!==0x0)continue;const _0x1d554a=_0x3e9749[_0x6a51b9(0x1c4)](_0x11cea9,_0x11cea9+_0x5b0ee8[_0x6a51b9(0x1b5)]),_0x47ca4c=_0x3e9749[_0x11cea9-0x1]??'\x20',_0x3d797d=_0x3e9749[_0x11cea9+_0x5b0ee8[_0x6a51b9(0x1b5)]]??'\x20';if(_0x1d554a[_0x6a51b9(0x1be)]()===_0x5b0ee8[_0x6a51b9(0x1be)]()&&!/[\w$]/[_0x6a51b9(0x1dd)](_0x47ca4c)&&!/[\w$]/[_0x6a51b9(0x1dd)](_0x3d797d))return!![];}return![];}function splitEquality(_0x49436e){const _0x581ba5=a289_0x1224,_0x1b11a7=stripOuterParentheses(_0x49436e);let _0x4bcdd7=0x0,_0xab06a5;for(let _0x351863=0x0;_0x351863<_0x1b11a7['length'];_0x351863+=0x1){const _0x2922fb=_0x1b11a7[_0x351863];if(_0x2922fb==='(')_0x4bcdd7+=0x1;if(_0x2922fb===')')_0x4bcdd7=Math[_0x581ba5(0x1ae)](0x0,_0x4bcdd7-0x1);const _0x33f9de=_0x1b11a7[_0x351863-0x1]??'',_0x55b77f=_0x1b11a7[_0x351863+0x1]??'';if(_0x2922fb==='='&&_0x4bcdd7===0x0&&!/[!<>=:]/[_0x581ba5(0x1dd)](_0x33f9de)&&_0x55b77f!=='='){if(_0xab06a5!==undefined)return null;_0xab06a5=_0x351863;}}return _0xab06a5===undefined?null:[_0x1b11a7['slice'](0x0,_0xab06a5)[_0x581ba5(0x1d0)](),_0x1b11a7[_0x581ba5(0x1c4)](_0xab06a5+0x1)[_0x581ba5(0x1d0)]()];}function parseDirectColumnReference(_0x7f1fed,_0x18d5cf){const _0x34e957=a289_0x1224,_0x2337bd=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x34e957(0x1b4)](stripOuterParentheses(_0x7f1fed));if(!_0x2337bd)return null;if(normalizeIdentifier(_0x2337bd[0x1]??'')!==normalizeIdentifier(_0x18d5cf))return null;return normalizeIdentifier(_0x2337bd[0x2]??'');}function containsColumnReference(_0x3df61a,_0x3ce97e){const _0x55b60d=a289_0x1224,_0x1647c6=_0x3df61a[_0x55b60d(0x1d2)](/[`"]/g,''),_0x2f5308=_0x3ce97e[_0x55b60d(0x1d2)](/[.*+?^${}()|[\]\\]/g,_0x55b60d(0x1d6));return new RegExp(_0x55b60d(0x1df)+_0x2f5308+_0x55b60d(0x1d7),'i')['test'](_0x1647c6);}function findEqualityPrefix(_0xb32f61,_0x5116a4){const _0x3e12be=a289_0x1224,_0x34cee1=new Set(_0x5116a4[_0x3e12be(0x1c9)](normalizeIdentifier)),_0x35a1f2=[];for(const _0x34e878 of _0xb32f61){if(!_0x34cee1[_0x3e12be(0x1b1)](normalizeIdentifier(_0x34e878)))break;_0x35a1f2[_0x3e12be(0x1e1)](_0x34e878);}return _0x35a1f2;}function resolveTableMetadata(_0x5c28b2,_0x14170c){const _0x320053=a289_0x1224,_0x4f8000=normalizeIdentifier(_0x14170c),_0x37d764=_0x5c28b2['filter'](_0x236b0a=>normalizeIdentifier(_0x236b0a[_0x320053(0x1f0)])===_0x4f8000);if(_0x37d764['length']===0x1)return _0x37d764[0x0];const _0x35af31=_0x4f8000[_0x320053(0x1e8)]('.'),_0x317d13=_0x4f8000[_0x320053(0x1bb)]('.')['at'](-0x1),_0x4fa522=_0x5c28b2[_0x320053(0x1b2)](_0xda687d=>{const _0x15bf25=_0x320053,_0xc20828=normalizeIdentifier(_0xda687d[_0x15bf25(0x1f0)]);if(_0x35af31&&_0xc20828[_0x15bf25(0x1e8)]('.'))return![];return _0xc20828[_0x15bf25(0x1bb)]('.')['at'](-0x1)===_0x317d13;});return _0x4fa522[_0x320053(0x1b5)]===0x1?_0x4fa522[0x0]:undefined;}function columnNamesMatch(_0xd91390,_0x5a8a52){return normalizeIdentifier(_0xd91390)===normalizeIdentifier(_0x5a8a52);}function normalizeIdentifier(_0x5eaa9a){const _0x329742=a289_0x1224;return _0x5eaa9a[_0x329742(0x1d2)](/[`"]/g,'')['trim']()['toLowerCase']();}function isSqlClauseKeyword(_0x5e701a){const _0x15d035=a289_0x1224;return new Set(['on',_0x15d035(0x1c3),_0x15d035(0x1d1),_0x15d035(0x1ec),_0x15d035(0x1c5),'left',_0x15d035(0x1c8),'full','cross',_0x15d035(0x1cc)])[_0x15d035(0x1b1)](_0x5e701a);}function stripOuterParentheses(_0x47b4de){const _0x4ad0e8=a289_0x1224;let _0xc4c7c7=_0x47b4de[_0x4ad0e8(0x1d0)]();while(_0xc4c7c7[_0x4ad0e8(0x1c0)]('(')&&_0xc4c7c7[_0x4ad0e8(0x1ea)](')')){let _0x4f4caa=0x0,_0x22f95d=!![];for(let _0x28a57f=0x0;_0x28a57f<_0xc4c7c7[_0x4ad0e8(0x1b5)];_0x28a57f+=0x1){if(_0xc4c7c7[_0x28a57f]==='(')_0x4f4caa+=0x1;if(_0xc4c7c7[_0x28a57f]===')')_0x4f4caa-=0x1;if(_0x4f4caa===0x0&&_0x28a57f<_0xc4c7c7[_0x4ad0e8(0x1b5)]-0x1){_0x22f95d=![];break;}}if(!_0x22f95d||_0x4f4caa!==0x0)break;_0xc4c7c7=_0xc4c7c7[_0x4ad0e8(0x1c4)](0x1,-0x1)[_0x4ad0e8(0x1d0)]();}return _0xc4c7c7;}
|
|
1
|
+
(function(_0x25a497,_0x42f90d){const _0x4b226c=a289_0x468b,_0x334df9=_0x25a497();while(!![]){try{const _0x44f2e3=-parseInt(_0x4b226c(0xd2))/0x1+-parseInt(_0x4b226c(0x106))/0x2+-parseInt(_0x4b226c(0xfe))/0x3+-parseInt(_0x4b226c(0xe3))/0x4*(parseInt(_0x4b226c(0xf0))/0x5)+-parseInt(_0x4b226c(0x102))/0x6+parseInt(_0x4b226c(0xd6))/0x7+parseInt(_0x4b226c(0xdd))/0x8*(parseInt(_0x4b226c(0xd9))/0x9);if(_0x44f2e3===_0x42f90d)break;else _0x334df9['push'](_0x334df9['shift']());}catch(_0x47cf5d){_0x334df9['push'](_0x334df9['shift']());}}}(a289_0x4a61,0x337aa));function a289_0x468b(_0x589a66,_0x4e9437){_0x589a66=_0x589a66-0xc7;const _0x4a6135=a289_0x4a61();let _0x468b4d=_0x4a6135[_0x589a66];return _0x468b4d;}import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x390ffc,_0x4d2583){const _0x9e17e=a289_0x468b,_0x403bec=[],_0x7bc4f=normalizeSqlForStaticAnalysis(_0x390ffc),_0x70c320=(_0x7bc4f[_0x9e17e(0xe2)]?[]:extractJoinFacts(_0x7bc4f[_0x9e17e(0xee)]))[_0x9e17e(0xd8)](_0x25c30a=>{const _0x1cc34b=_0x9e17e;if(_0x25c30a['unsupportedPredicate']||_0x25c30a['columns'][_0x1cc34b(0xd0)]===0x0)return _0x403bec[_0x1cc34b(0xd3)]({'code':_0x1cc34b(0xf2),'table':_0x25c30a['table'],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'reason':_0x25c30a[_0x1cc34b(0x105)]??_0x1cc34b(0x10b)}),{'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'status':_0x1cc34b(0xeb)};const _0x442fe5=resolveTableMetadata(_0x4d2583,_0x25c30a[_0x1cc34b(0xed)]),_0x29b384=(_0x442fe5?.[_0x1cc34b(0x104)]??[])[_0x1cc34b(0xd8)](_0x9696f1=>({'index':_0x9696f1,'matchedPrefix':findEqualityPrefix(_0x9696f1['columns'],_0x25c30a[_0x1cc34b(0xc9)])}))[_0x1cc34b(0xcb)](_0x2f1d2f=>_0x2f1d2f['matchedPrefix'][_0x1cc34b(0xd0)]>0x0),_0x4c78c8=_0x29b384['reduce']((_0x2ada90,_0x3b6bce)=>!_0x2ada90||_0x3b6bce[_0x1cc34b(0x110)][_0x1cc34b(0xd0)]>_0x2ada90[_0x1cc34b(0x110)][_0x1cc34b(0xd0)]?_0x3b6bce:_0x2ada90,_0x29b384[0x0]);if(_0x4c78c8)return{'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'status':_0x1cc34b(0xde),'matchedIndex':{..._0x4c78c8[_0x1cc34b(0xf8)],'matchedPrefix':_0x4c78c8[_0x1cc34b(0x110)]}};const _0x48fb89=_0x442fe5?.['indexes'][_0x1cc34b(0xcb)](_0x5dbb41=>_0x5dbb41[_0x1cc34b(0xc9)][_0x1cc34b(0xd7)](_0x430229=>_0x25c30a[_0x1cc34b(0xc9)][_0x1cc34b(0xd7)](_0x5e5fb6=>columnNamesMatch(_0x430229,_0x5e5fb6))))??[];if(_0x48fb89[_0x1cc34b(0xd0)]>0x0)return _0x403bec['push']({'code':_0x1cc34b(0xf9),'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'reason':_0x1cc34b(0x108)}),{'table':_0x25c30a['table'],'alias':_0x25c30a['alias'],'columns':_0x25c30a[_0x1cc34b(0xc9)],'status':_0x1cc34b(0xf4),'candidateIndexes':_0x48fb89};if(_0x442fe5&&_0x442fe5[_0x1cc34b(0xef)]!==![]&&_0x442fe5['indexes']['length']>0x0&&_0x25c30a[_0x1cc34b(0xc9)]['length']>0x0)return _0x403bec[_0x1cc34b(0xd3)]({'code':'JOIN_INDEX_MISSING','table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a['columns'],'status':_0x1cc34b(0xf4)};return _0x403bec['push']({'code':_0x1cc34b(0xfb),'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'reason':_0x442fe5?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':_0x1cc34b(0x10d)}),{'table':_0x25c30a['table'],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a['columns'],'status':'unavailable'};});return{'checked':_0x70c320[_0x9e17e(0xd0)]>0x0,'joins':_0x70c320,'warnings':_0x403bec};}function extractJoinFacts(_0x326508){const _0x396448=a289_0x468b,_0x12f2f5=maskNestedQueries(stripSqlNoise(_0x326508)),_0x3f3669=maskQuotedIdentifiers(_0x12f2f5),_0xe57fa7=[],_0x533560=new Set(),_0x2ab49f=/\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 _0x41f5eb of _0x12f2f5['matchAll'](_0x2ab49f)){const _0x1458e5=_0x41f5eb[_0x396448(0xf8)]??0x0,_0x21c406=_0x41f5eb[0x0]['search'](/\bJOIN\b/i),_0xf36fe4=_0x1458e5+Math['max'](0x0,_0x21c406);if(!/^JOIN\b/i[_0x396448(0xe1)](_0x3f3669['slice'](_0xf36fe4)))continue;_0x533560[_0x396448(0x109)](_0xf36fe4);const _0x2a889a=normalizeIdentifier(_0x41f5eb[0x1]||'INNER'),_0x72e674=normalizeIdentifier(_0x41f5eb[0x2]??''),_0x37193c=normalizeIdentifier(_0x41f5eb[0x3]||_0x72e674[_0x396448(0xfa)]('.')['at'](-0x1)||_0x72e674),_0x330e91=[],_0x49a42d=_0x72e674===_0x396448(0xe8);let _0x2f9071=_0x2a889a===_0x396448(0xdc)||_0x2a889a===_0x396448(0xe5)||_0x49a42d,_0x5d3d12=_0x2f9071?_0x49a42d?_0x396448(0xcc):_0x2a889a['toUpperCase']()+_0x396448(0xc7):undefined;const _0x5bc63e=stripOuterParentheses(_0x41f5eb[0x4]??''),_0x155260=_0x5bc63e['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x5bc63e[_0x396448(0xf5)](MYBATIS_DYNAMIC_END_MARKER),_0xf9d466=_0x5bc63e[_0x396448(0xf5)](MYBATIS_INCLUDE_MARKER);_0x155260&&(_0x2f9071=!![],_0x5d3d12??=_0x396448(0x103));_0xf9d466&&(_0x2f9071=!![],_0x5d3d12??=_0x396448(0xd5));const _0x374960=_0x5bc63e[_0x396448(0xe6)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x396448(0xe6)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x396448(0xe6)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x374960,'OR')&&(_0x2f9071=!![],_0x5d3d12??=_0x396448(0x10e));for(const _0x2a2982 of splitTopLevelAnd(_0x374960)){const _0x24644c=stripOuterParentheses(_0x2a2982);if(hasTopLevelKeyword(_0x24644c,'OR')){_0x2f9071=!![],_0x5d3d12??=_0x396448(0x10e);continue;}const _0x1b48b0=splitEquality(_0x24644c);if(!_0x1b48b0){containsColumnReference(_0x2a2982,_0x37193c)&&(_0x2f9071=!![]);continue;}const _0x41bf0c=parseDirectColumnReference(_0x1b48b0[0x0],_0x37193c),_0x36e8ff=parseDirectColumnReference(_0x1b48b0[0x1],_0x37193c),_0x13f510=containsColumnReference(_0x1b48b0[0x0],_0x37193c),_0x5636e8=containsColumnReference(_0x1b48b0[0x1],_0x37193c),_0x459024=_0x41bf0c&&!_0x5636e8?_0x41bf0c:_0x36e8ff&&!_0x13f510?_0x36e8ff:null;if(_0x459024&&!_0x330e91[_0x396448(0xf5)](_0x459024))_0x330e91[_0x396448(0xd3)](_0x459024);else!_0x459024&&containsColumnReference(_0x2a2982,_0x37193c)&&(_0x2f9071=!![]);}_0xe57fa7[_0x396448(0xd3)]({'table':_0x72e674,'alias':_0x37193c,'columns':_0x330e91,'unsupportedPredicate':_0x2f9071,'unsupportedReason':_0x5d3d12,'containsUnresolvedInclude':_0xf9d466,'position':_0xf36fe4});}for(const _0x4de30f of _0x3f3669[_0x396448(0xf3)](/\bJOIN\b/gi)){const _0x1c64ed=_0x4de30f[_0x396448(0xf8)]??0x0;if(_0x533560[_0x396448(0xff)](_0x1c64ed))continue;const _0x200c5b=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/['exec'](_0x12f2f5['slice'](_0x1c64ed+_0x4de30f[0x0][_0x396448(0xd0)])),_0x44248f=normalizeIdentifier(_0x200c5b?.[0x1]||_0x396448(0x101)),_0x24afdf=normalizeIdentifier(_0x200c5b?.[0x2]||''),_0xc30c8b=isSqlClauseKeyword(_0x24afdf)?_0x44248f['split']('.')['at'](-0x1)||_0x44248f:_0x24afdf||_0x44248f[_0x396448(0xfa)]('.')['at'](-0x1)||_0x44248f;_0xe57fa7['push']({'table':_0x44248f,'alias':_0xc30c8b,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x1c64ed});}const _0x5ce0c6=_0x3f3669[_0x396448(0xf1)](MYBATIS_INCLUDE_MARKER);return _0x5ce0c6>=0x0&&!_0xe57fa7['some'](_0x5ad496=>_0x5ad496[_0x396448(0xec)])&&_0xe57fa7['push']({'table':_0x396448(0x101),'alias':'unknown','columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x396448(0xe9),'containsUnresolvedInclude':!![],'position':_0x5ce0c6}),_0xe57fa7[_0x396448(0xfc)]((_0x91cb53,_0x12d194)=>_0x91cb53[_0x396448(0xdb)]-_0x12d194[_0x396448(0xdb)]);}function stripSqlNoise(_0x3afd56){const _0x4b7cc1=a289_0x468b,_0x5a27bc=Array[_0x4b7cc1(0xfd)](_0x3afd56),_0x54de5b=(_0x21c4ca,_0x20d675)=>{for(let _0x2ed689=_0x21c4ca;_0x2ed689<_0x20d675;_0x2ed689+=0x1){_0x5a27bc[_0x2ed689]!=='\x0a'&&_0x5a27bc[_0x2ed689]!=='\x0d'&&(_0x5a27bc[_0x2ed689]='\x20');}};for(let _0x1852d5=0x0;_0x1852d5<_0x5a27bc[_0x4b7cc1(0xd0)];_0x1852d5+=0x1){const _0x34062f=_0x5a27bc[_0x1852d5],_0x199283=_0x5a27bc[_0x1852d5+0x1];if(_0x34062f==='\x27'||_0x34062f==='\x22'||_0x34062f==='`'){const _0x4e6638=_0x34062f,_0x2b2299=_0x1852d5;_0x1852d5+=0x1;while(_0x1852d5<_0x5a27bc['length']){if(_0x5a27bc[_0x1852d5]==='\x5c'&&_0x1852d5+0x1<_0x5a27bc[_0x4b7cc1(0xd0)]){_0x1852d5+=0x2;continue;}if(_0x5a27bc[_0x1852d5]!==_0x4e6638){_0x1852d5+=0x1;continue;}if(_0x5a27bc[_0x1852d5+0x1]===_0x4e6638){_0x1852d5+=0x2;continue;}break;}if(_0x4e6638==='\x27')_0x54de5b(_0x2b2299,Math[_0x4b7cc1(0xcf)](_0x1852d5+0x1,_0x5a27bc[_0x4b7cc1(0xd0)]));continue;}if(_0x34062f==='-'&&_0x199283==='-'){const _0x1be631=_0x1852d5;while(_0x1852d5<_0x5a27bc[_0x4b7cc1(0xd0)]&&_0x5a27bc[_0x1852d5]!=='\x0a')_0x1852d5+=0x1;_0x54de5b(_0x1be631,_0x1852d5);continue;}if(_0x34062f==='/'&&_0x199283==='*'){const _0x13e6ea=_0x1852d5;_0x1852d5+=0x2;while(_0x1852d5<_0x5a27bc['length']&&!(_0x5a27bc[_0x1852d5]==='*'&&_0x5a27bc[_0x1852d5+0x1]==='/')){_0x1852d5+=0x1;}_0x1852d5=Math[_0x4b7cc1(0xcf)](_0x1852d5+0x1,_0x5a27bc[_0x4b7cc1(0xd0)]-0x1),_0x54de5b(_0x13e6ea,_0x1852d5+0x1);continue;}if(_0x34062f==='#'&&_0x199283!=='{'){const _0x5e6a71=_0x1852d5;while(_0x1852d5<_0x5a27bc['length']&&_0x5a27bc[_0x1852d5]!=='\x0a')_0x1852d5+=0x1;_0x54de5b(_0x5e6a71,_0x1852d5);continue;}if((_0x34062f==='#'||_0x34062f==='$')&&_0x199283==='{'){const _0x227382=_0x1852d5;_0x1852d5+=0x2;while(_0x1852d5<_0x5a27bc['length']&&_0x5a27bc[_0x1852d5]!=='}')_0x1852d5+=0x1;_0x54de5b(_0x227382,Math[_0x4b7cc1(0xcf)](_0x1852d5+0x1,_0x5a27bc[_0x4b7cc1(0xd0)]));}}return _0x5a27bc['join']('');}function maskQuotedIdentifiers(_0x365518){const _0x41834d=a289_0x468b,_0x1c4f88=Array[_0x41834d(0xfd)](_0x365518);for(let _0x2ae777=0x0;_0x2ae777<_0x1c4f88[_0x41834d(0xd0)];_0x2ae777+=0x1){const _0x5057c5=_0x1c4f88[_0x2ae777];if(_0x5057c5!=='\x22'&&_0x5057c5!=='`')continue;_0x2ae777+=0x1;while(_0x2ae777<_0x1c4f88['length']){if(_0x1c4f88[_0x2ae777]===_0x5057c5){if(_0x1c4f88[_0x2ae777+0x1]===_0x5057c5){_0x1c4f88[_0x2ae777]='\x20',_0x1c4f88[_0x2ae777+0x1]='\x20',_0x2ae777+=0x2;continue;}break;}_0x1c4f88[_0x2ae777]='\x20',_0x2ae777+=0x1;}}return _0x1c4f88[_0x41834d(0xf7)]('');}function maskNestedQueries(_0x220449){const _0x5ee8c8=a289_0x468b,_0xaf21d2=Array[_0x5ee8c8(0xfd)](_0x220449);for(let _0x415043=0x0;_0x415043<_0xaf21d2[_0x5ee8c8(0xd0)];_0x415043+=0x1){if(_0xaf21d2[_0x415043]!=='(')continue;const _0x3818b4=_0x220449[_0x5ee8c8(0xca)](_0x415043+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x5ee8c8(0xe1)](_0x3818b4))continue;let _0x4ad856=0x1,_0x382b1c=_0x415043+0x1;for(;_0x382b1c<_0xaf21d2[_0x5ee8c8(0xd0)]&&_0x4ad856>0x0;_0x382b1c+=0x1){if(_0xaf21d2[_0x382b1c]==='(')_0x4ad856+=0x1;if(_0xaf21d2[_0x382b1c]===')')_0x4ad856-=0x1;}if(_0x4ad856!==0x0)continue;for(let _0x595ed5=_0x415043;_0x595ed5<_0x382b1c;_0x595ed5+=0x1){_0xaf21d2[_0x595ed5]='\x20';}const _0x1cee27=_0x5ee8c8(0xe8);for(let _0x4a833a=0x0;_0x4a833a<_0x1cee27[_0x5ee8c8(0xd0)]&&_0x415043+_0x4a833a<_0x382b1c;_0x4a833a+=0x1){_0xaf21d2[_0x415043+_0x4a833a]=_0x1cee27[_0x4a833a];}_0x415043=_0x382b1c-0x1;}return _0xaf21d2[_0x5ee8c8(0xf7)]('');}function a289_0x4a61(){const _0x5c101d=['min','length','toLowerCase','68530LOdEgi','push','alias','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','1149771eUUcWh','some','map','36441UnlsfY','where','position','right','2776jpCLaN','covered','trim','cross','test','error','19000eBsAVW','max','full','replaceAll','replace','__sq__','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','(?:^|[^\x5cw$])','unavailable','containsUnresolvedInclude','table','sql','metadataAvailable','410wFmvIP','indexOf','JOIN_PREDICATE_UNSUPPORTED','matchAll','warning','includes','left','join','index','JOIN_INDEX_NOT_USABLE','split','INDEX_METADATA_UNAVAILABLE','sort','from','359223zYAJfv','has','natural','unknown','2528856PwnVYs','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','indexes','unsupportedReason','718302gtpmDs','\x5cs*\x5c.\x5cs*[\x5cw$]+','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','add','exec','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','\x5c$&','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','tableName','matchedPrefix','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','inner','columns','slice','filter','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','toUpperCase','endsWith'];a289_0x4a61=function(){return _0x5c101d;};return a289_0x4a61();}function splitTopLevelAnd(_0x880013){const _0x1033db=a289_0x468b,_0x40645b=[];let _0x5876bf=0x0,_0x5cba2b=0x0;for(let _0x156b07=0x0;_0x156b07<_0x880013[_0x1033db(0xd0)];_0x156b07+=0x1){const _0x5c5508=_0x880013[_0x156b07];if(_0x5c5508==='(')_0x5876bf+=0x1;if(_0x5c5508===')')_0x5876bf=Math['max'](0x0,_0x5876bf-0x1);_0x5876bf===0x0&&_0x880013[_0x1033db(0xca)](_0x156b07)['match'](/^AND\b/i)&&(_0x156b07===0x0||/\s/['test'](_0x880013[_0x156b07-0x1]??''))&&(_0x40645b[_0x1033db(0xd3)](_0x880013['slice'](_0x5cba2b,_0x156b07)[_0x1033db(0xdf)]()),_0x156b07+=0x2,_0x5cba2b=_0x156b07+0x1);}const _0x223d13=_0x880013[_0x1033db(0xca)](_0x5cba2b)['trim']();if(_0x223d13)_0x40645b[_0x1033db(0xd3)](_0x223d13);return _0x40645b;}function hasTopLevelKeyword(_0x32960f,_0x3fd956){const _0x4903c7=a289_0x468b;let _0x32d006=0x0;for(let _0x49c5ac=0x0;_0x49c5ac<_0x32960f[_0x4903c7(0xd0)];_0x49c5ac+=0x1){const _0x589ef0=_0x32960f[_0x49c5ac];if(_0x589ef0==='(')_0x32d006+=0x1;if(_0x589ef0===')')_0x32d006=Math[_0x4903c7(0xe4)](0x0,_0x32d006-0x1);if(_0x32d006!==0x0)continue;const _0x589e13=_0x32960f[_0x4903c7(0xca)](_0x49c5ac,_0x49c5ac+_0x3fd956['length']),_0x19a220=_0x32960f[_0x49c5ac-0x1]??'\x20',_0x487ed8=_0x32960f[_0x49c5ac+_0x3fd956['length']]??'\x20';if(_0x589e13[_0x4903c7(0xcd)]()===_0x3fd956[_0x4903c7(0xcd)]()&&!/[\w$]/[_0x4903c7(0xe1)](_0x19a220)&&!/[\w$]/[_0x4903c7(0xe1)](_0x487ed8))return!![];}return![];}function splitEquality(_0x344fe4){const _0x4eab2e=a289_0x468b,_0x891963=stripOuterParentheses(_0x344fe4);let _0x35963b=0x0,_0x544b6b;for(let _0x1fe6d9=0x0;_0x1fe6d9<_0x891963[_0x4eab2e(0xd0)];_0x1fe6d9+=0x1){const _0x5df85a=_0x891963[_0x1fe6d9];if(_0x5df85a==='(')_0x35963b+=0x1;if(_0x5df85a===')')_0x35963b=Math[_0x4eab2e(0xe4)](0x0,_0x35963b-0x1);const _0x4b43de=_0x891963[_0x1fe6d9-0x1]??'',_0x1e04d3=_0x891963[_0x1fe6d9+0x1]??'';if(_0x5df85a==='='&&_0x35963b===0x0&&!/[!<>=:]/[_0x4eab2e(0xe1)](_0x4b43de)&&_0x1e04d3!=='='){if(_0x544b6b!==undefined)return null;_0x544b6b=_0x1fe6d9;}}return _0x544b6b===undefined?null:[_0x891963['slice'](0x0,_0x544b6b)[_0x4eab2e(0xdf)](),_0x891963[_0x4eab2e(0xca)](_0x544b6b+0x1)[_0x4eab2e(0xdf)]()];}function parseDirectColumnReference(_0x7d65cd,_0x33b103){const _0xeea628=a289_0x468b,_0x3a15ca=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0xeea628(0x10a)](stripOuterParentheses(_0x7d65cd));if(!_0x3a15ca)return null;if(normalizeIdentifier(_0x3a15ca[0x1]??'')!==normalizeIdentifier(_0x33b103))return null;return normalizeIdentifier(_0x3a15ca[0x2]??'');}function containsColumnReference(_0x5d9df5,_0x2d451e){const _0x1af310=a289_0x468b,_0x3ae670=_0x5d9df5[_0x1af310(0xe7)](/[`"]/g,''),_0x3b083a=_0x2d451e[_0x1af310(0xe7)](/[.*+?^${}()|[\]\\]/g,_0x1af310(0x10c));return new RegExp(_0x1af310(0xea)+_0x3b083a+_0x1af310(0x107),'i')[_0x1af310(0xe1)](_0x3ae670);}function findEqualityPrefix(_0x49a02f,_0x4a0a9b){const _0x20c867=new Set(_0x4a0a9b['map'](normalizeIdentifier)),_0xce6f0=[];for(const _0x48b2e9 of _0x49a02f){if(!_0x20c867['has'](normalizeIdentifier(_0x48b2e9)))break;_0xce6f0['push'](_0x48b2e9);}return _0xce6f0;}function resolveTableMetadata(_0x32939c,_0x4256d8){const _0x385214=a289_0x468b,_0x3c7505=normalizeIdentifier(_0x4256d8),_0xf6dc0e=_0x32939c['filter'](_0x3cd3af=>normalizeIdentifier(_0x3cd3af[_0x385214(0x10f)])===_0x3c7505);if(_0xf6dc0e[_0x385214(0xd0)]===0x1)return _0xf6dc0e[0x0];const _0x29da74=_0x3c7505[_0x385214(0xf5)]('.'),_0x409efb=_0x3c7505[_0x385214(0xfa)]('.')['at'](-0x1),_0x3e25d7=_0x32939c[_0x385214(0xcb)](_0x1f011b=>{const _0x3e1db5=_0x385214,_0x456978=normalizeIdentifier(_0x1f011b[_0x3e1db5(0x10f)]);if(_0x29da74&&_0x456978['includes']('.'))return![];return _0x456978[_0x3e1db5(0xfa)]('.')['at'](-0x1)===_0x409efb;});return _0x3e25d7[_0x385214(0xd0)]===0x1?_0x3e25d7[0x0]:undefined;}function columnNamesMatch(_0x40adaf,_0x47f27b){return normalizeIdentifier(_0x40adaf)===normalizeIdentifier(_0x47f27b);}function normalizeIdentifier(_0x4d3aea){const _0x4697b8=a289_0x468b;return _0x4d3aea[_0x4697b8(0xe7)](/[`"]/g,'')[_0x4697b8(0xdf)]()[_0x4697b8(0xd1)]();}function isSqlClauseKeyword(_0x2f1ef7){const _0x2cd4e2=a289_0x468b;return new Set(['on','using',_0x2cd4e2(0xda),_0x2cd4e2(0xf7),_0x2cd4e2(0xc8),_0x2cd4e2(0xf6),_0x2cd4e2(0xdc),_0x2cd4e2(0xe5),_0x2cd4e2(0xe0),_0x2cd4e2(0x100)])[_0x2cd4e2(0xff)](_0x2f1ef7);}function stripOuterParentheses(_0x387440){const _0x12b830=a289_0x468b;let _0x12ee9d=_0x387440['trim']();while(_0x12ee9d['startsWith']('(')&&_0x12ee9d[_0x12b830(0xce)](')')){let _0x692cb=0x0,_0x176c75=!![];for(let _0x55ef67=0x0;_0x55ef67<_0x12ee9d['length'];_0x55ef67+=0x1){if(_0x12ee9d[_0x55ef67]==='(')_0x692cb+=0x1;if(_0x12ee9d[_0x55ef67]===')')_0x692cb-=0x1;if(_0x692cb===0x0&&_0x55ef67<_0x12ee9d[_0x12b830(0xd0)]-0x1){_0x176c75=![];break;}}if(!_0x176c75||_0x692cb!==0x0)break;_0x12ee9d=_0x12ee9d[_0x12b830(0xca)](0x1,-0x1)['trim']();}return _0x12ee9d;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a290_0x2d1e23=a290_0x19f4;function a290_0x646a(){const _0x279131=['1972040CniNDS','2772702PeFRoX','/sql','sql-trash','5289759stgyYU','1446784iisWfe','3070034TdVmsC','299016davfnX','3wwcVRZ','sql.lock.json','5970712NxkwNN','7DlCasY'];a290_0x646a=function(){return _0x279131;};return a290_0x646a();}function a290_0x19f4(_0x435326,_0x46de44){_0x435326=_0x435326-0x198;const _0x646ab0=a290_0x646a();let _0x19f40b=_0x646ab0[_0x435326];return _0x19f40b;}(function(_0x29dd7f,_0x287601){const _0x176b46=a290_0x19f4,_0x5988cb=_0x29dd7f();while(!![]){try{const _0x540b1f=-parseInt(_0x176b46(0x19d))/0x1+parseInt(_0x176b46(0x19c))/0x2*(parseInt(_0x176b46(0x19e))/0x3)+parseInt(_0x176b46(0x19b))/0x4+-parseInt(_0x176b46(0x1a2))/0x5+-parseInt(_0x176b46(0x1a3))/0x6+parseInt(_0x176b46(0x1a1))/0x7*(parseInt(_0x176b46(0x1a0))/0x8)+-parseInt(_0x176b46(0x19a))/0x9;if(_0x540b1f===_0x287601)break;else _0x5988cb['push'](_0x5988cb['shift']());}catch(_0x2ef921){_0x5988cb['push'](_0x5988cb['shift']());}}}(a290_0x646a,0xdbab0));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a290_0x2d1e23(0x19f),TRASH_DIR_NAME=a290_0x2d1e23(0x199);export function loadSqlProjectConfig(_0x2a2175,_0x592d21){const _0x2a8868=a290_0x2d1e23,_0x1b1a50=resolve(_0x592d21??findProjectRootDirectory()),_0x1cc292=DOT_DIR+_0x2a8868(0x198),_0x16c59a=_0x1cc292+'/'+_0x2a2175;return{'projectRoot':_0x1b1a50,'appCode':_0x2a2175,'sqlWorkspaceRoot':_0x1cc292,'sqlRoot':_0x16c59a,'sqlRootDir':resolve(_0x1b1a50,DOT_DIR,'sql',_0x2a2175),'lockFilePath':resolve(_0x1b1a50,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x1b1a50,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x55d473,_0x749abe){const _0x40efcb=a291_0xec3d,_0x52107f=_0x55d473();while(!![]){try{const _0x599c81=parseInt(_0x40efcb(0xb9))/0x1+-parseInt(_0x40efcb(0xac))/0x2*(-parseInt(_0x40efcb(0xbc))/0x3)+-parseInt(_0x40efcb(0xc3))/0x4+parseInt(_0x40efcb(0xbe))/0x5+-parseInt(_0x40efcb(0xb8))/0x6+-parseInt(_0x40efcb(0xb3))/0x7*(parseInt(_0x40efcb(0xab))/0x8)+parseInt(_0x40efcb(0xb5))/0x9;if(_0x599c81===_0x749abe)break;else _0x52107f['push'](_0x52107f['shift']());}catch(_0x4c11ae){_0x52107f['push'](_0x52107f['shift']());}}}(a291_0x1cbd,0x2fe7b));function a291_0x1cbd(){const _0x26dcdf=['sqlName','dbName','push','1433816TmxYtj','name','8waWwdf','2SmkTEH','dbId','ENOENT','sqlRootDir','mode','split','slice','1342075theGlp','isDirectory','2768769hQRfXw','replace','mybatisXml','1070760hloeFW','108381SbPoJH','sql','sqlCode','813519pdBJWU','.xml','1188315WyomAz','length'];a291_0x1cbd=function(){return _0x26dcdf;};return a291_0x1cbd();}import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x70da80){const _0x29d11b=a291_0xec3d;if(_0x70da80==='.sql')return _0x29d11b(0xba);if(_0x70da80===_0x29d11b(0xbd))return _0x29d11b(0xb7);return undefined;}async function scanSqlFilesRecursively(_0x576f39,_0x401077){const _0x375893=a291_0xec3d,_0x566552=[];try{const _0x26d2c9=await readdir(_0x576f39,{'withFileTypes':!![]});for(const _0x46af10 of _0x26d2c9){const _0x5158a5=join(_0x576f39,_0x46af10[_0x375893(0xaa)]);if(_0x46af10[_0x375893(0xb4)]()){_0x566552[_0x375893(0xc2)](...await scanSqlFilesRecursively(_0x5158a5,_0x401077));continue;}if(!_0x46af10['isFile']())continue;const _0x13b3ea=extname(_0x46af10[_0x375893(0xaa)])['toLowerCase'](),_0xbfc813=extensionToMode(_0x13b3ea);if(!_0xbfc813)continue;const _0x24bca0=relative(_0x401077,_0x5158a5)[_0x375893(0xb6)](/\\/g,'/'),_0x5eaedd=_0x24bca0[_0x375893(0xb1)]('/')['filter'](Boolean),_0xc64ec3=parseSqlPath(_0x5eaedd,_0x46af10[_0x375893(0xaa)],_0x13b3ea);if(!_0xc64ec3)continue;_0x566552[_0x375893(0xc2)]({'sqlCode':_0xc64ec3[_0x375893(0xbb)],'sqlName':_0xc64ec3[_0x375893(0xc0)],'dbDirectory':_0x5eaedd[0x0],'filePath':_0x5158a5,'relativePath':_0x24bca0,'lockKey':_0xc64ec3[_0x375893(0xbb)],'mode':_0xbfc813});}}catch(_0x42d2bc){if(_0x42d2bc['code']!==_0x375893(0xae))throw _0x42d2bc;}return _0x566552;}export async function scanLocalSqlQueries(_0x58c7d9){const _0x418b3c=a291_0xec3d;return scanSqlFilesRecursively(_0x58c7d9[_0x418b3c(0xaf)],_0x58c7d9['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x52f180,_0x4f14bd,_0x32afd0){const _0x4c6859=a291_0xec3d,_0xaee4c0=_0x32afd0?.['path']||(_0x32afd0?.[_0x4c6859(0xc0)]||_0x32afd0?.[_0x4c6859(0xc1)]?buildSqlRelativePath(_0x4f14bd,_0x32afd0?.[_0x4c6859(0xc0)],_0x32afd0?.[_0x4c6859(0xc1)],_0x32afd0?.[_0x4c6859(0xb0)]||_0x4c6859(0xba),_0x32afd0?.[_0x4c6859(0xad)]):buildDefaultSqlFileName(_0x4f14bd,_0x32afd0?.['mode']||_0x4c6859(0xba)));return join(_0x52f180[_0x4c6859(0xaf)],_0xaee4c0);}export async function directoryExists(_0x177c11){const _0x488b9f=a291_0xec3d;try{const _0x5e0fcb=await stat(_0x177c11);return _0x5e0fcb[_0x488b9f(0xb4)]();}catch{return![];}}function a291_0xec3d(_0x18bea8,_0x39c1e1){_0x18bea8=_0x18bea8-0xaa;const _0x1cbdba=a291_0x1cbd();let _0xec3d1c=_0x1cbdba[_0x18bea8];return _0xec3d1c;}function parseSqlPath(_0x8b3375,_0x2d6f27,_0x3b093e){const _0xc56afb=a291_0xec3d,_0xa46082=_0x2d6f27[_0xc56afb(0xb2)](0x0,-_0x3b093e[_0xc56afb(0xbf)]);if(_0x8b3375[_0xc56afb(0xbf)]<0x2)return null;const _0xee63b3=_0xa46082['indexOf']('_');if(_0xee63b3<=0x0||_0xee63b3>=_0xa46082['length']-0x1)return null;const _0x2a1de9=_0xa46082[_0xc56afb(0xb2)](0x0,_0xee63b3);if(!isLikelySqlCode(_0x2a1de9))return null;return{'sqlCode':_0x2a1de9,'sqlName':_0xa46082[_0xc56afb(0xb2)](_0xee63b3+0x1)};}function isLikelySqlCode(_0x706f5f){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0x706f5f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a292_0x2f3b(_0x2f5124,_0x599aa5){_0x2f5124=_0x2f5124-0x107;const _0x92d56=a292_0x92d5();let _0x2f3b4d=_0x92d56[_0x2f5124];return _0x2f3b4d;}(function(_0x30cf28,_0x17cd54){const _0x2ee314=a292_0x2f3b,_0xf57b12=_0x30cf28();while(!![]){try{const _0x3dbbce=parseInt(_0x2ee314(0x10b))/0x1*(-parseInt(_0x2ee314(0x113))/0x2)+parseInt(_0x2ee314(0x107))/0x3*(-parseInt(_0x2ee314(0x10e))/0x4)+parseInt(_0x2ee314(0x112))/0x5*(parseInt(_0x2ee314(0x10f))/0x6)+-parseInt(_0x2ee314(0x109))/0x7+-parseInt(_0x2ee314(0x10d))/0x8+-parseInt(_0x2ee314(0x111))/0x9+parseInt(_0x2ee314(0x10a))/0xa*(parseInt(_0x2ee314(0x115))/0xb);if(_0x3dbbce===_0x17cd54)break;else _0xf57b12['push'](_0xf57b12['shift']());}catch(_0x2c2b8){_0xf57b12['push'](_0xf57b12['shift']());}}}(a292_0x92d5,0x4cad6));import{readFile}from'node:fs/promises';import a292_0x3d4fae from'node:crypto';export function computeSqlContentHash(_0x4d208b){const _0x32eb22=a292_0x2f3b;return a292_0x3d4fae[_0x32eb22(0x10c)]('md5')[_0x32eb22(0x114)](_0x4d208b)[_0x32eb22(0x108)](_0x32eb22(0x116));}export async function computeSqlFileHash(_0x49b40c){const _0x9db644=a292_0x2f3b,_0x38b444=await readFile(_0x49b40c,_0x9db644(0x110));return computeSqlContentHash(_0x38b444);}function a292_0x92d5(){const _0x2b9a08=['24TVvxnX','utf8','1664406zjVOkh','98390Qiaboo','7408fVMCwb','update','4873PLzyTR','hex','3SzHScx','digest','1406419wOVcSj','42290RjRGjx','136pplkkv','createHash','1027944oJRApv','2480004thxZlS'];a292_0x92d5=function(){return _0x2b9a08;};return a292_0x92d5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x10a308,_0x445f7d){const _0x5b39ba=a293_0x572e,_0x2f31f0=_0x10a308();while(!![]){try{const _0x2c1576=parseInt(_0x5b39ba(0xef))/0x1*(-parseInt(_0x5b39ba(0xec))/0x2)+parseInt(_0x5b39ba(0xe4))/0x3+-parseInt(_0x5b39ba(0xe2))/0x4+parseInt(_0x5b39ba(0xe0))/0x5*(parseInt(_0x5b39ba(0xdd))/0x6)+parseInt(_0x5b39ba(0xea))/0x7*(parseInt(_0x5b39ba(0xe7))/0x8)+parseInt(_0x5b39ba(0xdc))/0x9+parseInt(_0x5b39ba(0xed))/0xa*(-parseInt(_0x5b39ba(0xe8))/0xb);if(_0x2c1576===_0x445f7d)break;else _0x2f31f0['push'](_0x2f31f0['shift']());}catch(_0x1c8317){_0x2f31f0['push'](_0x2f31f0['shift']());}}}(a293_0x442b,0xdf1a9));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a293_0x442b(){const _0x29663f=['\x22\x20vs\x20lock\x20\x22','utf8','7283885oksAkK','stringify','558060INCyvP','ENOENT','407217CYRGXG','sqlRoot','apps','2224cXnGoM','182677SHXIIL','lastSync','10129eoimSx','code','106KEapbM','830UHDrwU','\x22.\x20','7907SoNVKU',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','7704162vOBNkj','6ZcgGzw'];a293_0x442b=function(){return _0x29663f;};return a293_0x442b();}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x1261e4,_0x43e01b,_0x2515a2,_0x3e32b8){const _0x430578=a293_0x572e,_0x1d0cce=_0x1261e4??createEmptySqlLock();let _0x2065ae=_0x1d0cce['apps'][_0x43e01b];if(!_0x2065ae)return _0x2065ae={'sqlRoot':_0x2515a2,'lastSync':'','sqls':{}},_0x1d0cce[_0x430578(0xe6)][_0x43e01b]=_0x2065ae,{'lockData':_0x1d0cce,'appLock':_0x2065ae};if(!_0x2065ae[_0x430578(0xe5)])_0x2065ae[_0x430578(0xe5)]=_0x2515a2;else{if(_0x2065ae[_0x430578(0xe5)]!==_0x2515a2)throw new Error(_0x3e32b8+_0x430578(0xdb)+_0x2515a2+_0x430578(0xde)+_0x2065ae[_0x430578(0xe5)]+_0x430578(0xee)+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x2065ae['sqls']&&(_0x2065ae['sqls']={}),!_0x2065ae[_0x430578(0xe9)]&&(_0x2065ae[_0x430578(0xe9)]=''),{'lockData':_0x1d0cce,'appLock':_0x2065ae};}function a293_0x572e(_0x2ad66d,_0x5650e2){_0x2ad66d=_0x2ad66d-0xdb;const _0x442b36=a293_0x442b();let _0x572e18=_0x442b36[_0x2ad66d];return _0x572e18;}export async function readSqlLockFile(_0x56cdbf){const _0x107e6a=a293_0x572e;try{const _0x430ba3=await readFile(_0x56cdbf,_0x107e6a(0xdf));return JSON['parse'](_0x430ba3);}catch(_0x2ef28e){if(_0x2ef28e[_0x107e6a(0xeb)]===_0x107e6a(0xe3))return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x2ef28e));}}export async function writeSqlLockFile(_0x4853c2,_0x38d8bb){const _0x4bbcbb=a293_0x572e;await mkdir(dirname(_0x4853c2),{'recursive':!![]}),await writeFile(_0x4853c2,JSON[_0x4bbcbb(0xe1)](_0x38d8bb,null,0x2),_0x4bbcbb(0xdf));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38bab1,_0xba7efb){const _0x174ded=a295_0x5c31,_0x3bb649=_0x38bab1();while(!![]){try{const _0x4b4d52=parseInt(_0x174ded(0x1fa))/0x1+parseInt(_0x174ded(0x1f8))/0x2*(parseInt(_0x174ded(0x1fd))/0x3)+parseInt(_0x174ded(0x1f0))/0x4*(parseInt(_0x174ded(0x1f2))/0x5)+parseInt(_0x174ded(0x1ff))/0x6+parseInt(_0x174ded(0x1ee))/0x7*(parseInt(_0x174ded(0x1fc))/0x8)+-parseInt(_0x174ded(0x1f4))/0x9*(parseInt(_0x174ded(0x1f7))/0xa)+-parseInt(_0x174ded(0x1fb))/0xb;if(_0x4b4d52===_0xba7efb)break;else _0x3bb649['push'](_0x3bb649['shift']());}catch(_0x566a61){_0x3bb649['push'](_0x3bb649['shift']());}}}(a295_0x9601,0xd8145));import{detectSqlSourceMode}from'../../core/sql-validator.js';export function detectSqlMode(_0xfd1cfd){return detectSqlSourceMode(_0xfd1cfd);}export function getSqlFileExtension(_0x41d892){const _0x4ba686=a295_0x5c31;return _0x41d892===_0x4ba686(0x1f1)?_0x4ba686(0x1ef):_0x4ba686(0x1f5);}function a295_0x5c31(_0x1e2cf7,_0x510a4b){_0x1e2cf7=_0x1e2cf7-0x1ee;const _0x960169=a295_0x9601();let _0x5c31fc=_0x960169[_0x1e2cf7];return _0x5c31fc;}export function buildDefaultSqlFileName(_0x294d77,_0x4e2808){return''+_0x294d77+getSqlFileExtension(_0x4e2808);}export function sanitizeSqlPathSegment(_0x3d7a37,_0x3bd840){const _0x2cb773=a295_0x5c31,_0x36c037=String(_0x3d7a37??'')['trim'](),_0x4d6b56=_0x36c037['replace'](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x2cb773(0x1f9)](/\s+/g,'-')['replace'](/-+/g,'-')[_0x2cb773(0x1f9)](/^\.+/,'')[_0x2cb773(0x1f9)](/\.+$/,'')['replace'](/^-+/,'')[_0x2cb773(0x1f9)](/-+$/,'');return _0x4d6b56||_0x3bd840;}function a295_0x9601(){const _0x3d815e=['unknown-db','15116814oFjkol','.sql','db-','10RJLbNr','1658662yWLbzC','replace','874880KFteZI','29338045wFmXkb','12057160UaaWVG','3UJVnEj','unknown-sql','5438130rCoTbO','7fxzTLP','.xml','4456364nVrICR','mybatisXml','5Bjuyvi'];a295_0x9601=function(){return _0x3d815e;};return a295_0x9601();}export function buildDbDirectoryName(_0x17b27c,_0x4a5c54){const _0x4e102e=a295_0x5c31;return sanitizeSqlPathSegment(_0x17b27c,_0x4a5c54!=null?_0x4e102e(0x1f6)+_0x4a5c54:_0x4e102e(0x1f3));}export function buildSqlRelativePath(_0x2d3756,_0x50a917,_0x41e544,_0x150837,_0x419d3d){const _0x2e842a=a295_0x5c31,_0x54724c=buildDbDirectoryName(_0x41e544,_0x419d3d),_0x5a3967=sanitizeSqlPathSegment(_0x2d3756,_0x2e842a(0x1fe)),_0x328324=sanitizeSqlPathSegment(_0x50a917,_0x5a3967);return _0x54724c+'/'+_0x5a3967+'_'+_0x328324+getSqlFileExtension(_0x150837);}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SQL 内容校验(轻量级)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* 供独立 sql validate 与索引提示使用,不接入保存或推送门禁。
|
|
5
|
+
* 只提供本地静态提示,不证明完整语法、模板展开、权限或执行安全。
|
|
6
6
|
* 从 lovrabet-dataset-mcp 的 sql-parser.ts 提取核心逻辑,无外部依赖。
|
|
7
7
|
*/
|
|
8
8
|
export interface SqlTypeInfo {
|
|
9
9
|
type: "SELECT" | "INSERT" | "UPDATE" | "DELETE" | "DDL" | "UNKNOWN";
|
|
10
|
+
/** Ordinary SELECT without locking clauses; not a database authorization check. */
|
|
10
11
|
isSelectOnly: boolean;
|
|
12
|
+
isLockingRead?: boolean;
|
|
11
13
|
isDangerous: boolean;
|
|
12
14
|
reason?: string;
|
|
13
15
|
}
|
|
@@ -29,6 +31,7 @@ export declare const MYBATIS_DYNAMIC_START_MARKER = "__RABETBASE_MYBATIS_DYNAMIC
|
|
|
29
31
|
export declare const MYBATIS_DYNAMIC_END_MARKER = "__RABETBASE_MYBATIS_DYNAMIC_END__";
|
|
30
32
|
export declare const MYBATIS_INCLUDE_MARKER = "__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__";
|
|
31
33
|
export declare function normalizeSqlForStaticAnalysis(sqlContent: string): SqlStaticAnalysisSource;
|
|
34
|
+
export declare function detectSqlSourceMode(content: string): "sql" | "mybatisXml";
|
|
32
35
|
export declare function detectSqlType(sqlContent: string): SqlTypeInfo;
|
|
33
36
|
export declare function validateSql(sqlContent: string): SqlValidation;
|
|
34
37
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a296_0x30ed2f=a296_0x2dd3;(function(_0x52b020,_0xd2f2c8){const _0x50a24c=a296_0x2dd3,_0xfc483d=_0x52b020();while(!![]){try{const _0x58ccb2=-parseInt(_0x50a24c(0x162))/0x1+parseInt(_0x50a24c(0x14a))/0x2*(-parseInt(_0x50a24c(0x193))/0x3)+-parseInt(_0x50a24c(0x163))/0x4*(parseInt(_0x50a24c(0x169))/0x5)+parseInt(_0x50a24c(0x174))/0x6*(-parseInt(_0x50a24c(0x17b))/0x7)+parseInt(_0x50a24c(0x170))/0x8*(parseInt(_0x50a24c(0x16d))/0x9)+parseInt(_0x50a24c(0x15f))/0xa*(parseInt(_0x50a24c(0x18e))/0xb)+parseInt(_0x50a24c(0x185))/0xc;if(_0x58ccb2===_0xd2f2c8)break;else _0xfc483d['push'](_0xfc483d['shift']());}catch(_0x382c27){_0xfc483d['push'](_0xfc483d['shift']());}}}(a296_0x2b2b,0xeed2a));const MYBATIS_OUTER_TAGS=new Map([[a296_0x30ed2f(0x18f),a296_0x30ed2f(0x165)],[a296_0x30ed2f(0x1a1),a296_0x30ed2f(0x171)],['update',a296_0x30ed2f(0x149)],['delete',a296_0x30ed2f(0x178)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a296_0x30ed2f(0x19e),a296_0x30ed2f(0x168),'choose','when',a296_0x30ed2f(0x17c),a296_0x30ed2f(0x14d),a296_0x30ed2f(0x177),a296_0x30ed2f(0x155),a296_0x30ed2f(0x151),a296_0x30ed2f(0x17d)]),MYBATIS_BRANCH_TAGS=new Set(['if',a296_0x30ed2f(0x168),a296_0x30ed2f(0x18a),'when',a296_0x30ed2f(0x17c)]);export const MYBATIS_DYNAMIC_START_MARKER='__RABETBASE_MYBATIS_DYNAMIC_START__';export const MYBATIS_DYNAMIC_END_MARKER='__RABETBASE_MYBATIS_DYNAMIC_END__';export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';function a296_0x2dd3(_0x4072e5,_0x38260e){_0x4072e5=_0x4072e5-0x147;const _0x2b2b0f=a296_0x2b2b();let _0x2dd382=_0x2b2b0f[_0x4072e5];return _0x2dd382;}const UNRESOLVED_SQL_FRAGMENT='__RABETBASE_UNRESOLVED_SQL_FRAGMENT__',MYBATIS_OUTER_TAG_PATTERN=new RegExp(a296_0x30ed2f(0x15b)+[...MYBATIS_OUTER_TAGS[a296_0x30ed2f(0x181)]()]['join']('|')+a296_0x30ed2f(0x15e),'i');export function normalizeSqlForStaticAnalysis(_0x573e19){const _0x9d07e3=a296_0x30ed2f,_0x51ac93=typeof _0x573e19==='string'?_0x573e19:'';if(!startsWithMybatisStatementWrapper(_0x51ac93))return{'sql':_0x51ac93,'mode':_0x9d07e3(0x19b)};let _0x15a310=0x0,_0x34f329='',_0x3830c2,_0x3817d2=![],_0x2c2355=![];const _0x53336c=[];while(_0x15a310<_0x51ac93['length']){if(_0x51ac93[_0x9d07e3(0x150)](_0x9d07e3(0x164),_0x15a310)){const _0x3f352b=_0x51ac93[_0x9d07e3(0x186)](_0x9d07e3(0x156),_0x15a310+0x4);if(_0x3f352b<0x0)return invalidMybatisSource(_0x9d07e3(0x194));_0x34f329+='\x20',_0x15a310=_0x3f352b+0x3;continue;}if(_0x51ac93[_0x9d07e3(0x150)](_0x9d07e3(0x19f),_0x15a310)){if(!_0x3817d2||_0x2c2355)return invalidMybatisSource(_0x9d07e3(0x183));const _0x5cc664=_0x51ac93[_0x9d07e3(0x186)](']]>',_0x15a310+0x9);if(_0x5cc664<0x0)return invalidMybatisSource(_0x9d07e3(0x16b));_0x34f329+=_0x51ac93['slice'](_0x15a310+0x9,_0x5cc664),_0x15a310=_0x5cc664+0x3;continue;}if(_0x51ac93[_0x9d07e3(0x150)]('<?',_0x15a310)){if(_0x3817d2)return invalidMybatisSource(_0x9d07e3(0x195));const _0x48090b=_0x51ac93[_0x9d07e3(0x186)]('?>',_0x15a310+0x2);if(_0x48090b<0x0)return invalidMybatisSource(_0x9d07e3(0x182));_0x34f329+='\x20',_0x15a310=_0x48090b+0x2;continue;}if(_0x51ac93[_0x15a310]!=='<'){const _0x417ed1=_0x51ac93['indexOf']('<',_0x15a310),_0x444cd1=_0x417ed1<0x0?_0x51ac93[_0x9d07e3(0x19a)]:_0x417ed1,_0x1c2f37=_0x51ac93[_0x9d07e3(0x152)](_0x15a310,_0x444cd1);if((!_0x3817d2||_0x2c2355)&&_0x1c2f37[_0x9d07e3(0x14d)]())return invalidMybatisSource('SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');if(_0x3817d2&&!_0x2c2355){const _0x35d655=decodeXmlEntities(_0x1c2f37);if(_0x35d655===null)return invalidMybatisSource(_0x9d07e3(0x19c));_0x34f329+=_0x35d655;}else _0x34f329+='\x20';_0x15a310=_0x444cd1;continue;}const _0x420708=findXmlTagEnd(_0x51ac93,_0x15a310);if(_0x420708<0x0)return invalidMybatisSource('Unterminated\x20MyBatis\x20XML\x20tag.');const _0x3dcda8=_0x51ac93['slice'](_0x15a310,_0x420708+0x1),_0x237a7=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x9d07e3(0x161)](_0x3dcda8);if(!_0x237a7)return invalidMybatisSource(_0x9d07e3(0x157));const _0x5dd98c=_0x237a7[0x1]==='/',_0x13f4ca=_0x237a7[0x2]??'',_0x1ad32f=_0x13f4ca['toLowerCase'](),_0x5beb09=_0x237a7[0x3]??'',_0xcc6f3a=_0x237a7[0x4]==='/',_0x2e1510=MYBATIS_OUTER_TAGS[_0x9d07e3(0x15c)](_0x1ad32f);if(!_0x2e1510&&!MYBATIS_DYNAMIC_TAGS[_0x9d07e3(0x16c)](_0x1ad32f))return invalidMybatisSource(_0x9d07e3(0x14c)+_0x1ad32f+'>.');if(!_0x2e1510&&_0x13f4ca!==_0x1ad32f)return invalidMybatisSource(_0x9d07e3(0x166)+_0x13f4ca+'>.');if(_0x5dd98c){if(_0x5beb09[_0x9d07e3(0x14d)]()||_0xcc6f3a)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x13f4ca+'>.');const _0x56e0c5=_0x53336c['at'](-0x1);if(!_0x56e0c5||(_0x56e0c5[_0x9d07e3(0x18d)]?_0x56e0c5[_0x9d07e3(0x167)]!==_0x1ad32f:_0x56e0c5[_0x9d07e3(0x16e)]!==_0x13f4ca))return invalidMybatisSource(_0x9d07e3(0x1a0)+_0x13f4ca+'>.');_0x53336c[_0x9d07e3(0x159)]();if(_0x56e0c5[_0x9d07e3(0x18d)])_0x2c2355=!![];_0x34f329+=MYBATIS_BRANCH_TAGS[_0x9d07e3(0x16c)](_0x1ad32f)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x5beb09))return invalidMybatisSource(_0x9d07e3(0x15a)+_0x13f4ca+'>.');if(_0x1ad32f===_0x9d07e3(0x17d)&&(!_0xcc6f3a||_0x53336c['at'](-0x1)?.['tagName']!=='include'))return invalidMybatisSource(_0x9d07e3(0x196));if(_0x2e1510){if(_0x3817d2||_0x53336c[_0x9d07e3(0x19a)]>0x0)return invalidMybatisSource(_0x9d07e3(0x17e));_0x3817d2=!![],_0x2c2355=_0xcc6f3a,_0x3830c2=_0x2e1510;}else{if(!_0x3817d2||_0x2c2355)return invalidMybatisSource(_0x9d07e3(0x199)+_0x13f4ca+'>.');}_0x34f329+=_0x1ad32f==='where'?_0x9d07e3(0x173):_0x1ad32f===_0x9d07e3(0x177)?'\x20SET\x20':_0x1ad32f===_0x9d07e3(0x151)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS['has'](_0x1ad32f)&&!_0xcc6f3a?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0xcc6f3a&&_0x53336c['push']({'rawName':_0x13f4ca,'tagName':_0x1ad32f,'outer':!!_0x2e1510});}_0x15a310=_0x420708+0x1;}if(_0x53336c[_0x9d07e3(0x19a)]>0x0)return invalidMybatisSource(_0x9d07e3(0x17a)+_0x53336c['at'](-0x1)?.[_0x9d07e3(0x16e)]+'>.');if(!_0x3817d2||!_0x2c2355)return invalidMybatisSource('MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.');return{'sql':_0x34f329[_0x9d07e3(0x14d)](),'mode':_0x9d07e3(0x153),..._0x3830c2?{'statementType':_0x3830c2}:{}};}function hasWellFormedXmlAttributes(_0x3ca014){const _0x5d6c0f=a296_0x30ed2f;let _0x58b67c=0x0;const _0x46a233=new Set();while(_0x58b67c<_0x3ca014[_0x5d6c0f(0x19a)]){while(_0x58b67c<_0x3ca014[_0x5d6c0f(0x19a)]&&/\s/[_0x5d6c0f(0x180)](_0x3ca014[_0x58b67c]??''))_0x58b67c+=0x1;if(_0x58b67c>=_0x3ca014['length'])return!![];const _0x5b1562=/^[A-Za-z_:][\w:.-]*/[_0x5d6c0f(0x161)](_0x3ca014['slice'](_0x58b67c)),_0x52aebb=_0x5b1562?.[0x0];if(!_0x52aebb||_0x46a233[_0x5d6c0f(0x16c)](_0x52aebb))return![];_0x46a233[_0x5d6c0f(0x16f)](_0x52aebb),_0x58b67c+=_0x52aebb[_0x5d6c0f(0x19a)];while(_0x58b67c<_0x3ca014[_0x5d6c0f(0x19a)]&&/\s/[_0x5d6c0f(0x180)](_0x3ca014[_0x58b67c]??''))_0x58b67c+=0x1;if(_0x3ca014[_0x58b67c]!=='=')return![];_0x58b67c+=0x1;while(_0x58b67c<_0x3ca014[_0x5d6c0f(0x19a)]&&/\s/[_0x5d6c0f(0x180)](_0x3ca014[_0x58b67c]??''))_0x58b67c+=0x1;const _0x1f51b9=_0x3ca014[_0x58b67c];if(_0x1f51b9!=='\x22'&&_0x1f51b9!=='\x27')return![];_0x58b67c+=0x1;const _0x5d2ed7=_0x3ca014[_0x5d6c0f(0x186)](_0x1f51b9,_0x58b67c);if(_0x5d2ed7<0x0)return![];if(decodeXmlEntities(_0x3ca014[_0x5d6c0f(0x152)](_0x58b67c,_0x5d2ed7))===null)return![];_0x58b67c=_0x5d2ed7+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x2e3486){const _0x46d9d6=a296_0x30ed2f;let _0x53f182=0x0;const _0x3a685a=()=>{const _0x177d5b=a296_0x2dd3;while(_0x53f182<_0x2e3486['length']&&/\s/[_0x177d5b(0x180)](_0x2e3486[_0x53f182]??''))_0x53f182+=0x1;};_0x3a685a();while(_0x53f182<_0x2e3486[_0x46d9d6(0x19a)]){if(_0x2e3486['startsWith'](_0x46d9d6(0x164),_0x53f182)){const _0x4d58f6=_0x2e3486[_0x46d9d6(0x186)](_0x46d9d6(0x156),_0x53f182+0x4);if(_0x4d58f6<0x0)return!![];_0x53f182=_0x4d58f6+0x3,_0x3a685a();continue;}if(_0x2e3486['startsWith']('<?',_0x53f182)){const _0x5cba5e=_0x2e3486['indexOf']('?>',_0x53f182+0x2);if(_0x5cba5e<0x0)return!![];_0x53f182=_0x5cba5e+0x2,_0x3a685a();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x46d9d6(0x180)](_0x2e3486[_0x46d9d6(0x152)](_0x53f182));}function invalidMybatisSource(_0x25196c){return{'sql':'','mode':'mybatisXml','error':_0x25196c};}function findXmlTagEnd(_0xc75218,_0x32336d){const _0x46664f=a296_0x30ed2f;let _0x376116;for(let _0x54b851=_0x32336d+0x1;_0x54b851<_0xc75218[_0x46664f(0x19a)];_0x54b851+=0x1){const _0x2e7fe2=_0xc75218[_0x54b851];if(_0x376116){if(_0x2e7fe2===_0x376116)_0x376116=undefined;continue;}if(_0x2e7fe2==='\x22'||_0x2e7fe2==='\x27'){_0x376116=_0x2e7fe2;continue;}if(_0x2e7fe2==='>')return _0x54b851;}return-0x1;}function decodeXmlEntities(_0x557620){const _0x450342=a296_0x30ed2f;let _0x1cb37a=![];const _0x4efb37=_0x557620[_0x450342(0x175)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x6747c8=>{const _0x211748=_0x450342;if(_0x6747c8===_0x211748(0x15d))return'<';if(_0x6747c8===_0x211748(0x18c))return'>';if(_0x6747c8===_0x211748(0x14f))return'\x22';if(_0x6747c8===_0x211748(0x14b))return'\x27';if(_0x6747c8==='&')return'&';const _0x50c2f1=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x211748(0x161)](_0x6747c8);if(_0x50c2f1){const _0x3dd446=_0x50c2f1[0x1],_0x19886d=_0x50c2f1[0x2],_0x3edb8c=Number[_0x211748(0x176)](_0x3dd446??_0x19886d??'',_0x3dd446?0x10:0xa);if(isValidXmlCharacter(_0x3edb8c))return String['fromCodePoint'](_0x3edb8c);}return _0x1cb37a=!![],'';});return _0x1cb37a?null:_0x4efb37;}function isValidXmlCharacter(_0x377424){return _0x377424===0x9||_0x377424===0xa||_0x377424===0xd||_0x377424>=0x20&&_0x377424<=0xd7ff||_0x377424>=0xe000&&_0x377424<=0xfffd||_0x377424>=0x10000&&_0x377424<=0x10ffff;}export function detectSqlType(_0x226b49){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x226b49));}function detectNormalizedSqlType(_0x391558){const _0x2b42d4=a296_0x30ed2f;if(_0x391558[_0x2b42d4(0x184)])return{'type':_0x2b42d4(0x179),'isSelectOnly':![],'isDangerous':![],'reason':_0x391558[_0x2b42d4(0x184)]};if(!_0x391558[_0x2b42d4(0x19b)][_0x2b42d4(0x14d)]())return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x2b42d4(0x19d)};const _0xb3779d=stripStaticAnalysisMarkers(_0x391558[_0x2b42d4(0x19b)])[_0x2b42d4(0x175)](/#\{[^}]*\}/g,'?')[_0x2b42d4(0x175)](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x2b42d4(0x175)](/\/\*[\s\S]*?\*\//g,'')['trim'](),_0x1750c7=_0xb3779d['split']('\x0a');let _0x190437='';for(const _0x584105 of _0x1750c7){const _0x4313f5=_0x584105[_0x2b42d4(0x14d)]();if(!_0x4313f5||_0x4313f5[_0x2b42d4(0x150)]('--')||_0x4313f5[_0x2b42d4(0x150)]('/*'))continue;_0x190437=_0x4313f5;break;}const _0xabd0ee=_0x190437['toUpperCase'](),_0xaa8baf=_0x391558['statementType'],_0x1ecd7f=maskSqlTextForBlockedKeywordScan(_0xb3779d),_0x16dd95=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i['test'](_0x1ecd7f);if(_0xaa8baf===_0x2b42d4(0x165)||!_0xaa8baf&&(_0xabd0ee[_0x2b42d4(0x150)](_0x2b42d4(0x165))||_0xabd0ee[_0x2b42d4(0x150)](_0x2b42d4(0x14e)))){const _0x35fe48=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x2b42d4(0x180)](_0xb3779d);return{'type':_0x2b42d4(0x165),'isSelectOnly':!_0x35fe48,'isDangerous':_0x35fe48,'reason':_0x35fe48?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0xaa8baf==='INSERT'||!_0xaa8baf&&_0xabd0ee[_0x2b42d4(0x150)]('INSERT'))return{'type':_0x2b42d4(0x171),'isSelectOnly':![],'isDangerous':_0x16dd95,'reason':_0x16dd95?_0x2b42d4(0x192):undefined};if(_0xaa8baf===_0x2b42d4(0x149)||!_0xaa8baf&&_0xabd0ee[_0x2b42d4(0x150)](_0x2b42d4(0x149)))return{'type':_0x2b42d4(0x149),'isSelectOnly':![],'isDangerous':_0x16dd95,'reason':_0x16dd95?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0xaa8baf===_0x2b42d4(0x178)||!_0xaa8baf&&_0xabd0ee[_0x2b42d4(0x150)](_0x2b42d4(0x178)))return{'type':_0x2b42d4(0x178),'isSelectOnly':![],'isDangerous':!![],'reason':_0x2b42d4(0x187)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x2b42d4(0x180)](_0xabd0ee))return{'type':_0x2b42d4(0x189),'isSelectOnly':![],'isDangerous':!![],'reason':_0x2b42d4(0x190)};return{'type':_0x2b42d4(0x179),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x53fd76){const _0x155f73=a296_0x30ed2f;return _0x53fd76[_0x155f73(0x148)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x155f73(0x148)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x155f73(0x148)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x5bb266){const _0x2fa420=a296_0x30ed2f;return _0x5bb266[_0x2fa420(0x175)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x2fa420(0x175)](/"(?:""|\\.|[^"])*"/g,'\x20')['replace'](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x2fa420(0x175)](/--.*$/gm,'\x20')[_0x2fa420(0x175)](/#.*$/gm,'\x20')['replace'](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x53760){const _0xcbc8f=a296_0x30ed2f,_0x343124=_0x53760[_0xcbc8f(0x175)](/#\{[^}]*\}/g,'?')[_0xcbc8f(0x175)](/\$\{[^}]*\}/g,'?')['replace'](/'[^']*'/g,'\x27\x27')[_0xcbc8f(0x175)](/--.*$/gm,'')[_0xcbc8f(0x175)](/\/\*[\s\S]*?\*\//g,''),_0xf3d46f=[],_0x7f018b=_0x343124[_0xcbc8f(0x154)](/FROM\s+([^\s,)(]+)/i);addTable(_0xf3d46f,_0x7f018b?.[0x1]);for(const _0x23953b of _0x343124[_0xcbc8f(0x191)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0xf3d46f,_0x23953b[0x1]);}const _0x2be310=_0x343124['match'](/INTO\s+([^\s(]+)/i);addTable(_0xf3d46f,_0x2be310?.[0x1]);const _0x52c176=_0x343124[_0xcbc8f(0x154)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0xf3d46f,_0x52c176?.[0x1]),_0xf3d46f;}function a296_0x2b2b(){const _0x31b08c=['exec','1376413MvoBLZ','9428dAbNwp','<!--','SELECT','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','tagName','foreach','3635kDJmuM','Unable\x20to\x20detect\x20SQL\x20type.\x20','Unterminated\x20CDATA\x20section.','has','99ISrzjf','rawName','add','153264JhimpB','INSERT','reason','\x20WHERE\x20','2626314qZHYFz','replace','parseInt','set','DELETE','UNKNOWN','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','7gDKmvR','otherwise','property','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','join','test','keys','Unterminated\x20XML\x20declaration.','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','error','51900672DQEboP','indexOf','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','type','DDL','choose','\x20query\x20targeting\x20','>','outer','46486VnxJTc','select','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','matchAll','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','3309927PBDZQq','Unterminated\x20XML\x20comment.','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','unknown\x20table(s)','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','length','sql','Invalid\x20XML\x20entity\x20reference.','SQL\x20content\x20is\x20empty','where','<![CDATA[','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','insert','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','from','replaceAll','UPDATE','2lrnfGQ',''','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','trim','WITH','"','startsWith','include','slice','mybatisXml','match','bind','-->','Invalid\x20MyBatis\x20XML\x20tag.','push','pop','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','^<\x5cs*(?:','get','<',')\x5cb','2540XInYuV','includes'];a296_0x2b2b=function(){return _0x31b08c;};return a296_0x2b2b();}function addTable(_0x4fc54b,_0x2d133e){const _0x4a9ace=a296_0x30ed2f,_0x2b0515=_0x2d133e?.[_0x4a9ace(0x175)](/[`"]/g,'');_0x2b0515&&_0x2b0515!==UNRESOLVED_SQL_FRAGMENT&&!_0x4fc54b[_0x4a9ace(0x160)](_0x2b0515)&&_0x4fc54b[_0x4a9ace(0x158)](_0x2b0515);}function extractParameters(_0x325f3c){const _0x48e5be=a296_0x30ed2f,_0x595592=new Set();for(const _0x105d24 of _0x325f3c['matchAll'](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x105d24[0x1])_0x595592['add'](_0x105d24[0x1]);}return Array[_0x48e5be(0x147)](_0x595592);}export function validateSql(_0x2c1503){const _0x53bc12=a296_0x30ed2f,_0x5c1ab6=normalizeSqlForStaticAnalysis(_0x2c1503),_0x56e28b=detectNormalizedSqlType(_0x5c1ab6),_0x44f0c6=stripStaticAnalysisMarkers(_0x5c1ab6[_0x53bc12(0x19b)]),_0x372f08=_0x5c1ab6[_0x53bc12(0x184)]?[]:extractTables(_0x44f0c6),_0x2c1192=_0x5c1ab6['error']?[]:extractParameters(_0x44f0c6);if(_0x56e28b['isDangerous'])return{'valid':![],'sqlType':_0x56e28b,'tables':_0x372f08,'parameters':_0x2c1192,'message':_0x56e28b[_0x53bc12(0x172)]||_0x56e28b[_0x53bc12(0x188)]+_0x53bc12(0x198)};if(_0x56e28b[_0x53bc12(0x188)]===_0x53bc12(0x179))return{'valid':![],'sqlType':_0x56e28b,'tables':_0x372f08,'parameters':_0x2c1192,'message':_0x5c1ab6[_0x53bc12(0x184)]?_0x53bc12(0x16a)+_0x5c1ab6[_0x53bc12(0x184)]:_0x53bc12(0x1a2)};return{'valid':!![],'sqlType':_0x56e28b,'tables':_0x372f08,'parameters':_0x2c1192,'message':_0x56e28b[_0x53bc12(0x188)]+_0x53bc12(0x18b)+(_0x372f08[_0x53bc12(0x19a)]?_0x372f08[_0x53bc12(0x17f)](',\x20'):_0x53bc12(0x197))+(_0x2c1192[_0x53bc12(0x19a)]?'\x20with\x20parameters:\x20'+_0x2c1192[_0x53bc12(0x17f)](',\x20'):'')};}
|
|
1
|
+
const a296_0x5c2e02=a296_0x2358;(function(_0x347599,_0x2a2496){const _0x46a384=a296_0x2358,_0x4e5934=_0x347599();while(!![]){try{const _0xc329e9=parseInt(_0x46a384(0x19f))/0x1*(-parseInt(_0x46a384(0x16e))/0x2)+parseInt(_0x46a384(0x192))/0x3+-parseInt(_0x46a384(0x1a6))/0x4+parseInt(_0x46a384(0x1ac))/0x5+-parseInt(_0x46a384(0x191))/0x6*(-parseInt(_0x46a384(0x17e))/0x7)+parseInt(_0x46a384(0x190))/0x8*(-parseInt(_0x46a384(0x15a))/0x9)+-parseInt(_0x46a384(0x199))/0xa;if(_0xc329e9===_0x2a2496)break;else _0x4e5934['push'](_0x4e5934['shift']());}catch(_0x1d0706){_0x4e5934['push'](_0x4e5934['shift']());}}}(a296_0x4ede,0xd697b));const MYBATIS_OUTER_TAGS=new Map([[a296_0x5c2e02(0x14b),a296_0x5c2e02(0x18d)],[a296_0x5c2e02(0x1a9),a296_0x5c2e02(0x1a2)],[a296_0x5c2e02(0x163),a296_0x5c2e02(0x172)],[a296_0x5c2e02(0x198),a296_0x5c2e02(0x1a1)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a296_0x5c2e02(0x15b),a296_0x5c2e02(0x185),'choose','when',a296_0x5c2e02(0x18e),a296_0x5c2e02(0x1a5),a296_0x5c2e02(0x175),a296_0x5c2e02(0x1ad),a296_0x5c2e02(0x14a),a296_0x5c2e02(0x1b1)]),MYBATIS_BRANCH_TAGS=new Set(['if',a296_0x5c2e02(0x185),a296_0x5c2e02(0x164),a296_0x5c2e02(0x1ab),a296_0x5c2e02(0x18e)]);export const MYBATIS_DYNAMIC_START_MARKER=a296_0x5c2e02(0x1b0);export const MYBATIS_DYNAMIC_END_MARKER=a296_0x5c2e02(0x155);export const MYBATIS_INCLUDE_MARKER=a296_0x5c2e02(0x17c);const UNRESOLVED_SQL_FRAGMENT=a296_0x5c2e02(0x1a3),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a296_0x5c2e02(0x17f)+[...MYBATIS_OUTER_TAGS[a296_0x5c2e02(0x186)]()][a296_0x5c2e02(0x181)]('|')+a296_0x5c2e02(0x161),'i');export function normalizeSqlForStaticAnalysis(_0xfcf15e){const _0xe41442=a296_0x5c2e02,_0x1e0576=typeof _0xfcf15e==='string'?_0xfcf15e:'';if(detectSqlSourceMode(_0x1e0576)===_0xe41442(0x19e))return{'sql':_0x1e0576,'mode':_0xe41442(0x19e)};let _0x25fdf8=0x0,_0x1e152f='',_0x16f27a,_0x174768=![],_0x3ef655=![];const _0x136055=[];while(_0x25fdf8<_0x1e0576[_0xe41442(0x176)]){if(_0x1e0576['startsWith'](_0xe41442(0x157),_0x25fdf8)){const _0x22bca8=_0x1e0576[_0xe41442(0x149)](_0xe41442(0x151),_0x25fdf8+0x4);if(_0x22bca8<0x0)return invalidMybatisSource(_0xe41442(0x193));_0x1e152f+='\x20',_0x25fdf8=_0x22bca8+0x3;continue;}if(_0x1e0576['startsWith'](_0xe41442(0x19b),_0x25fdf8)){if(!_0x174768||_0x3ef655)return invalidMybatisSource(_0xe41442(0x152));const _0x22a391=_0x1e0576[_0xe41442(0x149)](_0xe41442(0x154),_0x25fdf8+0x9);if(_0x22a391<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x1e152f+=_0x1e0576[_0xe41442(0x17b)](_0x25fdf8+0x9,_0x22a391),_0x25fdf8=_0x22a391+0x3;continue;}if(_0x1e0576['startsWith']('<?',_0x25fdf8)){if(_0x174768)return invalidMybatisSource(_0xe41442(0x196));const _0x2062ec=_0x1e0576[_0xe41442(0x149)]('?>',_0x25fdf8+0x2);if(_0x2062ec<0x0)return invalidMybatisSource('Unterminated\x20XML\x20declaration.');_0x1e152f+='\x20',_0x25fdf8=_0x2062ec+0x2;continue;}if(_0x1e0576[_0x25fdf8]!=='<'){const _0x4893af=_0x1e0576['indexOf']('<',_0x25fdf8),_0x61013e=_0x4893af<0x0?_0x1e0576['length']:_0x4893af,_0x1ae66a=_0x1e0576[_0xe41442(0x17b)](_0x25fdf8,_0x61013e);if((!_0x174768||_0x3ef655)&&_0x1ae66a['trim']())return invalidMybatisSource('SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');if(_0x174768&&!_0x3ef655){const _0x3cc5a6=decodeXmlEntities(_0x1ae66a);if(_0x3cc5a6===null)return invalidMybatisSource(_0xe41442(0x14c));_0x1e152f+=_0x3cc5a6;}else _0x1e152f+='\x20';_0x25fdf8=_0x61013e;continue;}const _0x1f5f01=findXmlTagEnd(_0x1e0576,_0x25fdf8);if(_0x1f5f01<0x0)return invalidMybatisSource('Unterminated\x20MyBatis\x20XML\x20tag.');const _0x53866d=_0x1e0576[_0xe41442(0x17b)](_0x25fdf8,_0x1f5f01+0x1),_0x21104a=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0xe41442(0x1b2)](_0x53866d);if(!_0x21104a)return invalidMybatisSource(_0xe41442(0x14e));const _0x230a01=_0x21104a[0x1]==='/',_0x3be770=_0x21104a[0x2]??'',_0x8ab5b=_0x3be770[_0xe41442(0x195)](),_0x237c75=_0x21104a[0x3]??'',_0x2e3f5e=_0x21104a[0x4]==='/',_0x570d7d=MYBATIS_OUTER_TAGS[_0xe41442(0x15f)](_0x8ab5b);if(!_0x570d7d&&!MYBATIS_DYNAMIC_TAGS[_0xe41442(0x167)](_0x8ab5b))return invalidMybatisSource(_0xe41442(0x178)+_0x8ab5b+'>.');if(!_0x570d7d&&_0x3be770!==_0x8ab5b)return invalidMybatisSource(_0xe41442(0x158)+_0x3be770+'>.');if(_0x230a01){if(_0x237c75['trim']()||_0x2e3f5e)return invalidMybatisSource(_0xe41442(0x177)+_0x3be770+'>.');const _0x3b050e=_0x136055['at'](-0x1);if(!_0x3b050e||(_0x3b050e[_0xe41442(0x183)]?_0x3b050e[_0xe41442(0x166)]!==_0x8ab5b:_0x3b050e[_0xe41442(0x19a)]!==_0x3be770))return invalidMybatisSource(_0xe41442(0x1af)+_0x3be770+'>.');_0x136055[_0xe41442(0x17a)]();if(_0x3b050e[_0xe41442(0x183)])_0x3ef655=!![];_0x1e152f+=MYBATIS_BRANCH_TAGS['has'](_0x8ab5b)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x237c75))return invalidMybatisSource('Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<'+_0x3be770+'>.');if(_0x8ab5b===_0xe41442(0x1b1)&&(!_0x2e3f5e||_0x136055['at'](-0x1)?.['tagName']!=='include'))return invalidMybatisSource('MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.');if(_0x570d7d){if(_0x174768||_0x136055[_0xe41442(0x176)]>0x0)return invalidMybatisSource(_0xe41442(0x160));_0x174768=!![],_0x3ef655=_0x2e3f5e,_0x16f27a=_0x570d7d;}else{if(!_0x174768||_0x3ef655)return invalidMybatisSource(_0xe41442(0x18b)+_0x3be770+'>.');}_0x1e152f+=_0x8ab5b===_0xe41442(0x15b)?_0xe41442(0x1a7):_0x8ab5b===_0xe41442(0x175)?_0xe41442(0x1a8):_0x8ab5b==='include'?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0xe41442(0x167)](_0x8ab5b)&&!_0x2e3f5e?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x2e3f5e&&_0x136055['push']({'rawName':_0x3be770,'tagName':_0x8ab5b,'outer':!!_0x570d7d});}_0x25fdf8=_0x1f5f01+0x1;}if(_0x136055[_0xe41442(0x176)]>0x0)return invalidMybatisSource('Unclosed\x20MyBatis\x20XML\x20tag:\x20<'+_0x136055['at'](-0x1)?.['rawName']+'>.');if(!_0x174768||!_0x3ef655)return invalidMybatisSource(_0xe41442(0x162));return{'sql':_0x1e152f[_0xe41442(0x1a5)](),'mode':_0xe41442(0x14d),..._0x16f27a?{'statementType':_0x16f27a}:{}};}function a296_0x2358(_0x3d8eae,_0x2513d3){_0x3d8eae=_0x3d8eae-0x149;const _0x4edef4=a296_0x4ede();let _0x2358c7=_0x4edef4[_0x3d8eae];return _0x2358c7;}function hasWellFormedXmlAttributes(_0x486ae1){const _0x555d34=a296_0x5c2e02;let _0x5eda80=0x0;const _0x14ac0f=new Set();while(_0x5eda80<_0x486ae1['length']){while(_0x5eda80<_0x486ae1[_0x555d34(0x176)]&&/\s/['test'](_0x486ae1[_0x5eda80]??''))_0x5eda80+=0x1;if(_0x5eda80>=_0x486ae1['length'])return!![];const _0x4d1239=/^[A-Za-z_:][\w:.-]*/['exec'](_0x486ae1[_0x555d34(0x17b)](_0x5eda80)),_0x30ed1e=_0x4d1239?.[0x0];if(!_0x30ed1e||_0x14ac0f['has'](_0x30ed1e))return![];_0x14ac0f[_0x555d34(0x153)](_0x30ed1e),_0x5eda80+=_0x30ed1e[_0x555d34(0x176)];while(_0x5eda80<_0x486ae1[_0x555d34(0x176)]&&/\s/[_0x555d34(0x187)](_0x486ae1[_0x5eda80]??''))_0x5eda80+=0x1;if(_0x486ae1[_0x5eda80]!=='=')return![];_0x5eda80+=0x1;while(_0x5eda80<_0x486ae1[_0x555d34(0x176)]&&/\s/[_0x555d34(0x187)](_0x486ae1[_0x5eda80]??''))_0x5eda80+=0x1;const _0x21c56c=_0x486ae1[_0x5eda80];if(_0x21c56c!=='\x22'&&_0x21c56c!=='\x27')return![];_0x5eda80+=0x1;const _0x6ae2f4=_0x486ae1[_0x555d34(0x149)](_0x21c56c,_0x5eda80);if(_0x6ae2f4<0x0)return![];if(decodeXmlEntities(_0x486ae1[_0x555d34(0x17b)](_0x5eda80,_0x6ae2f4))===null)return![];_0x5eda80=_0x6ae2f4+0x1;}return!![];}function a296_0x4ede(){const _0xce09b0=['UNKNOWN','DDL\x20statements\x20require\x20explicit\x20review','some','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','includes','SELECT','otherwise','\x20statements\x20require\x20explicit\x20review.\x20Local\x20analysis\x20does\x20not\x20authorize\x20saving\x20or\x20execution.','1972616uoNERp','611670HPPcbR','3666816lTGLup','Unterminated\x20XML\x20comment.','match','toLowerCase','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','SHARE','delete','19246940KkPopV','rawName','<![CDATA[','LOCK\x20IN\x20SHARE\x20MODE','reason','sql','110UMbUIO','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','DELETE','INSERT','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','WITH','trim','1355488wQLHsn','\x20WHERE\x20','\x20SET\x20','insert','isDangerous','when','7456335EmPSXL','bind','NOT','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','__RABETBASE_MYBATIS_DYNAMIC_START__','property','exec','indexOf','include','select','Invalid\x20XML\x20entity\x20reference.','mybatisXml','Invalid\x20MyBatis\x20XML\x20tag.','replaceAll','Local\x20analysis\x20could\x20not\x20parse\x20the\x20WITH\x20prefix;\x20this\x20is\x20a\x20local\x20capability\x20limit,\x20not\x20a\x20platform\x20rejection.','-->','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','add',']]>','__RABETBASE_MYBATIS_DYNAMIC_END__','parseInt','<!--','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','startsWith','9bQyXab','where','Unable\x20to\x20detect\x20SQL\x20type.\x20','SET','\x20with\x20parameters:\x20','get','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.',')\x5cb','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','update','choose','RECURSIVE','tagName','has','filter','push','from','SQL\x20content\x20is\x20empty','replace','MATERIALIZED','15520ixrxuy','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','DELETE\x20statements\x20require\x20explicit\x20review','type','UPDATE','matchAll','DDL','set','length','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','statementType','pop','slice','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','error','105axuzVW','^<\x5cs*(?:','&','join','unknown\x20table(s)','outer','FOR','foreach','keys','test'];a296_0x4ede=function(){return _0xce09b0;};return a296_0x4ede();}export function detectSqlSourceMode(_0xddbae7){const _0x5f4aaf=a296_0x5c2e02;let _0x25f1af=0x0;const _0x10e9a0=()=>{const _0x39e080=a296_0x2358;while(_0x25f1af<_0xddbae7[_0x39e080(0x176)]&&/\s/[_0x39e080(0x187)](_0xddbae7[_0x25f1af]??''))_0x25f1af+=0x1;};_0x10e9a0();while(_0x25f1af<_0xddbae7['length']){if(_0xddbae7[_0x5f4aaf(0x159)](_0x5f4aaf(0x157),_0x25f1af)){const _0x215954=_0xddbae7[_0x5f4aaf(0x149)](_0x5f4aaf(0x151),_0x25f1af+0x4);if(_0x215954<0x0)return _0x5f4aaf(0x14d);_0x25f1af=_0x215954+0x3,_0x10e9a0();continue;}if(_0xddbae7[_0x5f4aaf(0x159)]('<?',_0x25f1af)){const _0x4b46b1=_0xddbae7['indexOf']('?>',_0x25f1af+0x2);if(_0x4b46b1<0x0)return'mybatisXml';_0x25f1af=_0x4b46b1+0x2,_0x10e9a0();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x5f4aaf(0x187)](_0xddbae7[_0x5f4aaf(0x17b)](_0x25f1af))?_0x5f4aaf(0x14d):_0x5f4aaf(0x19e);}function invalidMybatisSource(_0x4cecab){return{'sql':'','mode':'mybatisXml','error':_0x4cecab};}function findXmlTagEnd(_0x2dd77b,_0x4a0735){const _0x14e26b=a296_0x5c2e02;let _0x582dbb;for(let _0x196bbe=_0x4a0735+0x1;_0x196bbe<_0x2dd77b[_0x14e26b(0x176)];_0x196bbe+=0x1){const _0x4c7d60=_0x2dd77b[_0x196bbe];if(_0x582dbb){if(_0x4c7d60===_0x582dbb)_0x582dbb=undefined;continue;}if(_0x4c7d60==='\x22'||_0x4c7d60==='\x27'){_0x582dbb=_0x4c7d60;continue;}if(_0x4c7d60==='>')return _0x196bbe;}return-0x1;}function decodeXmlEntities(_0x26fc24){const _0x31220a=a296_0x5c2e02;let _0x24ccc6=![];const _0x5ecd29=_0x26fc24[_0x31220a(0x16c)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x5b2ec4=>{const _0x46552e=_0x31220a;if(_0x5b2ec4==='<')return'<';if(_0x5b2ec4==='>')return'>';if(_0x5b2ec4==='"')return'\x22';if(_0x5b2ec4===''')return'\x27';if(_0x5b2ec4===_0x46552e(0x180))return'&';const _0x15b8f6=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x46552e(0x1b2)](_0x5b2ec4);if(_0x15b8f6){const _0x5067b3=_0x15b8f6[0x1],_0x2eeb33=_0x15b8f6[0x2],_0xe760fc=Number[_0x46552e(0x156)](_0x5067b3??_0x2eeb33??'',_0x5067b3?0x10:0xa);if(isValidXmlCharacter(_0xe760fc))return String['fromCodePoint'](_0xe760fc);}return _0x24ccc6=!![],'';});return _0x24ccc6?null:_0x5ecd29;}function isValidXmlCharacter(_0x471383){return _0x471383===0x9||_0x471383===0xa||_0x471383===0xd||_0x471383>=0x20&&_0x471383<=0xd7ff||_0x471383>=0xe000&&_0x471383<=0xfffd||_0x471383>=0x10000&&_0x471383<=0x10ffff;}export function detectSqlType(_0x544f8a){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x544f8a));}function detectNormalizedSqlType(_0x30a927){const _0x3e06a3=a296_0x5c2e02;if(_0x30a927['error'])return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x30a927[_0x3e06a3(0x17d)]};if(!_0x30a927['sql'][_0x3e06a3(0x1a5)]())return{'type':_0x3e06a3(0x188),'isSelectOnly':![],'isDangerous':![],'reason':_0x3e06a3(0x16b)};const _0x2156fa=tokenizeSqlForTypeAnalysis(_0x30a927[_0x3e06a3(0x19e)]),_0x458e07=_0x2156fa[_0x3e06a3(0x168)](_0x59f941=>_0x59f941!==MYBATIS_DYNAMIC_START_MARKER&&_0x59f941!==MYBATIS_DYNAMIC_END_MARKER),_0x37bd27=findMainStatementIndex(_0x458e07);if(_0x37bd27<0x0)return{'type':_0x3e06a3(0x188),'isSelectOnly':![],'isDangerous':![],'reason':_0x3e06a3(0x150)};const _0x184873=_0x458e07[_0x37bd27]??'',_0xf1fd29=_0x30a927[_0x3e06a3(0x179)]??_0x184873,_0x59437f=_0x2156fa[_0x3e06a3(0x18a)](_0x40cce4=>/^(DELETE|DROP|ALTER|CREATE|TRUNCATE)$/[_0x3e06a3(0x187)](_0x40cce4)),_0x210919=new Set();let _0x1dcc3c=![];for(let _0x1c3c9e=0x0;_0x1c3c9e<_0x2156fa[_0x3e06a3(0x176)];_0x1c3c9e+=0x1){const _0x4e4036=_0x2156fa[_0x1c3c9e];(_0x4e4036===_0x3e06a3(0x172)||_0x4e4036===_0x3e06a3(0x197))&&isLockingClauseKeyword(_0x2156fa,_0x1c3c9e)&&(_0x210919[_0x3e06a3(0x153)](_0x1c3c9e),_0x1dcc3c=!![]);if(_0x2156fa[_0x3e06a3(0x17b)](_0x1c3c9e,_0x1c3c9e+0x4)['join']('\x20')===_0x3e06a3(0x19c))_0x1dcc3c=!![];}if(_0xf1fd29===_0x3e06a3(0x18d)){const _0x1ac4fc=_0x2156fa['some']((_0xfcd751,_0x8febe)=>/^(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)$/[_0x3e06a3(0x187)](_0xfcd751)&&!_0x210919[_0x3e06a3(0x167)](_0x8febe));return{'type':_0x3e06a3(0x18d),'isSelectOnly':!_0x1ac4fc&&!_0x1dcc3c,'isLockingRead':_0x1dcc3c,'isDangerous':_0x1ac4fc,'reason':_0x1ac4fc?_0x3e06a3(0x16f):undefined};}if(_0xf1fd29===_0x3e06a3(0x1a2))return{'type':_0x3e06a3(0x1a2),'isSelectOnly':![],'isDangerous':_0x59437f,'reason':_0x59437f?_0x3e06a3(0x1a0):undefined};if(_0xf1fd29===_0x3e06a3(0x172))return{'type':_0x3e06a3(0x172),'isSelectOnly':![],'isDangerous':_0x59437f,'reason':_0x59437f?_0x3e06a3(0x1a0):undefined};if(_0xf1fd29===_0x3e06a3(0x1a1))return{'type':_0x3e06a3(0x1a1),'isSelectOnly':![],'isDangerous':!![],'reason':_0x3e06a3(0x170)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i['test'](_0x184873))return{'type':_0x3e06a3(0x174),'isSelectOnly':![],'isDangerous':!![],'reason':_0x3e06a3(0x189)};return{'type':_0x3e06a3(0x188),'isSelectOnly':![],'isDangerous':![]};}function isLockingClauseKeyword(_0x4d05dc,_0x1d6846){const _0x2272b6=a296_0x5c2e02,_0x55c69c=_0x4d05dc[_0x1d6846]===_0x2272b6(0x172)?[[_0x2272b6(0x184)],[_0x2272b6(0x184),'NO','KEY']]:[['FOR'],[_0x2272b6(0x184),'KEY']],_0x4dd011=_0x55c69c[_0x2272b6(0x18a)](_0x203f03=>{const _0x20e019=_0x2272b6,_0x2a12b0=_0x1d6846-_0x203f03[_0x20e019(0x176)];return _0x2a12b0>=0x0&&_0x4d05dc['slice'](_0x2a12b0,_0x1d6846)[_0x20e019(0x181)]('\x20')===_0x203f03[_0x20e019(0x181)]('\x20');});if(!_0x4dd011)return![];return!_0x4d05dc[_0x2272b6(0x17b)](_0x1d6846+0x1,_0x1d6846+0x5)[_0x2272b6(0x18c)](_0x2272b6(0x15d));}function findMainStatementIndex(_0x2eadd4){const _0x5920ea=a296_0x5c2e02;if(_0x2eadd4[0x0]!==_0x5920ea(0x1a4))return 0x0;let _0x48c374=_0x2eadd4[0x1]===_0x5920ea(0x165)?0x2:0x1;while(_0x48c374<_0x2eadd4[_0x5920ea(0x176)]){const _0x5017a6=_0x2eadd4[_0x48c374];if(!_0x5017a6||!(/^[A-Z_][\w$]*$/[_0x5920ea(0x187)](_0x5017a6)||/^[`"]/['test'](_0x5017a6)))return-0x1;_0x48c374+=0x1;if(_0x2eadd4[_0x48c374]==='('){_0x48c374=skipSqlParentheses(_0x2eadd4,_0x48c374);if(_0x48c374<0x0)return-0x1;}if(_0x2eadd4[_0x48c374]!=='AS')return-0x1;_0x48c374+=0x1;if(_0x2eadd4[_0x48c374]===_0x5920ea(0x1ae)&&_0x2eadd4[_0x48c374+0x1]===_0x5920ea(0x16d))_0x48c374+=0x2;else{if(_0x2eadd4[_0x48c374]==='MATERIALIZED')_0x48c374+=0x1;}_0x48c374=skipSqlParentheses(_0x2eadd4,_0x48c374);if(_0x48c374<0x0)return-0x1;if(_0x2eadd4[_0x48c374]!==','){const _0x58dbbc=_0x2eadd4[_0x48c374]==='('?_0x48c374+0x1:_0x48c374;return/^(SELECT|INSERT|UPDATE|DELETE)$/[_0x5920ea(0x187)](_0x2eadd4[_0x58dbbc]??'')?_0x58dbbc:-0x1;}_0x48c374+=0x1;}return-0x1;}function skipSqlParentheses(_0x3c6c96,_0xfa44cc){const _0x2d4c24=a296_0x5c2e02;if(_0x3c6c96[_0xfa44cc]!=='(')return-0x1;let _0xe520a4=0x0;for(let _0x35062d=_0xfa44cc;_0x35062d<_0x3c6c96[_0x2d4c24(0x176)];_0x35062d+=0x1){const _0x43ca11=_0x3c6c96[_0x35062d];if(_0x43ca11===';')return-0x1;if(_0x43ca11==='(')_0xe520a4+=0x1;if(_0x43ca11===')'&&--_0xe520a4===0x0)return _0x35062d+0x1;}return-0x1;}function stripStaticAnalysisMarkers(_0x10c063){const _0x5c535d=a296_0x5c2e02;return _0x10c063[_0x5c535d(0x14f)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x5c535d(0x14f)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function tokenizeSqlForTypeAnalysis(_0x3bd4b4){const _0xaef30e=a296_0x5c2e02,_0x145bff=[],_0x157133=/\/\*[\s\S]*?\*\/|--[^\r\n]*|[#$]\{[^}]*\}|#[^\r\n]*|'(?:''|\\[\s\S]|[^'\\])*'|"(?:""|\\[\s\S]|[^"\\])*"|`(?:``|\\[\s\S]|[^`\\])*`|@[A-Za-z_]\w*|[A-Za-z_]\w*|\S/g;for(const _0x55a722 of _0x3bd4b4['matchAll'](_0x157133)){const _0x53d6ae=_0x55a722[0x0];if(_0x53d6ae[_0xaef30e(0x159)]('/*')||_0x53d6ae[_0xaef30e(0x159)]('--')||_0x53d6ae[_0xaef30e(0x159)]('#')&&!_0x53d6ae[_0xaef30e(0x159)]('#{'))continue;_0x145bff[_0xaef30e(0x169)](/^["`]/[_0xaef30e(0x187)](_0x53d6ae)?_0x53d6ae:/^[\x27@#$]/['test'](_0x53d6ae)?'?':_0x53d6ae['toUpperCase']());}return _0x145bff;}function extractTables(_0x106994,_0x51d535){const _0x2b1738=a296_0x5c2e02,_0xc3273c=_0x106994[_0x2b1738(0x16c)](/#\{[^}]*\}/g,'?')[_0x2b1738(0x16c)](/\$\{[^}]*\}/g,'?')['replace'](/'[^']*'/g,'\x27\x27')[_0x2b1738(0x16c)](/--.*$/gm,'')['replace'](/\/\*[\s\S]*?\*\//g,''),_0x5af903=[],_0x4cb8b7=_0xc3273c[_0x2b1738(0x194)](/FROM\s+([^\s,)(]+)/i);addTable(_0x5af903,_0x4cb8b7?.[0x1]);for(const _0x5c63c0 of _0xc3273c[_0x2b1738(0x173)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x5af903,_0x5c63c0[0x1]);}const _0x3ab276=_0xc3273c[_0x2b1738(0x194)](/INTO\s+([^\s(]+)/i);addTable(_0x5af903,_0x3ab276?.[0x1]);if(_0x51d535===_0x2b1738(0x172)){const _0x2db4b0=_0xc3273c[_0x2b1738(0x194)](/UPDATE\s+([^\s,)(]+)/i);addTable(_0x5af903,_0x2db4b0?.[0x1]);}return _0x5af903;}function addTable(_0xdf7daa,_0x475cf4){const _0x3f0f95=a296_0x5c2e02,_0x5cfe18=_0x475cf4?.[_0x3f0f95(0x16c)](/[`"]/g,'');_0x5cfe18&&_0x5cfe18!==UNRESOLVED_SQL_FRAGMENT&&!_0xdf7daa['includes'](_0x5cfe18)&&_0xdf7daa['push'](_0x5cfe18);}function extractParameters(_0x328bc7){const _0x2a80ad=a296_0x5c2e02,_0xb19131=new Set();for(const _0x45346f of _0x328bc7[_0x2a80ad(0x173)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x45346f[0x1])_0xb19131[_0x2a80ad(0x153)](_0x45346f[0x1]);}return Array[_0x2a80ad(0x16a)](_0xb19131);}export function validateSql(_0x6d8eec){const _0x49cf11=a296_0x5c2e02,_0x464191=normalizeSqlForStaticAnalysis(_0x6d8eec),_0x513c49=detectNormalizedSqlType(_0x464191),_0x5ac7e0=stripStaticAnalysisMarkers(_0x464191[_0x49cf11(0x19e)]),_0x199fd4=_0x464191[_0x49cf11(0x17d)]?[]:extractTables(_0x5ac7e0,_0x513c49[_0x49cf11(0x171)]),_0x3e9241=_0x464191[_0x49cf11(0x17d)]?[]:extractParameters(_0x5ac7e0);if(_0x513c49[_0x49cf11(0x1aa)])return{'valid':![],'sqlType':_0x513c49,'tables':_0x199fd4,'parameters':_0x3e9241,'message':_0x513c49[_0x49cf11(0x19d)]||_0x513c49[_0x49cf11(0x171)]+_0x49cf11(0x18f)};if(_0x513c49['type']===_0x49cf11(0x188))return{'valid':![],'sqlType':_0x513c49,'tables':_0x199fd4,'parameters':_0x3e9241,'message':_0x464191['error']?'Unable\x20to\x20detect\x20SQL\x20type.\x20'+_0x464191[_0x49cf11(0x17d)]:_0x513c49[_0x49cf11(0x19d)]?_0x49cf11(0x15c)+_0x513c49[_0x49cf11(0x19d)]:'Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.'};return{'valid':!![],'sqlType':_0x513c49,'tables':_0x199fd4,'parameters':_0x3e9241,'message':_0x513c49[_0x49cf11(0x171)]+'\x20query\x20targeting\x20'+(_0x199fd4['length']?_0x199fd4[_0x49cf11(0x181)](',\x20'):_0x49cf11(0x182))+(_0x3e9241['length']?_0x49cf11(0x15e)+_0x3e9241[_0x49cf11(0x181)](',\x20'):'')};}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a297_0xd4415a=a297_0x33e8;(function(_0x5f3b91,_0x645941){const _0x5c3ee0=a297_0x33e8,_0x4cb48f=_0x5f3b91();while(!![]){try{const _0x2e1c0b=-parseInt(_0x5c3ee0(0x115))/0x1+parseInt(_0x5c3ee0(0x101))/0x2*(-parseInt(_0x5c3ee0(0xfd))/0x3)+-parseInt(_0x5c3ee0(0x118))/0x4+parseInt(_0x5c3ee0(0x112))/0x5+parseInt(_0x5c3ee0(0x114))/0x6+-parseInt(_0x5c3ee0(0x106))/0x7*(-parseInt(_0x5c3ee0(0x10d))/0x8)+parseInt(_0x5c3ee0(0x10b))/0x9;if(_0x2e1c0b===_0x645941)break;else _0x4cb48f['push'](_0x4cb48f['shift']());}catch(_0x135fb8){_0x4cb48f['push'](_0x4cb48f['shift']());}}}(a297_0x5349,0xa993b));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';export{CliError};function a297_0x5349(){const _0x1887d3=['config_missing','Check\x20your\x20internet\x20connection\x20and\x20try\x20again.','\x20--help`\x20to\x20see\x20available\x20commands.','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.\x0a\x20\x20\x20\x20\x20\x20\x20Tip:\x20`','2002240QWjxdC','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>\x20--global`\x20registers\x20a\x20reusable\x20global\x20app\x20profile.','4149138hSpRaq','821424CNfEUS','cancelled','Authentication\x20required','4297516NXALOS','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','1683597jrUQjn','Operation\x20cancelled.','Network\x20error:\x20','not_in_project','4siFWkG','Missing\x20required\x20flag:\x20--','\x20auth`\x20to\x20login\x20first.','apiError','unknown_command','14XODbIk','Not\x20in\x20a\x20','Set\x20appcode\x20via\x20`','Run\x20`','\x20project\x20directory','18742887IgycSM','validation','2153096xCPXjj'];a297_0x5349=function(){return _0x1887d3;};return a297_0x5349();}function a297_0x33e8(_0x4be877,_0x57e12c){_0x4be877=_0x4be877-0xfd;const _0x534991=a297_0x5349();let _0x33e874=_0x534991[_0x4be877];return _0x33e874;}const baseCliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a297_0xd4415a(0x109)+CLI_BIN_NAME+a297_0xd4415a(0x103),'configMissingHint':a297_0xd4415a(0x108)+CLI_BIN_NAME+a297_0xd4415a(0x111)+CLI_BIN_NAME+a297_0xd4415a(0x113),'notInProjectHint':a297_0xd4415a(0x119)});export const CliErrors={'authRequired'(_0xa38af0){const _0x3ef45b=a297_0xd4415a;return new CliError('auth_required',0x1,_0x3ef45b(0x117),_0xa38af0??_0x3ef45b(0x109)+CLI_BIN_NAME+_0x3ef45b(0x103));},'configMissing'(_0x4bd971){const _0x1858b3=a297_0xd4415a;return new CliError(_0x1858b3(0x10e),0x1,'Configuration\x20file\x20not\x20found',_0x4bd971??_0x1858b3(0x108)+CLI_BIN_NAME+_0x1858b3(0x111)+CLI_BIN_NAME+_0x1858b3(0x113));},'notInProject'(){const _0x2e18b3=a297_0xd4415a;return new CliError(_0x2e18b3(0x100),0x1,_0x2e18b3(0x107)+CLI_BIN_NAME+_0x2e18b3(0x10a),'Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.');},'apiError'(_0x3160d5,_0x4eac92){const _0x12b169=a297_0xd4415a;return baseCliErrors[_0x12b169(0x104)](_0x3160d5,_0x4eac92);},'networkError'(_0x1ee275){const _0x4aa9cf=a297_0xd4415a;return new CliError('network_error',0x2,_0x4aa9cf(0xff)+_0x1ee275,_0x4aa9cf(0x10f));},'unknownCommand'(_0x16a97d){const _0x1f63ae=a297_0xd4415a;return new CliError(_0x1f63ae(0x105),0x1,'Unknown\x20command:\x20'+_0x16a97d,_0x1f63ae(0x109)+CLI_BIN_NAME+_0x1f63ae(0x110));},'flagMissing'(_0x47942d,_0x48f4bb){const _0x15176a=a297_0xd4415a;return new CliError('flag_missing',0x1,_0x15176a(0x102)+_0x47942d,_0x48f4bb);},'validation'(_0x5180c7,_0x1115eb){const _0x8ac6fa=a297_0xd4415a;return baseCliErrors[_0x8ac6fa(0x10c)](_0x5180c7,_0x1115eb);},'cancelled'(_0x46ad0a){const _0x319bea=a297_0xd4415a;return new CliError(_0x319bea(0x116),0x0,_0x46ad0a??_0x319bea(0xfe));}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2cf05a,_0x309bbe){const _0x2da906=a298_0x1608,_0x535b72=_0x2cf05a();while(!![]){try{const _0xb2c8be=-parseInt(_0x2da906(0x74))/0x1*(parseInt(_0x2da906(0x78))/0x2)+-parseInt(_0x2da906(0x80))/0x3*(-parseInt(_0x2da906(0x7f))/0x4)+-parseInt(_0x2da906(0x7e))/0x5+-parseInt(_0x2da906(0x77))/0x6+-parseInt(_0x2da906(0x76))/0x7*(parseInt(_0x2da906(0x7d))/0x8)+-parseInt(_0x2da906(0x7c))/0x9*(parseInt(_0x2da906(0x75))/0xa)+-parseInt(_0x2da906(0x79))/0xb*(-parseInt(_0x2da906(0x81))/0xc);if(_0xb2c8be===_0x309bbe)break;else _0x535b72['push'](_0x535b72['shift']());}catch(_0x1245b9){_0x535b72['push'](_0x535b72['shift']());}}}(a298_0x2598,0xd732f));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a298_0x3548f7}from'@lovrabet/cli-framework';function a298_0x1608(_0x343b97,_0x2cae4b){_0x343b97=_0x343b97-0x74;const _0x25987c=a298_0x2598();let _0x16086c=_0x25987c[_0x343b97];return _0x16086c;}import{EXPLICIT_YES_FLAG_DESCRIPTION,requiresExplicitYes}from'../framework/explicit-yes.js';function a298_0x2598(){const _0x52df9b=['1578lYSJUZ','53978716hhLOdz','yes','map','1213686VPhnsi','49768WSAxOY','2724120XCqRQJ','496egjOoa','4809PpbUKx','12kDHlcA','1565YeUkYM','60hSYlNr','1309SBMkMm','2834478jxcKZC'];a298_0x2598=function(){return _0x52df9b;};return a298_0x2598();}export function buildAllFlags(_0x693454){const _0x38339b=a298_0x1608,_0x32d882=a298_0x3548f7(_0x693454,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});if(!requiresExplicitYes(_0x693454))return _0x32d882;return _0x32d882[_0x38339b(0x7b)](_0x516f6a=>_0x516f6a['name']===_0x38339b(0x7a)?{..._0x516f6a,'description':EXPLICIT_YES_FLAG_DESCRIPTION}:_0x516f6a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x53cac1,_0x282708){var _0x3c10bb=a299_0x2181,_0xd854fc=_0x53cac1();while(!![]){try{var _0x1c9f3a=parseInt(_0x3c10bb(0x19d))/0x1*(parseInt(_0x3c10bb(0x19f))/0x2)+-parseInt(_0x3c10bb(0x1a3))/0x3+parseInt(_0x3c10bb(0x199))/0x4*(parseInt(_0x3c10bb(0x19a))/0x5)+-parseInt(_0x3c10bb(0x1a0))/0x6+parseInt(_0x3c10bb(0x1a4))/0x7+parseInt(_0x3c10bb(0x1a2))/0x8+-parseInt(_0x3c10bb(0x19b))/0x9;if(_0x1c9f3a===_0x282708)break;else _0xd854fc['push'](_0xd854fc['shift']());}catch(_0x9a046d){_0xd854fc['push'](_0xd854fc['shift']());}}}(a299_0x3a47,0x3aaa0));function a299_0x3a47(){var _0x203c39=['def','4mAHJJH','structuredErrors','47118TZWiER','65826SzvOSH','defaultFormat','3694832rtqLPi','212445OYQRMD','2944116tzhiRn','compress','4632svEBDp','530dOoyLb','6996168walttn'];a299_0x3a47=function(){return _0x203c39;};return a299_0x3a47();}import{resolveOutputConfig}from'@lovrabet/cli-framework';function a299_0x2181(_0x4f6792,_0x1b0b4d){_0x4f6792=_0x4f6792-0x199;var _0x3a47b1=a299_0x3a47();var _0x2181ba=_0x3a47b1[_0x4f6792];return _0x2181ba;}export function usesStructuredErrorOutput(_0x551a7f){var _0x4e64be=a299_0x2181;return _0x551a7f?.[_0x4e64be(0x19e)]===!![];}export function resolveErrorOutputFormat(_0x51e7a5){var _0x1d7e10=a299_0x2181;if(!_0x51e7a5[_0x1d7e10(0x19c)])return _0x51e7a5[_0x1d7e10(0x1a1)]??_0x1d7e10(0x1a5);return resolveOutputConfig({'flags':_0x51e7a5['flags']??{},'def':_0x51e7a5[_0x1d7e10(0x19c)],'configDefault':_0x51e7a5[_0x1d7e10(0x1a1)]})['format'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a300_0x25ee76=a300_0x21a0;function a300_0x36dd(){const _0x3eb2aa=['16TRosJI','28ocAuMM','4179728vtsTmt','664557KSUiGc','notification\x20config-delete','37113270gKtDkE','17kNItUY','14595525XsrBTY','kb\x20delete','service','223658tKRHpp','7834434gnDvoW','command','has','3223115fUwJku','menu\x20delete'];a300_0x36dd=function(){return _0x3eb2aa;};return a300_0x36dd();}(function(_0x240ef5,_0x2a6d93){const _0x302add=a300_0x21a0,_0x17b790=_0x240ef5();while(!![]){try{const _0x30decf=parseInt(_0x302add(0x129))/0x1*(-parseInt(_0x302add(0x12d))/0x2)+-parseInt(_0x302add(0x126))/0x3*(-parseInt(_0x302add(0x134))/0x4)+-parseInt(_0x302add(0x131))/0x5+-parseInt(_0x302add(0x12e))/0x6+-parseInt(_0x302add(0x135))/0x7*(-parseInt(_0x302add(0x133))/0x8)+-parseInt(_0x302add(0x12a))/0x9+parseInt(_0x302add(0x128))/0xa;if(_0x30decf===_0x2a6d93)break;else _0x17b790['push'](_0x17b790['shift']());}catch(_0x2ba5d3){_0x17b790['push'](_0x17b790['shift']());}}}(a300_0x36dd,0xeffcc));const EXPLICIT_YES_COMMANDS=new Set([a300_0x25ee76(0x132),a300_0x25ee76(0x12b),'notification\x20config-update',a300_0x25ee76(0x127)]);export const EXPLICIT_YES_FLAG_DESCRIPTION='Required\x20for\x20execution\x20after\x20reviewing\x20the\x20--dry-run\x20plan';function a300_0x21a0(_0xa13157,_0x4a1772){_0xa13157=_0xa13157-0x126;const _0x36dd36=a300_0x36dd();let _0x21a00d=_0x36dd36[_0xa13157];return _0x21a00d;}export function requiresExplicitYes(_0x3062b5){const _0x4a258f=a300_0x25ee76;return EXPLICIT_YES_COMMANDS[_0x4a258f(0x130)](_0x3062b5[_0x4a258f(0x12c)]+'\x20'+_0x3062b5[_0x4a258f(0x12f)]);}
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a301_0x26362c=a301_0x41aa;(function(_0x44db19,_0x44a7f4){const _0x5b1ab7=a301_0x41aa,_0x27f9b0=_0x44db19();while(!![]){try{const _0x41371a=-parseInt(_0x5b1ab7(0x88))/0x1*(-parseInt(_0x5b1ab7(0x84))/0x2)+-parseInt(_0x5b1ab7(0x8a))/0x3+parseInt(_0x5b1ab7(0x85))/0x4+parseInt(_0x5b1ab7(0x87))/0x5+parseInt(_0x5b1ab7(0x83))/0x6+parseInt(_0x5b1ab7(0x86))/0x7*(-parseInt(_0x5b1ab7(0x8c))/0x8)+-parseInt(_0x5b1ab7(0x89))/0x9;if(_0x41371a===_0x44a7f4)break;else _0x27f9b0['push'](_0x27f9b0['shift']());}catch(_0x5296a0){_0x27f9b0['push'](_0x27f9b0['shift']());}}}(a301_0x38e8,0xc7459));function a301_0x41aa(_0x3e9bae,_0x37d1c3){_0x3e9bae=_0x3e9bae-0x83;const _0x38e8a3=a301_0x38e8();let _0x41aad9=_0x38e8a3[_0x3e9bae];return _0x41aad9;}import{createFlagHelpers}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers['parseFlags'];export const validateFlags=helpers[a301_0x26362c(0x8b)];function a301_0x38e8(){const _0x168141=['371216vUhdwy','5384220DMYefs','59128vSpSTc','3672320ZxsqcK','14zSCpXq','3028890hrWodb','25CJBnyc','12414717qhCCRH','2615682SGyrem','validateFlags'];a301_0x38e8=function(){return _0x168141;};return a301_0x38e8();}
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a302_0x16ad(){const _0x26a0dc=['get','Requires\x20explicit\x20--yes\x20for\x20execution;\x20use\x20--dry-run\x20to\x20preview.','generateServiceHelp','Requires\x20appcode\x20(set\x20via\x20`','2586612LgZzQL','48296cBQGvI','202148EfpmqI','213001MmVxje','Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.','203deYqdg','generateCommandHelp','1055862wHKFVH','88920xSbcth','\x20workspace\x20init`\x20or\x20--appcode).','replace','1224170eIAgnQ'];a302_0x16ad=function(){return _0x26a0dc;};return a302_0x16ad();}(function(_0x4db6ae,_0x370a40){const _0x317b13=a302_0x543c,_0x33196e=_0x4db6ae();while(!![]){try{const _0xf5b2ce=-parseInt(_0x317b13(0xfc))/0x1+parseInt(_0x317b13(0xfb))/0x2+parseInt(_0x317b13(0x100))/0x3+parseInt(_0x317b13(0x101))/0x4+parseInt(_0x317b13(0x104))/0x5+-parseInt(_0x317b13(0xf9))/0x6+-parseInt(_0x317b13(0xfe))/0x7*(-parseInt(_0x317b13(0xfa))/0x8);if(_0xf5b2ce===_0x370a40)break;else _0x33196e['push'](_0x33196e['shift']());}catch(_0x302e00){_0x33196e['push'](_0x33196e['shift']());}}}(a302_0x16ad,0x3d4b6));import{createHelpGenerators}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{requiresExplicitYes}from'../framework/explicit-yes.js';function createGenerators(){const _0x14c514=a302_0x543c;return createHelpGenerators({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'globalFlags':GLOBAL_FLAGS,'serviceRegistry':serviceRegistry,'getServiceEntry':getServiceEntry,'getServiceDefinitions':_0x1adba0=>serviceGroups[_0x14c514(0x105)](_0x1adba0),'buildAllFlags':buildAllFlags,'appPrerequisiteText':_0x14c514(0x108)+CLI_BIN_NAME+_0x14c514(0x102),'serviceUsageSuffix':'\x20[args]\x20[flags]'});}export function generateCommandHelp(_0x4d25c4){const _0x808599=a302_0x543c,_0x249e2b=createGenerators()[_0x808599(0xff)](_0x4d25c4);if(!requiresExplicitYes(_0x4d25c4))return _0x249e2b;return _0x249e2b[_0x808599(0x103)](_0x808599(0xfd),_0x808599(0x106));}export function generateServiceHelp(_0x2b4fea){const _0x307642=a302_0x543c;return createGenerators()[_0x307642(0x107)](_0x2b4fea);}function a302_0x543c(_0x5b6a65,_0x29765b){_0x5b6a65=_0x5b6a65-0xf9;const _0x16ad6e=a302_0x16ad();let _0x543cf8=_0x16ad6e[_0x5b6a65];return _0x543cf8;}export function generateFullHelp(){return createGenerators()['generateFullHelp']();}
|
package/lib/framework/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x25a459,_0x4d0304){var _0x4822df=a303_0x22bf,_0xea9921=_0x25a459();while(!![]){try{var _0x39f17f=-parseInt(_0x4822df(0x114))/0x1*(parseInt(_0x4822df(0x117))/0x2)+-parseInt(_0x4822df(0x111))/0x3+-parseInt(_0x4822df(0x110))/0x4*(parseInt(_0x4822df(0x10e))/0x5)+parseInt(_0x4822df(0x113))/0x6+-parseInt(_0x4822df(0x112))/0x7*(-parseInt(_0x4822df(0x118))/0x8)+parseInt(_0x4822df(0x116))/0x9+parseInt(_0x4822df(0x10f))/0xa*(parseInt(_0x4822df(0x115))/0xb);if(_0x39f17f===_0x4d0304)break;else _0xea9921['push'](_0xea9921['shift']());}catch(_0x18e7d4){_0xea9921['push'](_0xea9921['shift']());}}}(a303_0x5f11,0x924ae));function a303_0x22bf(_0x392c78,_0x3be1ec){_0x392c78=_0x392c78-0x10e;var _0x5f11dc=a303_0x5f11();var _0x22bf2d=_0x5f11dc[_0x392c78];return _0x22bf2d;}export{runCommand}from'../framework/runner.js';export{parseFlags,validateFlags}from'../framework/flags.js';export{formatOutput}from'../framework/output.js';export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'../framework/help.js';export{extractList,extractPaging}from'../framework/response.js';function a303_0x5f11(){var _0x1d6de5=['2145972vvHKGv','3hIYBqI','5665gRCkTN','2382831hhvIko','401444RKkudz','6806648sFXzKR','7915JjJorH','2780pIierj','124ItkcfC','1097907rMytCh','7BeCLUa'];a303_0x5f11=function(){return _0x1d6de5;};return a303_0x5f11();}export{riskLevelOrder}from'../framework/types.js';
|