@lovrabet/rabetbase-cli 2.5.10-beta.2 → 2.5.10-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -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.d.ts +2 -2
- 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/detail.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.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/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.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/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.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/page-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.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/context.d.ts +3 -0
- package/lib/commands/issue/context.js +1 -0
- 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/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/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.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/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.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/feishu-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.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/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-analysis.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.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/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.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.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/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 +2 -2
- package/skills/rabetbase/SKILL.md +2 -2
- package/skills/rabetbase/references/rabetbase-issue-report.md +4 -1
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
- package/lib/commands/issue/shared.d.ts +0 -32
- package/lib/commands/issue/shared.js +0 -1
- package/lib/telemetry/send-platform-issue-collect-log.d.ts +0 -26
- package/lib/telemetry/send-platform-issue-collect-log.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a304_0x491447=a304_0x4615;(function(_0x4d07ce,_0x2c98a6){const _0x48c407=a304_0x4615,_0xde68f7=_0x4d07ce();while(!![]){try{const _0x520562=-parseInt(_0x48c407(0x1f5))/0x1+-parseInt(_0x48c407(0x1f0))/0x2*(-parseInt(_0x48c407(0x202))/0x3)+parseInt(_0x48c407(0x209))/0x4*(parseInt(_0x48c407(0x1fc))/0x5)+parseInt(_0x48c407(0x20a))/0x6*(-parseInt(_0x48c407(0x206))/0x7)+parseInt(_0x48c407(0x200))/0x8*(parseInt(_0x48c407(0x1fb))/0x9)+parseInt(_0x48c407(0x1f6))/0xa*(-parseInt(_0x48c407(0x207))/0xb)+-parseInt(_0x48c407(0x1ff))/0xc;if(_0x520562===_0x2c98a6)break;else _0xde68f7['push'](_0xde68f7['shift']());}catch(_0x3d7557){_0xde68f7['push'](_0xde68f7['shift']());}}}(a304_0x37d0,0x3e9eb));function a304_0x37d0(){const _0x2c8e0c=['sort','7KQdjIm','951511DHqsjN','isDirectory','16676IEJqxq','869358bLcRKv','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','split','cwd','39986IfHeAF','name','.rabetbase','validation','utf8','174776ATSoDg','50oEmmpU','isFile','Unsupported\x20file\x20in\x20page\x20directory:\x20','page','Page\x20directory\x20not\x20found:\x20','742725CRALOD','545LyWeqz','page.lock.json','localeCompare','398544ItHlpC','24asbPUB','.json','51JqSHLq','F_OK','flagMissing'];a304_0x37d0=function(){return _0x2c8e0c;};return a304_0x37d0();}import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';function a304_0x4615(_0x45a67c,_0x3e0ab0){_0x45a67c=_0x45a67c-0x1f0;const _0x37d0ad=a304_0x37d0();let _0x4615a2=_0x37d0ad[_0x45a67c];return _0x4615a2;}import{dirname,join,relative,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x6a05d6,_0xf3812a=process[a304_0x491447(0x20d)]()){const _0x373382=a304_0x491447,_0x194381=resolve(_0xf3812a),_0x22fa8c=join(_0x194381,'.rabetbase',_0x373382(0x1f9));return{'projectRoot':_0x194381,'pagesBaseDir':_0x22fa8c,'appPagesDir':join(_0x22fa8c,_0x6a05d6),'lockFilePath':join(_0x194381,_0x373382(0x1f2),_0x373382(0x1fd))};}export function buildPageFileName(_0x47189f,_0x2c6d03){const _0x3d5489=a304_0x491447;return _0x47189f+'-'+_0x2c6d03['toUpperCase']()+_0x3d5489(0x201);}export function resolvePageFilePath(_0x2661df,_0x14326f,_0x5115ed){return join(_0x2661df['appPagesDir'],buildPageFileName(_0x14326f,_0x5115ed));}export async function ensureParentDirectory(_0x4e8932){await mkdir(dirname(_0x4e8932),{'recursive':!![]});}export async function fileExists(_0x3d1702){const _0x294176=a304_0x491447;try{return await access(_0x3d1702,constants[_0x294176(0x203)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0x42b500){const _0x402db9=a304_0x491447,_0x493037=_0x42b500['trim']();if(!_0x493037)throw CliErrors[_0x402db9(0x204)]('page-dir');const _0x50d507=resolve(_0x493037);let _0xc9dee9;try{_0xc9dee9=await lstat(_0x50d507);}catch{throw CliErrors[_0x402db9(0x1f3)](_0x402db9(0x1fa)+_0x493037);}if(!_0xc9dee9['isDirectory']())throw CliErrors[_0x402db9(0x1f3)](_0x402db9(0x20b)+_0x493037);const _0x4e4f01={};return await readDirectory(_0x50d507,_0x50d507,_0x4e4f01),_0x4e4f01;}async function readDirectory(_0x410d4b,_0x494410,_0x1e7db4){const _0x361781=a304_0x491447,_0x108af5=await readdir(_0x494410,{'withFileTypes':!![]});for(const _0x18d00f of _0x108af5[_0x361781(0x205)]((_0x2e7f32,_0x105e91)=>_0x2e7f32[_0x361781(0x1f1)][_0x361781(0x1fe)](_0x105e91['name']))){const _0xd073e1=join(_0x494410,_0x18d00f[_0x361781(0x1f1)]);if(_0x18d00f[_0x361781(0x208)]()){await readDirectory(_0x410d4b,_0xd073e1,_0x1e7db4);continue;}if(!_0x18d00f[_0x361781(0x1f7)]())throw CliErrors[_0x361781(0x1f3)](_0x361781(0x1f8)+_0xd073e1);_0x1e7db4[relative(_0x410d4b,_0xd073e1)[_0x361781(0x20c)](sep)['join']('/')]=await readFile(_0xd073e1,_0x361781(0x1f4));}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x15a70a,_0x1baa9f){const _0x5069db=a305_0x2b45,_0x5b2758=_0x15a70a();while(!![]){try{const _0x50a3f6=-parseInt(_0x5069db(0x1a8))/0x1+parseInt(_0x5069db(0x1b1))/0x2+parseInt(_0x5069db(0x1a7))/0x3+parseInt(_0x5069db(0x1a9))/0x4+-parseInt(_0x5069db(0x1af))/0x5+parseInt(_0x5069db(0x1b0))/0x6*(-parseInt(_0x5069db(0x1a3))/0x7)+parseInt(_0x5069db(0x1a6))/0x8*(parseInt(_0x5069db(0x1ac))/0x9);if(_0x50a3f6===_0x1baa9f)break;else _0x5b2758['push'](_0x5b2758['shift']());}catch(_0x25d0fd){_0x5b2758['push'](_0x5b2758['shift']());}}}(a305_0xe1f8,0x444e0));import a305_0x507aa9 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x13aa6d){const _0x5b4bd0=a305_0x2b45;return JSON[_0x5b4bd0(0x1ae)](JSON[_0x5b4bd0(0x1ab)](_0x13aa6d),null,0x2)+'\x0a';}function a305_0xe1f8(){const _0x3719dc=['md5','12296BDdJQt','863721GAqdJK','428084DkcxQv','248620RvsMGe','update','parse','4689DxhChp','digest','stringify','1666365ZtHLUI','6uyjviI','703558KYKcFf','hex','3230395SWREGN','createHash'];a305_0xe1f8=function(){return _0x3719dc;};return a305_0xe1f8();}export function computePageContentHash(_0x5db2ed){const _0x10ce08=a305_0x2b45;return a305_0x507aa9[_0x10ce08(0x1a4)](_0x10ce08(0x1a5))[_0x10ce08(0x1aa)](_0x5db2ed)[_0x10ce08(0x1ad)](_0x10ce08(0x1b2));}function a305_0x2b45(_0x3e1290,_0x527791){_0x3e1290=_0x3e1290-0x1a3;const _0xe1f825=a305_0xe1f8();let _0x2b4593=_0xe1f825[_0x3e1290];return _0x2b4593;}export function computeSerializedSchemaHash(_0x4c051a){return computePageContentHash(serializePageSchemaForFile(_0x4c051a));}export async function computePageFileHash(_0xab7195){const _0x4ec18d=await readFile(_0xab7195,'utf8');return computePageContentHash(_0x4ec18d);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5745cb,_0x16c47f){const _0x54458e=a306_0x4f60,_0x4e4a06=_0x5745cb();while(!![]){try{const _0x46ca79=-parseInt(_0x54458e(0x1a5))/0x1*(-parseInt(_0x54458e(0x1ac))/0x2)+parseInt(_0x54458e(0x1a7))/0x3+parseInt(_0x54458e(0x1a0))/0x4+parseInt(_0x54458e(0x1a1))/0x5*(-parseInt(_0x54458e(0x1ad))/0x6)+-parseInt(_0x54458e(0x19e))/0x7*(parseInt(_0x54458e(0x1a4))/0x8)+parseInt(_0x54458e(0x19c))/0x9*(parseInt(_0x54458e(0x199))/0xa)+-parseInt(_0x54458e(0x1a6))/0xb*(parseInt(_0x54458e(0x19a))/0xc);if(_0x46ca79===_0x16c47f)break;else _0x4e4a06['push'](_0x4e4a06['shift']());}catch(_0x5066a5){_0x4e4a06['push'](_0x4e4a06['shift']());}}}(a306_0x50c9,0xaccb5));function a306_0x4f60(_0x207498,_0x2c0eec){_0x207498=_0x207498-0x199;const _0x50c98c=a306_0x50c9();let _0x4f60e9=_0x50c98c[_0x207498];return _0x4f60e9;}function a306_0x50c9(){const _0x16f87e=['612808IPhHmH','28955465ZBSCvG','2022921UEAmcc','code','apps','ENOENT','stringify','4UiANwi','4584lhmDea','960590jbFHWN','12RaDTCJ','object','81ZZPxBy','utf8','7eTirlu','lastSync','5514076dQprUx','1640ayPDQq','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','pages','4418408VHzZJH'];a306_0x50c9=function(){return _0x16f87e;};return a306_0x50c9();}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x543997,_0x15f2a9){const _0x3d9e54=a306_0x4f60,_0x564b20={'apps':_0x543997[_0x3d9e54(0x1a9)]&&typeof _0x543997[_0x3d9e54(0x1a9)]===_0x3d9e54(0x19b)?_0x543997[_0x3d9e54(0x1a9)]:{}};let _0xb32458=_0x564b20[_0x3d9e54(0x1a9)][_0x15f2a9];if(!_0xb32458)return _0xb32458={'lastSync':'','pages':{}},_0x564b20['apps'][_0x15f2a9]=_0xb32458,{'lockData':_0x564b20,'appLock':_0xb32458};return!_0xb32458[_0x3d9e54(0x19f)]&&(_0xb32458[_0x3d9e54(0x19f)]=''),(!_0xb32458[_0x3d9e54(0x1a3)]||typeof _0xb32458['pages']!==_0x3d9e54(0x19b))&&(_0xb32458['pages']={}),{'lockData':_0x564b20,'appLock':_0xb32458};}export async function readPageLockFile(_0x3b3fb6){const _0x9c9a82=a306_0x4f60;try{const _0x23ff67=await readFile(_0x3b3fb6,_0x9c9a82(0x19d)),_0xea9ebd=JSON['parse'](_0x23ff67);return{'apps':_0xea9ebd[_0x9c9a82(0x1a9)]&&typeof _0xea9ebd['apps']===_0x9c9a82(0x19b)?_0xea9ebd['apps']:{}};}catch(_0x293f12){if(_0x293f12[_0x9c9a82(0x1a8)]===_0x9c9a82(0x1aa))return null;throw new Error(_0x9c9a82(0x1a2)+String(_0x293f12));}}export async function writePageLockFile(_0x298d12,_0x531e07){const _0x2c0821=a306_0x4f60;await mkdir(dirname(_0x298d12),{'recursive':!![]}),await writeFile(_0x298d12,JSON[_0x2c0821(0x1ab)](_0x531e07,null,0x2),_0x2c0821(0x19d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1dbce3,_0x3f43f8){const _0x110a77=a307_0x5e59,_0x515020=_0x1dbce3();while(!![]){try{const _0x2c32ca=-parseInt(_0x110a77(0x15b))/0x1+-parseInt(_0x110a77(0x13c))/0x2*(parseInt(_0x110a77(0x131))/0x3)+parseInt(_0x110a77(0x15a))/0x4+-parseInt(_0x110a77(0x144))/0x5*(-parseInt(_0x110a77(0x149))/0x6)+-parseInt(_0x110a77(0x13f))/0x7*(parseInt(_0x110a77(0x159))/0x8)+parseInt(_0x110a77(0x14e))/0x9+-parseInt(_0x110a77(0x13e))/0xa*(parseInt(_0x110a77(0x139))/0xb);if(_0x2c32ca===_0x3f43f8)break;else _0x515020['push'](_0x515020['shift']());}catch(_0xf198be){_0x515020['push'](_0x515020['shift']());}}}(a307_0x49de,0xd9715));import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0x27655b,_0x4fdb0b,_0x56a173){const _0xfabcf1=a307_0x5e59,_0x3867ca=parseSchema(_0x27655b,_0xfabcf1(0x14a)),_0x4e6ae7=parseSchema(_0x4fdb0b,_0xfabcf1(0x141)),_0x4c64be=collectLrSmartJsx(_0x3867ca,!![]);if(_0x4c64be['length']===0x0)return{'content':_0x27655b,'compiledNodes':0x0,'normalizedNodes':0x0};const _0x50497c=new Map(collectLrSmartJsx(_0x4e6ae7)['map'](_0x4be4ef=>[_0x4be4ef[_0xfabcf1(0x14d)],_0x4be4ef]));let _0x474644=0x0,_0x4f7310=0x0;for(const _0x1fa038 of _0x4c64be){const _0x580d27=readNonEmptyString(_0x1fa038['render']['source']),_0x56a5ba=readNonEmptyString(_0x1fa038[_0xfabcf1(0x15c)]['value']),_0x5d76bd=_0x50497c[_0xfabcf1(0x138)](_0x1fa038['key']),_0x160900=readNonEmptyString(_0x5d76bd?.[_0xfabcf1(0x15c)]['source']),_0x436eb4=readNonEmptyString(_0x5d76bd?.[_0xfabcf1(0x15c)]['value']);let _0x10122b=![];_0x1fa038[_0xfabcf1(0x15c)][_0xfabcf1(0x152)]!==_0xfabcf1(0x13b)&&(_0x1fa038[_0xfabcf1(0x15c)]['type']=_0xfabcf1(0x13b),_0x10122b=!![]);!isPageContextExpression(_0x1fa038[_0xfabcf1(0x154)]['_context'])&&(_0x1fa038['props'][_0xfabcf1(0x153)]={'type':_0xfabcf1(0x147),'value':'this'},_0x10122b=!![]);if(!_0x580d27){if(!_0x56a5ba)throw CliErrors[_0xfabcf1(0x157)](_0xfabcf1(0x14b)+_0x1fa038[_0xfabcf1(0x132)]+_0xfabcf1(0x143),'Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.');if(_0x10122b)_0x4f7310+=0x1;continue;}const _0x28fa28=!_0x5d76bd||_0x580d27!==_0x160900,_0x547450=!_0x56a5ba;if(!_0x28fa28&&_0x56a5ba&&_0x436eb4&&_0x56a5ba!==_0x436eb4)throw CliErrors[_0xfabcf1(0x157)](_0xfabcf1(0x14b)+_0x1fa038[_0xfabcf1(0x132)]+_0xfabcf1(0x135),_0xfabcf1(0x137));if(_0x28fa28||_0x547450||!_0x436eb4){const _0x1805ad=readNonEmptyString(await _0x56a173(_0x580d27));if(!_0x1805ad)throw CliErrors[_0xfabcf1(0x151)](_0xfabcf1(0x140)+_0x1fa038[_0xfabcf1(0x132)]+'\x22.');_0x1fa038['render']['value']=_0x1805ad,_0x474644+=0x1,_0x10122b=!![];}if(_0x10122b)_0x4f7310+=0x1;}if(_0x4f7310===0x0)return{'content':_0x27655b,'compiledNodes':_0x474644,'normalizedNodes':_0x4f7310};return{'content':JSON['stringify'](_0x3867ca),'compiledNodes':_0x474644,'normalizedNodes':_0x4f7310};}function parseSchema(_0x188ef3,_0xbe4f6){const _0x19213d=a307_0x5e59;try{return JSON[_0x19213d(0x14c)](_0x188ef3);}catch{throw CliErrors[_0x19213d(0x157)]('Invalid\x20JSON\x20in\x20'+_0xbe4f6+_0x19213d(0x13a));}}function collectLrSmartJsx(_0x4475c4,_0x599f1a=![]){const _0x22a4ef=[],_0x1af38=(_0x23a564,_0x5ef65b)=>{const _0x98f39c=a307_0x5e59;if(Array[_0x98f39c(0x158)](_0x23a564)){_0x23a564[_0x98f39c(0x133)]((_0x4f5fb2,_0x52c248)=>_0x1af38(_0x4f5fb2,_0x5ef65b+'['+_0x52c248+']'));return;}if(!isObject(_0x23a564))return;if(_0x23a564[_0x98f39c(0x156)]===_0x98f39c(0x13d)){const _0x2f295c=readNonEmptyString(_0x23a564['id']),_0x48174b=_0x2f295c||_0x5ef65b,_0x5f1061=isObject(_0x23a564[_0x98f39c(0x154)])?_0x23a564['props']:undefined;if(!_0x5f1061){if(_0x599f1a)throw CliErrors[_0x98f39c(0x157)](_0x98f39c(0x14b)+_0x48174b+_0x98f39c(0x145),_0x98f39c(0x155));return;}const _0x2c67d9=isObject(_0x5f1061[_0x98f39c(0x15c)])?_0x5f1061['render']:undefined;if(!_0x2c67d9){if(_0x599f1a)throw CliErrors['validation']('LrSmartJsx\x20node\x20\x22'+_0x48174b+_0x98f39c(0x14f),'Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.');return;}_0x22a4ef[_0x98f39c(0x146)]({'key':_0x2f295c?_0x98f39c(0x136)+_0x2f295c:'path:'+_0x5ef65b,'label':_0x48174b,'props':_0x5f1061,'render':_0x2c67d9});}for(const [_0x2bf2ac,_0x1fe682]of Object[_0x98f39c(0x134)](_0x23a564)){if(_0x2bf2ac==='props'&&_0x23a564['componentName']===_0x98f39c(0x13d))continue;_0x1af38(_0x1fe682,_0x5ef65b+'.'+_0x2bf2ac);}};return _0x1af38(_0x4475c4,'$'),_0x22a4ef;}function isObject(_0x429ab9){return Boolean(_0x429ab9)&&typeof _0x429ab9==='object'&&!Array['isArray'](_0x429ab9);}function readNonEmptyString(_0x335574){const _0x32b03=a307_0x5e59;return typeof _0x335574===_0x32b03(0x150)&&_0x335574[_0x32b03(0x148)]()?_0x335574:undefined;}function a307_0x5e59(_0x1c00ee,_0xaf3948){_0x1c00ee=_0x1c00ee-0x131;const _0x49dea2=a307_0x49de();let _0x5e5915=_0x49dea2[_0x1c00ee];return _0x5e5915;}function isPageContextExpression(_0x82da23){const _0x4394e0=a307_0x5e59;return isObject(_0x82da23)&&_0x82da23[_0x4394e0(0x152)]===_0x4394e0(0x147)&&_0x82da23['value']===_0x4394e0(0x142);}function a307_0x49de(){const _0xdc4cd6=['221826aJEcjc','LrSmartJsx','7760tzCPRt','26215rKvOfY','LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22','remote','this','\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.','9535jmWYSD','\x22\x20has\x20missing\x20or\x20invalid\x20props.','push','JSExpression','trim','5490ziKfpk','local','LrSmartJsx\x20node\x20\x22','parse','key','11704248TIqRNL','\x22\x20has\x20missing\x20or\x20invalid\x20props.render.','string','apiError','type','_context','props','Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.','componentName','validation','isArray','2104dMlEvT','5144516cYteww','381287TdHPAa','render','21BSSDMN','label','forEach','entries','\x22\x20has\x20a\x20manually\x20changed\x20render.value.','id:','Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.','get','18403fueWCG','\x20page\x20schema.','JSFunction'];a307_0x49de=function(){return _0xdc4cd6;};return a307_0x49de();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2f0c89,_0x1f9ddc){const _0x1895d4=a309_0x35c2,_0x2bec6e=_0x2f0c89();while(!![]){try{const _0x42ab6e=parseInt(_0x1895d4(0x1da))/0x1*(parseInt(_0x1895d4(0x1bf))/0x2)+parseInt(_0x1895d4(0x1e6))/0x3*(-parseInt(_0x1895d4(0x1bd))/0x4)+parseInt(_0x1895d4(0x1c5))/0x5*(-parseInt(_0x1895d4(0x1b1))/0x6)+-parseInt(_0x1895d4(0x1d5))/0x7+-parseInt(_0x1895d4(0x1af))/0x8+parseInt(_0x1895d4(0x1bb))/0x9+parseInt(_0x1895d4(0x1d1))/0xa;if(_0x42ab6e===_0x1f9ddc)break;else _0x2bec6e['push'](_0x2bec6e['shift']());}catch(_0x1c85b5){_0x2bec6e['push'](_0x2bec6e['shift']());}}}(a309_0x55c8,0xc0cde));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x1ba9c1,_0x418e8a){const _0x6eb270=a309_0x35c2,_0x2d5279=[],_0x4818c9=normalizeSqlForStaticAnalysis(_0x1ba9c1),_0xb980b9=(_0x4818c9['error']?[]:extractJoinFacts(_0x4818c9[_0x6eb270(0x1ea)]))['map'](_0xf6b404=>{const _0x4d97ce=_0x6eb270;if(_0xf6b404[_0x4d97ce(0x1a7)]||_0xf6b404[_0x4d97ce(0x1f1)][_0x4d97ce(0x1ce)]===0x0)return _0x2d5279[_0x4d97ce(0x1dd)]({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0xf6b404[_0x4d97ce(0x1be)],'alias':_0xf6b404['alias'],'columns':_0xf6b404[_0x4d97ce(0x1f1)],'reason':_0xf6b404[_0x4d97ce(0x1d4)]??_0x4d97ce(0x1c6)}),{'table':_0xf6b404[_0x4d97ce(0x1be)],'alias':_0xf6b404['alias'],'columns':_0xf6b404[_0x4d97ce(0x1f1)],'status':_0x4d97ce(0x1c8)};const _0xe5edd0=resolveTableMetadata(_0x418e8a,_0xf6b404[_0x4d97ce(0x1be)]),_0x41dcc1=(_0xe5edd0?.[_0x4d97ce(0x1ed)]??[])[_0x4d97ce(0x1b8)](_0x2fb71b=>({'index':_0x2fb71b,'matchedPrefix':findEqualityPrefix(_0x2fb71b[_0x4d97ce(0x1f1)],_0xf6b404[_0x4d97ce(0x1f1)])}))[_0x4d97ce(0x1e8)](_0xe4600b=>_0xe4600b['matchedPrefix'][_0x4d97ce(0x1ce)]>0x0),_0xae488c=_0x41dcc1[_0x4d97ce(0x1d0)]((_0x3c0ba4,_0x39cb5d)=>!_0x3c0ba4||_0x39cb5d[_0x4d97ce(0x1d8)]['length']>_0x3c0ba4[_0x4d97ce(0x1d8)][_0x4d97ce(0x1ce)]?_0x39cb5d:_0x3c0ba4,_0x41dcc1[0x0]);if(_0xae488c)return{'table':_0xf6b404[_0x4d97ce(0x1be)],'alias':_0xf6b404[_0x4d97ce(0x1e2)],'columns':_0xf6b404['columns'],'status':_0x4d97ce(0x1eb),'matchedIndex':{..._0xae488c['index'],'matchedPrefix':_0xae488c[_0x4d97ce(0x1d8)]}};const _0x38184c=_0xe5edd0?.['indexes']['filter'](_0xdc12af=>_0xdc12af['columns'][_0x4d97ce(0x1b7)](_0x2eb5ed=>_0xf6b404[_0x4d97ce(0x1f1)][_0x4d97ce(0x1b7)](_0x2827a3=>columnNamesMatch(_0x2eb5ed,_0x2827a3))))??[];if(_0x38184c['length']>0x0)return _0x2d5279[_0x4d97ce(0x1dd)]({'code':_0x4d97ce(0x1b9),'table':_0xf6b404[_0x4d97ce(0x1be)],'alias':_0xf6b404['alias'],'columns':_0xf6b404[_0x4d97ce(0x1f1)],'reason':_0x4d97ce(0x1cb)}),{'table':_0xf6b404[_0x4d97ce(0x1be)],'alias':_0xf6b404[_0x4d97ce(0x1e2)],'columns':_0xf6b404['columns'],'status':_0x4d97ce(0x1b6),'candidateIndexes':_0x38184c};if(_0xe5edd0&&_0xe5edd0['metadataAvailable']!==![]&&_0xe5edd0['indexes']['length']>0x0&&_0xf6b404[_0x4d97ce(0x1f1)][_0x4d97ce(0x1ce)]>0x0)return _0x2d5279[_0x4d97ce(0x1dd)]({'code':'JOIN_INDEX_MISSING','table':_0xf6b404[_0x4d97ce(0x1be)],'alias':_0xf6b404['alias'],'columns':_0xf6b404['columns'],'reason':_0x4d97ce(0x1c4)}),{'table':_0xf6b404[_0x4d97ce(0x1be)],'alias':_0xf6b404[_0x4d97ce(0x1e2)],'columns':_0xf6b404[_0x4d97ce(0x1f1)],'status':_0x4d97ce(0x1b6)};return _0x2d5279[_0x4d97ce(0x1dd)]({'code':_0x4d97ce(0x1e4),'table':_0xf6b404['table'],'alias':_0xf6b404[_0x4d97ce(0x1e2)],'columns':_0xf6b404[_0x4d97ce(0x1f1)],'reason':_0xe5edd0?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':_0x4d97ce(0x1ac)}),{'table':_0xf6b404['table'],'alias':_0xf6b404[_0x4d97ce(0x1e2)],'columns':_0xf6b404[_0x4d97ce(0x1f1)],'status':_0x4d97ce(0x1c8)};});return{'checked':_0xb980b9[_0x6eb270(0x1ce)]>0x0,'joins':_0xb980b9,'warnings':_0x2d5279};}function extractJoinFacts(_0x5298d6){const _0x33720=a309_0x35c2,_0x7e4461=maskNestedQueries(stripSqlNoise(_0x5298d6)),_0x414ec5=maskQuotedIdentifiers(_0x7e4461),_0x584341=[],_0x1129cd=new Set(),_0x50b220=/\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 _0x15023b of _0x7e4461['matchAll'](_0x50b220)){const _0x528d9f=_0x15023b[_0x33720(0x1b4)]??0x0,_0x9c2509=_0x15023b[0x0]['search'](/\bJOIN\b/i),_0x1fd563=_0x528d9f+Math[_0x33720(0x1ba)](0x0,_0x9c2509);if(!/^JOIN\b/i[_0x33720(0x1aa)](_0x414ec5['slice'](_0x1fd563)))continue;_0x1129cd[_0x33720(0x1c3)](_0x1fd563);const _0x4f315d=normalizeIdentifier(_0x15023b[0x1]||_0x33720(0x1e3)),_0x31830c=normalizeIdentifier(_0x15023b[0x2]??''),_0x16a7db=normalizeIdentifier(_0x15023b[0x3]||_0x31830c['split']('.')['at'](-0x1)||_0x31830c),_0x3001ee=[],_0x82e03a=_0x31830c===_0x33720(0x1ae);let _0x2d5e9b=_0x4f315d==='right'||_0x4f315d===_0x33720(0x1ef)||_0x82e03a,_0xa1528f=_0x2d5e9b?_0x82e03a?_0x33720(0x1c9):_0x4f315d[_0x33720(0x1ec)]()+_0x33720(0x1ca):undefined;const _0x3af578=stripOuterParentheses(_0x15023b[0x4]??''),_0x216345=_0x3af578[_0x33720(0x1c7)](MYBATIS_DYNAMIC_START_MARKER)||_0x3af578[_0x33720(0x1c7)](MYBATIS_DYNAMIC_END_MARKER),_0x99bc78=_0x3af578[_0x33720(0x1c7)](MYBATIS_INCLUDE_MARKER);_0x216345&&(_0x2d5e9b=!![],_0xa1528f??=_0x33720(0x1c1));_0x99bc78&&(_0x2d5e9b=!![],_0xa1528f??=_0x33720(0x1ee));const _0x566110=_0x3af578[_0x33720(0x1f2)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x33720(0x1f2)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x33720(0x1f2)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x566110,'OR')&&(_0x2d5e9b=!![],_0xa1528f??=_0x33720(0x1e5));for(const _0x4ff861 of splitTopLevelAnd(_0x566110)){const _0x15a97f=stripOuterParentheses(_0x4ff861);if(hasTopLevelKeyword(_0x15a97f,'OR')){_0x2d5e9b=!![],_0xa1528f??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x5f24a2=splitEquality(_0x15a97f);if(!_0x5f24a2){containsColumnReference(_0x4ff861,_0x16a7db)&&(_0x2d5e9b=!![]);continue;}const _0x114b49=parseDirectColumnReference(_0x5f24a2[0x0],_0x16a7db),_0x1cbe5c=parseDirectColumnReference(_0x5f24a2[0x1],_0x16a7db),_0x1366a1=containsColumnReference(_0x5f24a2[0x0],_0x16a7db),_0x222cfe=containsColumnReference(_0x5f24a2[0x1],_0x16a7db),_0x351c5a=_0x114b49&&!_0x222cfe?_0x114b49:_0x1cbe5c&&!_0x1366a1?_0x1cbe5c:null;if(_0x351c5a&&!_0x3001ee['includes'](_0x351c5a))_0x3001ee['push'](_0x351c5a);else!_0x351c5a&&containsColumnReference(_0x4ff861,_0x16a7db)&&(_0x2d5e9b=!![]);}_0x584341[_0x33720(0x1dd)]({'table':_0x31830c,'alias':_0x16a7db,'columns':_0x3001ee,'unsupportedPredicate':_0x2d5e9b,'unsupportedReason':_0xa1528f,'containsUnresolvedInclude':_0x99bc78,'position':_0x1fd563});}for(const _0x4675ae of _0x414ec5[_0x33720(0x1d6)](/\bJOIN\b/gi)){const _0x395d4d=_0x4675ae[_0x33720(0x1b4)]??0x0;if(_0x1129cd[_0x33720(0x1ab)](_0x395d4d))continue;const _0x116bd1=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x33720(0x1a9)](_0x7e4461[_0x33720(0x1d7)](_0x395d4d+_0x4675ae[0x0][_0x33720(0x1ce)])),_0x4514eb=normalizeIdentifier(_0x116bd1?.[0x1]||'unknown'),_0x413782=normalizeIdentifier(_0x116bd1?.[0x2]||''),_0x17fd28=isSqlClauseKeyword(_0x413782)?_0x4514eb[_0x33720(0x1cd)]('.')['at'](-0x1)||_0x4514eb:_0x413782||_0x4514eb['split']('.')['at'](-0x1)||_0x4514eb;_0x584341[_0x33720(0x1dd)]({'table':_0x4514eb,'alias':_0x17fd28,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x33720(0x1a8),'position':_0x395d4d});}const _0x134974=_0x414ec5[_0x33720(0x1de)](MYBATIS_INCLUDE_MARKER);return _0x134974>=0x0&&!_0x584341[_0x33720(0x1b7)](_0x34e7ea=>_0x34e7ea[_0x33720(0x1cf)])&&_0x584341['push']({'table':_0x33720(0x1e7),'alias':_0x33720(0x1e7),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x33720(0x1df),'containsUnresolvedInclude':!![],'position':_0x134974}),_0x584341[_0x33720(0x1bc)]((_0x242056,_0xea44be)=>_0x242056[_0x33720(0x1f0)]-_0xea44be[_0x33720(0x1f0)]);}function stripSqlNoise(_0x55625b){const _0x794906=a309_0x35c2,_0x380a86=Array[_0x794906(0x1b2)](_0x55625b),_0x4fe4c0=(_0x2a16fb,_0x130a52)=>{for(let _0x4125d5=_0x2a16fb;_0x4125d5<_0x130a52;_0x4125d5+=0x1){_0x380a86[_0x4125d5]!=='\x0a'&&_0x380a86[_0x4125d5]!=='\x0d'&&(_0x380a86[_0x4125d5]='\x20');}};for(let _0x5abb21=0x0;_0x5abb21<_0x380a86[_0x794906(0x1ce)];_0x5abb21+=0x1){const _0x209567=_0x380a86[_0x5abb21],_0x5e5487=_0x380a86[_0x5abb21+0x1];if(_0x209567==='\x27'||_0x209567==='\x22'||_0x209567==='`'){const _0x1e0d29=_0x209567,_0x5b2c26=_0x5abb21;_0x5abb21+=0x1;while(_0x5abb21<_0x380a86[_0x794906(0x1ce)]){if(_0x380a86[_0x5abb21]==='\x5c'&&_0x5abb21+0x1<_0x380a86[_0x794906(0x1ce)]){_0x5abb21+=0x2;continue;}if(_0x380a86[_0x5abb21]!==_0x1e0d29){_0x5abb21+=0x1;continue;}if(_0x380a86[_0x5abb21+0x1]===_0x1e0d29){_0x5abb21+=0x2;continue;}break;}if(_0x1e0d29==='\x27')_0x4fe4c0(_0x5b2c26,Math[_0x794906(0x1b0)](_0x5abb21+0x1,_0x380a86[_0x794906(0x1ce)]));continue;}if(_0x209567==='-'&&_0x5e5487==='-'){const _0x3265f0=_0x5abb21;while(_0x5abb21<_0x380a86[_0x794906(0x1ce)]&&_0x380a86[_0x5abb21]!=='\x0a')_0x5abb21+=0x1;_0x4fe4c0(_0x3265f0,_0x5abb21);continue;}if(_0x209567==='/'&&_0x5e5487==='*'){const _0x33ff41=_0x5abb21;_0x5abb21+=0x2;while(_0x5abb21<_0x380a86[_0x794906(0x1ce)]&&!(_0x380a86[_0x5abb21]==='*'&&_0x380a86[_0x5abb21+0x1]==='/')){_0x5abb21+=0x1;}_0x5abb21=Math[_0x794906(0x1b0)](_0x5abb21+0x1,_0x380a86[_0x794906(0x1ce)]-0x1),_0x4fe4c0(_0x33ff41,_0x5abb21+0x1);continue;}if(_0x209567==='#'&&_0x5e5487!=='{'){const _0x31f080=_0x5abb21;while(_0x5abb21<_0x380a86[_0x794906(0x1ce)]&&_0x380a86[_0x5abb21]!=='\x0a')_0x5abb21+=0x1;_0x4fe4c0(_0x31f080,_0x5abb21);continue;}if((_0x209567==='#'||_0x209567==='$')&&_0x5e5487==='{'){const _0x2f0c92=_0x5abb21;_0x5abb21+=0x2;while(_0x5abb21<_0x380a86[_0x794906(0x1ce)]&&_0x380a86[_0x5abb21]!=='}')_0x5abb21+=0x1;_0x4fe4c0(_0x2f0c92,Math['min'](_0x5abb21+0x1,_0x380a86[_0x794906(0x1ce)]));}}return _0x380a86['join']('');}function maskQuotedIdentifiers(_0x31c26a){const _0x574166=a309_0x35c2,_0x3cd332=Array[_0x574166(0x1b2)](_0x31c26a);for(let _0x884216=0x0;_0x884216<_0x3cd332[_0x574166(0x1ce)];_0x884216+=0x1){const _0xac6330=_0x3cd332[_0x884216];if(_0xac6330!=='\x22'&&_0xac6330!=='`')continue;_0x884216+=0x1;while(_0x884216<_0x3cd332[_0x574166(0x1ce)]){if(_0x3cd332[_0x884216]===_0xac6330){if(_0x3cd332[_0x884216+0x1]===_0xac6330){_0x3cd332[_0x884216]='\x20',_0x3cd332[_0x884216+0x1]='\x20',_0x884216+=0x2;continue;}break;}_0x3cd332[_0x884216]='\x20',_0x884216+=0x1;}}return _0x3cd332['join']('');}function maskNestedQueries(_0x3ecfef){const _0x8cc4b0=a309_0x35c2,_0x4f6df3=Array[_0x8cc4b0(0x1b2)](_0x3ecfef);for(let _0x477e57=0x0;_0x477e57<_0x4f6df3['length'];_0x477e57+=0x1){if(_0x4f6df3[_0x477e57]!=='(')continue;const _0x5778f1=_0x3ecfef[_0x8cc4b0(0x1d7)](_0x477e57+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x8cc4b0(0x1aa)](_0x5778f1))continue;let _0x476994=0x1,_0x5c2057=_0x477e57+0x1;for(;_0x5c2057<_0x4f6df3[_0x8cc4b0(0x1ce)]&&_0x476994>0x0;_0x5c2057+=0x1){if(_0x4f6df3[_0x5c2057]==='(')_0x476994+=0x1;if(_0x4f6df3[_0x5c2057]===')')_0x476994-=0x1;}if(_0x476994!==0x0)continue;for(let _0x11c9fa=_0x477e57;_0x11c9fa<_0x5c2057;_0x11c9fa+=0x1){_0x4f6df3[_0x11c9fa]='\x20';}const _0x2a33d3=_0x8cc4b0(0x1ae);for(let _0x31ebd1=0x0;_0x31ebd1<_0x2a33d3['length']&&_0x477e57+_0x31ebd1<_0x5c2057;_0x31ebd1+=0x1){_0x4f6df3[_0x477e57+_0x31ebd1]=_0x2a33d3[_0x31ebd1];}_0x477e57=_0x5c2057-0x1;}return _0x4f6df3[_0x8cc4b0(0x1b5)]('');}function splitTopLevelAnd(_0x4ac764){const _0x12b958=a309_0x35c2,_0x50b053=[];let _0x4678e3=0x0,_0x1834b3=0x0;for(let _0x27b9cf=0x0;_0x27b9cf<_0x4ac764[_0x12b958(0x1ce)];_0x27b9cf+=0x1){const _0x2f9ade=_0x4ac764[_0x27b9cf];if(_0x2f9ade==='(')_0x4678e3+=0x1;if(_0x2f9ade===')')_0x4678e3=Math[_0x12b958(0x1ba)](0x0,_0x4678e3-0x1);_0x4678e3===0x0&&_0x4ac764[_0x12b958(0x1d7)](_0x27b9cf)['match'](/^AND\b/i)&&(_0x27b9cf===0x0||/\s/[_0x12b958(0x1aa)](_0x4ac764[_0x27b9cf-0x1]??''))&&(_0x50b053[_0x12b958(0x1dd)](_0x4ac764[_0x12b958(0x1d7)](_0x1834b3,_0x27b9cf)[_0x12b958(0x1ad)]()),_0x27b9cf+=0x2,_0x1834b3=_0x27b9cf+0x1);}const _0x599f08=_0x4ac764[_0x12b958(0x1d7)](_0x1834b3)[_0x12b958(0x1ad)]();if(_0x599f08)_0x50b053['push'](_0x599f08);return _0x50b053;}function hasTopLevelKeyword(_0x2798ef,_0x5284aa){const _0x5643b4=a309_0x35c2;let _0x17bbf7=0x0;for(let _0x1bb3f8=0x0;_0x1bb3f8<_0x2798ef[_0x5643b4(0x1ce)];_0x1bb3f8+=0x1){const _0x3070c0=_0x2798ef[_0x1bb3f8];if(_0x3070c0==='(')_0x17bbf7+=0x1;if(_0x3070c0===')')_0x17bbf7=Math['max'](0x0,_0x17bbf7-0x1);if(_0x17bbf7!==0x0)continue;const _0x3012e0=_0x2798ef[_0x5643b4(0x1d7)](_0x1bb3f8,_0x1bb3f8+_0x5284aa['length']),_0x562394=_0x2798ef[_0x1bb3f8-0x1]??'\x20',_0x17af0f=_0x2798ef[_0x1bb3f8+_0x5284aa[_0x5643b4(0x1ce)]]??'\x20';if(_0x3012e0[_0x5643b4(0x1ec)]()===_0x5284aa['toUpperCase']()&&!/[\w$]/['test'](_0x562394)&&!/[\w$]/[_0x5643b4(0x1aa)](_0x17af0f))return!![];}return![];}function splitEquality(_0x5dfd98){const _0x45bc71=a309_0x35c2,_0xf48da8=stripOuterParentheses(_0x5dfd98);let _0xbfe892=0x0,_0x4ee473;for(let _0x44018f=0x0;_0x44018f<_0xf48da8[_0x45bc71(0x1ce)];_0x44018f+=0x1){const _0x5a42fd=_0xf48da8[_0x44018f];if(_0x5a42fd==='(')_0xbfe892+=0x1;if(_0x5a42fd===')')_0xbfe892=Math[_0x45bc71(0x1ba)](0x0,_0xbfe892-0x1);const _0x37f17a=_0xf48da8[_0x44018f-0x1]??'',_0x5def28=_0xf48da8[_0x44018f+0x1]??'';if(_0x5a42fd==='='&&_0xbfe892===0x0&&!/[!<>=:]/[_0x45bc71(0x1aa)](_0x37f17a)&&_0x5def28!=='='){if(_0x4ee473!==undefined)return null;_0x4ee473=_0x44018f;}}return _0x4ee473===undefined?null:[_0xf48da8[_0x45bc71(0x1d7)](0x0,_0x4ee473)[_0x45bc71(0x1ad)](),_0xf48da8[_0x45bc71(0x1d7)](_0x4ee473+0x1)[_0x45bc71(0x1ad)]()];}function parseDirectColumnReference(_0xec08c3,_0xdcd35a){const _0x1f39c8=a309_0x35c2,_0x2ef29c=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x1f39c8(0x1a9)](stripOuterParentheses(_0xec08c3));if(!_0x2ef29c)return null;if(normalizeIdentifier(_0x2ef29c[0x1]??'')!==normalizeIdentifier(_0xdcd35a))return null;return normalizeIdentifier(_0x2ef29c[0x2]??'');}function containsColumnReference(_0x18dd6a,_0x342685){const _0x2cc5e5=a309_0x35c2,_0x172728=_0x18dd6a[_0x2cc5e5(0x1e1)](/[`"]/g,''),_0x1f8456=_0x342685[_0x2cc5e5(0x1e1)](/[.*+?^${}()|[\]\\]/g,_0x2cc5e5(0x1e0));return new RegExp(_0x2cc5e5(0x1b3)+_0x1f8456+_0x2cc5e5(0x1d9),'i')['test'](_0x172728);}function a309_0x35c2(_0x1e0f45,_0x2fb28b){_0x1e0f45=_0x1e0f45-0x1a7;const _0x55c8f3=a309_0x55c8();let _0x35c217=_0x55c8f3[_0x1e0f45];return _0x35c217;}function findEqualityPrefix(_0x2b46d4,_0x55edd7){const _0x42895f=a309_0x35c2,_0x3431ba=new Set(_0x55edd7[_0x42895f(0x1b8)](normalizeIdentifier)),_0x3cadd0=[];for(const _0xe6e0b8 of _0x2b46d4){if(!_0x3431ba[_0x42895f(0x1ab)](normalizeIdentifier(_0xe6e0b8)))break;_0x3cadd0[_0x42895f(0x1dd)](_0xe6e0b8);}return _0x3cadd0;}function resolveTableMetadata(_0x86b1be,_0x8a439a){const _0x4ec9a0=a309_0x35c2,_0x1cc58c=normalizeIdentifier(_0x8a439a),_0x330326=_0x86b1be[_0x4ec9a0(0x1e8)](_0x33fd4e=>normalizeIdentifier(_0x33fd4e[_0x4ec9a0(0x1db)])===_0x1cc58c);if(_0x330326[_0x4ec9a0(0x1ce)]===0x1)return _0x330326[0x0];const _0xbd74ca=_0x1cc58c['includes']('.'),_0x3e840d=_0x1cc58c[_0x4ec9a0(0x1cd)]('.')['at'](-0x1),_0x53657a=_0x86b1be['filter'](_0x106a8d=>{const _0x17b49e=_0x4ec9a0,_0x510105=normalizeIdentifier(_0x106a8d[_0x17b49e(0x1db)]);if(_0xbd74ca&&_0x510105[_0x17b49e(0x1c7)]('.'))return![];return _0x510105['split']('.')['at'](-0x1)===_0x3e840d;});return _0x53657a[_0x4ec9a0(0x1ce)]===0x1?_0x53657a[0x0]:undefined;}function columnNamesMatch(_0x10f282,_0x4e3974){return normalizeIdentifier(_0x10f282)===normalizeIdentifier(_0x4e3974);}function normalizeIdentifier(_0x5a9374){const _0x2b0766=a309_0x35c2;return _0x5a9374[_0x2b0766(0x1e1)](/[`"]/g,'')['trim']()[_0x2b0766(0x1e9)]();}function isSqlClauseKeyword(_0x429b98){const _0x326c42=a309_0x35c2;return new Set(['on','using',_0x326c42(0x1cc),_0x326c42(0x1b5),'inner',_0x326c42(0x1d2),_0x326c42(0x1dc),_0x326c42(0x1ef),_0x326c42(0x1c2),_0x326c42(0x1c0)])[_0x326c42(0x1ab)](_0x429b98);}function stripOuterParentheses(_0x4a4c4d){const _0x2bd55c=a309_0x35c2;let _0x50cc75=_0x4a4c4d['trim']();while(_0x50cc75[_0x2bd55c(0x1d3)]('(')&&_0x50cc75['endsWith'](')')){let _0x22aa2b=0x0,_0x618f3c=!![];for(let _0x185b3e=0x0;_0x185b3e<_0x50cc75['length'];_0x185b3e+=0x1){if(_0x50cc75[_0x185b3e]==='(')_0x22aa2b+=0x1;if(_0x50cc75[_0x185b3e]===')')_0x22aa2b-=0x1;if(_0x22aa2b===0x0&&_0x185b3e<_0x50cc75['length']-0x1){_0x618f3c=![];break;}}if(!_0x618f3c||_0x22aa2b!==0x0)break;_0x50cc75=_0x50cc75[_0x2bd55c(0x1d7)](0x1,-0x1)[_0x2bd55c(0x1ad)]();}return _0x50cc75;}function a309_0x55c8(){const _0x4f4cf5=['some','map','JOIN_INDEX_NOT_USABLE','max','11378115VgqTda','sort','4SVxifJ','table','2636QMoZeh','natural','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','cross','add','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','25695ZIWQPU','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','includes','unavailable','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','where','split','length','containsUnresolvedInclude','reduce','3636260OHMcnT','left','startsWith','unsupportedReason','2296679SPQFGb','matchAll','slice','matchedPrefix','\x5cs*\x5c.\x5cs*[\x5cw$]+','1115XrLeIW','tableName','right','push','indexOf','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','\x5c$&','replace','alias','INNER','INDEX_METADATA_UNAVAILABLE','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','494679crTjdp','unknown','filter','toLowerCase','sql','covered','toUpperCase','indexes','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','full','position','columns','replaceAll','unsupportedPredicate','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','exec','test','has','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','trim','__sq__','4733064prmIpK','min','1428YQwBUO','from','(?:^|[^\x5cw$])','index','join','warning'];a309_0x55c8=function(){return _0x4f4cf5;};return a309_0x55c8();}
|
|
1
|
+
(function(_0x2e3ccb,_0x4dbf08){const _0x78c829=a309_0x1989,_0x49e2e6=_0x2e3ccb();while(!![]){try{const _0x5724f1=parseInt(_0x78c829(0xd6))/0x1*(parseInt(_0x78c829(0x100))/0x2)+parseInt(_0x78c829(0xcf))/0x3*(-parseInt(_0x78c829(0xc9))/0x4)+parseInt(_0x78c829(0xfa))/0x5*(-parseInt(_0x78c829(0xe1))/0x6)+parseInt(_0x78c829(0xce))/0x7*(-parseInt(_0x78c829(0xbf))/0x8)+-parseInt(_0x78c829(0xf0))/0x9+-parseInt(_0x78c829(0xb6))/0xa+parseInt(_0x78c829(0xc2))/0xb*(parseInt(_0x78c829(0xbc))/0xc);if(_0x5724f1===_0x4dbf08)break;else _0x49e2e6['push'](_0x49e2e6['shift']());}catch(_0x33900e){_0x49e2e6['push'](_0x49e2e6['shift']());}}}(a309_0x340f,0x35ca5));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x173398,_0x31a7e7){const _0xbfc5cf=a309_0x1989,_0x18d91f=[],_0x3c87d7=normalizeSqlForStaticAnalysis(_0x173398),_0x54b52f=(_0x3c87d7[_0xbfc5cf(0xc3)]?[]:extractJoinFacts(_0x3c87d7[_0xbfc5cf(0xc7)]))[_0xbfc5cf(0xdc)](_0x1b0c7f=>{const _0x44955f=_0xbfc5cf;if(_0x1b0c7f[_0x44955f(0xca)]||_0x1b0c7f[_0x44955f(0xc0)][_0x44955f(0xe3)]===0x0)return _0x18d91f['push']({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0x1b0c7f[_0x44955f(0xc6)],'alias':_0x1b0c7f[_0x44955f(0xc8)],'columns':_0x1b0c7f['columns'],'reason':_0x1b0c7f[_0x44955f(0xde)]??_0x44955f(0xfb)}),{'table':_0x1b0c7f[_0x44955f(0xc6)],'alias':_0x1b0c7f[_0x44955f(0xc8)],'columns':_0x1b0c7f[_0x44955f(0xc0)],'status':_0x44955f(0xb8)};const _0x31e313=resolveTableMetadata(_0x31a7e7,_0x1b0c7f[_0x44955f(0xc6)]),_0x53bf09=(_0x31e313?.[_0x44955f(0xf6)]??[])[_0x44955f(0xdc)](_0x1b1601=>({'index':_0x1b1601,'matchedPrefix':findEqualityPrefix(_0x1b1601[_0x44955f(0xc0)],_0x1b0c7f['columns'])}))['filter'](_0x488ad1=>_0x488ad1[_0x44955f(0xf2)]['length']>0x0),_0x29b2f1=_0x53bf09[_0x44955f(0xc4)]((_0x48aed3,_0x228273)=>!_0x48aed3||_0x228273[_0x44955f(0xf2)][_0x44955f(0xe3)]>_0x48aed3[_0x44955f(0xf2)]['length']?_0x228273:_0x48aed3,_0x53bf09[0x0]);if(_0x29b2f1)return{'table':_0x1b0c7f[_0x44955f(0xc6)],'alias':_0x1b0c7f[_0x44955f(0xc8)],'columns':_0x1b0c7f[_0x44955f(0xc0)],'status':'covered','matchedIndex':{..._0x29b2f1[_0x44955f(0xed)],'matchedPrefix':_0x29b2f1['matchedPrefix']}};const _0x5cf63c=_0x31e313?.[_0x44955f(0xf6)][_0x44955f(0xee)](_0x52ead3=>_0x52ead3['columns'][_0x44955f(0xba)](_0x1f2ed9=>_0x1b0c7f['columns'][_0x44955f(0xba)](_0x1b78f7=>columnNamesMatch(_0x1f2ed9,_0x1b78f7))))??[];if(_0x5cf63c[_0x44955f(0xe3)]>0x0)return _0x18d91f[_0x44955f(0xe5)]({'code':_0x44955f(0xd1),'table':_0x1b0c7f[_0x44955f(0xc6)],'alias':_0x1b0c7f[_0x44955f(0xc8)],'columns':_0x1b0c7f[_0x44955f(0xc0)],'reason':_0x44955f(0xf3)}),{'table':_0x1b0c7f['table'],'alias':_0x1b0c7f['alias'],'columns':_0x1b0c7f[_0x44955f(0xc0)],'status':'warning','candidateIndexes':_0x5cf63c};if(_0x31e313&&_0x31e313['metadataAvailable']!==![]&&_0x31e313[_0x44955f(0xf6)][_0x44955f(0xe3)]>0x0&&_0x1b0c7f[_0x44955f(0xc0)][_0x44955f(0xe3)]>0x0)return _0x18d91f['push']({'code':_0x44955f(0xd0),'table':_0x1b0c7f[_0x44955f(0xc6)],'alias':_0x1b0c7f[_0x44955f(0xc8)],'columns':_0x1b0c7f['columns'],'reason':_0x44955f(0xd9)}),{'table':_0x1b0c7f[_0x44955f(0xc6)],'alias':_0x1b0c7f['alias'],'columns':_0x1b0c7f[_0x44955f(0xc0)],'status':_0x44955f(0xe6)};return _0x18d91f[_0x44955f(0xe5)]({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x1b0c7f[_0x44955f(0xc6)],'alias':_0x1b0c7f[_0x44955f(0xc8)],'columns':_0x1b0c7f[_0x44955f(0xc0)],'reason':_0x31e313?_0x44955f(0xb5):_0x44955f(0xdf)}),{'table':_0x1b0c7f[_0x44955f(0xc6)],'alias':_0x1b0c7f[_0x44955f(0xc8)],'columns':_0x1b0c7f[_0x44955f(0xc0)],'status':_0x44955f(0xb8)};});return{'checked':_0x54b52f['length']>0x0,'joins':_0x54b52f,'warnings':_0x18d91f};}function extractJoinFacts(_0x32c981){const _0x50235c=a309_0x1989,_0x1f1dc4=maskNestedQueries(stripSqlNoise(_0x32c981)),_0x1f0ff7=maskQuotedIdentifiers(_0x1f1dc4),_0x14c49b=[],_0x35cbed=new Set(),_0x4543e4=/\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 _0x40f3d0 of _0x1f1dc4[_0x50235c(0xd2)](_0x4543e4)){const _0x4bb3c5=_0x40f3d0[_0x50235c(0xed)]??0x0,_0x24826e=_0x40f3d0[0x0][_0x50235c(0xf4)](/\bJOIN\b/i),_0xaaaa66=_0x4bb3c5+Math[_0x50235c(0xfd)](0x0,_0x24826e);if(!/^JOIN\b/i[_0x50235c(0xbd)](_0x1f0ff7['slice'](_0xaaaa66)))continue;_0x35cbed[_0x50235c(0xf5)](_0xaaaa66);const _0x20473e=normalizeIdentifier(_0x40f3d0[0x1]||_0x50235c(0xef)),_0x12c7fa=normalizeIdentifier(_0x40f3d0[0x2]??''),_0x1af5c6=normalizeIdentifier(_0x40f3d0[0x3]||_0x12c7fa[_0x50235c(0xe0)]('.')['at'](-0x1)||_0x12c7fa),_0x5f2605=[],_0x3d6ec6=_0x12c7fa===_0x50235c(0xb7);let _0x2df324=_0x20473e===_0x50235c(0xf9)||_0x20473e===_0x50235c(0xe9)||_0x3d6ec6,_0x14a193=_0x2df324?_0x3d6ec6?'Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.':_0x20473e[_0x50235c(0xd7)]()+_0x50235c(0xe4):undefined;const _0x30693a=stripOuterParentheses(_0x40f3d0[0x4]??''),_0x9accd6=_0x30693a['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x30693a[_0x50235c(0xc5)](MYBATIS_DYNAMIC_END_MARKER),_0x4c63cf=_0x30693a[_0x50235c(0xc5)](MYBATIS_INCLUDE_MARKER);_0x9accd6&&(_0x2df324=!![],_0x14a193??=_0x50235c(0xd3));_0x4c63cf&&(_0x2df324=!![],_0x14a193??=_0x50235c(0xb9));const _0x6d15d8=_0x30693a[_0x50235c(0xcd)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x50235c(0xcd)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x50235c(0xcd)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x6d15d8,'OR')&&(_0x2df324=!![],_0x14a193??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.');for(const _0x2ad809 of splitTopLevelAnd(_0x6d15d8)){const _0x28da03=stripOuterParentheses(_0x2ad809);if(hasTopLevelKeyword(_0x28da03,'OR')){_0x2df324=!![],_0x14a193??=_0x50235c(0xf1);continue;}const _0x27d028=splitEquality(_0x28da03);if(!_0x27d028){containsColumnReference(_0x2ad809,_0x1af5c6)&&(_0x2df324=!![]);continue;}const _0x3b0377=parseDirectColumnReference(_0x27d028[0x0],_0x1af5c6),_0x18abd2=parseDirectColumnReference(_0x27d028[0x1],_0x1af5c6),_0xadaa9d=containsColumnReference(_0x27d028[0x0],_0x1af5c6),_0xd48fb2=containsColumnReference(_0x27d028[0x1],_0x1af5c6),_0x183480=_0x3b0377&&!_0xd48fb2?_0x3b0377:_0x18abd2&&!_0xadaa9d?_0x18abd2:null;if(_0x183480&&!_0x5f2605[_0x50235c(0xc5)](_0x183480))_0x5f2605[_0x50235c(0xe5)](_0x183480);else!_0x183480&&containsColumnReference(_0x2ad809,_0x1af5c6)&&(_0x2df324=!![]);}_0x14c49b[_0x50235c(0xe5)]({'table':_0x12c7fa,'alias':_0x1af5c6,'columns':_0x5f2605,'unsupportedPredicate':_0x2df324,'unsupportedReason':_0x14a193,'containsUnresolvedInclude':_0x4c63cf,'position':_0xaaaa66});}for(const _0x4386f1 of _0x1f0ff7[_0x50235c(0xd2)](/\bJOIN\b/gi)){const _0xdcd16=_0x4386f1['index']??0x0;if(_0x35cbed[_0x50235c(0xfc)](_0xdcd16))continue;const _0x407b89=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x50235c(0xdd)](_0x1f1dc4[_0x50235c(0xe8)](_0xdcd16+_0x4386f1[0x0][_0x50235c(0xe3)])),_0x32bd5f=normalizeIdentifier(_0x407b89?.[0x1]||_0x50235c(0xbb)),_0x56fd0c=normalizeIdentifier(_0x407b89?.[0x2]||''),_0x195696=isSqlClauseKeyword(_0x56fd0c)?_0x32bd5f[_0x50235c(0xe0)]('.')['at'](-0x1)||_0x32bd5f:_0x56fd0c||_0x32bd5f[_0x50235c(0xe0)]('.')['at'](-0x1)||_0x32bd5f;_0x14c49b[_0x50235c(0xe5)]({'table':_0x32bd5f,'alias':_0x195696,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0xdcd16});}const _0x20c286=_0x1f0ff7[_0x50235c(0xcc)](MYBATIS_INCLUDE_MARKER);return _0x20c286>=0x0&&!_0x14c49b[_0x50235c(0xba)](_0x3f97aa=>_0x3f97aa[_0x50235c(0xec)])&&_0x14c49b[_0x50235c(0xe5)]({'table':_0x50235c(0xbb),'alias':_0x50235c(0xbb),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x50235c(0xe2),'containsUnresolvedInclude':!![],'position':_0x20c286}),_0x14c49b['sort']((_0x308c4d,_0x304fc2)=>_0x308c4d[_0x50235c(0xc1)]-_0x304fc2['position']);}function stripSqlNoise(_0x3b2b3b){const _0x3e51bf=a309_0x1989,_0x5e4e9d=Array[_0x3e51bf(0xdb)](_0x3b2b3b),_0x486f2d=(_0x3f1056,_0x49a758)=>{for(let _0x2b9112=_0x3f1056;_0x2b9112<_0x49a758;_0x2b9112+=0x1){_0x5e4e9d[_0x2b9112]!=='\x0a'&&_0x5e4e9d[_0x2b9112]!=='\x0d'&&(_0x5e4e9d[_0x2b9112]='\x20');}};for(let _0x1932a6=0x0;_0x1932a6<_0x5e4e9d['length'];_0x1932a6+=0x1){const _0x2d010e=_0x5e4e9d[_0x1932a6],_0x3ca627=_0x5e4e9d[_0x1932a6+0x1];if(_0x2d010e==='\x27'||_0x2d010e==='\x22'||_0x2d010e==='`'){const _0x3c9c75=_0x2d010e,_0x4d8aa9=_0x1932a6;_0x1932a6+=0x1;while(_0x1932a6<_0x5e4e9d['length']){if(_0x5e4e9d[_0x1932a6]==='\x5c'&&_0x1932a6+0x1<_0x5e4e9d[_0x3e51bf(0xe3)]){_0x1932a6+=0x2;continue;}if(_0x5e4e9d[_0x1932a6]!==_0x3c9c75){_0x1932a6+=0x1;continue;}if(_0x5e4e9d[_0x1932a6+0x1]===_0x3c9c75){_0x1932a6+=0x2;continue;}break;}if(_0x3c9c75==='\x27')_0x486f2d(_0x4d8aa9,Math[_0x3e51bf(0xf7)](_0x1932a6+0x1,_0x5e4e9d[_0x3e51bf(0xe3)]));continue;}if(_0x2d010e==='-'&&_0x3ca627==='-'){const _0x15ddf3=_0x1932a6;while(_0x1932a6<_0x5e4e9d[_0x3e51bf(0xe3)]&&_0x5e4e9d[_0x1932a6]!=='\x0a')_0x1932a6+=0x1;_0x486f2d(_0x15ddf3,_0x1932a6);continue;}if(_0x2d010e==='/'&&_0x3ca627==='*'){const _0x5d5d9e=_0x1932a6;_0x1932a6+=0x2;while(_0x1932a6<_0x5e4e9d['length']&&!(_0x5e4e9d[_0x1932a6]==='*'&&_0x5e4e9d[_0x1932a6+0x1]==='/')){_0x1932a6+=0x1;}_0x1932a6=Math[_0x3e51bf(0xf7)](_0x1932a6+0x1,_0x5e4e9d[_0x3e51bf(0xe3)]-0x1),_0x486f2d(_0x5d5d9e,_0x1932a6+0x1);continue;}if(_0x2d010e==='#'&&_0x3ca627!=='{'){const _0x3a606a=_0x1932a6;while(_0x1932a6<_0x5e4e9d[_0x3e51bf(0xe3)]&&_0x5e4e9d[_0x1932a6]!=='\x0a')_0x1932a6+=0x1;_0x486f2d(_0x3a606a,_0x1932a6);continue;}if((_0x2d010e==='#'||_0x2d010e==='$')&&_0x3ca627==='{'){const _0x1f94bc=_0x1932a6;_0x1932a6+=0x2;while(_0x1932a6<_0x5e4e9d[_0x3e51bf(0xe3)]&&_0x5e4e9d[_0x1932a6]!=='}')_0x1932a6+=0x1;_0x486f2d(_0x1f94bc,Math['min'](_0x1932a6+0x1,_0x5e4e9d[_0x3e51bf(0xe3)]));}}return _0x5e4e9d[_0x3e51bf(0xe7)]('');}function maskQuotedIdentifiers(_0x10715e){const _0x38c7a8=a309_0x1989,_0x5cff5d=Array[_0x38c7a8(0xdb)](_0x10715e);for(let _0xfb2353=0x0;_0xfb2353<_0x5cff5d[_0x38c7a8(0xe3)];_0xfb2353+=0x1){const _0x1695c4=_0x5cff5d[_0xfb2353];if(_0x1695c4!=='\x22'&&_0x1695c4!=='`')continue;_0xfb2353+=0x1;while(_0xfb2353<_0x5cff5d['length']){if(_0x5cff5d[_0xfb2353]===_0x1695c4){if(_0x5cff5d[_0xfb2353+0x1]===_0x1695c4){_0x5cff5d[_0xfb2353]='\x20',_0x5cff5d[_0xfb2353+0x1]='\x20',_0xfb2353+=0x2;continue;}break;}_0x5cff5d[_0xfb2353]='\x20',_0xfb2353+=0x1;}}return _0x5cff5d[_0x38c7a8(0xe7)]('');}function maskNestedQueries(_0x3bdbd4){const _0xd28e3a=a309_0x1989,_0x2eff05=Array[_0xd28e3a(0xdb)](_0x3bdbd4);for(let _0x2bfa3f=0x0;_0x2bfa3f<_0x2eff05[_0xd28e3a(0xe3)];_0x2bfa3f+=0x1){if(_0x2eff05[_0x2bfa3f]!=='(')continue;const _0x18f8fa=_0x3bdbd4['slice'](_0x2bfa3f+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0xd28e3a(0xbd)](_0x18f8fa))continue;let _0x4ae0af=0x1,_0x40a393=_0x2bfa3f+0x1;for(;_0x40a393<_0x2eff05[_0xd28e3a(0xe3)]&&_0x4ae0af>0x0;_0x40a393+=0x1){if(_0x2eff05[_0x40a393]==='(')_0x4ae0af+=0x1;if(_0x2eff05[_0x40a393]===')')_0x4ae0af-=0x1;}if(_0x4ae0af!==0x0)continue;for(let _0x46f29d=_0x2bfa3f;_0x46f29d<_0x40a393;_0x46f29d+=0x1){_0x2eff05[_0x46f29d]='\x20';}const _0x15d423=_0xd28e3a(0xb7);for(let _0x1ce5d1=0x0;_0x1ce5d1<_0x15d423[_0xd28e3a(0xe3)]&&_0x2bfa3f+_0x1ce5d1<_0x40a393;_0x1ce5d1+=0x1){_0x2eff05[_0x2bfa3f+_0x1ce5d1]=_0x15d423[_0x1ce5d1];}_0x2bfa3f=_0x40a393-0x1;}return _0x2eff05[_0xd28e3a(0xe7)]('');}function a309_0x1989(_0x186967,_0x1e0d11){_0x186967=_0x186967-0xb5;const _0x340f98=a309_0x340f();let _0x198906=_0x340f98[_0x186967];return _0x198906;}function splitTopLevelAnd(_0x3ea346){const _0x376b65=a309_0x1989,_0x206381=[];let _0x54df28=0x0,_0x1d3542=0x0;for(let _0x2d080c=0x0;_0x2d080c<_0x3ea346['length'];_0x2d080c+=0x1){const _0x4ce633=_0x3ea346[_0x2d080c];if(_0x4ce633==='(')_0x54df28+=0x1;if(_0x4ce633===')')_0x54df28=Math[_0x376b65(0xfd)](0x0,_0x54df28-0x1);_0x54df28===0x0&&_0x3ea346[_0x376b65(0xe8)](_0x2d080c)[_0x376b65(0xea)](/^AND\b/i)&&(_0x2d080c===0x0||/\s/[_0x376b65(0xbd)](_0x3ea346[_0x2d080c-0x1]??''))&&(_0x206381[_0x376b65(0xe5)](_0x3ea346[_0x376b65(0xe8)](_0x1d3542,_0x2d080c)[_0x376b65(0xcb)]()),_0x2d080c+=0x2,_0x1d3542=_0x2d080c+0x1);}const _0x37f610=_0x3ea346[_0x376b65(0xe8)](_0x1d3542)[_0x376b65(0xcb)]();if(_0x37f610)_0x206381[_0x376b65(0xe5)](_0x37f610);return _0x206381;}function hasTopLevelKeyword(_0x296a74,_0x1ea43c){const _0x31a7ef=a309_0x1989;let _0x2f7cf3=0x0;for(let _0x23b453=0x0;_0x23b453<_0x296a74[_0x31a7ef(0xe3)];_0x23b453+=0x1){const _0x419579=_0x296a74[_0x23b453];if(_0x419579==='(')_0x2f7cf3+=0x1;if(_0x419579===')')_0x2f7cf3=Math[_0x31a7ef(0xfd)](0x0,_0x2f7cf3-0x1);if(_0x2f7cf3!==0x0)continue;const _0x43d142=_0x296a74[_0x31a7ef(0xe8)](_0x23b453,_0x23b453+_0x1ea43c[_0x31a7ef(0xe3)]),_0x4c3176=_0x296a74[_0x23b453-0x1]??'\x20',_0x202ebf=_0x296a74[_0x23b453+_0x1ea43c[_0x31a7ef(0xe3)]]??'\x20';if(_0x43d142[_0x31a7ef(0xd7)]()===_0x1ea43c['toUpperCase']()&&!/[\w$]/['test'](_0x4c3176)&&!/[\w$]/[_0x31a7ef(0xbd)](_0x202ebf))return!![];}return![];}function splitEquality(_0x5ef507){const _0x4c1c68=a309_0x1989,_0x3c0f5f=stripOuterParentheses(_0x5ef507);let _0x575267=0x0,_0x13b531;for(let _0xbf8b56=0x0;_0xbf8b56<_0x3c0f5f[_0x4c1c68(0xe3)];_0xbf8b56+=0x1){const _0x115448=_0x3c0f5f[_0xbf8b56];if(_0x115448==='(')_0x575267+=0x1;if(_0x115448===')')_0x575267=Math[_0x4c1c68(0xfd)](0x0,_0x575267-0x1);const _0x4748e5=_0x3c0f5f[_0xbf8b56-0x1]??'',_0x46755d=_0x3c0f5f[_0xbf8b56+0x1]??'';if(_0x115448==='='&&_0x575267===0x0&&!/[!<>=:]/[_0x4c1c68(0xbd)](_0x4748e5)&&_0x46755d!=='='){if(_0x13b531!==undefined)return null;_0x13b531=_0xbf8b56;}}return _0x13b531===undefined?null:[_0x3c0f5f[_0x4c1c68(0xe8)](0x0,_0x13b531)['trim'](),_0x3c0f5f[_0x4c1c68(0xe8)](_0x13b531+0x1)[_0x4c1c68(0xcb)]()];}function parseDirectColumnReference(_0x27d0a9,_0x127cdf){const _0x43b401=a309_0x1989,_0x497650=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x43b401(0xdd)](stripOuterParentheses(_0x27d0a9));if(!_0x497650)return null;if(normalizeIdentifier(_0x497650[0x1]??'')!==normalizeIdentifier(_0x127cdf))return null;return normalizeIdentifier(_0x497650[0x2]??'');}function containsColumnReference(_0x623fc8,_0x2e2e35){const _0x3c0dff=a309_0x1989,_0x1adc5e=_0x623fc8[_0x3c0dff(0xd5)](/[`"]/g,''),_0x18bda1=_0x2e2e35[_0x3c0dff(0xd5)](/[.*+?^${}()|[\]\\]/g,_0x3c0dff(0x101));return new RegExp(_0x3c0dff(0xf8)+_0x18bda1+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')['test'](_0x1adc5e);}function findEqualityPrefix(_0x57539a,_0x235c12){const _0x4e57fc=a309_0x1989,_0x1bf761=new Set(_0x235c12[_0x4e57fc(0xdc)](normalizeIdentifier)),_0x30c879=[];for(const _0x9bf847 of _0x57539a){if(!_0x1bf761[_0x4e57fc(0xfc)](normalizeIdentifier(_0x9bf847)))break;_0x30c879['push'](_0x9bf847);}return _0x30c879;}function resolveTableMetadata(_0x538715,_0x5c0ab9){const _0x5cc702=a309_0x1989,_0xa88217=normalizeIdentifier(_0x5c0ab9),_0x53e752=_0x538715[_0x5cc702(0xee)](_0x4068b5=>normalizeIdentifier(_0x4068b5[_0x5cc702(0xfe)])===_0xa88217);if(_0x53e752['length']===0x1)return _0x53e752[0x0];const _0x3c0aa7=_0xa88217[_0x5cc702(0xc5)]('.'),_0x47c2c4=_0xa88217[_0x5cc702(0xe0)]('.')['at'](-0x1),_0x1bd3a3=_0x538715['filter'](_0x5a58af=>{const _0x1d2d34=_0x5cc702,_0x3dc134=normalizeIdentifier(_0x5a58af[_0x1d2d34(0xfe)]);if(_0x3c0aa7&&_0x3dc134[_0x1d2d34(0xc5)]('.'))return![];return _0x3dc134['split']('.')['at'](-0x1)===_0x47c2c4;});return _0x1bd3a3['length']===0x1?_0x1bd3a3[0x0]:undefined;}function columnNamesMatch(_0x524ee5,_0x5a0c24){return normalizeIdentifier(_0x524ee5)===normalizeIdentifier(_0x5a0c24);}function normalizeIdentifier(_0x11efe3){const _0x37cb68=a309_0x1989;return _0x11efe3['replace'](/[`"]/g,'')[_0x37cb68(0xcb)]()['toLowerCase']();}function a309_0x340f(){const _0x58edbc=['unsupportedPredicate','trim','indexOf','replaceAll','3199fQCKJV','12RfgRlk','JOIN_INDEX_MISSING','JOIN_INDEX_NOT_USABLE','matchAll','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','endsWith','replace','22495jIuhOD','toUpperCase','where','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','using','from','map','exec','unsupportedReason','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','split','84198cpyvkL','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','length','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','push','warning','join','slice','full','match','cross','containsUnresolvedInclude','index','filter','INNER','2457738FACurf','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','matchedPrefix','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','search','add','indexes','min','(?:^|[^\x5cw$])','right','85jNwMaV','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','has','max','tableName','left','34FEljJV','\x5c$&','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','500280ioZnbk','__sq__','unavailable','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','some','unknown','612bUGzbq','test','inner','352FgtxHI','columns','position','93577xdgfLM','error','reduce','includes','table','sql','alias','14168PUCzGW'];a309_0x340f=function(){return _0x58edbc;};return a309_0x340f();}function isSqlClauseKeyword(_0xee3253){const _0x2352aa=a309_0x1989;return new Set(['on',_0x2352aa(0xda),_0x2352aa(0xd8),'join',_0x2352aa(0xbe),_0x2352aa(0xff),_0x2352aa(0xf9),'full',_0x2352aa(0xeb),'natural'])[_0x2352aa(0xfc)](_0xee3253);}function stripOuterParentheses(_0x49233d){const _0x118914=a309_0x1989;let _0x3984db=_0x49233d[_0x118914(0xcb)]();while(_0x3984db['startsWith']('(')&&_0x3984db[_0x118914(0xd4)](')')){let _0x42a43f=0x0,_0x290396=!![];for(let _0x3c15b6=0x0;_0x3c15b6<_0x3984db[_0x118914(0xe3)];_0x3c15b6+=0x1){if(_0x3984db[_0x3c15b6]==='(')_0x42a43f+=0x1;if(_0x3984db[_0x3c15b6]===')')_0x42a43f-=0x1;if(_0x42a43f===0x0&&_0x3c15b6<_0x3984db[_0x118914(0xe3)]-0x1){_0x290396=![];break;}}if(!_0x290396||_0x42a43f!==0x0)break;_0x3984db=_0x3984db['slice'](0x1,-0x1)[_0x118914(0xcb)]();}return _0x3984db;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a310_0x1fb705=a310_0x2ac8;(function(_0x258057,_0x1e39ae){const _0x31dc8a=a310_0x2ac8,_0x2e9f71=_0x258057();while(!![]){try{const _0x380cfe=-parseInt(_0x31dc8a(0xb1))/0x1+parseInt(_0x31dc8a(0xa9))/0x2+parseInt(_0x31dc8a(0xab))/0x3+-parseInt(_0x31dc8a(0xae))/0x4*(-parseInt(_0x31dc8a(0xb3))/0x5)+-parseInt(_0x31dc8a(0xad))/0x6+parseInt(_0x31dc8a(0xb6))/0x7+-parseInt(_0x31dc8a(0xaa))/0x8*(parseInt(_0x31dc8a(0xb4))/0x9);if(_0x380cfe===_0x1e39ae)break;else _0x2e9f71['push'](_0x2e9f71['shift']());}catch(_0x3ef274){_0x2e9f71['push'](_0x2e9f71['shift']());}}}(a310_0x4b94,0xe2725));function a310_0x2ac8(_0x3f2539,_0x11b1f8){_0x3f2539=_0x3f2539-0xa9;const _0x4b94ab=a310_0x4b94();let _0x2ac879=_0x4b94ab[_0x3f2539];return _0x2ac879;}import{resolve}from'node:path';function a310_0x4b94(){const _0x29a41=['sql.lock.json','332508BgdsqQ','sql','3505qOesrH','27sUQrzB','sql-trash','1653232FTBxKu','3133544SOdJNt','6951544PnBaCV','4114215FcYhWw','/sql','4900464jgrERC','8612EpZZNR','.rabetbase'];a310_0x4b94=function(){return _0x29a41;};return a310_0x4b94();}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a310_0x1fb705(0xaf),LOCK_FILE_NAME=a310_0x1fb705(0xb0),TRASH_DIR_NAME=a310_0x1fb705(0xb5);export function loadSqlProjectConfig(_0xf08895,_0x40e4b7){const _0x2f30ba=a310_0x1fb705,_0x2a8e2b=resolve(_0x40e4b7??findProjectRootDirectory()),_0x2e0f15=DOT_DIR+_0x2f30ba(0xac),_0x1aed40=_0x2e0f15+'/'+_0xf08895;return{'projectRoot':_0x2a8e2b,'appCode':_0xf08895,'sqlWorkspaceRoot':_0x2e0f15,'sqlRoot':_0x1aed40,'sqlRootDir':resolve(_0x2a8e2b,DOT_DIR,_0x2f30ba(0xb2),_0xf08895),'lockFilePath':resolve(_0x2a8e2b,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2a8e2b,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x59144d,_0x47f719){const _0x167f38=a311_0x9813,_0x34ce40=_0x59144d();while(!![]){try{const _0x5aeb57=-parseInt(_0x167f38(0x15d))/0x1*(parseInt(_0x167f38(0x157))/0x2)+parseInt(_0x167f38(0x172))/0x3+parseInt(_0x167f38(0x158))/0x4+parseInt(_0x167f38(0x161))/0x5+parseInt(_0x167f38(0x176))/0x6+-parseInt(_0x167f38(0x16d))/0x7*(-parseInt(_0x167f38(0x15c))/0x8)+-parseInt(_0x167f38(0x16f))/0x9;if(_0x5aeb57===_0x47f719)break;else _0x34ce40['push'](_0x34ce40['shift']());}catch(_0x3c8b5b){_0x34ce40['push'](_0x34ce40['shift']());}}}(a311_0x299f,0xd0fca));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function a311_0x299f(){const _0x4dbd84=['5088800ZRcrit','split','sqlName','indexOf','10872obEBgb','1dPIhiq','code','.sql','sqlCode','1063540oEhEzA','dbId','slice','length','replace','push','sqlRootDir','path','sql','filter','dbName','test','1092ApkYMl','toLowerCase','15911559WUtbgL','isDirectory','name','4340121lTGoJu','ENOENT','.xml','mode','3142950zAWtht','2086966SjQwAS'];a311_0x299f=function(){return _0x4dbd84;};return a311_0x299f();}function a311_0x9813(_0x14869f,_0x2b5e10){_0x14869f=_0x14869f-0x157;const _0x299f00=a311_0x299f();let _0x98133f=_0x299f00[_0x14869f];return _0x98133f;}function extensionToMode(_0x583afd){const _0x123091=a311_0x9813;if(_0x583afd===_0x123091(0x15f))return _0x123091(0x169);if(_0x583afd===_0x123091(0x174))return'mybatisXml';return undefined;}async function scanSqlFilesRecursively(_0x418a06,_0x33608b){const _0x29fc6b=a311_0x9813,_0x332256=[];try{const _0xfd6428=await readdir(_0x418a06,{'withFileTypes':!![]});for(const _0x570cad of _0xfd6428){const _0x33575c=join(_0x418a06,_0x570cad[_0x29fc6b(0x171)]);if(_0x570cad[_0x29fc6b(0x170)]()){_0x332256[_0x29fc6b(0x166)](...await scanSqlFilesRecursively(_0x33575c,_0x33608b));continue;}if(!_0x570cad['isFile']())continue;const _0x10a751=extname(_0x570cad[_0x29fc6b(0x171)])[_0x29fc6b(0x16e)](),_0x3174c4=extensionToMode(_0x10a751);if(!_0x3174c4)continue;const _0x158ace=relative(_0x33608b,_0x33575c)[_0x29fc6b(0x165)](/\\/g,'/'),_0x2e237b=_0x158ace[_0x29fc6b(0x159)]('/')[_0x29fc6b(0x16a)](Boolean),_0x54ed75=parseSqlPath(_0x2e237b,_0x570cad[_0x29fc6b(0x171)],_0x10a751);if(!_0x54ed75)continue;_0x332256['push']({'sqlCode':_0x54ed75[_0x29fc6b(0x160)],'sqlName':_0x54ed75[_0x29fc6b(0x15a)],'dbDirectory':_0x2e237b[0x0],'filePath':_0x33575c,'relativePath':_0x158ace,'lockKey':_0x54ed75['sqlCode'],'mode':_0x3174c4});}}catch(_0x20df9e){if(_0x20df9e[_0x29fc6b(0x15e)]!==_0x29fc6b(0x173))throw _0x20df9e;}return _0x332256;}export async function scanLocalSqlQueries(_0x85fed3){const _0x448f70=a311_0x9813;return scanSqlFilesRecursively(_0x85fed3['sqlRootDir'],_0x85fed3[_0x448f70(0x167)]);}export function resolveLocalSqlFilePath(_0x1ecbd4,_0x1c5a01,_0xf30a66){const _0x39a977=a311_0x9813,_0x325c51=_0xf30a66?.[_0x39a977(0x168)]||(_0xf30a66?.[_0x39a977(0x15a)]||_0xf30a66?.['dbName']?buildSqlRelativePath(_0x1c5a01,_0xf30a66?.[_0x39a977(0x15a)],_0xf30a66?.[_0x39a977(0x16b)],_0xf30a66?.[_0x39a977(0x175)]||_0x39a977(0x169),_0xf30a66?.[_0x39a977(0x162)]):buildDefaultSqlFileName(_0x1c5a01,_0xf30a66?.[_0x39a977(0x175)]||_0x39a977(0x169)));return join(_0x1ecbd4[_0x39a977(0x167)],_0x325c51);}export async function directoryExists(_0x475cee){try{const _0x4cd0e2=await stat(_0x475cee);return _0x4cd0e2['isDirectory']();}catch{return![];}}function parseSqlPath(_0x33aa18,_0x4ff311,_0x56d3aa){const _0xff4685=a311_0x9813,_0x495c3c=_0x4ff311['slice'](0x0,-_0x56d3aa['length']);if(_0x33aa18[_0xff4685(0x164)]<0x2)return null;const _0x47ee4a=_0x495c3c[_0xff4685(0x15b)]('_');if(_0x47ee4a<=0x0||_0x47ee4a>=_0x495c3c[_0xff4685(0x164)]-0x1)return null;const _0x2d6560=_0x495c3c[_0xff4685(0x163)](0x0,_0x47ee4a);if(!isLikelySqlCode(_0x2d6560))return null;return{'sqlCode':_0x2d6560,'sqlName':_0x495c3c['slice'](_0x47ee4a+0x1)};}function isLikelySqlCode(_0x2a6a3b){const _0x440360=a311_0x9813;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x440360(0x16c)](_0x2a6a3b);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1542f2,_0x391c01){const _0x39bcd5=a312_0x4ae0,_0x67b7b9=_0x1542f2();while(!![]){try{const _0x4b3227=parseInt(_0x39bcd5(0x13c))/0x1+-parseInt(_0x39bcd5(0x13d))/0x2+parseInt(_0x39bcd5(0x13b))/0x3*(parseInt(_0x39bcd5(0x131))/0x4)+parseInt(_0x39bcd5(0x133))/0x5*(-parseInt(_0x39bcd5(0x137))/0x6)+-parseInt(_0x39bcd5(0x134))/0x7*(-parseInt(_0x39bcd5(0x132))/0x8)+-parseInt(_0x39bcd5(0x136))/0x9*(parseInt(_0x39bcd5(0x139))/0xa)+-parseInt(_0x39bcd5(0x135))/0xb;if(_0x4b3227===_0x391c01)break;else _0x67b7b9['push'](_0x67b7b9['shift']());}catch(_0x12e07b){_0x67b7b9['push'](_0x67b7b9['shift']());}}}(a312_0x464f,0x6a570));function a312_0x4ae0(_0x3e346c,_0x4f919e){_0x3e346c=_0x3e346c-0x130;const _0x464f33=a312_0x464f();let _0x4ae0fe=_0x464f33[_0x3e346c];return _0x4ae0fe;}import{readFile}from'node:fs/promises';import a312_0x2d977e from'node:crypto';function a312_0x464f(){const _0x35d961=['hex','10KYUtsM','digest','3xqkZMM','254121ChAhlk','224216ODXJuY','createHash','1465572HIWmqR','24hdxoCq','65GnnQte','1176847evvmIe','4132777uZMSfM','722421FPTGPd','55950Qlgiwp'];a312_0x464f=function(){return _0x35d961;};return a312_0x464f();}export function computeSqlContentHash(_0x191f07){const _0x386f0f=a312_0x4ae0;return a312_0x2d977e[_0x386f0f(0x130)]('md5')['update'](_0x191f07)[_0x386f0f(0x13a)](_0x386f0f(0x138));}export async function computeSqlFileHash(_0x4a8fce){const _0x580f6a=await readFile(_0x4a8fce,'utf8');return computeSqlContentHash(_0x580f6a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a313_0x55e7(_0x292186,_0x5d2a56){_0x292186=_0x292186-0xe4;const _0x217824=a313_0x2178();let _0x55e790=_0x217824[_0x292186];return _0x55e790;}(function(_0x20bae0,_0xf745e){const _0x224f70=a313_0x55e7,_0x21a02d=_0x20bae0();while(!![]){try{const _0x1afa12=-parseInt(_0x224f70(0xeb))/0x1*(-parseInt(_0x224f70(0xea))/0x2)+-parseInt(_0x224f70(0xed))/0x3+-parseInt(_0x224f70(0xef))/0x4+-parseInt(_0x224f70(0xe9))/0x5+-parseInt(_0x224f70(0xe8))/0x6+parseInt(_0x224f70(0xee))/0x7*(parseInt(_0x224f70(0xf5))/0x8)+parseInt(_0x224f70(0xe4))/0x9;if(_0x1afa12===_0xf745e)break;else _0x21a02d['push'](_0x21a02d['shift']());}catch(_0x4e113a){_0x21a02d['push'](_0x21a02d['shift']());}}}(a313_0x2178,0x31e2c));function a313_0x2178(){const _0x398b4a=['1272924NppnfH','sqls','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','utf8',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','\x22\x20vs\x20lock\x20\x22','50536LdvTSf','lastSync','stringify','7186491TsuSRn','apps','code','\x22.\x20','1529664HyTADF','372410ozUfyV','1126LuBDFA','239YfzEgk','sqlRoot','451662ppwCuD','77HhtQyB'];a313_0x2178=function(){return _0x398b4a;};return a313_0x2178();}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x24f02f,_0x2a0eab,_0x120a0d,_0x1174e6){const _0x299155=a313_0x55e7,_0x45bd7e=_0x24f02f??createEmptySqlLock();let _0x12e366=_0x45bd7e[_0x299155(0xe5)][_0x2a0eab];if(!_0x12e366)return _0x12e366={'sqlRoot':_0x120a0d,'lastSync':'','sqls':{}},_0x45bd7e['apps'][_0x2a0eab]=_0x12e366,{'lockData':_0x45bd7e,'appLock':_0x12e366};if(!_0x12e366['sqlRoot'])_0x12e366[_0x299155(0xec)]=_0x120a0d;else{if(_0x12e366['sqlRoot']!==_0x120a0d)throw new Error(_0x1174e6+_0x299155(0xf3)+_0x120a0d+_0x299155(0xf4)+_0x12e366['sqlRoot']+_0x299155(0xe7)+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x12e366[_0x299155(0xf0)]&&(_0x12e366['sqls']={}),!_0x12e366[_0x299155(0xf6)]&&(_0x12e366[_0x299155(0xf6)]=''),{'lockData':_0x45bd7e,'appLock':_0x12e366};}export async function readSqlLockFile(_0x268958){const _0x5079fd=a313_0x55e7;try{const _0xd2d4a2=await readFile(_0x268958,_0x5079fd(0xf2));return JSON['parse'](_0xd2d4a2);}catch(_0x4c0bf9){if(_0x4c0bf9[_0x5079fd(0xe6)]==='ENOENT')return null;throw new Error(_0x5079fd(0xf1)+String(_0x4c0bf9));}}export async function writeSqlLockFile(_0x4b5c4a,_0x4c6c4c){const _0x609480=a313_0x55e7;await mkdir(dirname(_0x4b5c4a),{'recursive':!![]}),await writeFile(_0x4b5c4a,JSON[_0x609480(0xf7)](_0x4c6c4c,null,0x2),_0x609480(0xf2));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2c761c,_0x2a1e1d){const _0x4d4c77=a315_0x3fc1,_0x47206e=_0x2c761c();while(!![]){try{const _0x1a7838=-parseInt(_0x4d4c77(0x191))/0x1*(parseInt(_0x4d4c77(0x18d))/0x2)+parseInt(_0x4d4c77(0x187))/0x3+parseInt(_0x4d4c77(0x192))/0x4*(-parseInt(_0x4d4c77(0x18e))/0x5)+-parseInt(_0x4d4c77(0x193))/0x6*(parseInt(_0x4d4c77(0x185))/0x7)+-parseInt(_0x4d4c77(0x18c))/0x8*(parseInt(_0x4d4c77(0x189))/0x9)+-parseInt(_0x4d4c77(0x18a))/0xa+-parseInt(_0x4d4c77(0x18f))/0xb*(-parseInt(_0x4d4c77(0x186))/0xc);if(_0x1a7838===_0x2a1e1d)break;else _0x47206e['push'](_0x47206e['shift']());}catch(_0x1a6018){_0x47206e['push'](_0x47206e['shift']());}}}(a315_0x555c,0x9464a));import{detectSqlSourceMode}from'../../core/sql-validator.js';function a315_0x3fc1(_0x1c4846,_0x26b513){_0x1c4846=_0x1c4846-0x184;const _0x555ca6=a315_0x555c();let _0x3fc14e=_0x555ca6[_0x1c4846];return _0x3fc14e;}function a315_0x555c(){const _0x4039dd=['4124155rxkkDa','84YYQhde','2853432esiBeN','.xml','85923sirvFK','9263710szpera','.sql','656EPkmiZ','2hYekdy','66490PZXPZq','4355098cDZOYj','unknown-db','54323BJPyfV','52GTLfOe','12KxRYOc','db-','replace'];a315_0x555c=function(){return _0x4039dd;};return a315_0x555c();}export function detectSqlMode(_0x3a5bf3){return detectSqlSourceMode(_0x3a5bf3);}export function getSqlFileExtension(_0x1ac094){const _0xd6fe98=a315_0x3fc1;return _0x1ac094==='mybatisXml'?_0xd6fe98(0x188):_0xd6fe98(0x18b);}export function buildDefaultSqlFileName(_0x4d8bdc,_0x11db63){return''+_0x4d8bdc+getSqlFileExtension(_0x11db63);}export function sanitizeSqlPathSegment(_0x45a21b,_0x568ebf){const _0x3b2221=a315_0x3fc1,_0x46488c=String(_0x45a21b??'')['trim'](),_0x1e625a=_0x46488c[_0x3b2221(0x184)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x3b2221(0x184)](/\s+/g,'-')[_0x3b2221(0x184)](/-+/g,'-')[_0x3b2221(0x184)](/^\.+/,'')['replace'](/\.+$/,'')['replace'](/^-+/,'')['replace'](/-+$/,'');return _0x1e625a||_0x568ebf;}export function buildDbDirectoryName(_0x5609ef,_0xd918cc){const _0x28d8d3=a315_0x3fc1;return sanitizeSqlPathSegment(_0x5609ef,_0xd918cc!=null?_0x28d8d3(0x194)+_0xd918cc:_0x28d8d3(0x190));}export function buildSqlRelativePath(_0x11af9a,_0x217b68,_0x2924d9,_0x3b1e2d,_0x5e0543){const _0x5728e1=buildDbDirectoryName(_0x2924d9,_0x5e0543),_0x44b010=sanitizeSqlPathSegment(_0x11af9a,'unknown-sql'),_0x5e4a9c=sanitizeSqlPathSegment(_0x217b68,_0x44b010);return _0x5728e1+'/'+_0x44b010+'_'+_0x5e4a9c+getSqlFileExtension(_0x3b1e2d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a316_0x400553=a316_0x4728;(function(_0x22cb91,_0x4a2d7c){const _0x381f91=a316_0x4728,_0x4571dd=_0x22cb91();while(!![]){try{const _0x5a2ba2=-parseInt(_0x381f91(0x190))/0x1+parseInt(_0x381f91(0x18d))/0x2*(-parseInt(_0x381f91(0x1b7))/0x3)+parseInt(_0x381f91(0x17b))/0x4*(parseInt(_0x381f91(0x1aa))/0x5)+parseInt(_0x381f91(0x18c))/0x6*(-parseInt(_0x381f91(0x16a))/0x7)+parseInt(_0x381f91(0x151))/0x8*(-parseInt(_0x381f91(0x199))/0x9)+parseInt(_0x381f91(0x180))/0xa*(parseInt(_0x381f91(0x15c))/0xb)+parseInt(_0x381f91(0x17a))/0xc*(parseInt(_0x381f91(0x18a))/0xd);if(_0x5a2ba2===_0x4a2d7c)break;else _0x4571dd['push'](_0x4571dd['shift']());}catch(_0x3b75eb){_0x4571dd['push'](_0x4571dd['shift']());}}}(a316_0x22f3,0x77ec9));const MYBATIS_OUTER_TAGS=new Map([[a316_0x400553(0x165),a316_0x400553(0x1ae)],['insert','INSERT'],['update',a316_0x400553(0x182)],[a316_0x400553(0x1b5),'DELETE']]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a316_0x400553(0x1b0),a316_0x400553(0x1a1),a316_0x400553(0x169),a316_0x400553(0x156),a316_0x400553(0x166),'trim',a316_0x400553(0x177),a316_0x400553(0x18e),a316_0x400553(0x198),a316_0x400553(0x19d)]),MYBATIS_BRANCH_TAGS=new Set(['if',a316_0x400553(0x1a1),a316_0x400553(0x169),a316_0x400553(0x156),a316_0x400553(0x166)]);export const MYBATIS_DYNAMIC_START_MARKER=a316_0x400553(0x194);export const MYBATIS_DYNAMIC_END_MARKER=a316_0x400553(0x15e);export const MYBATIS_INCLUDE_MARKER=a316_0x400553(0x161);const UNRESOLVED_SQL_FRAGMENT=a316_0x400553(0x171),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a316_0x400553(0x1b1)+[...MYBATIS_OUTER_TAGS[a316_0x400553(0x1ac)]()][a316_0x400553(0x1a8)]('|')+')\x5cb','i');export function normalizeSqlForStaticAnalysis(_0x22f265){const _0x2a53b3=a316_0x400553,_0x3147b2=typeof _0x22f265===_0x2a53b3(0x1a9)?_0x22f265:'';if(detectSqlSourceMode(_0x3147b2)===_0x2a53b3(0x1b2))return{'sql':_0x3147b2,'mode':_0x2a53b3(0x1b2)};let _0x45743b=0x0,_0xac905d='',_0x123080,_0x58aaf3=![],_0x45963a=![];const _0x2c40c6=[];while(_0x45743b<_0x3147b2[_0x2a53b3(0x15d)]){if(_0x3147b2['startsWith'](_0x2a53b3(0x19a),_0x45743b)){const _0x4d593e=_0x3147b2['indexOf']('-->',_0x45743b+0x4);if(_0x4d593e<0x0)return invalidMybatisSource(_0x2a53b3(0x15b));_0xac905d+='\x20',_0x45743b=_0x4d593e+0x3;continue;}if(_0x3147b2[_0x2a53b3(0x191)](_0x2a53b3(0x18b),_0x45743b)){if(!_0x58aaf3||_0x45963a)return invalidMybatisSource(_0x2a53b3(0x167));const _0x23e33d=_0x3147b2['indexOf'](_0x2a53b3(0x178),_0x45743b+0x9);if(_0x23e33d<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0xac905d+=_0x3147b2['slice'](_0x45743b+0x9,_0x23e33d),_0x45743b=_0x23e33d+0x3;continue;}if(_0x3147b2[_0x2a53b3(0x191)]('<?',_0x45743b)){if(_0x58aaf3)return invalidMybatisSource(_0x2a53b3(0x174));const _0x36cb68=_0x3147b2[_0x2a53b3(0x19e)]('?>',_0x45743b+0x2);if(_0x36cb68<0x0)return invalidMybatisSource(_0x2a53b3(0x16c));_0xac905d+='\x20',_0x45743b=_0x36cb68+0x2;continue;}if(_0x3147b2[_0x45743b]!=='<'){const _0x561f0b=_0x3147b2['indexOf']('<',_0x45743b),_0x4d96c0=_0x561f0b<0x0?_0x3147b2[_0x2a53b3(0x15d)]:_0x561f0b,_0x4212d6=_0x3147b2[_0x2a53b3(0x176)](_0x45743b,_0x4d96c0);if((!_0x58aaf3||_0x45963a)&&_0x4212d6[_0x2a53b3(0x189)]())return invalidMybatisSource(_0x2a53b3(0x1a6));if(_0x58aaf3&&!_0x45963a){const _0xcd840=decodeXmlEntities(_0x4212d6);if(_0xcd840===null)return invalidMybatisSource(_0x2a53b3(0x14c));_0xac905d+=_0xcd840;}else _0xac905d+='\x20';_0x45743b=_0x4d96c0;continue;}const _0x5bc691=findXmlTagEnd(_0x3147b2,_0x45743b);if(_0x5bc691<0x0)return invalidMybatisSource(_0x2a53b3(0x185));const _0x47156f=_0x3147b2['slice'](_0x45743b,_0x5bc691+0x1),_0x299490=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x2a53b3(0x1a5)](_0x47156f);if(!_0x299490)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20tag.');const _0x2311ad=_0x299490[0x1]==='/',_0xd1c058=_0x299490[0x2]??'',_0x3c06cd=_0xd1c058['toLowerCase'](),_0x59cd09=_0x299490[0x3]??'',_0x5e3028=_0x299490[0x4]==='/',_0x5cde3e=MYBATIS_OUTER_TAGS[_0x2a53b3(0x183)](_0x3c06cd);if(!_0x5cde3e&&!MYBATIS_DYNAMIC_TAGS['has'](_0x3c06cd))return invalidMybatisSource(_0x2a53b3(0x196)+_0x3c06cd+'>.');if(!_0x5cde3e&&_0xd1c058!==_0x3c06cd)return invalidMybatisSource(_0x2a53b3(0x15a)+_0xd1c058+'>.');if(_0x2311ad){if(_0x59cd09[_0x2a53b3(0x189)]()||_0x5e3028)return invalidMybatisSource(_0x2a53b3(0x1a2)+_0xd1c058+'>.');const _0x1c5efa=_0x2c40c6['at'](-0x1);if(!_0x1c5efa||(_0x1c5efa[_0x2a53b3(0x152)]?_0x1c5efa[_0x2a53b3(0x1b3)]!==_0x3c06cd:_0x1c5efa[_0x2a53b3(0x17d)]!==_0xd1c058))return invalidMybatisSource(_0x2a53b3(0x179)+_0xd1c058+'>.');_0x2c40c6[_0x2a53b3(0x18f)]();if(_0x1c5efa[_0x2a53b3(0x152)])_0x45963a=!![];_0xac905d+=MYBATIS_BRANCH_TAGS[_0x2a53b3(0x19c)](_0x3c06cd)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x59cd09))return invalidMybatisSource('Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<'+_0xd1c058+'>.');if(_0x3c06cd===_0x2a53b3(0x19d)&&(!_0x5e3028||_0x2c40c6['at'](-0x1)?.[_0x2a53b3(0x1b3)]!=='include'))return invalidMybatisSource(_0x2a53b3(0x158));if(_0x5cde3e){if(_0x58aaf3||_0x2c40c6['length']>0x0)return invalidMybatisSource(_0x2a53b3(0x187));_0x58aaf3=!![],_0x45963a=_0x5e3028,_0x123080=_0x5cde3e;}else{if(!_0x58aaf3||_0x45963a)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<'+_0xd1c058+'>.');}_0xac905d+=_0x3c06cd===_0x2a53b3(0x1b0)?'\x20WHERE\x20':_0x3c06cd==='set'?'\x20SET\x20':_0x3c06cd===_0x2a53b3(0x198)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x2a53b3(0x19c)](_0x3c06cd)&&!_0x5e3028?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x5e3028&&_0x2c40c6['push']({'rawName':_0xd1c058,'tagName':_0x3c06cd,'outer':!!_0x5cde3e});}_0x45743b=_0x5bc691+0x1;}if(_0x2c40c6[_0x2a53b3(0x15d)]>0x0)return invalidMybatisSource(_0x2a53b3(0x16e)+_0x2c40c6['at'](-0x1)?.[_0x2a53b3(0x17d)]+'>.');if(!_0x58aaf3||!_0x45963a)return invalidMybatisSource(_0x2a53b3(0x173));return{'sql':_0xac905d['trim'](),'mode':_0x2a53b3(0x159),..._0x123080?{'statementType':_0x123080}:{}};}function hasWellFormedXmlAttributes(_0x655acf){const _0x34fd99=a316_0x400553;let _0x5848a1=0x0;const _0x5c65e0=new Set();while(_0x5848a1<_0x655acf[_0x34fd99(0x15d)]){while(_0x5848a1<_0x655acf[_0x34fd99(0x15d)]&&/\s/['test'](_0x655acf[_0x5848a1]??''))_0x5848a1+=0x1;if(_0x5848a1>=_0x655acf[_0x34fd99(0x15d)])return!![];const _0x743034=/^[A-Za-z_:][\w:.-]*/[_0x34fd99(0x1a5)](_0x655acf[_0x34fd99(0x176)](_0x5848a1)),_0x1fc785=_0x743034?.[0x0];if(!_0x1fc785||_0x5c65e0[_0x34fd99(0x19c)](_0x1fc785))return![];_0x5c65e0[_0x34fd99(0x172)](_0x1fc785),_0x5848a1+=_0x1fc785[_0x34fd99(0x15d)];while(_0x5848a1<_0x655acf[_0x34fd99(0x15d)]&&/\s/[_0x34fd99(0x155)](_0x655acf[_0x5848a1]??''))_0x5848a1+=0x1;if(_0x655acf[_0x5848a1]!=='=')return![];_0x5848a1+=0x1;while(_0x5848a1<_0x655acf[_0x34fd99(0x15d)]&&/\s/[_0x34fd99(0x155)](_0x655acf[_0x5848a1]??''))_0x5848a1+=0x1;const _0xad4f80=_0x655acf[_0x5848a1];if(_0xad4f80!=='\x22'&&_0xad4f80!=='\x27')return![];_0x5848a1+=0x1;const _0x1312df=_0x655acf['indexOf'](_0xad4f80,_0x5848a1);if(_0x1312df<0x0)return![];if(decodeXmlEntities(_0x655acf[_0x34fd99(0x176)](_0x5848a1,_0x1312df))===null)return![];_0x5848a1=_0x1312df+0x1;}return!![];}export function detectSqlSourceMode(_0x568597){const _0x3f1d1a=a316_0x400553;let _0x2decf4=0x0;const _0x1801ee=()=>{const _0x1f5b7c=a316_0x4728;while(_0x2decf4<_0x568597['length']&&/\s/[_0x1f5b7c(0x155)](_0x568597[_0x2decf4]??''))_0x2decf4+=0x1;};_0x1801ee();while(_0x2decf4<_0x568597['length']){if(_0x568597[_0x3f1d1a(0x191)](_0x3f1d1a(0x19a),_0x2decf4)){const _0x401124=_0x568597[_0x3f1d1a(0x19e)]('-->',_0x2decf4+0x4);if(_0x401124<0x0)return _0x3f1d1a(0x159);_0x2decf4=_0x401124+0x3,_0x1801ee();continue;}if(_0x568597[_0x3f1d1a(0x191)]('<?',_0x2decf4)){const _0x1d4a2f=_0x568597[_0x3f1d1a(0x19e)]('?>',_0x2decf4+0x2);if(_0x1d4a2f<0x0)return _0x3f1d1a(0x159);_0x2decf4=_0x1d4a2f+0x2,_0x1801ee();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x3f1d1a(0x155)](_0x568597[_0x3f1d1a(0x176)](_0x2decf4))?'mybatisXml':_0x3f1d1a(0x1b2);}function invalidMybatisSource(_0x2b9a66){const _0x1c8ef9=a316_0x400553;return{'sql':'','mode':_0x1c8ef9(0x159),'error':_0x2b9a66};}function findXmlTagEnd(_0x1cb4dd,_0x3e3aa8){const _0x2a3dc=a316_0x400553;let _0x6ff6b7;for(let _0x371f46=_0x3e3aa8+0x1;_0x371f46<_0x1cb4dd[_0x2a3dc(0x15d)];_0x371f46+=0x1){const _0x4e3432=_0x1cb4dd[_0x371f46];if(_0x6ff6b7){if(_0x4e3432===_0x6ff6b7)_0x6ff6b7=undefined;continue;}if(_0x4e3432==='\x22'||_0x4e3432==='\x27'){_0x6ff6b7=_0x4e3432;continue;}if(_0x4e3432==='>')return _0x371f46;}return-0x1;}function decodeXmlEntities(_0x1554de){let _0x29b24d=![];const _0x200161=_0x1554de['replace'](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x3d38a3=>{const _0x1483d0=a316_0x4728;if(_0x3d38a3===_0x1483d0(0x17f))return'<';if(_0x3d38a3===_0x1483d0(0x16b))return'>';if(_0x3d38a3===_0x1483d0(0x154))return'\x22';if(_0x3d38a3===''')return'\x27';if(_0x3d38a3==='&')return'&';const _0x214092=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x1483d0(0x1a5)](_0x3d38a3);if(_0x214092){const _0x2364fa=_0x214092[0x1],_0xf9a3e=_0x214092[0x2],_0x3a0623=Number[_0x1483d0(0x17e)](_0x2364fa??_0xf9a3e??'',_0x2364fa?0x10:0xa);if(isValidXmlCharacter(_0x3a0623))return String[_0x1483d0(0x1ad)](_0x3a0623);}return _0x29b24d=!![],'';});return _0x29b24d?null:_0x200161;}function isValidXmlCharacter(_0xdffa2c){return _0xdffa2c===0x9||_0xdffa2c===0xa||_0xdffa2c===0xd||_0xdffa2c>=0x20&&_0xdffa2c<=0xd7ff||_0xdffa2c>=0xe000&&_0xdffa2c<=0xfffd||_0xdffa2c>=0x10000&&_0xdffa2c<=0x10ffff;}export function detectSqlType(_0x4cfbbd){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x4cfbbd));}function detectNormalizedSqlType(_0x28b309){const _0x203abf=a316_0x400553;if(_0x28b309[_0x203abf(0x16d)])return{'type':_0x203abf(0x163),'isSelectOnly':![],'isDangerous':![],'reason':_0x28b309[_0x203abf(0x16d)]};if(!_0x28b309['sql']['trim']())return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x203abf(0x14f)};const _0x2d1567=tokenizeSqlForTypeAnalysis(_0x28b309[_0x203abf(0x1b2)]),_0x3d6d0a=_0x2d1567[_0x203abf(0x170)](_0x6c9466=>_0x6c9466!==MYBATIS_DYNAMIC_START_MARKER&&_0x6c9466!==MYBATIS_DYNAMIC_END_MARKER),_0xb60b3d=findMainStatementIndex(_0x3d6d0a);if(_0xb60b3d<0x0)return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':'Local\x20analysis\x20could\x20not\x20parse\x20the\x20WITH\x20prefix;\x20this\x20is\x20a\x20local\x20capability\x20limit,\x20not\x20a\x20platform\x20rejection.'};const _0x2f614f=_0x3d6d0a[_0xb60b3d]??'',_0x4cce86=_0x28b309['statementType']??_0x2f614f,_0x3efab6=_0x2d1567['some'](_0x211b52=>/^(DELETE|DROP|ALTER|CREATE|TRUNCATE)$/[_0x203abf(0x155)](_0x211b52)),_0x4ae408=new Set();let _0x32100f=![];for(let _0x331cfa=0x0;_0x331cfa<_0x2d1567['length'];_0x331cfa+=0x1){const _0xfe4db3=_0x2d1567[_0x331cfa];(_0xfe4db3===_0x203abf(0x182)||_0xfe4db3==='SHARE')&&isLockingClauseKeyword(_0x2d1567,_0x331cfa)&&(_0x4ae408[_0x203abf(0x172)](_0x331cfa),_0x32100f=!![]);if(_0x2d1567['slice'](_0x331cfa,_0x331cfa+0x4)[_0x203abf(0x1a8)]('\x20')===_0x203abf(0x17c))_0x32100f=!![];}if(_0x4cce86===_0x203abf(0x1ae)){const _0x2bd3b6=_0x2d1567[_0x203abf(0x14e)]((_0x55456e,_0x395dc8)=>/^(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)$/[_0x203abf(0x155)](_0x55456e)&&!_0x4ae408[_0x203abf(0x19c)](_0x395dc8));return{'type':_0x203abf(0x1ae),'isSelectOnly':!_0x2bd3b6&&!_0x32100f,'isLockingRead':_0x32100f,'isDangerous':_0x2bd3b6,'reason':_0x2bd3b6?_0x203abf(0x1a4):undefined};}if(_0x4cce86===_0x203abf(0x157))return{'type':'INSERT','isSelectOnly':![],'isDangerous':_0x3efab6,'reason':_0x3efab6?_0x203abf(0x1a0):undefined};if(_0x4cce86==='UPDATE')return{'type':_0x203abf(0x182),'isSelectOnly':![],'isDangerous':_0x3efab6,'reason':_0x3efab6?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x4cce86===_0x203abf(0x1ab))return{'type':_0x203abf(0x1ab),'isSelectOnly':![],'isDangerous':!![],'reason':_0x203abf(0x181)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x203abf(0x155)](_0x2f614f))return{'type':_0x203abf(0x1a7),'isSelectOnly':![],'isDangerous':!![],'reason':_0x203abf(0x192)};return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![]};}function isLockingClauseKeyword(_0x3be1af,_0x28e084){const _0x1a2abe=a316_0x400553,_0x2e13ea=_0x3be1af[_0x28e084]==='UPDATE'?[[_0x1a2abe(0x153)],['FOR','NO',_0x1a2abe(0x164)]]:[[_0x1a2abe(0x153)],[_0x1a2abe(0x153),'KEY']],_0x49e487=_0x2e13ea[_0x1a2abe(0x14e)](_0xfa8ded=>{const _0x3a3248=_0x1a2abe,_0x5d38f3=_0x28e084-_0xfa8ded[_0x3a3248(0x15d)];return _0x5d38f3>=0x0&&_0x3be1af[_0x3a3248(0x176)](_0x5d38f3,_0x28e084)['join']('\x20')===_0xfa8ded[_0x3a3248(0x1a8)]('\x20');});if(!_0x49e487)return![];return!_0x3be1af[_0x1a2abe(0x176)](_0x28e084+0x1,_0x28e084+0x5)[_0x1a2abe(0x14d)](_0x1a2abe(0x1b4));}function a316_0x22f3(){const _0x1fa488=['filter','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','add','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','RECURSIVE','slice','set',']]>','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','551748nnYiPw','45740CxOsrA','LOCK\x20IN\x20SHARE\x20MODE','rawName','parseInt','<','7090Fbzanw','DELETE\x20statements\x20require\x20explicit\x20review','UPDATE','get','NOT','Unterminated\x20MyBatis\x20XML\x20tag.','unknown\x20table(s)','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','MATERIALIZED','trim','559UoZiZy','<![CDATA[','182928YSMjMQ','9530IipZPG','bind','pop','297839OpcnJn','startsWith','DDL\x20statements\x20require\x20explicit\x20review','type','__RABETBASE_MYBATIS_DYNAMIC_START__','isDangerous','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','\x20query\x20targeting\x20','include','1205505djNFAs','<!--','Unable\x20to\x20detect\x20SQL\x20type.\x20','has','property','indexOf','matchAll','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','foreach','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','exec','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','DDL','join','string','170KgvTqm','DELETE','keys','fromCodePoint','SELECT','\x20with\x20parameters:\x20','where','^<\x5cs*(?:','sql','tagName','SET','delete','replaceAll','531yDkPqF','Invalid\x20XML\x20entity\x20reference.','includes','some','SQL\x20content\x20is\x20empty','WITH','56sSxwts','outer','FOR','"','test','when','INSERT','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','mybatisXml','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','Unterminated\x20XML\x20comment.','8371pvudoh','length','__RABETBASE_MYBATIS_DYNAMIC_END__','push','\x20statements\x20require\x20explicit\x20review.\x20Local\x20analysis\x20does\x20not\x20authorize\x20saving\x20or\x20execution.','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','match','UNKNOWN','KEY','select','otherwise','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','replace','choose','77oVdAie','>','Unterminated\x20XML\x20declaration.','error','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','reason'];a316_0x22f3=function(){return _0x1fa488;};return a316_0x22f3();}function findMainStatementIndex(_0x4ab3a5){const _0x4a861d=a316_0x400553;if(_0x4ab3a5[0x0]!==_0x4a861d(0x150))return 0x0;let _0x53bc03=_0x4ab3a5[0x1]===_0x4a861d(0x175)?0x2:0x1;while(_0x53bc03<_0x4ab3a5[_0x4a861d(0x15d)]){const _0x60d4fb=_0x4ab3a5[_0x53bc03];if(!_0x60d4fb||!(/^[A-Z_][\w$]*$/[_0x4a861d(0x155)](_0x60d4fb)||/^[`"]/[_0x4a861d(0x155)](_0x60d4fb)))return-0x1;_0x53bc03+=0x1;if(_0x4ab3a5[_0x53bc03]==='('){_0x53bc03=skipSqlParentheses(_0x4ab3a5,_0x53bc03);if(_0x53bc03<0x0)return-0x1;}if(_0x4ab3a5[_0x53bc03]!=='AS')return-0x1;_0x53bc03+=0x1;if(_0x4ab3a5[_0x53bc03]===_0x4a861d(0x184)&&_0x4ab3a5[_0x53bc03+0x1]===_0x4a861d(0x188))_0x53bc03+=0x2;else{if(_0x4ab3a5[_0x53bc03]==='MATERIALIZED')_0x53bc03+=0x1;}_0x53bc03=skipSqlParentheses(_0x4ab3a5,_0x53bc03);if(_0x53bc03<0x0)return-0x1;if(_0x4ab3a5[_0x53bc03]!==','){const _0x4bf974=_0x4ab3a5[_0x53bc03]==='('?_0x53bc03+0x1:_0x53bc03;return/^(SELECT|INSERT|UPDATE|DELETE)$/['test'](_0x4ab3a5[_0x4bf974]??'')?_0x4bf974:-0x1;}_0x53bc03+=0x1;}return-0x1;}function a316_0x4728(_0x26964c,_0x270356){_0x26964c=_0x26964c-0x14c;const _0x22f3c3=a316_0x22f3();let _0x472875=_0x22f3c3[_0x26964c];return _0x472875;}function skipSqlParentheses(_0x4048cc,_0x43e116){if(_0x4048cc[_0x43e116]!=='(')return-0x1;let _0x40d584=0x0;for(let _0x11a2fd=_0x43e116;_0x11a2fd<_0x4048cc['length'];_0x11a2fd+=0x1){const _0x323607=_0x4048cc[_0x11a2fd];if(_0x323607===';')return-0x1;if(_0x323607==='(')_0x40d584+=0x1;if(_0x323607===')'&&--_0x40d584===0x0)return _0x11a2fd+0x1;}return-0x1;}function stripStaticAnalysisMarkers(_0x27f1e9){const _0x5d7c7f=a316_0x400553;return _0x27f1e9['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x5d7c7f(0x1b6)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x5d7c7f(0x1b6)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function tokenizeSqlForTypeAnalysis(_0x3462d6){const _0x4c45f2=a316_0x400553,_0x48fb88=[],_0x1c39b8=/\/\*[\s\S]*?\*\/|--[^\r\n]*|[#$]\{[^}]*\}|#[^\r\n]*|'(?:''|\\[\s\S]|[^'\\])*'|"(?:""|\\[\s\S]|[^"\\])*"|`(?:``|\\[\s\S]|[^`\\])*`|@[A-Za-z_]\w*|[A-Za-z_]\w*|\S/g;for(const _0x12fa84 of _0x3462d6[_0x4c45f2(0x19f)](_0x1c39b8)){const _0x387dad=_0x12fa84[0x0];if(_0x387dad[_0x4c45f2(0x191)]('/*')||_0x387dad[_0x4c45f2(0x191)]('--')||_0x387dad[_0x4c45f2(0x191)]('#')&&!_0x387dad[_0x4c45f2(0x191)]('#{'))continue;_0x48fb88['push'](/^["`]/[_0x4c45f2(0x155)](_0x387dad)?_0x387dad:/^[\x27@#$]/[_0x4c45f2(0x155)](_0x387dad)?'?':_0x387dad['toUpperCase']());}return _0x48fb88;}function extractTables(_0x4ff929,_0x59ba93){const _0x25a912=a316_0x400553,_0x5575fe=_0x4ff929[_0x25a912(0x168)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x25a912(0x168)](/'[^']*'/g,'\x27\x27')[_0x25a912(0x168)](/--.*$/gm,'')[_0x25a912(0x168)](/\/\*[\s\S]*?\*\//g,''),_0x166f37=[],_0x453be8=_0x5575fe['match'](/FROM\s+([^\s,)(]+)/i);addTable(_0x166f37,_0x453be8?.[0x1]);for(const _0x188c26 of _0x5575fe[_0x25a912(0x19f)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x166f37,_0x188c26[0x1]);}const _0x25e729=_0x5575fe['match'](/INTO\s+([^\s(]+)/i);addTable(_0x166f37,_0x25e729?.[0x1]);if(_0x59ba93===_0x25a912(0x182)){const _0x1fa98f=_0x5575fe[_0x25a912(0x162)](/UPDATE\s+([^\s,)(]+)/i);addTable(_0x166f37,_0x1fa98f?.[0x1]);}return _0x166f37;}function addTable(_0x592df1,_0x46a569){const _0x1d2c53=a316_0x400553,_0x44fd74=_0x46a569?.[_0x1d2c53(0x168)](/[`"]/g,'');_0x44fd74&&_0x44fd74!==UNRESOLVED_SQL_FRAGMENT&&!_0x592df1['includes'](_0x44fd74)&&_0x592df1[_0x1d2c53(0x15f)](_0x44fd74);}function extractParameters(_0x271147){const _0x58c22a=a316_0x400553,_0x3e4fe7=new Set();for(const _0x2de07a of _0x271147[_0x58c22a(0x19f)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x2de07a[0x1])_0x3e4fe7['add'](_0x2de07a[0x1]);}return Array['from'](_0x3e4fe7);}export function validateSql(_0x2e5966){const _0x119750=a316_0x400553,_0x37fea6=normalizeSqlForStaticAnalysis(_0x2e5966),_0x49f0a4=detectNormalizedSqlType(_0x37fea6),_0x116cf6=stripStaticAnalysisMarkers(_0x37fea6['sql']),_0x2f6b9=_0x37fea6[_0x119750(0x16d)]?[]:extractTables(_0x116cf6,_0x49f0a4[_0x119750(0x193)]),_0x1e13ca=_0x37fea6[_0x119750(0x16d)]?[]:extractParameters(_0x116cf6);if(_0x49f0a4[_0x119750(0x195)])return{'valid':![],'sqlType':_0x49f0a4,'tables':_0x2f6b9,'parameters':_0x1e13ca,'message':_0x49f0a4['reason']||_0x49f0a4['type']+_0x119750(0x160)};if(_0x49f0a4[_0x119750(0x193)]===_0x119750(0x163))return{'valid':![],'sqlType':_0x49f0a4,'tables':_0x2f6b9,'parameters':_0x1e13ca,'message':_0x37fea6[_0x119750(0x16d)]?'Unable\x20to\x20detect\x20SQL\x20type.\x20'+_0x37fea6['error']:_0x49f0a4['reason']?_0x119750(0x19b)+_0x49f0a4[_0x119750(0x16f)]:_0x119750(0x1a3)};return{'valid':!![],'sqlType':_0x49f0a4,'tables':_0x2f6b9,'parameters':_0x1e13ca,'message':_0x49f0a4['type']+_0x119750(0x197)+(_0x2f6b9[_0x119750(0x15d)]?_0x2f6b9[_0x119750(0x1a8)](',\x20'):_0x119750(0x186))+(_0x1e13ca[_0x119750(0x15d)]?_0x119750(0x1af)+_0x1e13ca['join'](',\x20'):'')};}
|
|
1
|
+
const a316_0x513f98=a316_0x2815;function a316_0xf91e(){const _0x461609=['MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','tagName','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','rawName','join','when','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','>','unknown\x20table(s)','10QgMKrg','exec','7054qWrMNK','KEY','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','replaceAll','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','error','336261zcMcYS','Unable\x20to\x20detect\x20SQL\x20type.\x20','get','Unterminated\x20MyBatis\x20XML\x20tag.','Invalid\x20XML\x20entity\x20reference.','&','<!--','delete','\x20SET\x20','4MBWnSI','\x20with\x20parameters:\x20','RECURSIVE','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','match','UNKNOWN','replace','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','3sVHOCw','pop','-->','type','has','push','\x20WHERE\x20','bind','isDangerous','startsWith','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','FOR','statementType','from','__RABETBASE_MYBATIS_DYNAMIC_START__','314945KSprBr',']]>','DELETE\x20statements\x20require\x20explicit\x20review','1094046EHgbhK','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','<![CDATA[','trim','1285417lAjxrW','reason','Unterminated\x20XML\x20comment.','"','indexOf','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','DELETE','sql','add','SET','foreach','set','SELECT','choose',''','slice','INSERT','DDL','otherwise','length','LOCK\x20IN\x20SHARE\x20MODE','matchAll','127176yRjsLh','test','includes','toLowerCase','Local\x20analysis\x20could\x20not\x20parse\x20the\x20WITH\x20prefix;\x20this\x20is\x20a\x20local\x20capability\x20limit,\x20not\x20a\x20platform\x20rejection.','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','where','include','UPDATE','mybatisXml','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','3829905bJLfGW','MATERIALIZED','Invalid\x20MyBatis\x20XML\x20tag.','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','outer','^<\x5cs*(?:','NOT','Unterminated\x20CDATA\x20section.'];a316_0xf91e=function(){return _0x461609;};return a316_0xf91e();}(function(_0x219ff0,_0xa245fc){const _0x508463=a316_0x2815,_0xcc7988=_0x219ff0();while(!![]){try{const _0x58c184=parseInt(_0x508463(0x19a))/0x1*(parseInt(_0x508463(0x181))/0x2)+-parseInt(_0x508463(0x187))/0x3*(-parseInt(_0x508463(0x190))/0x4)+-parseInt(_0x508463(0x145))/0x5+-parseInt(_0x508463(0x148))/0x6+-parseInt(_0x508463(0x14c))/0x7+-parseInt(_0x508463(0x163))/0x8+-parseInt(_0x508463(0x16e))/0x9*(-parseInt(_0x508463(0x17f))/0xa);if(_0x58c184===_0xa245fc)break;else _0xcc7988['push'](_0xcc7988['shift']());}catch(_0x164289){_0xcc7988['push'](_0xcc7988['shift']());}}}(a316_0xf91e,0x193bb));const MYBATIS_OUTER_TAGS=new Map([['select',a316_0x513f98(0x159)],['insert',a316_0x513f98(0x15d)],['update',a316_0x513f98(0x16b)],[a316_0x513f98(0x18e),a316_0x513f98(0x153)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a316_0x513f98(0x169),a316_0x513f98(0x157),a316_0x513f98(0x15a),a316_0x513f98(0x17b),a316_0x513f98(0x15f),a316_0x513f98(0x14b),a316_0x513f98(0x158),a316_0x513f98(0x1a1),a316_0x513f98(0x16a),'property']),MYBATIS_BRANCH_TAGS=new Set(['if',a316_0x513f98(0x157),a316_0x513f98(0x15a),a316_0x513f98(0x17b),a316_0x513f98(0x15f)]);export const MYBATIS_DYNAMIC_START_MARKER=a316_0x513f98(0x1a8);export const MYBATIS_DYNAMIC_END_MARKER='__RABETBASE_MYBATIS_DYNAMIC_END__';export const MYBATIS_INCLUDE_MARKER=a316_0x513f98(0x1a4);const UNRESOLVED_SQL_FRAGMENT=a316_0x513f98(0x152),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a316_0x513f98(0x173)+[...MYBATIS_OUTER_TAGS['keys']()][a316_0x513f98(0x17a)]('|')+')\x5cb','i');export function normalizeSqlForStaticAnalysis(_0x518f34){const _0x3802ca=a316_0x513f98,_0x1dceda=typeof _0x518f34==='string'?_0x518f34:'';if(detectSqlSourceMode(_0x1dceda)==='sql')return{'sql':_0x1dceda,'mode':_0x3802ca(0x154)};let _0x589dba=0x0,_0x3f9a45='',_0x31be6e,_0x1994d9=![],_0x173fa3=![];const _0x3aab4a=[];while(_0x589dba<_0x1dceda['length']){if(_0x1dceda[_0x3802ca(0x1a3)]('<!--',_0x589dba)){const _0x25a3f4=_0x1dceda[_0x3802ca(0x150)](_0x3802ca(0x19c),_0x589dba+0x4);if(_0x25a3f4<0x0)return invalidMybatisSource(_0x3802ca(0x14e));_0x3f9a45+='\x20',_0x589dba=_0x25a3f4+0x3;continue;}if(_0x1dceda[_0x3802ca(0x1a3)](_0x3802ca(0x14a),_0x589dba)){if(!_0x1994d9||_0x173fa3)return invalidMybatisSource(_0x3802ca(0x183));const _0x4dfd3d=_0x1dceda[_0x3802ca(0x150)](_0x3802ca(0x146),_0x589dba+0x9);if(_0x4dfd3d<0x0)return invalidMybatisSource(_0x3802ca(0x175));_0x3f9a45+=_0x1dceda['slice'](_0x589dba+0x9,_0x4dfd3d),_0x589dba=_0x4dfd3d+0x3;continue;}if(_0x1dceda[_0x3802ca(0x1a3)]('<?',_0x589dba)){if(_0x1994d9)return invalidMybatisSource(_0x3802ca(0x151));const _0x4c9c92=_0x1dceda[_0x3802ca(0x150)]('?>',_0x589dba+0x2);if(_0x4c9c92<0x0)return invalidMybatisSource('Unterminated\x20XML\x20declaration.');_0x3f9a45+='\x20',_0x589dba=_0x4c9c92+0x2;continue;}if(_0x1dceda[_0x589dba]!=='<'){const _0x21ecb0=_0x1dceda[_0x3802ca(0x150)]('<',_0x589dba),_0x55c82a=_0x21ecb0<0x0?_0x1dceda['length']:_0x21ecb0,_0xca7f3c=_0x1dceda[_0x3802ca(0x15c)](_0x589dba,_0x55c82a);if((!_0x1994d9||_0x173fa3)&&_0xca7f3c[_0x3802ca(0x14b)]())return invalidMybatisSource(_0x3802ca(0x197));if(_0x1994d9&&!_0x173fa3){const _0xe44a3c=decodeXmlEntities(_0xca7f3c);if(_0xe44a3c===null)return invalidMybatisSource(_0x3802ca(0x18b));_0x3f9a45+=_0xe44a3c;}else _0x3f9a45+='\x20';_0x589dba=_0x55c82a;continue;}const _0x384350=findXmlTagEnd(_0x1dceda,_0x589dba);if(_0x384350<0x0)return invalidMybatisSource(_0x3802ca(0x18a));const _0x268b2c=_0x1dceda[_0x3802ca(0x15c)](_0x589dba,_0x384350+0x1),_0x1da608=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x3802ca(0x180)](_0x268b2c);if(!_0x1da608)return invalidMybatisSource(_0x3802ca(0x170));const _0x50c78c=_0x1da608[0x1]==='/',_0x30fbbb=_0x1da608[0x2]??'',_0x17f25b=_0x30fbbb[_0x3802ca(0x166)](),_0x837298=_0x1da608[0x3]??'',_0x64cdac=_0x1da608[0x4]==='/',_0x2cc7b4=MYBATIS_OUTER_TAGS[_0x3802ca(0x189)](_0x17f25b);if(!_0x2cc7b4&&!MYBATIS_DYNAMIC_TAGS[_0x3802ca(0x19e)](_0x17f25b))return invalidMybatisSource(_0x3802ca(0x185)+_0x17f25b+'>.');if(!_0x2cc7b4&&_0x30fbbb!==_0x17f25b)return invalidMybatisSource(_0x3802ca(0x176)+_0x30fbbb+'>.');if(_0x50c78c){if(_0x837298[_0x3802ca(0x14b)]()||_0x64cdac)return invalidMybatisSource(_0x3802ca(0x149)+_0x30fbbb+'>.');const _0x5a5b61=_0x3aab4a['at'](-0x1);if(!_0x5a5b61||(_0x5a5b61[_0x3802ca(0x172)]?_0x5a5b61[_0x3802ca(0x177)]!==_0x17f25b:_0x5a5b61[_0x3802ca(0x179)]!==_0x30fbbb))return invalidMybatisSource('Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x30fbbb+'>.');_0x3aab4a[_0x3802ca(0x19b)]();if(_0x5a5b61[_0x3802ca(0x172)])_0x173fa3=!![];_0x3f9a45+=MYBATIS_BRANCH_TAGS['has'](_0x17f25b)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x837298))return invalidMybatisSource(_0x3802ca(0x168)+_0x30fbbb+'>.');if(_0x17f25b==='property'&&(!_0x64cdac||_0x3aab4a['at'](-0x1)?.[_0x3802ca(0x177)]!==_0x3802ca(0x16a)))return invalidMybatisSource('MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.');if(_0x2cc7b4){if(_0x1994d9||_0x3aab4a[_0x3802ca(0x160)]>0x0)return invalidMybatisSource(_0x3802ca(0x193));_0x1994d9=!![],_0x173fa3=_0x64cdac,_0x31be6e=_0x2cc7b4;}else{if(!_0x1994d9||_0x173fa3)return invalidMybatisSource(_0x3802ca(0x178)+_0x30fbbb+'>.');}_0x3f9a45+=_0x17f25b===_0x3802ca(0x169)?_0x3802ca(0x1a0):_0x17f25b===_0x3802ca(0x158)?_0x3802ca(0x18f):_0x17f25b==='include'?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x3802ca(0x19e)](_0x17f25b)&&!_0x64cdac?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x64cdac&&_0x3aab4a['push']({'rawName':_0x30fbbb,'tagName':_0x17f25b,'outer':!!_0x2cc7b4});}_0x589dba=_0x384350+0x1;}if(_0x3aab4a[_0x3802ca(0x160)]>0x0)return invalidMybatisSource(_0x3802ca(0x171)+_0x3aab4a['at'](-0x1)?.[_0x3802ca(0x179)]+'>.');if(!_0x1994d9||!_0x173fa3)return invalidMybatisSource(_0x3802ca(0x17c));return{'sql':_0x3f9a45[_0x3802ca(0x14b)](),'mode':'mybatisXml',..._0x31be6e?{'statementType':_0x31be6e}:{}};}function hasWellFormedXmlAttributes(_0x5f40ee){const _0x54dd51=a316_0x513f98;let _0x5f423f=0x0;const _0x1050d2=new Set();while(_0x5f423f<_0x5f40ee[_0x54dd51(0x160)]){while(_0x5f423f<_0x5f40ee[_0x54dd51(0x160)]&&/\s/[_0x54dd51(0x164)](_0x5f40ee[_0x5f423f]??''))_0x5f423f+=0x1;if(_0x5f423f>=_0x5f40ee['length'])return!![];const _0x20d414=/^[A-Za-z_:][\w:.-]*/[_0x54dd51(0x180)](_0x5f40ee[_0x54dd51(0x15c)](_0x5f423f)),_0x57a3c9=_0x20d414?.[0x0];if(!_0x57a3c9||_0x1050d2['has'](_0x57a3c9))return![];_0x1050d2[_0x54dd51(0x155)](_0x57a3c9),_0x5f423f+=_0x57a3c9[_0x54dd51(0x160)];while(_0x5f423f<_0x5f40ee['length']&&/\s/[_0x54dd51(0x164)](_0x5f40ee[_0x5f423f]??''))_0x5f423f+=0x1;if(_0x5f40ee[_0x5f423f]!=='=')return![];_0x5f423f+=0x1;while(_0x5f423f<_0x5f40ee[_0x54dd51(0x160)]&&/\s/[_0x54dd51(0x164)](_0x5f40ee[_0x5f423f]??''))_0x5f423f+=0x1;const _0x498f92=_0x5f40ee[_0x5f423f];if(_0x498f92!=='\x22'&&_0x498f92!=='\x27')return![];_0x5f423f+=0x1;const _0x552723=_0x5f40ee[_0x54dd51(0x150)](_0x498f92,_0x5f423f);if(_0x552723<0x0)return![];if(decodeXmlEntities(_0x5f40ee[_0x54dd51(0x15c)](_0x5f423f,_0x552723))===null)return![];_0x5f423f=_0x552723+0x1;}return!![];}export function detectSqlSourceMode(_0x5366ed){const _0x4b5f12=a316_0x513f98;let _0xcac94a=0x0;const _0x5c9cd5=()=>{const _0x4a93ba=a316_0x2815;while(_0xcac94a<_0x5366ed[_0x4a93ba(0x160)]&&/\s/['test'](_0x5366ed[_0xcac94a]??''))_0xcac94a+=0x1;};_0x5c9cd5();while(_0xcac94a<_0x5366ed[_0x4b5f12(0x160)]){if(_0x5366ed[_0x4b5f12(0x1a3)](_0x4b5f12(0x18d),_0xcac94a)){const _0x149592=_0x5366ed[_0x4b5f12(0x150)]('-->',_0xcac94a+0x4);if(_0x149592<0x0)return _0x4b5f12(0x16c);_0xcac94a=_0x149592+0x3,_0x5c9cd5();continue;}if(_0x5366ed[_0x4b5f12(0x1a3)]('<?',_0xcac94a)){const _0x2565af=_0x5366ed[_0x4b5f12(0x150)]('?>',_0xcac94a+0x2);if(_0x2565af<0x0)return _0x4b5f12(0x16c);_0xcac94a=_0x2565af+0x2,_0x5c9cd5();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN['test'](_0x5366ed['slice'](_0xcac94a))?_0x4b5f12(0x16c):_0x4b5f12(0x154);}function invalidMybatisSource(_0x20f2ba){const _0x1e20a4=a316_0x513f98;return{'sql':'','mode':_0x1e20a4(0x16c),'error':_0x20f2ba};}function findXmlTagEnd(_0xd34b79,_0xc27c98){const _0x3daf49=a316_0x513f98;let _0x51f9de;for(let _0x369a5f=_0xc27c98+0x1;_0x369a5f<_0xd34b79[_0x3daf49(0x160)];_0x369a5f+=0x1){const _0x2ae1a1=_0xd34b79[_0x369a5f];if(_0x51f9de){if(_0x2ae1a1===_0x51f9de)_0x51f9de=undefined;continue;}if(_0x2ae1a1==='\x22'||_0x2ae1a1==='\x27'){_0x51f9de=_0x2ae1a1;continue;}if(_0x2ae1a1==='>')return _0x369a5f;}return-0x1;}function decodeXmlEntities(_0x24be6a){const _0x43ac08=a316_0x513f98;let _0x78637a=![];const _0x1f1ad4=_0x24be6a[_0x43ac08(0x196)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x859caf=>{const _0xa473cc=_0x43ac08;if(_0x859caf==='<')return'<';if(_0x859caf===_0xa473cc(0x17d))return'>';if(_0x859caf===_0xa473cc(0x14f))return'\x22';if(_0x859caf===_0xa473cc(0x15b))return'\x27';if(_0x859caf===_0xa473cc(0x18c))return'&';const _0x5be4bc=/^&#(?:x([0-9a-f]+)|([0-9]+));$/['exec'](_0x859caf);if(_0x5be4bc){const _0x25204e=_0x5be4bc[0x1],_0x4b771e=_0x5be4bc[0x2],_0x1fc215=Number['parseInt'](_0x25204e??_0x4b771e??'',_0x25204e?0x10:0xa);if(isValidXmlCharacter(_0x1fc215))return String['fromCodePoint'](_0x1fc215);}return _0x78637a=!![],'';});return _0x78637a?null:_0x1f1ad4;}function isValidXmlCharacter(_0x17e448){return _0x17e448===0x9||_0x17e448===0xa||_0x17e448===0xd||_0x17e448>=0x20&&_0x17e448<=0xd7ff||_0x17e448>=0xe000&&_0x17e448<=0xfffd||_0x17e448>=0x10000&&_0x17e448<=0x10ffff;}export function detectSqlType(_0x5a9c74){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x5a9c74));}function detectNormalizedSqlType(_0x284935){const _0x53dd32=a316_0x513f98;if(_0x284935[_0x53dd32(0x186)])return{'type':_0x53dd32(0x195),'isSelectOnly':![],'isDangerous':![],'reason':_0x284935['error']};if(!_0x284935[_0x53dd32(0x154)][_0x53dd32(0x14b)]())return{'type':_0x53dd32(0x195),'isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0x5897cc=tokenizeSqlForTypeAnalysis(_0x284935[_0x53dd32(0x154)]),_0x1b21ba=_0x5897cc['filter'](_0x5ad306=>_0x5ad306!==MYBATIS_DYNAMIC_START_MARKER&&_0x5ad306!==MYBATIS_DYNAMIC_END_MARKER),_0x2c09f0=findMainStatementIndex(_0x1b21ba);if(_0x2c09f0<0x0)return{'type':_0x53dd32(0x195),'isSelectOnly':![],'isDangerous':![],'reason':_0x53dd32(0x167)};const _0x4c1cca=_0x1b21ba[_0x2c09f0]??'',_0x778b74=_0x284935[_0x53dd32(0x1a6)]??_0x4c1cca,_0xc4491=_0x5897cc['some'](_0xe6f4e8=>/^(DELETE|DROP|ALTER|CREATE|TRUNCATE)$/[_0x53dd32(0x164)](_0xe6f4e8)),_0x66c239=new Set();let _0x5840f8=![];for(let _0x9224f8=0x0;_0x9224f8<_0x5897cc['length'];_0x9224f8+=0x1){const _0x46bcdd=_0x5897cc[_0x9224f8];(_0x46bcdd===_0x53dd32(0x16b)||_0x46bcdd==='SHARE')&&isLockingClauseKeyword(_0x5897cc,_0x9224f8)&&(_0x66c239[_0x53dd32(0x155)](_0x9224f8),_0x5840f8=!![]);if(_0x5897cc[_0x53dd32(0x15c)](_0x9224f8,_0x9224f8+0x4)[_0x53dd32(0x17a)]('\x20')===_0x53dd32(0x161))_0x5840f8=!![];}if(_0x778b74===_0x53dd32(0x159)){const _0x4dc8fd=_0x5897cc['some']((_0x56165d,_0x391b8f)=>/^(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)$/[_0x53dd32(0x164)](_0x56165d)&&!_0x66c239['has'](_0x391b8f));return{'type':_0x53dd32(0x159),'isSelectOnly':!_0x4dc8fd&&!_0x5840f8,'isLockingRead':_0x5840f8,'isDangerous':_0x4dc8fd,'reason':_0x4dc8fd?_0x53dd32(0x199):undefined};}if(_0x778b74===_0x53dd32(0x15d))return{'type':'INSERT','isSelectOnly':![],'isDangerous':_0xc4491,'reason':_0xc4491?_0x53dd32(0x16d):undefined};if(_0x778b74===_0x53dd32(0x16b))return{'type':_0x53dd32(0x16b),'isSelectOnly':![],'isDangerous':_0xc4491,'reason':_0xc4491?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x778b74===_0x53dd32(0x153))return{'type':'DELETE','isSelectOnly':![],'isDangerous':!![],'reason':_0x53dd32(0x147)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x53dd32(0x164)](_0x4c1cca))return{'type':_0x53dd32(0x15e),'isSelectOnly':![],'isDangerous':!![],'reason':'DDL\x20statements\x20require\x20explicit\x20review'};return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![]};}function isLockingClauseKeyword(_0x5be385,_0x4a6444){const _0xed0594=a316_0x513f98,_0x395d0b=_0x5be385[_0x4a6444]===_0xed0594(0x16b)?[[_0xed0594(0x1a5)],['FOR','NO',_0xed0594(0x182)]]:[[_0xed0594(0x1a5)],[_0xed0594(0x1a5),'KEY']],_0x4f2b09=_0x395d0b['some'](_0x750863=>{const _0x2f748f=_0xed0594,_0x1b94a1=_0x4a6444-_0x750863['length'];return _0x1b94a1>=0x0&&_0x5be385[_0x2f748f(0x15c)](_0x1b94a1,_0x4a6444)[_0x2f748f(0x17a)]('\x20')===_0x750863[_0x2f748f(0x17a)]('\x20');});if(!_0x4f2b09)return![];return!_0x5be385[_0xed0594(0x15c)](_0x4a6444+0x1,_0x4a6444+0x5)[_0xed0594(0x165)](_0xed0594(0x156));}function findMainStatementIndex(_0x16ccb8){const _0x4f3486=a316_0x513f98;if(_0x16ccb8[0x0]!=='WITH')return 0x0;let _0x4df86b=_0x16ccb8[0x1]===_0x4f3486(0x192)?0x2:0x1;while(_0x4df86b<_0x16ccb8[_0x4f3486(0x160)]){const _0x14bc39=_0x16ccb8[_0x4df86b];if(!_0x14bc39||!(/^[A-Z_][\w$]*$/[_0x4f3486(0x164)](_0x14bc39)||/^[`"]/[_0x4f3486(0x164)](_0x14bc39)))return-0x1;_0x4df86b+=0x1;if(_0x16ccb8[_0x4df86b]==='('){_0x4df86b=skipSqlParentheses(_0x16ccb8,_0x4df86b);if(_0x4df86b<0x0)return-0x1;}if(_0x16ccb8[_0x4df86b]!=='AS')return-0x1;_0x4df86b+=0x1;if(_0x16ccb8[_0x4df86b]===_0x4f3486(0x174)&&_0x16ccb8[_0x4df86b+0x1]===_0x4f3486(0x16f))_0x4df86b+=0x2;else{if(_0x16ccb8[_0x4df86b]==='MATERIALIZED')_0x4df86b+=0x1;}_0x4df86b=skipSqlParentheses(_0x16ccb8,_0x4df86b);if(_0x4df86b<0x0)return-0x1;if(_0x16ccb8[_0x4df86b]!==','){const _0xa8b23=_0x16ccb8[_0x4df86b]==='('?_0x4df86b+0x1:_0x4df86b;return/^(SELECT|INSERT|UPDATE|DELETE)$/[_0x4f3486(0x164)](_0x16ccb8[_0xa8b23]??'')?_0xa8b23:-0x1;}_0x4df86b+=0x1;}return-0x1;}function skipSqlParentheses(_0x1eef2b,_0x4dbc81){const _0x4491b9=a316_0x513f98;if(_0x1eef2b[_0x4dbc81]!=='(')return-0x1;let _0x40b0bf=0x0;for(let _0x3409c9=_0x4dbc81;_0x3409c9<_0x1eef2b[_0x4491b9(0x160)];_0x3409c9+=0x1){const _0x159016=_0x1eef2b[_0x3409c9];if(_0x159016===';')return-0x1;if(_0x159016==='(')_0x40b0bf+=0x1;if(_0x159016===')'&&--_0x40b0bf===0x0)return _0x3409c9+0x1;}return-0x1;}function stripStaticAnalysisMarkers(_0x26b4fb){const _0x545ba9=a316_0x513f98;return _0x26b4fb[_0x545ba9(0x184)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x545ba9(0x184)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x545ba9(0x184)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function tokenizeSqlForTypeAnalysis(_0x52d8a6){const _0x2e1d87=a316_0x513f98,_0x3656b2=[],_0x2387b2=/\/\*[\s\S]*?\*\/|--[^\r\n]*|[#$]\{[^}]*\}|#[^\r\n]*|'(?:''|\\[\s\S]|[^'\\])*'|"(?:""|\\[\s\S]|[^"\\])*"|`(?:``|\\[\s\S]|[^`\\])*`|@[A-Za-z_]\w*|[A-Za-z_]\w*|\S/g;for(const _0x4fe3ef of _0x52d8a6[_0x2e1d87(0x162)](_0x2387b2)){const _0x2d79de=_0x4fe3ef[0x0];if(_0x2d79de[_0x2e1d87(0x1a3)]('/*')||_0x2d79de[_0x2e1d87(0x1a3)]('--')||_0x2d79de['startsWith']('#')&&!_0x2d79de['startsWith']('#{'))continue;_0x3656b2[_0x2e1d87(0x19f)](/^["`]/['test'](_0x2d79de)?_0x2d79de:/^[\x27@#$]/[_0x2e1d87(0x164)](_0x2d79de)?'?':_0x2d79de['toUpperCase']());}return _0x3656b2;}function extractTables(_0x2cf423,_0x537c4e){const _0x29d235=a316_0x513f98,_0x213009=_0x2cf423[_0x29d235(0x196)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x29d235(0x196)](/'[^']*'/g,'\x27\x27')[_0x29d235(0x196)](/--.*$/gm,'')[_0x29d235(0x196)](/\/\*[\s\S]*?\*\//g,''),_0x2177a1=[],_0x153f2e=_0x213009[_0x29d235(0x194)](/FROM\s+([^\s,)(]+)/i);addTable(_0x2177a1,_0x153f2e?.[0x1]);for(const _0x1c4153 of _0x213009[_0x29d235(0x162)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x2177a1,_0x1c4153[0x1]);}const _0x1aa642=_0x213009[_0x29d235(0x194)](/INTO\s+([^\s(]+)/i);addTable(_0x2177a1,_0x1aa642?.[0x1]);if(_0x537c4e===_0x29d235(0x16b)){const _0x421238=_0x213009['match'](/UPDATE\s+([^\s,)(]+)/i);addTable(_0x2177a1,_0x421238?.[0x1]);}return _0x2177a1;}function addTable(_0x4b02d2,_0x24c05d){const _0x1b7e59=a316_0x513f98,_0x15c1e2=_0x24c05d?.[_0x1b7e59(0x196)](/[`"]/g,'');_0x15c1e2&&_0x15c1e2!==UNRESOLVED_SQL_FRAGMENT&&!_0x4b02d2[_0x1b7e59(0x165)](_0x15c1e2)&&_0x4b02d2[_0x1b7e59(0x19f)](_0x15c1e2);}function extractParameters(_0x4813cb){const _0x456f97=a316_0x513f98,_0x53ddb8=new Set();for(const _0x4bd2a5 of _0x4813cb['matchAll'](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x4bd2a5[0x1])_0x53ddb8[_0x456f97(0x155)](_0x4bd2a5[0x1]);}return Array[_0x456f97(0x1a7)](_0x53ddb8);}function a316_0x2815(_0x34f6fd,_0x399b59){_0x34f6fd=_0x34f6fd-0x145;const _0xf91ed0=a316_0xf91e();let _0x28152b=_0xf91ed0[_0x34f6fd];return _0x28152b;}export function validateSql(_0x4d8433){const _0x58b6df=a316_0x513f98,_0x182f0a=normalizeSqlForStaticAnalysis(_0x4d8433),_0x3babe5=detectNormalizedSqlType(_0x182f0a),_0x432531=stripStaticAnalysisMarkers(_0x182f0a['sql']),_0x22bdca=_0x182f0a[_0x58b6df(0x186)]?[]:extractTables(_0x432531,_0x3babe5[_0x58b6df(0x19d)]),_0x110ecb=_0x182f0a[_0x58b6df(0x186)]?[]:extractParameters(_0x432531);if(_0x3babe5[_0x58b6df(0x1a2)])return{'valid':![],'sqlType':_0x3babe5,'tables':_0x22bdca,'parameters':_0x110ecb,'message':_0x3babe5[_0x58b6df(0x14d)]||_0x3babe5[_0x58b6df(0x19d)]+'\x20statements\x20require\x20explicit\x20review.\x20Local\x20analysis\x20does\x20not\x20authorize\x20saving\x20or\x20execution.'};if(_0x3babe5[_0x58b6df(0x19d)]===_0x58b6df(0x195))return{'valid':![],'sqlType':_0x3babe5,'tables':_0x22bdca,'parameters':_0x110ecb,'message':_0x182f0a[_0x58b6df(0x186)]?_0x58b6df(0x188)+_0x182f0a['error']:_0x3babe5[_0x58b6df(0x14d)]?_0x58b6df(0x188)+_0x3babe5[_0x58b6df(0x14d)]:_0x58b6df(0x198)};return{'valid':!![],'sqlType':_0x3babe5,'tables':_0x22bdca,'parameters':_0x110ecb,'message':_0x3babe5[_0x58b6df(0x19d)]+'\x20query\x20targeting\x20'+(_0x22bdca[_0x58b6df(0x160)]?_0x22bdca[_0x58b6df(0x17a)](',\x20'):_0x58b6df(0x17e))+(_0x110ecb[_0x58b6df(0x160)]?_0x58b6df(0x191)+_0x110ecb[_0x58b6df(0x17a)](',\x20'):'')};}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a317_0x659db1=a317_0x52a5;(function(_0x545a65,_0x3e2c3e){const _0x1f5fec=a317_0x52a5,_0x39533c=_0x545a65();while(!![]){try{const _0xd91b9f=-parseInt(_0x1f5fec(0x1d0))/0x1+-parseInt(_0x1f5fec(0x1de))/0x2*(-parseInt(_0x1f5fec(0x1dd))/0x3)+parseInt(_0x1f5fec(0x1c9))/0x4+parseInt(_0x1f5fec(0x1cf))/0x5+-parseInt(_0x1f5fec(0x1ce))/0x6*(parseInt(_0x1f5fec(0x1db))/0x7)+-parseInt(_0x1f5fec(0x1d9))/0x8*(-parseInt(_0x1f5fec(0x1df))/0x9)+parseInt(_0x1f5fec(0x1cb))/0xa*(-parseInt(_0x1f5fec(0x1c8))/0xb);if(_0xd91b9f===_0x3e2c3e)break;else _0x39533c['push'](_0x39533c['shift']());}catch(_0x40c2ab){_0x39533c['push'](_0x39533c['shift']());}}}(a317_0x3c09,0xd41fa));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';export{CliError};const baseCliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a317_0x659db1(0x1d3)+CLI_BIN_NAME+a317_0x659db1(0x1e0),'configMissingHint':'Set\x20appcode\x20via\x20`'+CLI_BIN_NAME+a317_0x659db1(0x1dc)+CLI_BIN_NAME+'\x20workspace\x20add\x20<name>\x20--appcode\x20<code>\x20--global`\x20registers\x20a\x20reusable\x20global\x20app\x20profile.','notInProjectHint':a317_0x659db1(0x1ca)});function a317_0x52a5(_0x1d311e,_0x4b2bc8){_0x1d311e=_0x1d311e-0x1c6;const _0x3c097b=a317_0x3c09();let _0x52a5a3=_0x3c097b[_0x1d311e];return _0x52a5a3;}export const CliErrors={'authRequired'(_0x4cb25a){const _0x2643c9=a317_0x659db1;return new CliError(_0x2643c9(0x1c7),0x1,_0x2643c9(0x1d8),_0x4cb25a??_0x2643c9(0x1d3)+CLI_BIN_NAME+_0x2643c9(0x1e0));},'configMissing'(_0x12fceb){const _0x18665d=a317_0x659db1;return new CliError(_0x18665d(0x1cd),0x1,_0x18665d(0x1d4),_0x12fceb??_0x18665d(0x1e3)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.\x0a\x20\x20\x20\x20\x20\x20\x20Tip:\x20`'+CLI_BIN_NAME+_0x18665d(0x1d5));},'notInProject'(){const _0x4f2ea2=a317_0x659db1;return new CliError(_0x4f2ea2(0x1cc),0x1,_0x4f2ea2(0x1e2)+CLI_BIN_NAME+_0x4f2ea2(0x1d6),_0x4f2ea2(0x1ca));},'apiError'(_0x2b328d,_0x29dbdd){const _0x3c98d6=a317_0x659db1;return baseCliErrors[_0x3c98d6(0x1d2)](_0x2b328d,_0x29dbdd);},'networkError'(_0x1b3c82){const _0x6f7c1a=a317_0x659db1;return new CliError(_0x6f7c1a(0x1e1),0x2,_0x6f7c1a(0x1d7)+_0x1b3c82,'Check\x20your\x20internet\x20connection\x20and\x20try\x20again.');},'unknownCommand'(_0x5efc4c){const _0xe43c78=a317_0x659db1;return new CliError('unknown_command',0x1,_0xe43c78(0x1d1)+_0x5efc4c,_0xe43c78(0x1d3)+CLI_BIN_NAME+'\x20--help`\x20to\x20see\x20available\x20commands.');},'flagMissing'(_0x302d75,_0x55a904){const _0x44a792=a317_0x659db1;return new CliError('flag_missing',0x1,_0x44a792(0x1e4)+_0x302d75,_0x55a904);},'validation'(_0x28da2c,_0x243ecb){const _0x63e6c6=a317_0x659db1;return baseCliErrors[_0x63e6c6(0x1da)](_0x28da2c,_0x243ecb);},'cancelled'(_0x21ddeb){const _0x62a6f3=a317_0x659db1;return new CliError(_0x62a6f3(0x1c6),0x0,_0x21ddeb??'Operation\x20cancelled.');}};function a317_0x3c09(){const _0x35bd23=['1388613Mvadfo','Unknown\x20command:\x20','apiError','Run\x20`','Configuration\x20file\x20not\x20found','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>\x20--global`\x20registers\x20a\x20reusable\x20global\x20app\x20profile.','\x20project\x20directory','Network\x20error:\x20','Authentication\x20required','8pHvGbi','validation','7nlTVsN','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.\x0a\x20\x20\x20\x20\x20\x20\x20Tip:\x20`','39cmTfXJ','209512XqVoaC','9450252aqNTuj','\x20auth`\x20to\x20login\x20first.','network_error','Not\x20in\x20a\x20','Set\x20appcode\x20via\x20`','Missing\x20required\x20flag:\x20--','cancelled','auth_required','231QMVGRd','4628772QUSgsh','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','711730jsWVfu','not_in_project','config_missing','8369742ZTYAoZ','7890060rnJiCG'];a317_0x3c09=function(){return _0x35bd23;};return a317_0x3c09();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a318_0x16b9(){const _0x42122a=['3276102Iqrxoj','449088jLnZie','242rtIYsx','8OkBTBk','387988mmhQhK','yes','660VEKFUt','1276584QbizzE','23607gEInsA','217SGCqNH','5MoTamV','name','2110423hsUIet','map','7034MFnQFg'];a318_0x16b9=function(){return _0x42122a;};return a318_0x16b9();}(function(_0x2c54b4,_0x247fab){const _0x4e83ac=a318_0x5088,_0x2fa6db=_0x2c54b4();while(!![]){try{const _0x4d8bff=parseInt(_0x4e83ac(0x8c))/0x1*(parseInt(_0x4e83ac(0x82))/0x2)+parseInt(_0x4e83ac(0x8a))/0x3+parseInt(_0x4e83ac(0x87))/0x4+parseInt(_0x4e83ac(0x8d))/0x5*(parseInt(_0x4e83ac(0x83))/0x6)+parseInt(_0x4e83ac(0x80))/0x7*(-parseInt(_0x4e83ac(0x86))/0x8)+-parseInt(_0x4e83ac(0x8b))/0x9*(parseInt(_0x4e83ac(0x89))/0xa)+parseInt(_0x4e83ac(0x85))/0xb*(-parseInt(_0x4e83ac(0x84))/0xc);if(_0x4d8bff===_0x247fab)break;else _0x2fa6db['push'](_0x2fa6db['shift']());}catch(_0xe5b683){_0x2fa6db['push'](_0x2fa6db['shift']());}}}(a318_0x16b9,0x82524));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a318_0x259e78}from'@lovrabet/cli-framework';function a318_0x5088(_0x1149f0,_0x30c9ee){_0x1149f0=_0x1149f0-0x7f;const _0x16b9ad=a318_0x16b9();let _0x508859=_0x16b9ad[_0x1149f0];return _0x508859;}import{EXPLICIT_YES_FLAG_DESCRIPTION,requiresExplicitYes}from'../framework/explicit-yes.js';export function buildAllFlags(_0xba81e5){const _0x4febfd=a318_0x5088,_0x559dd5=a318_0x259e78(_0xba81e5,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});if(!requiresExplicitYes(_0xba81e5))return _0x559dd5;return _0x559dd5[_0x4febfd(0x81)](_0x12899f=>_0x12899f[_0x4febfd(0x7f)]===_0x4febfd(0x88)?{..._0x12899f,'description':EXPLICIT_YES_FLAG_DESCRIPTION}:_0x12899f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x26379c,_0x48ee03){var _0x3c8ae7=a319_0x2011,_0x50d9e9=_0x26379c();while(!![]){try{var _0x46c91c=-parseInt(_0x3c8ae7(0x1a7))/0x1*(-parseInt(_0x3c8ae7(0x1b3))/0x2)+-parseInt(_0x3c8ae7(0x1b4))/0x3+-parseInt(_0x3c8ae7(0x1b0))/0x4+-parseInt(_0x3c8ae7(0x1a9))/0x5*(parseInt(_0x3c8ae7(0x1ab))/0x6)+-parseInt(_0x3c8ae7(0x1b2))/0x7+-parseInt(_0x3c8ae7(0x1af))/0x8+parseInt(_0x3c8ae7(0x1ac))/0x9*(parseInt(_0x3c8ae7(0x1a6))/0xa);if(_0x46c91c===_0x48ee03)break;else _0x50d9e9['push'](_0x50d9e9['shift']());}catch(_0x35e89e){_0x50d9e9['push'](_0x50d9e9['shift']());}}}(a319_0x3240,0x55db7));function a319_0x3240(){var _0x15073f=['985590fqXElY','6754330CEnzTO','1393YXRsMM','defaultFormat','360VNoUqP','compress','438fJNLII','27voMImp','format','def','5328720AGxFej','1311752VwRVLe','flags','3022509zRJrsz','122uZMnyT'];a319_0x3240=function(){return _0x15073f;};return a319_0x3240();}import{resolveOutputConfig}from'@lovrabet/cli-framework';function a319_0x2011(_0x4caf7f,_0x483c98){_0x4caf7f=_0x4caf7f-0x1a6;var _0x32400b=a319_0x3240();var _0x20110e=_0x32400b[_0x4caf7f];return _0x20110e;}export function usesStructuredErrorOutput(_0x49d961){return _0x49d961?.['structuredErrors']===!![];}export function resolveErrorOutputFormat(_0x2f6b6b){var _0x2a6636=a319_0x2011;if(!_0x2f6b6b[_0x2a6636(0x1ae)])return _0x2f6b6b[_0x2a6636(0x1a8)]??_0x2a6636(0x1aa);return resolveOutputConfig({'flags':_0x2f6b6b[_0x2a6636(0x1b1)]??{},'def':_0x2f6b6b['def'],'configDefault':_0x2f6b6b[_0x2a6636(0x1a8)]})[_0x2a6636(0x1ad)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a320_0x55ae(){const _0x5ecda8=['notification\x20config-update','5222255pmsxhH','1705658KSmAlE','1557AeLdxt','command','1003885zmdpPw','35690690tYjZwu','4660fhNOsk','kb\x20delete','721170YFCWfd','notification\x20config-delete','menu\x20delete','13355720KZQKWs','49GcPtzE','Required\x20for\x20execution\x20after\x20reviewing\x20the\x20--dry-run\x20plan','9boOBIv'];a320_0x55ae=function(){return _0x5ecda8;};return a320_0x55ae();}const a320_0x2485bd=a320_0x6f59;function a320_0x6f59(_0x2a3246,_0x3f63b0){_0x2a3246=_0x2a3246-0x1d6;const _0x55ae1a=a320_0x55ae();let _0x6f595=_0x55ae1a[_0x2a3246];return _0x6f595;}(function(_0x5aad71,_0x50e6d3){const _0x7c4d00=a320_0x6f59,_0x2cf20f=_0x5aad71();while(!![]){try{const _0xe9b541=-parseInt(_0x7c4d00(0x1d8))/0x1+-parseInt(_0x7c4d00(0x1e5))/0x2+-parseInt(_0x7c4d00(0x1d6))/0x3*(-parseInt(_0x7c4d00(0x1da))/0x4)+parseInt(_0x7c4d00(0x1e4))/0x5+-parseInt(_0x7c4d00(0x1dc))/0x6*(parseInt(_0x7c4d00(0x1e0))/0x7)+-parseInt(_0x7c4d00(0x1df))/0x8+parseInt(_0x7c4d00(0x1e2))/0x9*(parseInt(_0x7c4d00(0x1d9))/0xa);if(_0xe9b541===_0x50e6d3)break;else _0x2cf20f['push'](_0x2cf20f['shift']());}catch(_0x39bbae){_0x2cf20f['push'](_0x2cf20f['shift']());}}}(a320_0x55ae,0xcfab3));const EXPLICIT_YES_COMMANDS=new Set([a320_0x2485bd(0x1de),a320_0x2485bd(0x1db),a320_0x2485bd(0x1e3),a320_0x2485bd(0x1dd)]);export const EXPLICIT_YES_FLAG_DESCRIPTION=a320_0x2485bd(0x1e1);export function requiresExplicitYes(_0x36cbbe){const _0x3df6c9=a320_0x2485bd;return EXPLICIT_YES_COMMANDS['has'](_0x36cbbe['service']+'\x20'+_0x36cbbe[_0x3df6c9(0x1d7)]);}
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a321_0x365b7c=a321_0x336f;function a321_0x2e32(){const _0x57b1f5=['1300736Wwoqnh','parseFlags','604056QPhXrJ','595660auBjHZ','5980260VjugQv','56590GseiBl','2148PWXSxg','63qAtBvp','1266DllwMm','validateFlags','2311425StMGYV','4518thwurP'];a321_0x2e32=function(){return _0x57b1f5;};return a321_0x2e32();}(function(_0x5135e8,_0x26912a){const _0x2b7215=a321_0x336f,_0x6651e3=_0x5135e8();while(!![]){try{const _0x36d3aa=-parseInt(_0x2b7215(0x1ba))/0x1+parseInt(_0x2b7215(0x1b7))/0x2+parseInt(_0x2b7215(0x1b3))/0x3*(-parseInt(_0x2b7215(0x1b1))/0x4)+-parseInt(_0x2b7215(0x1b5))/0x5+-parseInt(_0x2b7215(0x1bb))/0x6+-parseInt(_0x2b7215(0x1b2))/0x7*(parseInt(_0x2b7215(0x1b9))/0x8)+parseInt(_0x2b7215(0x1b6))/0x9*(parseInt(_0x2b7215(0x1bc))/0xa);if(_0x36d3aa===_0x26912a)break;else _0x6651e3['push'](_0x6651e3['shift']());}catch(_0x32b536){_0x6651e3['push'](_0x6651e3['shift']());}}}(a321_0x2e32,0x817b2));import{createFlagHelpers}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';const helpers=createFlagHelpers(CliErrors);function a321_0x336f(_0x49a125,_0x5bc717){_0x49a125=_0x49a125-0x1b1;const _0x2e3281=a321_0x2e32();let _0x336f7c=_0x2e3281[_0x49a125];return _0x336f7c;}export const parseFlags=helpers[a321_0x365b7c(0x1b8)];export const validateFlags=helpers[a321_0x365b7c(0x1b4)];
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x41e29d,_0x52bf98){const _0x14787d=a322_0x1306,_0xa8ee7b=_0x41e29d();while(!![]){try{const _0x4505cd=parseInt(_0x14787d(0x1a3))/0x1+parseInt(_0x14787d(0x1a0))/0x2*(parseInt(_0x14787d(0x19c))/0x3)+-parseInt(_0x14787d(0x1a4))/0x4+parseInt(_0x14787d(0x199))/0x5+parseInt(_0x14787d(0x192))/0x6*(-parseInt(_0x14787d(0x19f))/0x7)+parseInt(_0x14787d(0x19d))/0x8+-parseInt(_0x14787d(0x197))/0x9*(parseInt(_0x14787d(0x194))/0xa);if(_0x4505cd===_0x52bf98)break;else _0xa8ee7b['push'](_0xa8ee7b['shift']());}catch(_0x413595){_0xa8ee7b['push'](_0xa8ee7b['shift']());}}}(a322_0x500f,0xd1be7));function a322_0x1306(_0x468fab,_0x2f216d){_0x468fab=_0x468fab-0x192;const _0x500f7a=a322_0x500f();let _0x1306e2=_0x500f7a[_0x468fab];return _0x1306e2;}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 _0xe7b19=a322_0x1306;return createHelpGenerators({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'globalFlags':GLOBAL_FLAGS,'serviceRegistry':serviceRegistry,'getServiceEntry':getServiceEntry,'getServiceDefinitions':_0x5b01d9=>serviceGroups[_0xe7b19(0x198)](_0x5b01d9),'buildAllFlags':buildAllFlags,'appPrerequisiteText':_0xe7b19(0x195)+CLI_BIN_NAME+_0xe7b19(0x1a1),'serviceUsageSuffix':_0xe7b19(0x19b)});}export function generateCommandHelp(_0x53c9b4){const _0x415913=a322_0x1306,_0x5b18d5=createGenerators()['generateCommandHelp'](_0x53c9b4);if(!requiresExplicitYes(_0x53c9b4))return _0x5b18d5;return _0x5b18d5[_0x415913(0x1a2)](_0x415913(0x196),_0x415913(0x19a));}function a322_0x500f(){const _0x85c89e=['5190285WJkzKd','Requires\x20explicit\x20--yes\x20for\x20execution;\x20use\x20--dry-run\x20to\x20preview.','\x20[args]\x20[flags]','741291STOWjO','7111096xxSlRO','generateFullHelp','9075059FElLPA','2Wxkyva','\x20workspace\x20init`\x20or\x20--appcode).','replace','577295ACBLax','101592uVeeWd','6CkZTtw','generateServiceHelp','100uqXHRl','Requires\x20appcode\x20(set\x20via\x20`','Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.','513351lyBVqS','get'];a322_0x500f=function(){return _0x85c89e;};return a322_0x500f();}export function generateServiceHelp(_0x5e6854){const _0x230a43=a322_0x1306;return createGenerators()[_0x230a43(0x193)](_0x5e6854);}export function generateFullHelp(){const _0x4c98cb=a322_0x1306;return createGenerators()[_0x4c98cb(0x19e)]();}
|