@lovrabet/rabetbase-cli 2.5.2-beta.4 → 2.5.2-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/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/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +0 -17
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/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/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.d.ts +6 -5
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +5 -6
- package/skills/rabetbase/references/rabetbase-deployment-sync-all.md +56 -0
- package/skills/rabetbase.manifest.json +4 -4
- package/lib/commands/deployment/auto-sync.d.ts +0 -20
- package/lib/commands/deployment/auto-sync.js +0 -1
- package/lib/commands/deployment/sync.d.ts +0 -2
- package/lib/commands/deployment/sync.js +0 -1
- package/skills/rabetbase/references/rabetbase-deployment-sync.md +0 -100
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a252_0x3bfd(_0x522ffa,_0x2ce58a){_0x522ffa=_0x522ffa-0x1c6;const _0xdc8b8e=a252_0xdc8b();let _0x3bfda8=_0xdc8b8e[_0x522ffa];return _0x3bfda8;}(function(_0x3943b3,_0xd26478){const _0x2a78d7=a252_0x3bfd,_0x2dc586=_0x3943b3();while(!![]){try{const _0x1570a6=-parseInt(_0x2a78d7(0x1c6))/0x1+-parseInt(_0x2a78d7(0x1cf))/0x2+-parseInt(_0x2a78d7(0x1c7))/0x3*(-parseInt(_0x2a78d7(0x1cd))/0x4)+parseInt(_0x2a78d7(0x1de))/0x5+parseInt(_0x2a78d7(0x1d2))/0x6*(parseInt(_0x2a78d7(0x1dd))/0x7)+-parseInt(_0x2a78d7(0x1db))/0x8*(parseInt(_0x2a78d7(0x1ca))/0x9)+parseInt(_0x2a78d7(0x1ce))/0xa*(parseInt(_0x2a78d7(0x1d0))/0xb);if(_0x1570a6===_0xd26478)break;else _0x2dc586['push'](_0x2dc586['shift']());}catch(_0x336352){_0x2dc586['push'](_0x2dc586['shift']());}}}(a252_0xdc8b,0x1c0ce));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x50eed4){const _0x190744=a252_0x3bfd;if(cache['has'](_0x50eed4))return cache[_0x190744(0x1cb)](_0x50eed4);const _0x5e0d02=await listDatasets(_0x50eed4),_0x413b51=new Map();for(const _0x59e28a of _0x5e0d02){const _0x205dad=_0x59e28a[_0x190744(0x1c8)];_0x205dad?.['dbId']!=null&&_0x413b51[_0x190744(0x1d5)](_0x205dad[_0x190744(0x1cc)],_0x205dad[_0x190744(0x1d1)]??'db-'+_0x205dad[_0x190744(0x1cc)]);}const _0x5b7b8b=[..._0x413b51[_0x190744(0x1e1)]()][_0x190744(0x1dc)](([_0x2b9091,_0x59dea6])=>({'dbId':_0x2b9091,'dbName':_0x59dea6}));return cache[_0x190744(0x1d5)](_0x50eed4,_0x5b7b8b),_0x5b7b8b;}export async function resolveDb(_0x58fa74,_0x3cb031){const _0x2b141d=a252_0x3bfd,_0x59f2eb=await listDatabases(_0x58fa74);if(_0x59f2eb[_0x2b141d(0x1d4)]===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20under\x20app\x20\x22'+_0x58fa74+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x3cb031)return{'resolved':_0x59f2eb};const _0x1ea73d=Number(_0x3cb031);if(!Number[_0x2b141d(0x1e2)](_0x1ea73d)){const _0x58928c=_0x59f2eb[_0x2b141d(0x1e0)](_0x34fdbb=>_0x34fdbb[_0x2b141d(0x1cc)]===_0x1ea73d);if(_0x58928c)return{'resolved':[_0x58928c]};}const _0x4866f9=_0x3cb031['toLowerCase'](),_0xa944b9=_0x59f2eb['filter'](_0x146d3f=>_0x146d3f[_0x2b141d(0x1d1)][_0x2b141d(0x1d3)]()[_0x2b141d(0x1d9)](_0x4866f9));if(_0xa944b9[_0x2b141d(0x1d4)]>0x0)return{'resolved':_0xa944b9};const _0x397cdd=_0x59f2eb['map'](_0x34d1b3=>_0x34d1b3[_0x2b141d(0x1d1)]+'\x20('+_0x34d1b3[_0x2b141d(0x1cc)]+')')[_0x2b141d(0x1d7)](',\x20');return{'resolved':[],'error':_0x2b141d(0x1da)+_0x3cb031+_0x2b141d(0x1df)+_0x58fa74+_0x2b141d(0x1d6)+_0x397cdd+_0x2b141d(0x1d8)};}function a252_0xdc8b(){const _0x2da913=['.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','includes','No\x20database\x20matching\x20\x22','1808rKHrUD','map','21nkFGoY','327725GAZesE','\x22\x20under\x20app\x20\x22','find','entries','isNaN','67034fkBIzi','16809OSlaRD','dbtableConfig','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','4311xQwLUd','get','dbId','88EUhYFZ','1790oxuKSY','209012wCTTSq','3014LadeWk','dbName','313662RfunWG','toLowerCase','length','set','\x22.\x20Available:\x20','join'];a252_0xdc8b=function(){return _0x2da913;};return a252_0xdc8b();}export async function resolveOneDb(_0x316596,_0x660d5a){const _0x4eafe6=a252_0x3bfd,{resolved:_0x46521c,error:_0x13e068}=await resolveDb(_0x316596,_0x660d5a);if(_0x13e068)return{'db':null,'error':_0x13e068};if(_0x46521c[_0x4eafe6(0x1d4)]===0x1)return{'db':_0x46521c[0x0]};if(!_0x660d5a){const _0x4871e6=_0x46521c[_0x4eafe6(0x1dc)](_0x529b97=>_0x529b97[_0x4eafe6(0x1d1)]+'\x20('+_0x529b97['dbId']+')')[_0x4eafe6(0x1d7)](',\x20');return{'db':null,'error':_0x4eafe6(0x1c9)+_0x4871e6};}const _0x25abac=_0x46521c['map'](_0x4d8dcb=>_0x4d8dcb[_0x4eafe6(0x1d1)]+'\x20('+_0x4d8dcb[_0x4eafe6(0x1cc)]+')')[_0x4eafe6(0x1d7)](',\x20');return{'db':null,'error':'\x22'+_0x660d5a+'\x22\x20matches\x20multiple\x20databases:\x20'+_0x25abac+'.\x20Be\x20more\x20specific.'};}export async function getDbName(_0x841beb,_0x522dfa){const _0x2e65e3=a252_0x3bfd,_0x294971=await listDatabases(_0x841beb);return _0x294971['find'](_0x4a90f9=>_0x4a90f9[_0x2e65e3(0x1cc)]===_0x522dfa)?.['dbName'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a253_0x491a63=a253_0x4c9f;(function(_0x44267f,_0x5bf994){const _0x260d5d=a253_0x4c9f,_0x4b3aa2=_0x44267f();while(!![]){try{const _0x4c2131=-parseInt(_0x260d5d(0xed))/0x1+-parseInt(_0x260d5d(0x118))/0x2+parseInt(_0x260d5d(0x121))/0x3+parseInt(_0x260d5d(0xf9))/0x4*(parseInt(_0x260d5d(0x101))/0x5)+-parseInt(_0x260d5d(0xe7))/0x6*(-parseInt(_0x260d5d(0xf7))/0x7)+-parseInt(_0x260d5d(0xf3))/0x8*(parseInt(_0x260d5d(0x117))/0x9)+parseInt(_0x260d5d(0xf0))/0xa;if(_0x4c2131===_0x5bf994)break;else _0x4b3aa2['push'](_0x4b3aa2['shift']());}catch(_0x452e0f){_0x4b3aa2['push'](_0x4b3aa2['shift']());}}}(a253_0x223d,0x90c21));import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';function a253_0x4c9f(_0x5af7ea,_0x9a7441){_0x5af7ea=_0x5af7ea-0xe6;const _0x223d69=a253_0x223d();let _0x4c9f09=_0x223d69[_0x5af7ea];return _0x4c9f09;}import{dirname,resolve}from'node:path';import{TextDecoder}from'node:util';import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT='.rabetbase/instant-api-policy';export const INSTANT_API_POLICY_FILE_NAME=a253_0x491a63(0x11d);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x40a81e,_0x2c8f2f,_0x286dc6){return new CliError(_0x40a81e,0x1,_0x2c8f2f,_0x286dc6);}export function loadInstantApiPolicyLocalConfig(_0xcf9c7b,_0x2bc8f5){assertSafeAppCode(_0xcf9c7b);const _0x36f553=resolve(_0x2bc8f5??findProjectRootDirectory()),_0x59dbf0=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0xcf9c7b+'/'+INSTANT_API_POLICY_FILE_NAME,_0x55d249=resolve(_0x36f553,INSTANT_API_POLICY_RELATIVE_ROOT,_0xcf9c7b),_0x32d050=resolve(_0x55d249,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x36f553,'appCode':_0xcf9c7b,'policyRoot':_0x55d249,'policyFilePath':_0x32d050,'policyRelativePath':_0x59dbf0};}export function createDefaultInstantApiPolicyConfig(_0x3317c0,_0x425877=a253_0x491a63(0x11f)){return assertSafeAppCode(_0x3317c0),{'version':'1','appCode':_0x3317c0,'defaults':{'instantApi':_0x425877},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x3bb2ba){const _0x329262=a253_0x491a63;let _0x128626;try{_0x128626=await stat(_0x3bb2ba[_0x329262(0x10a)]);}catch(_0x310b78){throw instantApiPolicyError('instant_api_policy_file_missing','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20'+_0x3bb2ba[_0x329262(0x10a)],_0x329262(0x11c));}if(!_0x128626[_0x329262(0xef)]())throw instantApiPolicyError(_0x329262(0x107),_0x329262(0x122)+_0x3bb2ba[_0x329262(0x10a)]);if(_0x128626['size']>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x329262(0x10f),_0x329262(0xea));let _0x271f81;try{_0x271f81=await readFile(_0x3bb2ba['policyFilePath']);}catch{throw instantApiPolicyError(_0x329262(0x125),_0x329262(0xf6)+_0x3bb2ba[_0x329262(0x10a)]);}if(_0x271f81[_0x329262(0xe9)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x329262(0xea));let _0x495858;try{_0x495858=new TextDecoder(_0x329262(0x11b),{'fatal':!![],'ignoreBOM':!![]})[_0x329262(0xe8)](_0x271f81);}catch{throw instantApiPolicyError(_0x329262(0x107),_0x329262(0x114)+_0x3bb2ba[_0x329262(0x10a)]);}let _0x395882;try{_0x395882=JSON[_0x329262(0x105)](_0x495858);}catch{throw instantApiPolicyError('instant_api_policy_json_invalid',_0x329262(0xf4)+_0x3bb2ba[_0x329262(0x10a)]);}return assertLocalPolicyContract(_0x395882,_0x3bb2ba[_0x329262(0x10b)]);}export async function writeInstantApiPolicyConfigFile(_0x21d9fb,_0x23807b,_0x419a30={}){const _0x4f6c94=a253_0x491a63,_0x572281=assertLocalPolicyContract(_0x23807b,_0x21d9fb['appCode']),_0x5ced70=JSON['stringify'](_0x572281,null,0x2)+'\x0a';if(Buffer[_0x4f6c94(0xe9)](_0x5ced70,_0x4f6c94(0x100))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x4f6c94(0x10f),_0x4f6c94(0xea));await mkdir(_0x21d9fb[_0x4f6c94(0xf1)],{'recursive':!![]});let _0x38f45b;try{_0x38f45b=await readFile(_0x21d9fb['policyFilePath'],_0x4f6c94(0x100));}catch(_0x52eee5){if(!isMissingFile(_0x52eee5))throw instantApiPolicyError(_0x4f6c94(0x125),_0x4f6c94(0xf5)+_0x21d9fb[_0x4f6c94(0x10a)]);}if(_0x38f45b===_0x5ced70)return{'action':_0x4f6c94(0x11a),'filePath':_0x21d9fb[_0x4f6c94(0x10a)]};if(_0x38f45b!==undefined&&!_0x419a30[_0x4f6c94(0x10c)])throw instantApiPolicyError('instant_api_policy_file_exists',_0x4f6c94(0x120)+_0x21d9fb['policyFilePath'],'Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.');if(_0x38f45b===undefined)try{return await writeFile(_0x21d9fb[_0x4f6c94(0x10a)],_0x5ced70,{'encoding':_0x4f6c94(0x100),'flag':'wx'}),{'action':'created','filePath':_0x21d9fb[_0x4f6c94(0x10a)]};}catch(_0x482ad6){if(!isAlreadyExists(_0x482ad6))throw instantApiPolicyError(_0x4f6c94(0xf2),_0x4f6c94(0xfc)+_0x21d9fb['policyFilePath']);if(!_0x419a30[_0x4f6c94(0x10c)])throw instantApiPolicyError(_0x4f6c94(0xec),_0x4f6c94(0x108)+_0x21d9fb[_0x4f6c94(0x10a)],_0x4f6c94(0x106));}const _0x248ed6=resolve(dirname(_0x21d9fb['policyFilePath']),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x4f6c94(0x11e)]+'.'+randomUUID()+_0x4f6c94(0xfa));try{await writeFile(_0x248ed6,_0x5ced70,{'encoding':'utf8','flag':'wx'}),await rename(_0x248ed6,_0x21d9fb[_0x4f6c94(0x10a)]);}catch{await unlink(_0x248ed6)['catch'](()=>undefined);throw instantApiPolicyError(_0x4f6c94(0xf2),_0x4f6c94(0x111)+_0x21d9fb['policyFilePath']);}return{'action':'overwritten','filePath':_0x21d9fb[_0x4f6c94(0x10a)]};}function assertSafeAppCode(_0x2a8963){const _0x23a8fb=a253_0x491a63,_0x2c48d1=_0x2a8963[_0x23a8fb(0xeb)]();if(!_0x2c48d1||_0x2c48d1!==_0x2a8963||_0x2c48d1[_0x23a8fb(0x110)]>0x64||_0x2c48d1==='.'||_0x2c48d1==='..'||_0x2c48d1[_0x23a8fb(0x119)]('/')||_0x2c48d1[_0x23a8fb(0x119)]('\x5c')||_0x2c48d1[_0x23a8fb(0x119)]('\x00'))throw instantApiPolicyError(_0x23a8fb(0x112),_0x23a8fb(0x103));}function assertLocalPolicyContract(_0x1e8c2a,_0x3ea5c2){const _0x25d7b6=a253_0x491a63;if(!isObject(_0x1e8c2a))throw instantApiPolicyError(_0x25d7b6(0xff),_0x25d7b6(0x10d));if(_0x1e8c2a[_0x25d7b6(0x10e)]!=='1')throw instantApiPolicyError(_0x25d7b6(0x113),_0x25d7b6(0xee),_0x25d7b6(0xe6));if(_0x1e8c2a[_0x25d7b6(0x10b)]!==_0x3ea5c2)throw instantApiPolicyError('instant_api_policy_app_code_mismatch',_0x25d7b6(0xfd)+_0x3ea5c2+'.');if(!isObject(_0x1e8c2a['defaults'])||typeof _0x1e8c2a[_0x25d7b6(0x116)][_0x25d7b6(0xfe)]!==_0x25d7b6(0x115))throw instantApiPolicyError(_0x25d7b6(0x104),'Policy\x20defaults.instantApi\x20is\x20required.');if(_0x1e8c2a['rules']!==undefined&&_0x1e8c2a['rules']!==null&&!Array[_0x25d7b6(0xf8)](_0x1e8c2a[_0x25d7b6(0x124)]))throw instantApiPolicyError(_0x25d7b6(0x123),'Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.');return _0x1e8c2a;}function isObject(_0x3cd252){const _0x3d0bf7=a253_0x491a63;return _0x3cd252!==null&&typeof _0x3cd252==='object'&&!Array[_0x3d0bf7(0xf8)](_0x3cd252);}function isMissingFile(_0x4c4738){const _0x119cb4=a253_0x491a63;return Boolean(_0x4c4738&&typeof _0x4c4738==='object'&&_0x4c4738['code']===_0x119cb4(0x102));}function a253_0x223d(){const _0x43a67a=['version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','254202pObfDm','decode','byteLength','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','trim','instant_api_policy_file_exists','1115781WdUjnK','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22.','isFile','10910680EXwZyI','policyRoot','instant_api_policy_file_unwritable','16sebsGm','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','7SjIiyv','isArray','8sAIJxr','.tmp','code','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','instantApi','instant_api_policy_json_invalid','utf8','1891115zwFKyR','ENOENT','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','instant_api_policy_defaults_invalid','parse','Review\x20the\x20file\x20before\x20retrying.','instant_api_policy_file_invalid','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','EEXIST','policyFilePath','appCode','force','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','version','instant_api_policy_file_too_large','length','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_app_code_invalid','instant_api_policy_version_invalid','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','string','defaults','2291364PCpwtc','1038778NUBusI','includes','unchanged','utf-8','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','policy.json','pid','allow','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','2542230AVTJpy','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','instant_api_policy_rules_invalid','rules','instant_api_policy_file_unreadable'];a253_0x223d=function(){return _0x43a67a;};return a253_0x223d();}function isAlreadyExists(_0x21055a){const _0x2b7b88=a253_0x491a63;return Boolean(_0x21055a&&typeof _0x21055a==='object'&&_0x21055a[_0x2b7b88(0xfb)]===_0x2b7b88(0x109));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a254_0x1176a0=a254_0xa82e;(function(_0x376988,_0x277b4a){const _0x836689=a254_0xa82e,_0x1f8e0d=_0x376988();while(!![]){try{const _0x27e5c3=-parseInt(_0x836689(0xff))/0x1*(parseInt(_0x836689(0x105))/0x2)+parseInt(_0x836689(0xc6))/0x3+parseInt(_0x836689(0xee))/0x4+-parseInt(_0x836689(0xdf))/0x5*(-parseInt(_0x836689(0xce))/0x6)+-parseInt(_0x836689(0x108))/0x7+parseInt(_0x836689(0xf7))/0x8*(parseInt(_0x836689(0xf6))/0x9)+-parseInt(_0x836689(0xea))/0xa;if(_0x27e5c3===_0x277b4a)break;else _0x1f8e0d['push'](_0x1f8e0d['shift']());}catch(_0x2b970b){_0x1f8e0d['push'](_0x1f8e0d['shift']());}}}(a254_0x27d1,0x21b61));import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a254_0x1176a0(0xcf),a254_0x1176a0(0xf5),a254_0x1176a0(0xc4),a254_0x1176a0(0xeb),a254_0x1176a0(0x101),a254_0x1176a0(0xe1)],HIT_KEYS=[a254_0x1176a0(0xfd),a254_0x1176a0(0xde),a254_0x1176a0(0x103),'scope','title',a254_0x1176a0(0x104),a254_0x1176a0(0xe8),a254_0x1176a0(0xd6),'rawScore',a254_0x1176a0(0xd8),a254_0x1176a0(0xf8)];export async function searchDevelopmentKnowledge(_0xcd73f4){const _0x4d9a29=a254_0x1176a0,_0x51ba0a=_0xcd73f4[_0x4d9a29(0xc0)][_0x4d9a29(0x109)](),_0x345bc7=_0xcd73f4[_0x4d9a29(0x106)][_0x4d9a29(0x109)]();if(!_0x51ba0a)throw CliErrors[_0x4d9a29(0xd7)](_0x4d9a29(0xdc));if(!_0xcd73f4['cookie'][_0x4d9a29(0x109)]())throw CliErrors[_0x4d9a29(0x102)]();if(!_0x345bc7)throw CliErrors[_0x4d9a29(0xd7)](_0x4d9a29(0xf9));validateTopK(_0xcd73f4[_0x4d9a29(0xd2)]);const _0x46a5bf=getKbDomain()+_0x4d9a29(0x10b);let _0x5f1c42;try{_0x5f1c42=await fetch(_0x46a5bf,{'method':_0x4d9a29(0xf1),'headers':{'Content-Type':'application/json','Cookie':_0xcd73f4['cookie'],'X-Invoke-Source':'cli:rabetbase'},'body':JSON['stringify']({'appCode':_0x51ba0a,'query':_0x345bc7,..._0xcd73f4[_0x4d9a29(0xd2)]!==undefined?{'topK':_0xcd73f4[_0x4d9a29(0xd2)]}:{}}),'signal':_0xcd73f4[_0x4d9a29(0xf2)]});}catch(_0x1dccbc){if(_0x1dccbc instanceof CliError)throw _0x1dccbc;if(_0x1dccbc instanceof Error&&_0x1dccbc[_0x4d9a29(0xe5)]===_0x4d9a29(0xfb))throw _0x1dccbc;throw CliErrors[_0x4d9a29(0xc2)](_0x4d9a29(0xe3));}if(!hasNoStore(_0x5f1c42[_0x4d9a29(0xc7)]))throw CliErrors['apiError']('SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.');if(_0x5f1c42[_0x4d9a29(0xe4)]===0x191)throw CliErrors[_0x4d9a29(0x102)]();if(!_0x5f1c42['ok'])throw CliErrors[_0x4d9a29(0xed)](_0x4d9a29(0xdd)+_0x5f1c42['status']+').');if(!(_0x5f1c42[_0x4d9a29(0xc7)][_0x4d9a29(0xca)]('content-type')??'')['toLowerCase']()[_0x4d9a29(0xef)](_0x4d9a29(0xe9)))throw CliErrors[_0x4d9a29(0xed)](_0x4d9a29(0xfc));let _0x1c1da5;try{_0x1c1da5=await _0x5f1c42[_0x4d9a29(0xd4)]();}catch{throw CliErrors[_0x4d9a29(0xed)](_0x4d9a29(0xf4));}return parseDevelopmentSearchResponse(readEnvelopeData(_0x1c1da5),_0xcd73f4[_0x4d9a29(0xd2)]);}function readEnvelopeData(_0xefc708){const _0x5428f0=a254_0x1176a0,_0x24bd26=requireRecord(_0xefc708,_0x5428f0(0xe7));if(_0x24bd26[_0x5428f0(0xd3)]===![])throw CliErrors[_0x5428f0(0xed)](_0x5428f0(0xfe));if(!('data'in _0x24bd26))throw invalidContract(_0x5428f0(0xe7));return _0x24bd26[_0x5428f0(0xfa)];}function validateTopK(_0x98c162){const _0x2a3910=a254_0x1176a0;if(_0x98c162!==undefined&&(!Number['isSafeInteger'](_0x98c162)||_0x98c162<0x1||_0x98c162>0x32))throw CliErrors[_0x2a3910(0xd7)]('Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.');}function hasNoStore(_0x1c2e19){const _0x26ac20=a254_0x1176a0;return(_0x1c2e19['get'](_0x26ac20(0xe2))??'')[_0x26ac20(0xc3)](',')[_0x26ac20(0xd5)](_0x5aa42d=>_0x5aa42d[_0x26ac20(0x109)]()['toLowerCase']()===_0x26ac20(0x107));}function parseDevelopmentSearchResponse(_0x290d2b,_0x8ddbd8){const _0x20f4d5=a254_0x1176a0,_0xafb337=requireExactRecord(_0x290d2b,RESPONSE_KEYS,_0x20f4d5(0xd0));if(_0xafb337[_0x20f4d5(0xcf)]!==0x2||_0xafb337[_0x20f4d5(0xf5)]!=='development')throw invalidContract('profile');if(!Array[_0x20f4d5(0xc9)](_0xafb337[_0x20f4d5(0xeb)])||_0xafb337[_0x20f4d5(0xeb)][_0x20f4d5(0x100)]>(_0x8ddbd8??0x32))throw invalidContract(_0x20f4d5(0xeb));if(typeof _0xafb337[_0x20f4d5(0x101)]!==_0x20f4d5(0xf0)||!/^sha256:[0-9a-f]{64}$/[_0x20f4d5(0x10a)](_0xafb337[_0x20f4d5(0x101)]))throw invalidContract(_0x20f4d5(0x101));const _0x28310b=requireRecord(_0xafb337[_0x20f4d5(0xe1)],_0x20f4d5(0xe1)),_0x176743={};for(const [_0x1128fd,_0x1b77c1]of Object[_0x20f4d5(0xf3)](_0x28310b)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x20f4d5(0x10a)](_0x1128fd)||typeof _0x1b77c1!==_0x20f4d5(0xd9)||!Number[_0x20f4d5(0xd1)](_0x1b77c1)||_0x1b77c1<0x0)throw invalidContract(_0x20f4d5(0xe1));_0x176743[_0x1128fd]=_0x1b77c1;}const _0x2fdb9c=_0xafb337[_0x20f4d5(0xeb)][_0x20f4d5(0xdb)]((_0x3b7d4e,_0x48cfa1)=>parseHit(_0x3b7d4e,_0x48cfa1));if(!Number[_0x20f4d5(0xc1)](_0xafb337['total'])||_0xafb337[_0x20f4d5(0xc4)]!==_0x2fdb9c[_0x20f4d5(0x100)])throw invalidContract(_0x20f4d5(0xc4));return{'schemaVersion':_0xafb337[_0x20f4d5(0xcf)],'profile':_0xafb337[_0x20f4d5(0xf5)],'total':_0xafb337[_0x20f4d5(0xc4)],'strategyFingerprint':_0xafb337[_0x20f4d5(0x101)],'timingsMs':_0x176743,'hits':_0x2fdb9c};}function a254_0x27d1(){const _0xff1870=['finalScore','number','hits[','map','Knowledge\x20search\x20appCode\x20is\x20required.','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','revision','205195kahmBC','title','timingsMs','cache-control','SmartCode\x20knowledge\x20search\x20request\x20failed.','status','name','object','response\x20envelope','tags','application/json','509500aPLPoD','hits','score','apiError','647420VLcEUp','includes','string','POST','signal','entries','SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','profile','1422lPnQVs','5408NrdvXa','scoreKind','Knowledge\x20search\x20query\x20is\x20required.','data','AbortError','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','documentId','SmartCode\x20knowledge\x20search\x20failed.','37UrUiPR','length','strategyFingerprint','authRequired','chunkId','text','10226KypDYl','query','no-store','1614991NGaAAs','trim','test','/smartapi/knowledge/company-public/search','sort','appCode','isSafeInteger','networkError','split','total','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','405201ogmIXZ','headers','\x20contract.','isArray','get','keys','scope','rawScore','30DooxKv','schemaVersion','response','isFinite','topK','success','json','some','rank','validation'];a254_0x27d1=function(){return _0xff1870;};return a254_0x27d1();}function a254_0xa82e(_0x2251ff,_0x250664){_0x2251ff=_0x2251ff-0xbf;const _0x27d102=a254_0x27d1();let _0xa82e59=_0x27d102[_0x2251ff];return _0xa82e59;}function parseHit(_0x2ea457,_0x4a0afa){const _0x3647a7=a254_0x1176a0,_0x2a0d6a=requireExactRecord(_0x2ea457,HIT_KEYS,_0x3647a7(0xda)+_0x4a0afa+']'),_0x5c8d54=_0x2efc9e=>{const _0x46fb4c=_0x2a0d6a[_0x2efc9e];if(typeof _0x46fb4c!=='string'||!_0x46fb4c)throw invalidContract(_0x2efc9e);return _0x46fb4c;};if(!Number[_0x3647a7(0xc1)](_0x2a0d6a[_0x3647a7(0xde)])||_0x2a0d6a[_0x3647a7(0xde)]<0x1)throw invalidContract(_0x3647a7(0xde));if(_0x2a0d6a[_0x3647a7(0xcc)]!=='public'&&_0x2a0d6a[_0x3647a7(0xcc)]!=='company')throw invalidContract(_0x3647a7(0xcc));if(typeof _0x2a0d6a[_0x3647a7(0xe0)]!=='string'||typeof _0x2a0d6a[_0x3647a7(0x104)]!=='string')throw invalidContract('text');if(!Array[_0x3647a7(0xc9)](_0x2a0d6a[_0x3647a7(0xe8)])||_0x2a0d6a[_0x3647a7(0xe8)][_0x3647a7(0xd5)](_0xb0cd64=>typeof _0xb0cd64!==_0x3647a7(0xf0)))throw invalidContract(_0x3647a7(0xe8));if(!Number[_0x3647a7(0xc1)](_0x2a0d6a[_0x3647a7(0xd6)])||_0x2a0d6a['rank']!==_0x4a0afa+0x1)throw invalidContract(_0x3647a7(0xd6));if(!isFiniteNumber(_0x2a0d6a[_0x3647a7(0xcd)])||!isFiniteNumber(_0x2a0d6a['finalScore']))throw invalidContract(_0x3647a7(0xec));return{'documentId':_0x5c8d54(_0x3647a7(0xfd)),'revision':_0x2a0d6a[_0x3647a7(0xde)],'chunkId':_0x5c8d54(_0x3647a7(0x103)),'scope':_0x2a0d6a['scope'],'title':_0x2a0d6a[_0x3647a7(0xe0)],'text':_0x2a0d6a['text'],'tags':[..._0x2a0d6a[_0x3647a7(0xe8)]],'rank':_0x2a0d6a[_0x3647a7(0xd6)],'rawScore':_0x2a0d6a[_0x3647a7(0xcd)],'finalScore':_0x2a0d6a[_0x3647a7(0xd8)],'scoreKind':_0x5c8d54(_0x3647a7(0xf8))};}function requireExactRecord(_0x540912,_0x4d3114,_0xfcba78){const _0x45ab06=a254_0x1176a0,_0x49cca6=requireRecord(_0x540912,_0xfcba78),_0xa22ee=Object[_0x45ab06(0xcb)](_0x49cca6)[_0x45ab06(0xbf)](),_0x22dace=[..._0x4d3114][_0x45ab06(0xbf)]();if(_0xa22ee[_0x45ab06(0x100)]!==_0x22dace[_0x45ab06(0x100)]||_0xa22ee[_0x45ab06(0xd5)]((_0x27b2d8,_0x923b5f)=>_0x27b2d8!==_0x22dace[_0x923b5f]))throw invalidContract(_0xfcba78);return _0x49cca6;}function requireRecord(_0xe9f280,_0x2e4be7){const _0x3a4ce5=a254_0x1176a0;if(!_0xe9f280||typeof _0xe9f280!==_0x3a4ce5(0xe6)||Array['isArray'](_0xe9f280))throw invalidContract(_0x2e4be7);return _0xe9f280;}function isFiniteNumber(_0x404a0c){return typeof _0x404a0c==='number'&&Number['isFinite'](_0x404a0c);}function invalidContract(_0x39fce2){const _0x2a0d27=a254_0x1176a0;return CliErrors[_0x2a0d27(0xed)](_0x2a0d27(0xc5)+_0x39fce2+_0x2a0d27(0xc8));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a255_0x3b2f(){const _0x11b06b=['470403caruxd','214bmDDbD','790404WjnMyg','cwd','isFile','.rabetbase','1276016jZWbbO','localeCompare','1471972XgFoZd','24MslENd','page','validation','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','trim','name','847320ZMTbsU','Unsupported\x20file\x20in\x20page\x20directory:\x20','525114kgVFwC','3449ZwETRj','split','join','isDirectory','page-dir','.json','flagMissing','utf8','sort','page.lock.json','F_OK'];a255_0x3b2f=function(){return _0x11b06b;};return a255_0x3b2f();}const a255_0x33e851=a255_0x3192;(function(_0x50c4c4,_0x2fba52){const _0xf74f09=a255_0x3192,_0x2a85ff=_0x50c4c4();while(!![]){try{const _0x4aea74=parseInt(_0xf74f09(0x14e))/0x1*(parseInt(_0xf74f09(0x13d))/0x2)+parseInt(_0xf74f09(0x14d))/0x3+-parseInt(_0xf74f09(0x144))/0x4+parseInt(_0xf74f09(0x14b))/0x5+-parseInt(_0xf74f09(0x13e))/0x6+-parseInt(_0xf74f09(0x142))/0x7+-parseInt(_0xf74f09(0x145))/0x8*(-parseInt(_0xf74f09(0x13c))/0x9);if(_0x4aea74===_0x2fba52)break;else _0x2a85ff['push'](_0x2a85ff['shift']());}catch(_0x438206){_0x2a85ff['push'](_0x2a85ff['shift']());}}}(a255_0x3b2f,0x2dfab));import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x342fc4,_0x29bb7a=process[a255_0x33e851(0x13f)]()){const _0x59503f=a255_0x33e851,_0x5907fb=resolve(_0x29bb7a),_0x4656ba=join(_0x5907fb,'.rabetbase',_0x59503f(0x146));return{'projectRoot':_0x5907fb,'pagesBaseDir':_0x4656ba,'appPagesDir':join(_0x4656ba,_0x342fc4),'lockFilePath':join(_0x5907fb,_0x59503f(0x141),_0x59503f(0x13a))};}export function buildPageFileName(_0x6df34d,_0x6b61eb){const _0x1f1f0d=a255_0x33e851;return _0x6df34d+'-'+_0x6b61eb['toUpperCase']()+_0x1f1f0d(0x136);}export function resolvePageFilePath(_0x564218,_0x484a3e,_0x22566d){return join(_0x564218['appPagesDir'],buildPageFileName(_0x484a3e,_0x22566d));}export async function ensureParentDirectory(_0x3840d6){await mkdir(dirname(_0x3840d6),{'recursive':!![]});}export async function fileExists(_0x421a42){const _0x8fe43d=a255_0x33e851;try{return await access(_0x421a42,constants[_0x8fe43d(0x13b)]),!![];}catch{return![];}}function a255_0x3192(_0x307ac0,_0x1f70e2){_0x307ac0=_0x307ac0-0x134;const _0x3b2f00=a255_0x3b2f();let _0x319246=_0x3b2f00[_0x307ac0];return _0x319246;}export async function readCustomPageDirectory(_0x567e5d){const _0x5b7aa9=a255_0x33e851,_0xfa1f1f=_0x567e5d[_0x5b7aa9(0x149)]();if(!_0xfa1f1f)throw CliErrors[_0x5b7aa9(0x137)](_0x5b7aa9(0x135));const _0x2d6ed0=resolve(_0xfa1f1f);let _0x3f0f10;try{_0x3f0f10=await lstat(_0x2d6ed0);}catch{throw CliErrors[_0x5b7aa9(0x147)]('Page\x20directory\x20not\x20found:\x20'+_0xfa1f1f);}if(!_0x3f0f10[_0x5b7aa9(0x134)]())throw CliErrors[_0x5b7aa9(0x147)](_0x5b7aa9(0x148)+_0xfa1f1f);const _0x294cd9={};return await readDirectory(_0x2d6ed0,_0x2d6ed0,_0x294cd9),_0x294cd9;}async function readDirectory(_0x1adb1a,_0x5a402b,_0x45ca8a){const _0x5aa699=a255_0x33e851,_0x49ee47=await readdir(_0x5a402b,{'withFileTypes':!![]});for(const _0x2bc948 of _0x49ee47[_0x5aa699(0x139)]((_0x3b4e56,_0x3cd572)=>_0x3b4e56[_0x5aa699(0x14a)][_0x5aa699(0x143)](_0x3cd572[_0x5aa699(0x14a)]))){const _0x33a228=join(_0x5a402b,_0x2bc948[_0x5aa699(0x14a)]);if(_0x2bc948[_0x5aa699(0x134)]()){await readDirectory(_0x1adb1a,_0x33a228,_0x45ca8a);continue;}if(!_0x2bc948[_0x5aa699(0x140)]())throw CliErrors[_0x5aa699(0x147)](_0x5aa699(0x14c)+_0x33a228);_0x45ca8a[relative(_0x1adb1a,_0x33a228)[_0x5aa699(0x14f)](sep)[_0x5aa699(0x150)]('/')]=await readFile(_0x33a228,_0x5aa699(0x138));}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x50aca9,_0x1f8d14){const _0x46c445=a256_0x1c4e,_0xaf44e0=_0x50aca9();while(!![]){try{const _0x140f9d=parseInt(_0x46c445(0xf8))/0x1*(parseInt(_0x46c445(0x102))/0x2)+-parseInt(_0x46c445(0x101))/0x3*(parseInt(_0x46c445(0xfe))/0x4)+parseInt(_0x46c445(0xf9))/0x5*(-parseInt(_0x46c445(0x103))/0x6)+parseInt(_0x46c445(0xff))/0x7*(-parseInt(_0x46c445(0xfc))/0x8)+-parseInt(_0x46c445(0x100))/0x9*(parseInt(_0x46c445(0xfd))/0xa)+parseInt(_0x46c445(0x105))/0xb+parseInt(_0x46c445(0xfa))/0xc;if(_0x140f9d===_0x1f8d14)break;else _0xaf44e0['push'](_0xaf44e0['shift']());}catch(_0x5e8789){_0xaf44e0['push'](_0xaf44e0['shift']());}}}(a256_0x120b,0xc733c));function a256_0x1c4e(_0xb9c0ee,_0x1f089f){_0xb9c0ee=_0xb9c0ee-0xf8;const _0x120b3b=a256_0x120b();let _0x1c4eb5=_0x120b3b[_0xb9c0ee];return _0x1c4eb5;}function a256_0x120b(){const _0x567743=['9gnyaih','1566gpSHQh','236MCrFTt','2166vdnyIG','update','12368532NObeeG','parse','utf8','createHash','stringify','4367OcfeST','16885SLCjiq','38783004PGHHby','digest','176KzOIjt','6731420QpTzOO','10028eszTlF','271985QmwrCm'];a256_0x120b=function(){return _0x567743;};return a256_0x120b();}import a256_0x5bf154 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x48a875){const _0x4e7849=a256_0x1c4e;return JSON[_0x4e7849(0x109)](JSON[_0x4e7849(0x106)](_0x48a875),null,0x2)+'\x0a';}export function computePageContentHash(_0x1618a5){const _0x220aa4=a256_0x1c4e;return a256_0x5bf154[_0x220aa4(0x108)]('md5')[_0x220aa4(0x104)](_0x1618a5)[_0x220aa4(0xfb)]('hex');}export function computeSerializedSchemaHash(_0x21e9aa){return computePageContentHash(serializePageSchemaForFile(_0x21e9aa));}export async function computePageFileHash(_0x540791){const _0x6a237b=a256_0x1c4e,_0xa65bdf=await readFile(_0x540791,_0x6a237b(0x107));return computePageContentHash(_0xa65bdf);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x25d856,_0xa3c444){const _0x3f2813=a257_0x27f6,_0x32d957=_0x25d856();while(!![]){try{const _0x321658=-parseInt(_0x3f2813(0x191))/0x1+-parseInt(_0x3f2813(0x19a))/0x2+-parseInt(_0x3f2813(0x190))/0x3*(-parseInt(_0x3f2813(0x18e))/0x4)+-parseInt(_0x3f2813(0x18c))/0x5*(parseInt(_0x3f2813(0x18f))/0x6)+-parseInt(_0x3f2813(0x18d))/0x7+-parseInt(_0x3f2813(0x18a))/0x8*(-parseInt(_0x3f2813(0x196))/0x9)+parseInt(_0x3f2813(0x195))/0xa;if(_0x321658===_0xa3c444)break;else _0x32d957['push'](_0x32d957['shift']());}catch(_0x137838){_0x32d957['push'](_0x32d957['shift']());}}}(a257_0x12c9,0x6705b));function a257_0x12c9(){const _0x23744e=['628423fIARMs','utf8','ENOENT','object','14329740gNURSo','61794CCfIuh','apps','lastSync','pages','1459656BLhgSM','568YUzuXy','stringify','60465EHoBsE','4149698UvCWys','7904pqnYFE','48xWXPol','834FwXVGp'];a257_0x12c9=function(){return _0x23744e;};return a257_0x12c9();}function a257_0x27f6(_0x20ac00,_0x3dd309){_0x20ac00=_0x20ac00-0x18a;const _0x12c953=a257_0x12c9();let _0x27f69c=_0x12c953[_0x20ac00];return _0x27f69c;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x32f2f7,_0x4cccb9){const _0x30ecb4=a257_0x27f6,_0xaa4db4={'apps':_0x32f2f7['apps']&&typeof _0x32f2f7[_0x30ecb4(0x197)]===_0x30ecb4(0x194)?_0x32f2f7['apps']:{}};let _0x5390b6=_0xaa4db4[_0x30ecb4(0x197)][_0x4cccb9];if(!_0x5390b6)return _0x5390b6={'lastSync':'','pages':{}},_0xaa4db4[_0x30ecb4(0x197)][_0x4cccb9]=_0x5390b6,{'lockData':_0xaa4db4,'appLock':_0x5390b6};return!_0x5390b6[_0x30ecb4(0x198)]&&(_0x5390b6[_0x30ecb4(0x198)]=''),(!_0x5390b6[_0x30ecb4(0x199)]||typeof _0x5390b6[_0x30ecb4(0x199)]!==_0x30ecb4(0x194))&&(_0x5390b6[_0x30ecb4(0x199)]={}),{'lockData':_0xaa4db4,'appLock':_0x5390b6};}export async function readPageLockFile(_0x15cdb9){const _0x1e7005=a257_0x27f6;try{const _0x144430=await readFile(_0x15cdb9,'utf8'),_0x48f70d=JSON['parse'](_0x144430);return{'apps':_0x48f70d[_0x1e7005(0x197)]&&typeof _0x48f70d[_0x1e7005(0x197)]===_0x1e7005(0x194)?_0x48f70d[_0x1e7005(0x197)]:{}};}catch(_0x1b3187){if(_0x1b3187['code']===_0x1e7005(0x193))return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0x1b3187));}}export async function writePageLockFile(_0x4e1e00,_0x157836){const _0x374af1=a257_0x27f6;await mkdir(dirname(_0x4e1e00),{'recursive':!![]}),await writeFile(_0x4e1e00,JSON[_0x374af1(0x18b)](_0x157836,null,0x2),_0x374af1(0x192));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x548205,_0x3552d6){const _0x10cb9b=a261_0x4a76,_0x20e58f=_0x548205();while(!![]){try{const _0x16b144=-parseInt(_0x10cb9b(0xb1))/0x1*(-parseInt(_0x10cb9b(0xdd))/0x2)+parseInt(_0x10cb9b(0xb2))/0x3*(-parseInt(_0x10cb9b(0xb3))/0x4)+-parseInt(_0x10cb9b(0xbd))/0x5+parseInt(_0x10cb9b(0xd8))/0x6*(-parseInt(_0x10cb9b(0xe9))/0x7)+-parseInt(_0x10cb9b(0xe5))/0x8+parseInt(_0x10cb9b(0xf6))/0x9+parseInt(_0x10cb9b(0xe8))/0xa*(parseInt(_0x10cb9b(0xc0))/0xb);if(_0x16b144===_0x3552d6)break;else _0x20e58f['push'](_0x20e58f['shift']());}catch(_0x1c27d5){_0x20e58f['push'](_0x20e58f['shift']());}}}(a261_0x15ff,0xbf076));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0xd1c550,_0x5472b6){const _0x533680=a261_0x4a76,_0x56b6c0=[],_0x2f0b15=normalizeSqlForStaticAnalysis(_0xd1c550),_0x1cb46f=(_0x2f0b15[_0x533680(0xc8)]?[]:extractJoinFacts(_0x2f0b15[_0x533680(0xd9)]))[_0x533680(0xe6)](_0x22cd11=>{const _0x477aee=_0x533680;if(_0x22cd11[_0x477aee(0xf3)]||_0x22cd11['columns']['length']===0x0)return _0x56b6c0[_0x477aee(0xc6)]({'code':_0x477aee(0xda),'table':_0x22cd11[_0x477aee(0xf0)],'alias':_0x22cd11[_0x477aee(0xae)],'columns':_0x22cd11[_0x477aee(0xe2)],'reason':_0x22cd11['unsupportedReason']??_0x477aee(0xf2)}),{'table':_0x22cd11[_0x477aee(0xf0)],'alias':_0x22cd11[_0x477aee(0xae)],'columns':_0x22cd11[_0x477aee(0xe2)],'status':_0x477aee(0xc5)};const _0x20f9cf=resolveTableMetadata(_0x5472b6,_0x22cd11[_0x477aee(0xf0)]),_0xd0f57b=(_0x20f9cf?.[_0x477aee(0xe4)]??[])[_0x477aee(0xe6)](_0x21d0b7=>({'index':_0x21d0b7,'matchedPrefix':findEqualityPrefix(_0x21d0b7[_0x477aee(0xe2)],_0x22cd11[_0x477aee(0xe2)])}))[_0x477aee(0xab)](_0x34b6e6=>_0x34b6e6['matchedPrefix'][_0x477aee(0xb4)]>0x0),_0x1589d0=_0xd0f57b[_0x477aee(0xca)]((_0x4efdd9,_0x3a9e38)=>!_0x4efdd9||_0x3a9e38[_0x477aee(0xed)][_0x477aee(0xb4)]>_0x4efdd9['matchedPrefix'][_0x477aee(0xb4)]?_0x3a9e38:_0x4efdd9,_0xd0f57b[0x0]);if(_0x1589d0)return{'table':_0x22cd11['table'],'alias':_0x22cd11[_0x477aee(0xae)],'columns':_0x22cd11[_0x477aee(0xe2)],'status':_0x477aee(0xbe),'matchedIndex':{..._0x1589d0[_0x477aee(0xba)],'matchedPrefix':_0x1589d0['matchedPrefix']}};const _0x102f5a=_0x20f9cf?.[_0x477aee(0xe4)]['filter'](_0x11758b=>_0x11758b[_0x477aee(0xe2)][_0x477aee(0xd2)](_0x2cc6c4=>_0x22cd11[_0x477aee(0xe2)][_0x477aee(0xd2)](_0x977618=>columnNamesMatch(_0x2cc6c4,_0x977618))))??[];if(_0x102f5a[_0x477aee(0xb4)]>0x0)return _0x56b6c0['push']({'code':_0x477aee(0xb8),'table':_0x22cd11[_0x477aee(0xf0)],'alias':_0x22cd11[_0x477aee(0xae)],'columns':_0x22cd11[_0x477aee(0xe2)],'reason':_0x477aee(0xeb)}),{'table':_0x22cd11[_0x477aee(0xf0)],'alias':_0x22cd11[_0x477aee(0xae)],'columns':_0x22cd11[_0x477aee(0xe2)],'status':_0x477aee(0xb6),'candidateIndexes':_0x102f5a};if(_0x20f9cf&&_0x20f9cf['metadataAvailable']!==![]&&_0x20f9cf[_0x477aee(0xe4)][_0x477aee(0xb4)]>0x0&&_0x22cd11['columns'][_0x477aee(0xb4)]>0x0)return _0x56b6c0[_0x477aee(0xc6)]({'code':_0x477aee(0xee),'table':_0x22cd11[_0x477aee(0xf0)],'alias':_0x22cd11[_0x477aee(0xae)],'columns':_0x22cd11[_0x477aee(0xe2)],'reason':_0x477aee(0xc2)}),{'table':_0x22cd11[_0x477aee(0xf0)],'alias':_0x22cd11[_0x477aee(0xae)],'columns':_0x22cd11['columns'],'status':_0x477aee(0xb6)};return _0x56b6c0[_0x477aee(0xc6)]({'code':_0x477aee(0xbc),'table':_0x22cd11['table'],'alias':_0x22cd11[_0x477aee(0xae)],'columns':_0x22cd11[_0x477aee(0xe2)],'reason':_0x20f9cf?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':_0x477aee(0xd6)}),{'table':_0x22cd11[_0x477aee(0xf0)],'alias':_0x22cd11[_0x477aee(0xae)],'columns':_0x22cd11['columns'],'status':'unavailable'};});return{'checked':_0x1cb46f[_0x533680(0xb4)]>0x0,'joins':_0x1cb46f,'warnings':_0x56b6c0};}function extractJoinFacts(_0x247fd7){const _0x1fedb8=a261_0x4a76,_0x220ed8=maskNestedQueries(stripSqlNoise(_0x247fd7)),_0x126632=maskQuotedIdentifiers(_0x220ed8),_0x20b332=[],_0xc1b4fd=new Set(),_0x1e3816=/\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 _0x28ba68 of _0x220ed8[_0x1fedb8(0xb9)](_0x1e3816)){const _0x2e75eb=_0x28ba68[_0x1fedb8(0xba)]??0x0,_0x216083=_0x28ba68[0x0][_0x1fedb8(0xcc)](/\bJOIN\b/i),_0x1b1f00=_0x2e75eb+Math[_0x1fedb8(0xef)](0x0,_0x216083);if(!/^JOIN\b/i[_0x1fedb8(0xaa)](_0x126632[_0x1fedb8(0xce)](_0x1b1f00)))continue;_0xc1b4fd[_0x1fedb8(0xdc)](_0x1b1f00);const _0x440c82=normalizeIdentifier(_0x28ba68[0x1]||_0x1fedb8(0xc1)),_0x262e5f=normalizeIdentifier(_0x28ba68[0x2]??''),_0x31f3f1=normalizeIdentifier(_0x28ba68[0x3]||_0x262e5f['split']('.')['at'](-0x1)||_0x262e5f),_0x36baf9=[],_0x3d8815=_0x262e5f===_0x1fedb8(0xd4);let _0x3b7c07=_0x440c82===_0x1fedb8(0xdb)||_0x440c82===_0x1fedb8(0xd3)||_0x3d8815,_0x34dd8b=_0x3b7c07?_0x3d8815?_0x1fedb8(0xd5):_0x440c82[_0x1fedb8(0xc3)]()+'\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.':undefined;const _0x404dd3=stripOuterParentheses(_0x28ba68[0x4]??''),_0x51de41=_0x404dd3[_0x1fedb8(0xd7)](MYBATIS_DYNAMIC_START_MARKER)||_0x404dd3[_0x1fedb8(0xd7)](MYBATIS_DYNAMIC_END_MARKER),_0x35d0a5=_0x404dd3[_0x1fedb8(0xd7)](MYBATIS_INCLUDE_MARKER);_0x51de41&&(_0x3b7c07=!![],_0x34dd8b??=_0x1fedb8(0xe0));_0x35d0a5&&(_0x3b7c07=!![],_0x34dd8b??=_0x1fedb8(0xe1));const _0x27149f=_0x404dd3[_0x1fedb8(0xb5)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x1fedb8(0xb5)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x27149f,'OR')&&(_0x3b7c07=!![],_0x34dd8b??=_0x1fedb8(0xc9));for(const _0x2af7ff of splitTopLevelAnd(_0x27149f)){const _0x5a67ca=stripOuterParentheses(_0x2af7ff);if(hasTopLevelKeyword(_0x5a67ca,'OR')){_0x3b7c07=!![],_0x34dd8b??=_0x1fedb8(0xc9);continue;}const _0x5bf0b1=splitEquality(_0x5a67ca);if(!_0x5bf0b1){containsColumnReference(_0x2af7ff,_0x31f3f1)&&(_0x3b7c07=!![]);continue;}const _0x36c169=parseDirectColumnReference(_0x5bf0b1[0x0],_0x31f3f1),_0x3960eb=parseDirectColumnReference(_0x5bf0b1[0x1],_0x31f3f1),_0x570526=containsColumnReference(_0x5bf0b1[0x0],_0x31f3f1),_0x282183=containsColumnReference(_0x5bf0b1[0x1],_0x31f3f1),_0x52f458=_0x36c169&&!_0x282183?_0x36c169:_0x3960eb&&!_0x570526?_0x3960eb:null;if(_0x52f458&&!_0x36baf9[_0x1fedb8(0xd7)](_0x52f458))_0x36baf9[_0x1fedb8(0xc6)](_0x52f458);else!_0x52f458&&containsColumnReference(_0x2af7ff,_0x31f3f1)&&(_0x3b7c07=!![]);}_0x20b332[_0x1fedb8(0xc6)]({'table':_0x262e5f,'alias':_0x31f3f1,'columns':_0x36baf9,'unsupportedPredicate':_0x3b7c07,'unsupportedReason':_0x34dd8b,'containsUnresolvedInclude':_0x35d0a5,'position':_0x1b1f00});}for(const _0x1327ad of _0x126632['matchAll'](/\bJOIN\b/gi)){const _0x134826=_0x1327ad[_0x1fedb8(0xba)]??0x0;if(_0xc1b4fd[_0x1fedb8(0xe7)](_0x134826))continue;const _0x1e9862=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/['exec'](_0x220ed8[_0x1fedb8(0xce)](_0x134826+_0x1327ad[0x0]['length'])),_0x1b2bc9=normalizeIdentifier(_0x1e9862?.[0x1]||_0x1fedb8(0xf4)),_0x25a092=normalizeIdentifier(_0x1e9862?.[0x2]||''),_0xb2703c=isSqlClauseKeyword(_0x25a092)?_0x1b2bc9[_0x1fedb8(0xb7)]('.')['at'](-0x1)||_0x1b2bc9:_0x25a092||_0x1b2bc9[_0x1fedb8(0xb7)]('.')['at'](-0x1)||_0x1b2bc9;_0x20b332[_0x1fedb8(0xc6)]({'table':_0x1b2bc9,'alias':_0xb2703c,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1fedb8(0xbb),'position':_0x134826});}const _0x31f651=_0x126632[_0x1fedb8(0xd1)](MYBATIS_INCLUDE_MARKER);return _0x31f651>=0x0&&!_0x20b332[_0x1fedb8(0xd2)](_0x138b3c=>_0x138b3c[_0x1fedb8(0xf7)])&&_0x20b332[_0x1fedb8(0xc6)]({'table':'unknown','alias':_0x1fedb8(0xf4),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1fedb8(0xd0),'containsUnresolvedInclude':!![],'position':_0x31f651}),_0x20b332[_0x1fedb8(0xdf)]((_0x36ba2f,_0x398c55)=>_0x36ba2f[_0x1fedb8(0xe3)]-_0x398c55[_0x1fedb8(0xe3)]);}function stripSqlNoise(_0x338fcf){const _0x19efac=a261_0x4a76,_0x9e12f1=Array[_0x19efac(0xcd)](_0x338fcf),_0x34229d=(_0x5271b4,_0x59d5b0)=>{for(let _0x31f174=_0x5271b4;_0x31f174<_0x59d5b0;_0x31f174+=0x1){_0x9e12f1[_0x31f174]!=='\x0a'&&_0x9e12f1[_0x31f174]!=='\x0d'&&(_0x9e12f1[_0x31f174]='\x20');}};for(let _0x3d0613=0x0;_0x3d0613<_0x9e12f1[_0x19efac(0xb4)];_0x3d0613+=0x1){const _0x1714f5=_0x9e12f1[_0x3d0613],_0x3a05a5=_0x9e12f1[_0x3d0613+0x1];if(_0x1714f5==='\x27'||_0x1714f5==='\x22'||_0x1714f5==='`'){const _0x527c54=_0x1714f5,_0x32a780=_0x3d0613;_0x3d0613+=0x1;while(_0x3d0613<_0x9e12f1[_0x19efac(0xb4)]){if(_0x9e12f1[_0x3d0613]==='\x5c'&&_0x3d0613+0x1<_0x9e12f1['length']){_0x3d0613+=0x2;continue;}if(_0x9e12f1[_0x3d0613]!==_0x527c54){_0x3d0613+=0x1;continue;}if(_0x9e12f1[_0x3d0613+0x1]===_0x527c54){_0x3d0613+=0x2;continue;}break;}if(_0x527c54==='\x27')_0x34229d(_0x32a780,Math[_0x19efac(0xde)](_0x3d0613+0x1,_0x9e12f1[_0x19efac(0xb4)]));continue;}if(_0x1714f5==='-'&&_0x3a05a5==='-'){const _0x474992=_0x3d0613;while(_0x3d0613<_0x9e12f1[_0x19efac(0xb4)]&&_0x9e12f1[_0x3d0613]!=='\x0a')_0x3d0613+=0x1;_0x34229d(_0x474992,_0x3d0613);continue;}if(_0x1714f5==='/'&&_0x3a05a5==='*'){const _0x1cede7=_0x3d0613;_0x3d0613+=0x2;while(_0x3d0613<_0x9e12f1[_0x19efac(0xb4)]&&!(_0x9e12f1[_0x3d0613]==='*'&&_0x9e12f1[_0x3d0613+0x1]==='/')){_0x3d0613+=0x1;}_0x3d0613=Math[_0x19efac(0xde)](_0x3d0613+0x1,_0x9e12f1[_0x19efac(0xb4)]-0x1),_0x34229d(_0x1cede7,_0x3d0613+0x1);continue;}if(_0x1714f5==='#'&&_0x3a05a5!=='{'){const _0x2ec301=_0x3d0613;while(_0x3d0613<_0x9e12f1[_0x19efac(0xb4)]&&_0x9e12f1[_0x3d0613]!=='\x0a')_0x3d0613+=0x1;_0x34229d(_0x2ec301,_0x3d0613);continue;}if((_0x1714f5==='#'||_0x1714f5==='$')&&_0x3a05a5==='{'){const _0x3ebf64=_0x3d0613;_0x3d0613+=0x2;while(_0x3d0613<_0x9e12f1[_0x19efac(0xb4)]&&_0x9e12f1[_0x3d0613]!=='}')_0x3d0613+=0x1;_0x34229d(_0x3ebf64,Math[_0x19efac(0xde)](_0x3d0613+0x1,_0x9e12f1[_0x19efac(0xb4)]));}}return _0x9e12f1[_0x19efac(0xf8)]('');}function maskQuotedIdentifiers(_0x1d8a61){const _0x18dcfb=a261_0x4a76,_0x1bd6eb=Array[_0x18dcfb(0xcd)](_0x1d8a61);for(let _0x1d0456=0x0;_0x1d0456<_0x1bd6eb[_0x18dcfb(0xb4)];_0x1d0456+=0x1){const _0x4e4493=_0x1bd6eb[_0x1d0456];if(_0x4e4493!=='\x22'&&_0x4e4493!=='`')continue;_0x1d0456+=0x1;while(_0x1d0456<_0x1bd6eb[_0x18dcfb(0xb4)]){if(_0x1bd6eb[_0x1d0456]===_0x4e4493){if(_0x1bd6eb[_0x1d0456+0x1]===_0x4e4493){_0x1bd6eb[_0x1d0456]='\x20',_0x1bd6eb[_0x1d0456+0x1]='\x20',_0x1d0456+=0x2;continue;}break;}_0x1bd6eb[_0x1d0456]='\x20',_0x1d0456+=0x1;}}return _0x1bd6eb[_0x18dcfb(0xf8)]('');}function maskNestedQueries(_0x1c5662){const _0x4cc2f7=a261_0x4a76,_0x4f0200=Array[_0x4cc2f7(0xcd)](_0x1c5662);for(let _0x58e614=0x0;_0x58e614<_0x4f0200['length'];_0x58e614+=0x1){if(_0x4f0200[_0x58e614]!=='(')continue;const _0x14f2ac=_0x1c5662[_0x4cc2f7(0xce)](_0x58e614+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x4cc2f7(0xaa)](_0x14f2ac))continue;let _0x36d162=0x1,_0x1186b9=_0x58e614+0x1;for(;_0x1186b9<_0x4f0200[_0x4cc2f7(0xb4)]&&_0x36d162>0x0;_0x1186b9+=0x1){if(_0x4f0200[_0x1186b9]==='(')_0x36d162+=0x1;if(_0x4f0200[_0x1186b9]===')')_0x36d162-=0x1;}if(_0x36d162!==0x0)continue;for(let _0x2bc829=_0x58e614;_0x2bc829<_0x1186b9;_0x2bc829+=0x1){_0x4f0200[_0x2bc829]='\x20';}const _0x1a3f47=_0x4cc2f7(0xd4);for(let _0x104fc8=0x0;_0x104fc8<_0x1a3f47[_0x4cc2f7(0xb4)]&&_0x58e614+_0x104fc8<_0x1186b9;_0x104fc8+=0x1){_0x4f0200[_0x58e614+_0x104fc8]=_0x1a3f47[_0x104fc8];}_0x58e614=_0x1186b9-0x1;}return _0x4f0200[_0x4cc2f7(0xf8)]('');}function splitTopLevelAnd(_0x3ebbc5){const _0x1cc55c=a261_0x4a76,_0x186d5d=[];let _0x4a24fc=0x0,_0x215310=0x0;for(let _0x40388b=0x0;_0x40388b<_0x3ebbc5[_0x1cc55c(0xb4)];_0x40388b+=0x1){const _0x3066f5=_0x3ebbc5[_0x40388b];if(_0x3066f5==='(')_0x4a24fc+=0x1;if(_0x3066f5===')')_0x4a24fc=Math[_0x1cc55c(0xef)](0x0,_0x4a24fc-0x1);_0x4a24fc===0x0&&_0x3ebbc5[_0x1cc55c(0xce)](_0x40388b)[_0x1cc55c(0xea)](/^AND\b/i)&&(_0x40388b===0x0||/\s/['test'](_0x3ebbc5[_0x40388b-0x1]??''))&&(_0x186d5d['push'](_0x3ebbc5[_0x1cc55c(0xce)](_0x215310,_0x40388b)[_0x1cc55c(0xf5)]()),_0x40388b+=0x2,_0x215310=_0x40388b+0x1);}const _0x53e98b=_0x3ebbc5['slice'](_0x215310)[_0x1cc55c(0xf5)]();if(_0x53e98b)_0x186d5d[_0x1cc55c(0xc6)](_0x53e98b);return _0x186d5d;}function hasTopLevelKeyword(_0x2c59d4,_0x16df94){const _0x38b64e=a261_0x4a76;let _0x4e118f=0x0;for(let _0x360460=0x0;_0x360460<_0x2c59d4[_0x38b64e(0xb4)];_0x360460+=0x1){const _0x2a64dc=_0x2c59d4[_0x360460];if(_0x2a64dc==='(')_0x4e118f+=0x1;if(_0x2a64dc===')')_0x4e118f=Math[_0x38b64e(0xef)](0x0,_0x4e118f-0x1);if(_0x4e118f!==0x0)continue;const _0x41c918=_0x2c59d4[_0x38b64e(0xce)](_0x360460,_0x360460+_0x16df94[_0x38b64e(0xb4)]),_0x8cdc16=_0x2c59d4[_0x360460-0x1]??'\x20',_0x13299c=_0x2c59d4[_0x360460+_0x16df94['length']]??'\x20';if(_0x41c918[_0x38b64e(0xc3)]()===_0x16df94['toUpperCase']()&&!/[\w$]/['test'](_0x8cdc16)&&!/[\w$]/['test'](_0x13299c))return!![];}return![];}function splitEquality(_0x545756){const _0x43c2df=a261_0x4a76,_0x3b3845=stripOuterParentheses(_0x545756);let _0x525d81=0x0,_0x1249d6;for(let _0x3f1613=0x0;_0x3f1613<_0x3b3845[_0x43c2df(0xb4)];_0x3f1613+=0x1){const _0x4cb538=_0x3b3845[_0x3f1613];if(_0x4cb538==='(')_0x525d81+=0x1;if(_0x4cb538===')')_0x525d81=Math[_0x43c2df(0xef)](0x0,_0x525d81-0x1);const _0xa12fab=_0x3b3845[_0x3f1613-0x1]??'',_0x4197aa=_0x3b3845[_0x3f1613+0x1]??'';if(_0x4cb538==='='&&_0x525d81===0x0&&!/[!<>=:]/[_0x43c2df(0xaa)](_0xa12fab)&&_0x4197aa!=='='){if(_0x1249d6!==undefined)return null;_0x1249d6=_0x3f1613;}}return _0x1249d6===undefined?null:[_0x3b3845['slice'](0x0,_0x1249d6)[_0x43c2df(0xf5)](),_0x3b3845[_0x43c2df(0xce)](_0x1249d6+0x1)[_0x43c2df(0xf5)]()];}function parseDirectColumnReference(_0x4736f4,_0x4a04aa){const _0x3c87ee=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/['exec'](stripOuterParentheses(_0x4736f4));if(!_0x3c87ee)return null;if(normalizeIdentifier(_0x3c87ee[0x1]??'')!==normalizeIdentifier(_0x4a04aa))return null;return normalizeIdentifier(_0x3c87ee[0x2]??'');}function containsColumnReference(_0x2fb7ec,_0x4a5030){const _0x372b27=a261_0x4a76,_0x1566df=_0x2fb7ec['replace'](/[`"]/g,''),_0x451777=_0x4a5030[_0x372b27(0xc4)](/[.*+?^${}()|[\]\\]/g,_0x372b27(0xf9));return new RegExp(_0x372b27(0xec)+_0x451777+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x372b27(0xaa)](_0x1566df);}function findEqualityPrefix(_0x4bbbfd,_0x5eb55a){const _0x29e386=a261_0x4a76,_0x437d0c=new Set(_0x5eb55a[_0x29e386(0xe6)](normalizeIdentifier)),_0x985c78=[];for(const _0x1a8404 of _0x4bbbfd){if(!_0x437d0c[_0x29e386(0xe7)](normalizeIdentifier(_0x1a8404)))break;_0x985c78[_0x29e386(0xc6)](_0x1a8404);}return _0x985c78;}function resolveTableMetadata(_0x5b37c8,_0xd24e60){const _0x2eb125=a261_0x4a76,_0x2101ff=normalizeIdentifier(_0xd24e60),_0xa895e1=_0x5b37c8[_0x2eb125(0xab)](_0x353875=>normalizeIdentifier(_0x353875[_0x2eb125(0xf1)])===_0x2101ff);if(_0xa895e1['length']===0x1)return _0xa895e1[0x0];const _0x3478f0=_0x2101ff[_0x2eb125(0xd7)]('.'),_0x5d52cc=_0x2101ff[_0x2eb125(0xb7)]('.')['at'](-0x1),_0x4dfab9=_0x5b37c8['filter'](_0x245cf0=>{const _0x27250c=_0x2eb125,_0x2eecc9=normalizeIdentifier(_0x245cf0[_0x27250c(0xf1)]);if(_0x3478f0&&_0x2eecc9[_0x27250c(0xd7)]('.'))return![];return _0x2eecc9[_0x27250c(0xb7)]('.')['at'](-0x1)===_0x5d52cc;});return _0x4dfab9[_0x2eb125(0xb4)]===0x1?_0x4dfab9[0x0]:undefined;}function columnNamesMatch(_0xbf0d45,_0x21c107){return normalizeIdentifier(_0xbf0d45)===normalizeIdentifier(_0x21c107);}function normalizeIdentifier(_0x5b9076){const _0x36e2ba=a261_0x4a76;return _0x5b9076[_0x36e2ba(0xc4)](/[`"]/g,'')['trim']()['toLowerCase']();}function a261_0x4a76(_0x3bf921,_0x1495be){_0x3bf921=_0x3bf921-0xaa;const _0x15ff2a=a261_0x15ff();let _0x4a7606=_0x15ff2a[_0x3bf921];return _0x4a7606;}function a261_0x15ff(){const _0x1f5895=['sql','JOIN_PREDICATE_UNSUPPORTED','right','add','70iagiCY','min','sort','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','columns','position','indexes','643360tCtZdR','map','has','15170VFxxeO','195419MqnzCn','match','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','(?:^|[^\x5cw$])','matchedPrefix','JOIN_INDEX_MISSING','max','table','tableName','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','unsupportedPredicate','unknown','trim','13771476DDBOoX','containsUnresolvedInclude','join','\x5c$&','test','filter','where','natural','alias','startsWith','using','34607XetdUW','15564wgFiGw','1036emzHyK','length','replaceAll','warning','split','JOIN_INDEX_NOT_USABLE','matchAll','index','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','INDEX_METADATA_UNAVAILABLE','2299285cBrAne','covered','endsWith','1683HsMxmn','INNER','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','toUpperCase','replace','unavailable','push','inner','error','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','reduce','cross','search','from','slice','left','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','indexOf','some','full','__sq__','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','includes','66relMad'];a261_0x15ff=function(){return _0x1f5895;};return a261_0x15ff();}function isSqlClauseKeyword(_0x7d0035){const _0x105497=a261_0x4a76;return new Set(['on',_0x105497(0xb0),_0x105497(0xac),_0x105497(0xf8),_0x105497(0xc7),_0x105497(0xcf),_0x105497(0xdb),_0x105497(0xd3),_0x105497(0xcb),_0x105497(0xad)])[_0x105497(0xe7)](_0x7d0035);}function stripOuterParentheses(_0x5d4b1b){const _0x45339e=a261_0x4a76;let _0x29fc72=_0x5d4b1b[_0x45339e(0xf5)]();while(_0x29fc72[_0x45339e(0xaf)]('(')&&_0x29fc72[_0x45339e(0xbf)](')')){let _0x12814c=0x0,_0x3df359=!![];for(let _0x32eb7a=0x0;_0x32eb7a<_0x29fc72['length'];_0x32eb7a+=0x1){if(_0x29fc72[_0x32eb7a]==='(')_0x12814c+=0x1;if(_0x29fc72[_0x32eb7a]===')')_0x12814c-=0x1;if(_0x12814c===0x0&&_0x32eb7a<_0x29fc72[_0x45339e(0xb4)]-0x1){_0x3df359=![];break;}}if(!_0x3df359||_0x12814c!==0x0)break;_0x29fc72=_0x29fc72[_0x45339e(0xce)](0x1,-0x1)[_0x45339e(0xf5)]();}return _0x29fc72;}
|
|
1
|
+
(function(_0x24e18a,_0x1bb877){const _0x1dafc0=a259_0x1928,_0x2ce5a7=_0x24e18a();while(!![]){try{const _0x368163=parseInt(_0x1dafc0(0xdc))/0x1*(parseInt(_0x1dafc0(0x114))/0x2)+-parseInt(_0x1dafc0(0x102))/0x3+parseInt(_0x1dafc0(0xf7))/0x4+-parseInt(_0x1dafc0(0xde))/0x5*(parseInt(_0x1dafc0(0xda))/0x6)+parseInt(_0x1dafc0(0xe1))/0x7*(-parseInt(_0x1dafc0(0x105))/0x8)+-parseInt(_0x1dafc0(0x10b))/0x9+parseInt(_0x1dafc0(0x108))/0xa*(parseInt(_0x1dafc0(0xe2))/0xb);if(_0x368163===_0x1bb877)break;else _0x2ce5a7['push'](_0x2ce5a7['shift']());}catch(_0x3c502f){_0x2ce5a7['push'](_0x2ce5a7['shift']());}}}(a259_0x1846,0x3d046));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x27c964,_0x27884a){const _0x16b85b=a259_0x1928,_0x2cfdee=[],_0x1b5e53=normalizeSqlForStaticAnalysis(_0x27c964),_0x33240f=(_0x1b5e53[_0x16b85b(0xed)]?[]:extractJoinFacts(_0x1b5e53['sql']))['map'](_0x30c9b4=>{const _0x2d888e=_0x16b85b;if(_0x30c9b4['unsupportedPredicate']||_0x30c9b4['columns'][_0x2d888e(0x113)]===0x0)return _0x2cfdee['push']({'code':_0x2d888e(0xf5),'table':_0x30c9b4['table'],'alias':_0x30c9b4['alias'],'columns':_0x30c9b4[_0x2d888e(0x103)],'reason':_0x30c9b4[_0x2d888e(0xe3)]??_0x2d888e(0x104)}),{'table':_0x30c9b4[_0x2d888e(0xd2)],'alias':_0x30c9b4[_0x2d888e(0x115)],'columns':_0x30c9b4[_0x2d888e(0x103)],'status':_0x2d888e(0xfe)};const _0x8157f6=resolveTableMetadata(_0x27884a,_0x30c9b4[_0x2d888e(0xd2)]),_0x5e8b57=(_0x8157f6?.['indexes']??[])[_0x2d888e(0xd7)](_0x118cb0=>({'index':_0x118cb0,'matchedPrefix':findEqualityPrefix(_0x118cb0[_0x2d888e(0x103)],_0x30c9b4[_0x2d888e(0x103)])}))[_0x2d888e(0x109)](_0x8e3336=>_0x8e3336['matchedPrefix'][_0x2d888e(0x113)]>0x0),_0x974b=_0x5e8b57[_0x2d888e(0xdf)]((_0xe0bdae,_0x287f4d)=>!_0xe0bdae||_0x287f4d[_0x2d888e(0xd9)][_0x2d888e(0x113)]>_0xe0bdae[_0x2d888e(0xd9)][_0x2d888e(0x113)]?_0x287f4d:_0xe0bdae,_0x5e8b57[0x0]);if(_0x974b)return{'table':_0x30c9b4[_0x2d888e(0xd2)],'alias':_0x30c9b4['alias'],'columns':_0x30c9b4[_0x2d888e(0x103)],'status':'covered','matchedIndex':{..._0x974b['index'],'matchedPrefix':_0x974b[_0x2d888e(0xd9)]}};const _0x5f565d=_0x8157f6?.[_0x2d888e(0xe6)][_0x2d888e(0x109)](_0x26796e=>_0x26796e[_0x2d888e(0x103)][_0x2d888e(0x10a)](_0x11e608=>_0x30c9b4[_0x2d888e(0x103)]['some'](_0x110651=>columnNamesMatch(_0x11e608,_0x110651))))??[];if(_0x5f565d[_0x2d888e(0x113)]>0x0)return _0x2cfdee[_0x2d888e(0xf9)]({'code':'JOIN_INDEX_NOT_USABLE','table':_0x30c9b4[_0x2d888e(0xd2)],'alias':_0x30c9b4['alias'],'columns':_0x30c9b4[_0x2d888e(0x103)],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x30c9b4['table'],'alias':_0x30c9b4[_0x2d888e(0x115)],'columns':_0x30c9b4[_0x2d888e(0x103)],'status':'warning','candidateIndexes':_0x5f565d};if(_0x8157f6&&_0x8157f6[_0x2d888e(0x107)]!==![]&&_0x8157f6['indexes']['length']>0x0&&_0x30c9b4['columns'][_0x2d888e(0x113)]>0x0)return _0x2cfdee[_0x2d888e(0xf9)]({'code':_0x2d888e(0xeb),'table':_0x30c9b4['table'],'alias':_0x30c9b4[_0x2d888e(0x115)],'columns':_0x30c9b4[_0x2d888e(0x103)],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x30c9b4[_0x2d888e(0xd2)],'alias':_0x30c9b4[_0x2d888e(0x115)],'columns':_0x30c9b4[_0x2d888e(0x103)],'status':_0x2d888e(0xff)};return _0x2cfdee[_0x2d888e(0xf9)]({'code':_0x2d888e(0xfd),'table':_0x30c9b4[_0x2d888e(0xd2)],'alias':_0x30c9b4[_0x2d888e(0x115)],'columns':_0x30c9b4[_0x2d888e(0x103)],'reason':_0x8157f6?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':_0x2d888e(0x10f)}),{'table':_0x30c9b4[_0x2d888e(0xd2)],'alias':_0x30c9b4['alias'],'columns':_0x30c9b4[_0x2d888e(0x103)],'status':_0x2d888e(0xfe)};});return{'checked':_0x33240f[_0x16b85b(0x113)]>0x0,'joins':_0x33240f,'warnings':_0x2cfdee};}function a259_0x1928(_0x3dbbda,_0x5b1cd5){_0x3dbbda=_0x3dbbda-0xce;const _0x1846b7=a259_0x1846();let _0x192859=_0x1846b7[_0x3dbbda];return _0x192859;}function extractJoinFacts(_0x3f2fd7){const _0x1faf2c=a259_0x1928,_0x18f1e9=maskNestedQueries(stripSqlNoise(_0x3f2fd7)),_0x1e28f0=maskQuotedIdentifiers(_0x18f1e9),_0xec0f4b=[],_0x1d9989=new Set(),_0x4a42f0=/\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 _0x5f4187 of _0x18f1e9[_0x1faf2c(0xd3)](_0x4a42f0)){const _0xa12673=_0x5f4187[_0x1faf2c(0x111)]??0x0,_0x4f061e=_0x5f4187[0x0][_0x1faf2c(0xea)](/\bJOIN\b/i),_0x86bf5f=_0xa12673+Math[_0x1faf2c(0xe8)](0x0,_0x4f061e);if(!/^JOIN\b/i['test'](_0x1e28f0[_0x1faf2c(0xd5)](_0x86bf5f)))continue;_0x1d9989[_0x1faf2c(0xdb)](_0x86bf5f);const _0x1189dc=normalizeIdentifier(_0x5f4187[0x1]||_0x1faf2c(0xf6)),_0x49f227=normalizeIdentifier(_0x5f4187[0x2]??''),_0x1477fe=normalizeIdentifier(_0x5f4187[0x3]||_0x49f227[_0x1faf2c(0x10c)]('.')['at'](-0x1)||_0x49f227),_0x13f57b=[],_0x407a75=_0x49f227==='__sq__';let _0x2d30f0=_0x1189dc==='right'||_0x1189dc===_0x1faf2c(0xcf)||_0x407a75,_0x57b639=_0x2d30f0?_0x407a75?_0x1faf2c(0xf3):_0x1189dc[_0x1faf2c(0x112)]()+_0x1faf2c(0xf2):undefined;const _0x509e54=stripOuterParentheses(_0x5f4187[0x4]??''),_0x2f7674=_0x509e54[_0x1faf2c(0x10d)](MYBATIS_DYNAMIC_START_MARKER)||_0x509e54[_0x1faf2c(0x10d)](MYBATIS_DYNAMIC_END_MARKER),_0x50a7e8=_0x509e54['includes'](MYBATIS_INCLUDE_MARKER);_0x2f7674&&(_0x2d30f0=!![],_0x57b639??=_0x1faf2c(0xd6));_0x50a7e8&&(_0x2d30f0=!![],_0x57b639??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0x350aa5=_0x509e54[_0x1faf2c(0xec)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x1faf2c(0xec)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x1faf2c(0xec)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x350aa5,'OR')&&(_0x2d30f0=!![],_0x57b639??=_0x1faf2c(0xef));for(const _0x57f410 of splitTopLevelAnd(_0x350aa5)){const _0x409230=stripOuterParentheses(_0x57f410);if(hasTopLevelKeyword(_0x409230,'OR')){_0x2d30f0=!![],_0x57b639??=_0x1faf2c(0xef);continue;}const _0xb293b2=splitEquality(_0x409230);if(!_0xb293b2){containsColumnReference(_0x57f410,_0x1477fe)&&(_0x2d30f0=!![]);continue;}const _0x428823=parseDirectColumnReference(_0xb293b2[0x0],_0x1477fe),_0x2dd71d=parseDirectColumnReference(_0xb293b2[0x1],_0x1477fe),_0x7d163e=containsColumnReference(_0xb293b2[0x0],_0x1477fe),_0x133653=containsColumnReference(_0xb293b2[0x1],_0x1477fe),_0x468f39=_0x428823&&!_0x133653?_0x428823:_0x2dd71d&&!_0x7d163e?_0x2dd71d:null;if(_0x468f39&&!_0x13f57b[_0x1faf2c(0x10d)](_0x468f39))_0x13f57b[_0x1faf2c(0xf9)](_0x468f39);else!_0x468f39&&containsColumnReference(_0x57f410,_0x1477fe)&&(_0x2d30f0=!![]);}_0xec0f4b['push']({'table':_0x49f227,'alias':_0x1477fe,'columns':_0x13f57b,'unsupportedPredicate':_0x2d30f0,'unsupportedReason':_0x57b639,'containsUnresolvedInclude':_0x50a7e8,'position':_0x86bf5f});}for(const _0x133cc9 of _0x1e28f0[_0x1faf2c(0xd3)](/\bJOIN\b/gi)){const _0x905970=_0x133cc9[_0x1faf2c(0x111)]??0x0;if(_0x1d9989['has'](_0x905970))continue;const _0x370ce5=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x1faf2c(0xf0)](_0x18f1e9[_0x1faf2c(0xd5)](_0x905970+_0x133cc9[0x0][_0x1faf2c(0x113)])),_0x32a531=normalizeIdentifier(_0x370ce5?.[0x1]||'unknown'),_0x11d623=normalizeIdentifier(_0x370ce5?.[0x2]||''),_0x215b59=isSqlClauseKeyword(_0x11d623)?_0x32a531[_0x1faf2c(0x10c)]('.')['at'](-0x1)||_0x32a531:_0x11d623||_0x32a531[_0x1faf2c(0x10c)]('.')['at'](-0x1)||_0x32a531;_0xec0f4b[_0x1faf2c(0xf9)]({'table':_0x32a531,'alias':_0x215b59,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1faf2c(0xf8),'position':_0x905970});}const _0x118355=_0x1e28f0['indexOf'](MYBATIS_INCLUDE_MARKER);return _0x118355>=0x0&&!_0xec0f4b[_0x1faf2c(0x10a)](_0x4ea376=>_0x4ea376[_0x1faf2c(0xf1)])&&_0xec0f4b[_0x1faf2c(0xf9)]({'table':_0x1faf2c(0xfa),'alias':_0x1faf2c(0xfa),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','containsUnresolvedInclude':!![],'position':_0x118355}),_0xec0f4b[_0x1faf2c(0xe5)]((_0x15d8fd,_0x2aa84d)=>_0x15d8fd[_0x1faf2c(0xee)]-_0x2aa84d[_0x1faf2c(0xee)]);}function a259_0x1846(){const _0x32e595=['some','2233494QCxaRa','split','includes','\x5c$&','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','from','index','toUpperCase','length','8MjrtuI','alias','using','full','join','(?:^|[^\x5cw$])','table','matchAll','cross','slice','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','map','min','matchedPrefix','2563332veXlVF','add','85388Jqzcxs','test','5MvYnWD','reduce','natural','9933WkvXOL','66iqHCfI','unsupportedReason','inner','sort','indexes','has','max','trim','search','JOIN_INDEX_MISSING','replaceAll','error','position','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','exec','containsUnresolvedInclude','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','tableName','JOIN_PREDICATE_UNSUPPORTED','INNER','669228WKuaCc','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','push','unknown','replace','right','INDEX_METADATA_UNAVAILABLE','unavailable','warning','startsWith','__sq__','338082vIRVBd','columns','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','840EpSbMq','match','metadataAvailable','1130240scMppT','filter'];a259_0x1846=function(){return _0x32e595;};return a259_0x1846();}function stripSqlNoise(_0x4f550a){const _0x53b3a5=a259_0x1928,_0x12234b=Array[_0x53b3a5(0x110)](_0x4f550a),_0x110259=(_0x2f14ca,_0x26116f)=>{for(let _0x3090f2=_0x2f14ca;_0x3090f2<_0x26116f;_0x3090f2+=0x1){_0x12234b[_0x3090f2]!=='\x0a'&&_0x12234b[_0x3090f2]!=='\x0d'&&(_0x12234b[_0x3090f2]='\x20');}};for(let _0x33cab5=0x0;_0x33cab5<_0x12234b[_0x53b3a5(0x113)];_0x33cab5+=0x1){const _0x2a1a35=_0x12234b[_0x33cab5],_0x54d74b=_0x12234b[_0x33cab5+0x1];if(_0x2a1a35==='\x27'||_0x2a1a35==='\x22'||_0x2a1a35==='`'){const _0x9f072e=_0x2a1a35,_0x50914e=_0x33cab5;_0x33cab5+=0x1;while(_0x33cab5<_0x12234b[_0x53b3a5(0x113)]){if(_0x12234b[_0x33cab5]==='\x5c'&&_0x33cab5+0x1<_0x12234b[_0x53b3a5(0x113)]){_0x33cab5+=0x2;continue;}if(_0x12234b[_0x33cab5]!==_0x9f072e){_0x33cab5+=0x1;continue;}if(_0x12234b[_0x33cab5+0x1]===_0x9f072e){_0x33cab5+=0x2;continue;}break;}if(_0x9f072e==='\x27')_0x110259(_0x50914e,Math[_0x53b3a5(0xd8)](_0x33cab5+0x1,_0x12234b[_0x53b3a5(0x113)]));continue;}if(_0x2a1a35==='-'&&_0x54d74b==='-'){const _0x22ab24=_0x33cab5;while(_0x33cab5<_0x12234b['length']&&_0x12234b[_0x33cab5]!=='\x0a')_0x33cab5+=0x1;_0x110259(_0x22ab24,_0x33cab5);continue;}if(_0x2a1a35==='/'&&_0x54d74b==='*'){const _0x5d2002=_0x33cab5;_0x33cab5+=0x2;while(_0x33cab5<_0x12234b['length']&&!(_0x12234b[_0x33cab5]==='*'&&_0x12234b[_0x33cab5+0x1]==='/')){_0x33cab5+=0x1;}_0x33cab5=Math['min'](_0x33cab5+0x1,_0x12234b[_0x53b3a5(0x113)]-0x1),_0x110259(_0x5d2002,_0x33cab5+0x1);continue;}if(_0x2a1a35==='#'&&_0x54d74b!=='{'){const _0x2d2aff=_0x33cab5;while(_0x33cab5<_0x12234b[_0x53b3a5(0x113)]&&_0x12234b[_0x33cab5]!=='\x0a')_0x33cab5+=0x1;_0x110259(_0x2d2aff,_0x33cab5);continue;}if((_0x2a1a35==='#'||_0x2a1a35==='$')&&_0x54d74b==='{'){const _0x3149bf=_0x33cab5;_0x33cab5+=0x2;while(_0x33cab5<_0x12234b[_0x53b3a5(0x113)]&&_0x12234b[_0x33cab5]!=='}')_0x33cab5+=0x1;_0x110259(_0x3149bf,Math[_0x53b3a5(0xd8)](_0x33cab5+0x1,_0x12234b[_0x53b3a5(0x113)]));}}return _0x12234b[_0x53b3a5(0xd0)]('');}function maskQuotedIdentifiers(_0x195014){const _0x4e71dd=a259_0x1928,_0x37bd15=Array[_0x4e71dd(0x110)](_0x195014);for(let _0x1d2bed=0x0;_0x1d2bed<_0x37bd15[_0x4e71dd(0x113)];_0x1d2bed+=0x1){const _0x41ba51=_0x37bd15[_0x1d2bed];if(_0x41ba51!=='\x22'&&_0x41ba51!=='`')continue;_0x1d2bed+=0x1;while(_0x1d2bed<_0x37bd15[_0x4e71dd(0x113)]){if(_0x37bd15[_0x1d2bed]===_0x41ba51){if(_0x37bd15[_0x1d2bed+0x1]===_0x41ba51){_0x37bd15[_0x1d2bed]='\x20',_0x37bd15[_0x1d2bed+0x1]='\x20',_0x1d2bed+=0x2;continue;}break;}_0x37bd15[_0x1d2bed]='\x20',_0x1d2bed+=0x1;}}return _0x37bd15[_0x4e71dd(0xd0)]('');}function maskNestedQueries(_0x14efa1){const _0x4f9de9=a259_0x1928,_0x33bdd9=Array['from'](_0x14efa1);for(let _0x2f9fc2=0x0;_0x2f9fc2<_0x33bdd9[_0x4f9de9(0x113)];_0x2f9fc2+=0x1){if(_0x33bdd9[_0x2f9fc2]!=='(')continue;const _0x417d69=_0x14efa1['slice'](_0x2f9fc2+0x1);if(!/^\s*(?:SELECT|WITH)\b/i['test'](_0x417d69))continue;let _0x3a7502=0x1,_0x12c407=_0x2f9fc2+0x1;for(;_0x12c407<_0x33bdd9[_0x4f9de9(0x113)]&&_0x3a7502>0x0;_0x12c407+=0x1){if(_0x33bdd9[_0x12c407]==='(')_0x3a7502+=0x1;if(_0x33bdd9[_0x12c407]===')')_0x3a7502-=0x1;}if(_0x3a7502!==0x0)continue;for(let _0x1ce98c=_0x2f9fc2;_0x1ce98c<_0x12c407;_0x1ce98c+=0x1){_0x33bdd9[_0x1ce98c]='\x20';}const _0x3b9e36=_0x4f9de9(0x101);for(let _0x53205c=0x0;_0x53205c<_0x3b9e36[_0x4f9de9(0x113)]&&_0x2f9fc2+_0x53205c<_0x12c407;_0x53205c+=0x1){_0x33bdd9[_0x2f9fc2+_0x53205c]=_0x3b9e36[_0x53205c];}_0x2f9fc2=_0x12c407-0x1;}return _0x33bdd9[_0x4f9de9(0xd0)]('');}function splitTopLevelAnd(_0x2a7c0a){const _0x52b66a=a259_0x1928,_0x3e31ea=[];let _0x59198a=0x0,_0x39167c=0x0;for(let _0x45dd16=0x0;_0x45dd16<_0x2a7c0a[_0x52b66a(0x113)];_0x45dd16+=0x1){const _0x4c0ab9=_0x2a7c0a[_0x45dd16];if(_0x4c0ab9==='(')_0x59198a+=0x1;if(_0x4c0ab9===')')_0x59198a=Math[_0x52b66a(0xe8)](0x0,_0x59198a-0x1);_0x59198a===0x0&&_0x2a7c0a[_0x52b66a(0xd5)](_0x45dd16)[_0x52b66a(0x106)](/^AND\b/i)&&(_0x45dd16===0x0||/\s/['test'](_0x2a7c0a[_0x45dd16-0x1]??''))&&(_0x3e31ea[_0x52b66a(0xf9)](_0x2a7c0a['slice'](_0x39167c,_0x45dd16)['trim']()),_0x45dd16+=0x2,_0x39167c=_0x45dd16+0x1);}const _0x558537=_0x2a7c0a[_0x52b66a(0xd5)](_0x39167c)['trim']();if(_0x558537)_0x3e31ea['push'](_0x558537);return _0x3e31ea;}function hasTopLevelKeyword(_0x3d7721,_0x4c3685){const _0x42ba0f=a259_0x1928;let _0x421e95=0x0;for(let _0x3fac7c=0x0;_0x3fac7c<_0x3d7721[_0x42ba0f(0x113)];_0x3fac7c+=0x1){const _0x2bf066=_0x3d7721[_0x3fac7c];if(_0x2bf066==='(')_0x421e95+=0x1;if(_0x2bf066===')')_0x421e95=Math[_0x42ba0f(0xe8)](0x0,_0x421e95-0x1);if(_0x421e95!==0x0)continue;const _0x5488c2=_0x3d7721['slice'](_0x3fac7c,_0x3fac7c+_0x4c3685[_0x42ba0f(0x113)]),_0x4665b9=_0x3d7721[_0x3fac7c-0x1]??'\x20',_0x52569d=_0x3d7721[_0x3fac7c+_0x4c3685['length']]??'\x20';if(_0x5488c2[_0x42ba0f(0x112)]()===_0x4c3685['toUpperCase']()&&!/[\w$]/[_0x42ba0f(0xdd)](_0x4665b9)&&!/[\w$]/[_0x42ba0f(0xdd)](_0x52569d))return!![];}return![];}function splitEquality(_0x32eea9){const _0x3dc6b5=a259_0x1928,_0x6b1fe7=stripOuterParentheses(_0x32eea9);let _0xd006b=0x0,_0x2bed1d;for(let _0x5a61bd=0x0;_0x5a61bd<_0x6b1fe7[_0x3dc6b5(0x113)];_0x5a61bd+=0x1){const _0xb0fff7=_0x6b1fe7[_0x5a61bd];if(_0xb0fff7==='(')_0xd006b+=0x1;if(_0xb0fff7===')')_0xd006b=Math[_0x3dc6b5(0xe8)](0x0,_0xd006b-0x1);const _0x59120d=_0x6b1fe7[_0x5a61bd-0x1]??'',_0x46ed28=_0x6b1fe7[_0x5a61bd+0x1]??'';if(_0xb0fff7==='='&&_0xd006b===0x0&&!/[!<>=:]/[_0x3dc6b5(0xdd)](_0x59120d)&&_0x46ed28!=='='){if(_0x2bed1d!==undefined)return null;_0x2bed1d=_0x5a61bd;}}return _0x2bed1d===undefined?null:[_0x6b1fe7[_0x3dc6b5(0xd5)](0x0,_0x2bed1d)[_0x3dc6b5(0xe9)](),_0x6b1fe7[_0x3dc6b5(0xd5)](_0x2bed1d+0x1)[_0x3dc6b5(0xe9)]()];}function parseDirectColumnReference(_0x197ebd,_0x3e9b23){const _0x2f918c=a259_0x1928,_0xa8524a=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x2f918c(0xf0)](stripOuterParentheses(_0x197ebd));if(!_0xa8524a)return null;if(normalizeIdentifier(_0xa8524a[0x1]??'')!==normalizeIdentifier(_0x3e9b23))return null;return normalizeIdentifier(_0xa8524a[0x2]??'');}function containsColumnReference(_0x15ff9e,_0xa3fddd){const _0x56b770=a259_0x1928,_0x6af746=_0x15ff9e[_0x56b770(0xfb)](/[`"]/g,''),_0x4fb5e5=_0xa3fddd[_0x56b770(0xfb)](/[.*+?^${}()|[\]\\]/g,_0x56b770(0x10e));return new RegExp(_0x56b770(0xd1)+_0x4fb5e5+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x56b770(0xdd)](_0x6af746);}function findEqualityPrefix(_0xf88382,_0xbebdb2){const _0x4ad86c=a259_0x1928,_0x242647=new Set(_0xbebdb2[_0x4ad86c(0xd7)](normalizeIdentifier)),_0x37ae7f=[];for(const _0x58f0ab of _0xf88382){if(!_0x242647[_0x4ad86c(0xe7)](normalizeIdentifier(_0x58f0ab)))break;_0x37ae7f['push'](_0x58f0ab);}return _0x37ae7f;}function resolveTableMetadata(_0x55fef5,_0x42eb56){const _0x135fec=a259_0x1928,_0xc48b50=normalizeIdentifier(_0x42eb56),_0x9a6de2=_0x55fef5[_0x135fec(0x109)](_0x127b5a=>normalizeIdentifier(_0x127b5a['tableName'])===_0xc48b50);if(_0x9a6de2[_0x135fec(0x113)]===0x1)return _0x9a6de2[0x0];const _0x1719ca=_0xc48b50['includes']('.'),_0xde8b93=_0xc48b50[_0x135fec(0x10c)]('.')['at'](-0x1),_0x222872=_0x55fef5[_0x135fec(0x109)](_0x524b37=>{const _0x5ce88c=_0x135fec,_0x3eeb6e=normalizeIdentifier(_0x524b37[_0x5ce88c(0xf4)]);if(_0x1719ca&&_0x3eeb6e[_0x5ce88c(0x10d)]('.'))return![];return _0x3eeb6e[_0x5ce88c(0x10c)]('.')['at'](-0x1)===_0xde8b93;});return _0x222872[_0x135fec(0x113)]===0x1?_0x222872[0x0]:undefined;}function columnNamesMatch(_0x572537,_0xa560b7){return normalizeIdentifier(_0x572537)===normalizeIdentifier(_0xa560b7);}function normalizeIdentifier(_0x2b57ba){const _0x5b07ba=a259_0x1928;return _0x2b57ba[_0x5b07ba(0xfb)](/[`"]/g,'')[_0x5b07ba(0xe9)]()['toLowerCase']();}function isSqlClauseKeyword(_0x34b9bb){const _0x3188fb=a259_0x1928;return new Set(['on',_0x3188fb(0xce),'where',_0x3188fb(0xd0),_0x3188fb(0xe4),'left',_0x3188fb(0xfc),'full',_0x3188fb(0xd4),_0x3188fb(0xe0)])[_0x3188fb(0xe7)](_0x34b9bb);}function stripOuterParentheses(_0x243243){const _0x134ca0=a259_0x1928;let _0x30d7b2=_0x243243['trim']();while(_0x30d7b2[_0x134ca0(0x100)]('(')&&_0x30d7b2['endsWith'](')')){let _0x5b8964=0x0,_0x5a1321=!![];for(let _0x2df437=0x0;_0x2df437<_0x30d7b2[_0x134ca0(0x113)];_0x2df437+=0x1){if(_0x30d7b2[_0x2df437]==='(')_0x5b8964+=0x1;if(_0x30d7b2[_0x2df437]===')')_0x5b8964-=0x1;if(_0x5b8964===0x0&&_0x2df437<_0x30d7b2['length']-0x1){_0x5a1321=![];break;}}if(!_0x5a1321||_0x5b8964!==0x0)break;_0x30d7b2=_0x30d7b2['slice'](0x1,-0x1)[_0x134ca0(0xe9)]();}return _0x30d7b2;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a260_0x133c1c=a260_0x2760;(function(_0x36e2e,_0x48fc95){const _0x2fb52d=a260_0x2760,_0x5b8db9=_0x36e2e();while(!![]){try{const _0x354f6f=parseInt(_0x2fb52d(0x18c))/0x1*(parseInt(_0x2fb52d(0x187))/0x2)+parseInt(_0x2fb52d(0x191))/0x3*(parseInt(_0x2fb52d(0x186))/0x4)+parseInt(_0x2fb52d(0x18d))/0x5+parseInt(_0x2fb52d(0x190))/0x6+-parseInt(_0x2fb52d(0x18b))/0x7+parseInt(_0x2fb52d(0x188))/0x8+-parseInt(_0x2fb52d(0x18a))/0x9;if(_0x354f6f===_0x48fc95)break;else _0x5b8db9['push'](_0x5b8db9['shift']());}catch(_0x5122b1){_0x5b8db9['push'](_0x5b8db9['shift']());}}}(a260_0x34b2,0x5062f));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a260_0x34b2(){const _0x37cf39=['268SYOsLj','1778420ELFNlG','.rabetbase','/sql','2802966GoijjX','7548hkDRxU','444vITwvv','2686TTUtpv','1860624lKHamf','sql-trash','12077613baDFpt','163821EtZZpo'];a260_0x34b2=function(){return _0x37cf39;};return a260_0x34b2();}function a260_0x2760(_0x281063,_0x1580d9){_0x281063=_0x281063-0x186;const _0x34b21c=a260_0x34b2();let _0x2760ae=_0x34b21c[_0x281063];return _0x2760ae;}const DOT_DIR=a260_0x133c1c(0x18e),LOCK_FILE_NAME='sql.lock.json',TRASH_DIR_NAME=a260_0x133c1c(0x189);export function loadSqlProjectConfig(_0x2d6654,_0x37ffc6){const _0x56e3d2=a260_0x133c1c,_0x235793=resolve(_0x37ffc6??findProjectRootDirectory()),_0x53aaca=DOT_DIR+_0x56e3d2(0x18f),_0x289541=_0x53aaca+'/'+_0x2d6654;return{'projectRoot':_0x235793,'appCode':_0x2d6654,'sqlWorkspaceRoot':_0x53aaca,'sqlRoot':_0x289541,'sqlRootDir':resolve(_0x235793,DOT_DIR,'sql',_0x2d6654),'lockFilePath':resolve(_0x235793,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x235793,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c5f85,_0x491bd0){const _0xa4663e=a261_0x38a9,_0x3b8f2d=_0x2c5f85();while(!![]){try{const _0x1b5b25=-parseInt(_0xa4663e(0x119))/0x1*(-parseInt(_0xa4663e(0x113))/0x2)+parseInt(_0xa4663e(0x11f))/0x3+-parseInt(_0xa4663e(0x114))/0x4*(-parseInt(_0xa4663e(0x115))/0x5)+-parseInt(_0xa4663e(0x116))/0x6*(-parseInt(_0xa4663e(0x110))/0x7)+-parseInt(_0xa4663e(0x118))/0x8+parseInt(_0xa4663e(0x11a))/0x9*(-parseInt(_0xa4663e(0x10a))/0xa)+parseInt(_0xa4663e(0x108))/0xb*(parseInt(_0xa4663e(0xff))/0xc);if(_0x1b5b25===_0x491bd0)break;else _0x3b8f2d['push'](_0x3b8f2d['shift']());}catch(_0x281311){_0x3b8f2d['push'](_0x3b8f2d['shift']());}}}(a261_0xad20,0x3b493));function a261_0x38a9(_0xa99312,_0x385d7f){_0xa99312=_0xa99312-0xff;const _0xad2059=a261_0xad20();let _0x38a9cb=_0xad2059[_0xa99312];return _0x38a9cb;}import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function a261_0xad20(){const _0x146a1f=['slice','isFile','.sql','code','778272ihtgYF','278760SFnwJU','toLowerCase','test','dbName','ENOENT','length','.xml','filter','sqlCode','55APlhFA','sql','1030qtoaYD','dbId','sqlName','mode','sqlRootDir','indexOf','357987gLvYCc','push','name','39662BkSJbY','4DgNhXj','107110bCYTQl','6MHHZrN','isDirectory','3305640zeyGyb','14RBxLYy','6093tHGdhl'];a261_0xad20=function(){return _0x146a1f;};return a261_0xad20();}function extensionToMode(_0x3a251c){const _0x3a02cc=a261_0x38a9;if(_0x3a251c===_0x3a02cc(0x11d))return _0x3a02cc(0x109);if(_0x3a251c===_0x3a02cc(0x105))return'mybatisXml';return undefined;}async function scanSqlFilesRecursively(_0x36fe47,_0x18c5a3){const _0x547cd1=a261_0x38a9,_0x410569=[];try{const _0x598e89=await readdir(_0x36fe47,{'withFileTypes':!![]});for(const _0xf2c523 of _0x598e89){const _0x45aca0=join(_0x36fe47,_0xf2c523[_0x547cd1(0x112)]);if(_0xf2c523[_0x547cd1(0x117)]()){_0x410569['push'](...await scanSqlFilesRecursively(_0x45aca0,_0x18c5a3));continue;}if(!_0xf2c523[_0x547cd1(0x11c)]())continue;const _0x101b4e=extname(_0xf2c523[_0x547cd1(0x112)])[_0x547cd1(0x100)](),_0x443e25=extensionToMode(_0x101b4e);if(!_0x443e25)continue;const _0x374bda=relative(_0x18c5a3,_0x45aca0)['replace'](/\\/g,'/'),_0x5a0171=_0x374bda['split']('/')[_0x547cd1(0x106)](Boolean),_0x54caa3=parseSqlPath(_0x5a0171,_0xf2c523[_0x547cd1(0x112)],_0x101b4e);if(!_0x54caa3)continue;_0x410569[_0x547cd1(0x111)]({'sqlCode':_0x54caa3[_0x547cd1(0x107)],'sqlName':_0x54caa3[_0x547cd1(0x10c)],'dbDirectory':_0x5a0171[0x0],'filePath':_0x45aca0,'relativePath':_0x374bda,'lockKey':_0x54caa3[_0x547cd1(0x107)],'mode':_0x443e25});}}catch(_0x2a18e3){if(_0x2a18e3[_0x547cd1(0x11e)]!==_0x547cd1(0x103))throw _0x2a18e3;}return _0x410569;}export async function scanLocalSqlQueries(_0x214d2a){const _0x297cf3=a261_0x38a9;return scanSqlFilesRecursively(_0x214d2a['sqlRootDir'],_0x214d2a[_0x297cf3(0x10e)]);}export function resolveLocalSqlFilePath(_0x511590,_0x14c52f,_0x1270b9){const _0x2f1e70=a261_0x38a9,_0x296160=_0x1270b9?.['path']||(_0x1270b9?.['sqlName']||_0x1270b9?.[_0x2f1e70(0x102)]?buildSqlRelativePath(_0x14c52f,_0x1270b9?.[_0x2f1e70(0x10c)],_0x1270b9?.[_0x2f1e70(0x102)],_0x1270b9?.[_0x2f1e70(0x10d)]||_0x2f1e70(0x109),_0x1270b9?.[_0x2f1e70(0x10b)]):buildDefaultSqlFileName(_0x14c52f,_0x1270b9?.[_0x2f1e70(0x10d)]||_0x2f1e70(0x109)));return join(_0x511590[_0x2f1e70(0x10e)],_0x296160);}export async function directoryExists(_0x1fb873){const _0x325b5e=a261_0x38a9;try{const _0x386b32=await stat(_0x1fb873);return _0x386b32[_0x325b5e(0x117)]();}catch{return![];}}function parseSqlPath(_0x5d4bba,_0x4a530a,_0x34897b){const _0x147d87=a261_0x38a9,_0x4f25a7=_0x4a530a['slice'](0x0,-_0x34897b[_0x147d87(0x104)]);if(_0x5d4bba[_0x147d87(0x104)]<0x2)return null;const _0x13656a=_0x4f25a7[_0x147d87(0x10f)]('_');if(_0x13656a<=0x0||_0x13656a>=_0x4f25a7['length']-0x1)return null;const _0x107aae=_0x4f25a7[_0x147d87(0x11b)](0x0,_0x13656a);if(!isLikelySqlCode(_0x107aae))return null;return{'sqlCode':_0x107aae,'sqlName':_0x4f25a7[_0x147d87(0x11b)](_0x13656a+0x1)};}function isLikelySqlCode(_0x70968){const _0xadc059=a261_0x38a9;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0xadc059(0x101)](_0x70968);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a262_0x3495(_0x1fa0f3,_0x10fd96){_0x1fa0f3=_0x1fa0f3-0x115;const _0x5e978b=a262_0x5e97();let _0x349505=_0x5e978b[_0x1fa0f3];return _0x349505;}(function(_0x1bb45d,_0x10a49d){const _0xbf6463=a262_0x3495,_0xb2c3c7=_0x1bb45d();while(!![]){try{const _0xc3a5c2=parseInt(_0xbf6463(0x11f))/0x1+-parseInt(_0xbf6463(0x119))/0x2+-parseInt(_0xbf6463(0x11d))/0x3+-parseInt(_0xbf6463(0x121))/0x4+parseInt(_0xbf6463(0x11c))/0x5*(parseInt(_0xbf6463(0x116))/0x6)+parseInt(_0xbf6463(0x122))/0x7*(-parseInt(_0xbf6463(0x118))/0x8)+parseInt(_0xbf6463(0x117))/0x9;if(_0xc3a5c2===_0x10a49d)break;else _0xb2c3c7['push'](_0xb2c3c7['shift']());}catch(_0x5aedf3){_0xb2c3c7['push'](_0xb2c3c7['shift']());}}}(a262_0x5e97,0xa3b93));function a262_0x5e97(){const _0x5e75aa=['243866jImOSB','digest','update','268095YuIbks','2352645VvTcOe','md5','377963WuzJUe','hex','240864TiAwWc','7HOIQpB','utf8','66XRNbMh','10672569TnRbpP','4133104dbMGIL'];a262_0x5e97=function(){return _0x5e75aa;};return a262_0x5e97();}import{readFile}from'node:fs/promises';import a262_0x5e922e from'node:crypto';export function computeSqlContentHash(_0x555392){const _0x16e100=a262_0x3495;return a262_0x5e922e['createHash'](_0x16e100(0x11e))[_0x16e100(0x11b)](_0x555392)[_0x16e100(0x11a)](_0x16e100(0x120));}export async function computeSqlFileHash(_0x2a9a77){const _0x315a50=a262_0x3495,_0x52e882=await readFile(_0x2a9a77,_0x315a50(0x115));return computeSqlContentHash(_0x52e882);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x17c640,_0x496d84){const _0x4b668e=a263_0x53a9,_0x5bfcc6=_0x17c640();while(!![]){try{const _0x4fa952=-parseInt(_0x4b668e(0x6a))/0x1+parseInt(_0x4b668e(0x76))/0x2+-parseInt(_0x4b668e(0x75))/0x3+parseInt(_0x4b668e(0x73))/0x4+parseInt(_0x4b668e(0x6e))/0x5+parseInt(_0x4b668e(0x71))/0x6+parseInt(_0x4b668e(0x70))/0x7*(-parseInt(_0x4b668e(0x6c))/0x8);if(_0x4fa952===_0x496d84)break;else _0x5bfcc6['push'](_0x5bfcc6['shift']());}catch(_0x4661da){_0x5bfcc6['push'](_0x5bfcc6['shift']());}}}(a263_0x4b75,0x9422c));function a263_0x4b75(){const _0x34f8b2=[':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','437882bmUyNd','utf8','1711592KVfVlr','\x22.\x20','263505KysAwx','apps','35TGiabJ','7138008EzbGEG','sqls','3666056fmYJgK','sqlRoot','2961360BaXocy','1885256TxsBaG','lastSync'];a263_0x4b75=function(){return _0x34f8b2;};return a263_0x4b75();}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a263_0x53a9(_0x3df2c0,_0x5a1304){_0x3df2c0=_0x3df2c0-0x68;const _0x4b75cd=a263_0x4b75();let _0x53a92e=_0x4b75cd[_0x3df2c0];return _0x53a92e;}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x5c311f,_0x1b72e7,_0xd94930,_0xf863a){const _0x2a74a0=a263_0x53a9,_0x317bec=_0x5c311f??createEmptySqlLock();let _0x246ccd=_0x317bec[_0x2a74a0(0x6f)][_0x1b72e7];if(!_0x246ccd)return _0x246ccd={'sqlRoot':_0xd94930,'lastSync':'','sqls':{}},_0x317bec['apps'][_0x1b72e7]=_0x246ccd,{'lockData':_0x317bec,'appLock':_0x246ccd};if(!_0x246ccd[_0x2a74a0(0x74)])_0x246ccd[_0x2a74a0(0x74)]=_0xd94930;else{if(_0x246ccd[_0x2a74a0(0x74)]!==_0xd94930)throw new Error(_0xf863a+_0x2a74a0(0x69)+_0xd94930+'\x22\x20vs\x20lock\x20\x22'+_0x246ccd[_0x2a74a0(0x74)]+_0x2a74a0(0x6d)+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x246ccd[_0x2a74a0(0x72)]&&(_0x246ccd[_0x2a74a0(0x72)]={}),!_0x246ccd[_0x2a74a0(0x68)]&&(_0x246ccd['lastSync']=''),{'lockData':_0x317bec,'appLock':_0x246ccd};}export async function readSqlLockFile(_0x1a788c){try{const _0x216073=await readFile(_0x1a788c,'utf8');return JSON['parse'](_0x216073);}catch(_0x22b9fc){if(_0x22b9fc['code']==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x22b9fc));}}export async function writeSqlLockFile(_0xc3efcd,_0x305828){const _0xa6876a=a263_0x53a9;await mkdir(dirname(_0xc3efcd),{'recursive':!![]}),await writeFile(_0xc3efcd,JSON['stringify'](_0x305828,null,0x2),_0xa6876a(0x6b));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a265_0x4957(_0x2e96bb,_0x365987){_0x2e96bb=_0x2e96bb-0x1b6;const _0x5b7333=a265_0x5b73();let _0x495725=_0x5b7333[_0x2e96bb];return _0x495725;}(function(_0x5debaf,_0x2641ce){const _0x7721d4=a265_0x4957,_0xd9fe4d=_0x5debaf();while(!![]){try{const _0x746bd1=parseInt(_0x7721d4(0x1c6))/0x1*(parseInt(_0x7721d4(0x1c8))/0x2)+parseInt(_0x7721d4(0x1c1))/0x3*(parseInt(_0x7721d4(0x1b6))/0x4)+parseInt(_0x7721d4(0x1bb))/0x5*(-parseInt(_0x7721d4(0x1b8))/0x6)+-parseInt(_0x7721d4(0x1bd))/0x7*(-parseInt(_0x7721d4(0x1c4))/0x8)+-parseInt(_0x7721d4(0x1c7))/0x9*(parseInt(_0x7721d4(0x1c5))/0xa)+parseInt(_0x7721d4(0x1c0))/0xb*(-parseInt(_0x7721d4(0x1b7))/0xc)+parseInt(_0x7721d4(0x1be))/0xd*(-parseInt(_0x7721d4(0x1cb))/0xe);if(_0x746bd1===_0x2641ce)break;else _0xd9fe4d['push'](_0xd9fe4d['shift']());}catch(_0x18ff01){_0xd9fe4d['push'](_0xd9fe4d['shift']());}}}(a265_0x5b73,0xd4bac));export function detectSqlMode(_0x5c82d2){const _0x1cd225=a265_0x4957,_0x432d2a=_0x5c82d2['trimStart']();if(/^<(select|insert|update|delete)\b/i['test'](_0x432d2a))return _0x1cd225(0x1bf);return _0x1cd225(0x1ba);}export function getSqlFileExtension(_0x5c3556){const _0x1525fb=a265_0x4957;return _0x5c3556===_0x1525fb(0x1bf)?_0x1525fb(0x1c3):'.sql';}export function buildDefaultSqlFileName(_0xa425f2,_0x11545f){return''+_0xa425f2+getSqlFileExtension(_0x11545f);}export function sanitizeSqlPathSegment(_0x26a2a3,_0x201a74){const _0x440195=a265_0x4957,_0xac567d=String(_0x26a2a3??'')[_0x440195(0x1ca)](),_0x22e386=_0xac567d[_0x440195(0x1b9)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x440195(0x1b9)](/\s+/g,'-')[_0x440195(0x1b9)](/-+/g,'-')[_0x440195(0x1b9)](/^\.+/,'')[_0x440195(0x1b9)](/\.+$/,'')[_0x440195(0x1b9)](/^-+/,'')[_0x440195(0x1b9)](/-+$/,'');return _0x22e386||_0x201a74;}export function buildDbDirectoryName(_0x58622c,_0x543953){const _0x4dd675=a265_0x4957;return sanitizeSqlPathSegment(_0x58622c,_0x543953!=null?_0x4dd675(0x1c2)+_0x543953:_0x4dd675(0x1c9));}export function buildSqlRelativePath(_0x29609c,_0x3f285d,_0x5bb539,_0x2fb643,_0x1fa599){const _0x170bf6=a265_0x4957,_0x46d00a=buildDbDirectoryName(_0x5bb539,_0x1fa599),_0x37a5f3=sanitizeSqlPathSegment(_0x29609c,_0x170bf6(0x1bc)),_0x74fcda=sanitizeSqlPathSegment(_0x3f285d,_0x37a5f3);return _0x46d00a+'/'+_0x37a5f3+'_'+_0x74fcda+getSqlFileExtension(_0x2fb643);}function a265_0x5b73(){const _0x56da19=['sql','10doRnfD','unknown-sql','272461fJyPFz','117guHMDm','mybatisXml','426151abTDxF','3HVcNwt','db-','.xml','216wXAQuF','85930oVhhJW','9WWHaXP','1503JjNNyR','138318ByjFyS','unknown-db','trim','495894xzjpXm','5179084RcLeop','12OLFGQd','912666AWkxEQ','replace'];a265_0x5b73=function(){return _0x56da19;};return a265_0x5b73();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a268_0x3365(_0x47ece1,_0xe22fe4){_0x47ece1=_0x47ece1-0x134;const _0x9e00da=a268_0x9e00();let _0x3365d7=_0x9e00da[_0x47ece1];return _0x3365d7;}const a268_0x41b5cb=a268_0x3365;(function(_0x4a4d5c,_0x249c4b){const _0x37baa9=a268_0x3365,_0x4797ab=_0x4a4d5c();while(!![]){try{const _0x1aed81=-parseInt(_0x37baa9(0x164))/0x1+-parseInt(_0x37baa9(0x184))/0x2+-parseInt(_0x37baa9(0x195))/0x3*(-parseInt(_0x37baa9(0x192))/0x4)+-parseInt(_0x37baa9(0x190))/0x5*(-parseInt(_0x37baa9(0x18a))/0x6)+-parseInt(_0x37baa9(0x18d))/0x7+parseInt(_0x37baa9(0x17d))/0x8+-parseInt(_0x37baa9(0x13e))/0x9*(-parseInt(_0x37baa9(0x193))/0xa);if(_0x1aed81===_0x249c4b)break;else _0x4797ab['push'](_0x4797ab['shift']());}catch(_0x3acd41){_0x4797ab['push'](_0x4797ab['shift']());}}}(a268_0x9e00,0xe71ba));const MYBATIS_OUTER_TAGS=new Map([[a268_0x41b5cb(0x14b),a268_0x41b5cb(0x147)],[a268_0x41b5cb(0x135),a268_0x41b5cb(0x152)],['update','UPDATE'],[a268_0x41b5cb(0x145),a268_0x41b5cb(0x181)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a268_0x41b5cb(0x196),a268_0x41b5cb(0x17e),'choose',a268_0x41b5cb(0x191),'otherwise','trim',a268_0x41b5cb(0x14e),'bind',a268_0x41b5cb(0x139),a268_0x41b5cb(0x157)]),MYBATIS_BRANCH_TAGS=new Set(['if',a268_0x41b5cb(0x17e),a268_0x41b5cb(0x134),a268_0x41b5cb(0x191),a268_0x41b5cb(0x14c)]);export const MYBATIS_DYNAMIC_START_MARKER='__RABETBASE_MYBATIS_DYNAMIC_START__';export const MYBATIS_DYNAMIC_END_MARKER='__RABETBASE_MYBATIS_DYNAMIC_END__';export const MYBATIS_INCLUDE_MARKER=a268_0x41b5cb(0x167);const UNRESOLVED_SQL_FRAGMENT=a268_0x41b5cb(0x166),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a268_0x41b5cb(0x169)+[...MYBATIS_OUTER_TAGS[a268_0x41b5cb(0x151)]()][a268_0x41b5cb(0x16c)]('|')+')\x5cb','i');export function normalizeSqlForStaticAnalysis(_0x34f787){const _0x51a476=a268_0x41b5cb,_0x43a25c=typeof _0x34f787===_0x51a476(0x159)?_0x34f787:'';if(!startsWithMybatisStatementWrapper(_0x43a25c))return{'sql':_0x43a25c,'mode':'sql'};let _0x9cb0c1=0x0,_0x35ddc9='',_0x5840bb,_0x232ce3=![],_0x590ee3=![];const _0x6d2f80=[];while(_0x9cb0c1<_0x43a25c[_0x51a476(0x176)]){if(_0x43a25c[_0x51a476(0x13d)](_0x51a476(0x16e),_0x9cb0c1)){const _0x9d9d45=_0x43a25c[_0x51a476(0x161)]('-->',_0x9cb0c1+0x4);if(_0x9d9d45<0x0)return invalidMybatisSource('Unterminated\x20XML\x20comment.');_0x35ddc9+='\x20',_0x9cb0c1=_0x9d9d45+0x3;continue;}if(_0x43a25c['startsWith']('<,_0x9cb0c1+0x9);if(_0x317441<0x0)return invalidMybatisSource(_0x51a476(0x140));_0x35ddc9+=_0x43a25c[_0x51a476(0x13c)](_0x9cb0c1+0x9,_0x317441),_0x9cb0c1=_0x317441+0x3;continue;}if(_0x43a25c[_0x51a476(0x13d)]('<?',_0x9cb0c1)){if(_0x232ce3)return invalidMybatisSource(_0x51a476(0x174));const _0x5a4b50=_0x43a25c[_0x51a476(0x161)]('?>',_0x9cb0c1+0x2);if(_0x5a4b50<0x0)return invalidMybatisSource(_0x51a476(0x15e));_0x35ddc9+='\x20',_0x9cb0c1=_0x5a4b50+0x2;continue;}if(_0x43a25c[_0x9cb0c1]!=='<'){const _0x397662=_0x43a25c[_0x51a476(0x161)]('<',_0x9cb0c1),_0x29adf8=_0x397662<0x0?_0x43a25c[_0x51a476(0x176)]:_0x397662,_0x512bad=_0x43a25c[_0x51a476(0x13c)](_0x9cb0c1,_0x29adf8);if((!_0x232ce3||_0x590ee3)&&_0x512bad[_0x51a476(0x13f)]())return invalidMybatisSource(_0x51a476(0x17a));if(_0x232ce3&&!_0x590ee3){const _0x39a731=decodeXmlEntities(_0x512bad);if(_0x39a731===null)return invalidMybatisSource(_0x51a476(0x189));_0x35ddc9+=_0x39a731;}else _0x35ddc9+='\x20';_0x9cb0c1=_0x29adf8;continue;}const _0x4e0105=findXmlTagEnd(_0x43a25c,_0x9cb0c1);if(_0x4e0105<0x0)return invalidMybatisSource(_0x51a476(0x178));const _0x18dd16=_0x43a25c[_0x51a476(0x13c)](_0x9cb0c1,_0x4e0105+0x1),_0x2d47ee=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x51a476(0x188)](_0x18dd16);if(!_0x2d47ee)return invalidMybatisSource(_0x51a476(0x154));const _0x2c395a=_0x2d47ee[0x1]==='/',_0x57223b=_0x2d47ee[0x2]??'',_0x104e0b=_0x57223b[_0x51a476(0x18c)](),_0x4be39e=_0x2d47ee[0x3]??'',_0xff8be4=_0x2d47ee[0x4]==='/',_0x381020=MYBATIS_OUTER_TAGS[_0x51a476(0x179)](_0x104e0b);if(!_0x381020&&!MYBATIS_DYNAMIC_TAGS[_0x51a476(0x15d)](_0x104e0b))return invalidMybatisSource(_0x51a476(0x16b)+_0x104e0b+'>.');if(!_0x381020&&_0x57223b!==_0x104e0b)return invalidMybatisSource(_0x51a476(0x14d)+_0x57223b+'>.');if(_0x2c395a){if(_0x4be39e[_0x51a476(0x13f)]()||_0xff8be4)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x57223b+'>.');const _0x526579=_0x6d2f80['at'](-0x1);if(!_0x526579||(_0x526579[_0x51a476(0x15b)]?_0x526579[_0x51a476(0x17b)]!==_0x104e0b:_0x526579['rawName']!==_0x57223b))return invalidMybatisSource(_0x51a476(0x158)+_0x57223b+'>.');_0x6d2f80[_0x51a476(0x163)]();if(_0x526579[_0x51a476(0x15b)])_0x590ee3=!![];_0x35ddc9+=MYBATIS_BRANCH_TAGS[_0x51a476(0x15d)](_0x104e0b)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x4be39e))return invalidMybatisSource(_0x51a476(0x173)+_0x57223b+'>.');if(_0x104e0b==='property'&&(!_0xff8be4||_0x6d2f80['at'](-0x1)?.[_0x51a476(0x17b)]!=='include'))return invalidMybatisSource('MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.');if(_0x381020){if(_0x232ce3||_0x6d2f80[_0x51a476(0x176)]>0x0)return invalidMybatisSource('Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.');_0x232ce3=!![],_0x590ee3=_0xff8be4,_0x5840bb=_0x381020;}else{if(!_0x232ce3||_0x590ee3)return invalidMybatisSource(_0x51a476(0x18f)+_0x57223b+'>.');}_0x35ddc9+=_0x104e0b===_0x51a476(0x196)?_0x51a476(0x17c):_0x104e0b===_0x51a476(0x14e)?_0x51a476(0x148):_0x104e0b===_0x51a476(0x139)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x51a476(0x15d)](_0x104e0b)&&!_0xff8be4?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0xff8be4&&_0x6d2f80[_0x51a476(0x149)]({'rawName':_0x57223b,'tagName':_0x104e0b,'outer':!!_0x381020});}_0x9cb0c1=_0x4e0105+0x1;}if(_0x6d2f80[_0x51a476(0x176)]>0x0)return invalidMybatisSource(_0x51a476(0x16f)+_0x6d2f80['at'](-0x1)?.[_0x51a476(0x15c)]+'>.');if(!_0x232ce3||!_0x590ee3)return invalidMybatisSource(_0x51a476(0x171));return{'sql':_0x35ddc9[_0x51a476(0x13f)](),'mode':'mybatisXml',..._0x5840bb?{'statementType':_0x5840bb}:{}};}function hasWellFormedXmlAttributes(_0x463cc4){const _0x445ca2=a268_0x41b5cb;let _0x21b359=0x0;const _0x128fef=new Set();while(_0x21b359<_0x463cc4[_0x445ca2(0x176)]){while(_0x21b359<_0x463cc4[_0x445ca2(0x176)]&&/\s/['test'](_0x463cc4[_0x21b359]??''))_0x21b359+=0x1;if(_0x21b359>=_0x463cc4[_0x445ca2(0x176)])return!![];const _0xf5e005=/^[A-Za-z_:][\w:.-]*/[_0x445ca2(0x188)](_0x463cc4['slice'](_0x21b359)),_0x5addb4=_0xf5e005?.[0x0];if(!_0x5addb4||_0x128fef[_0x445ca2(0x15d)](_0x5addb4))return![];_0x128fef[_0x445ca2(0x16a)](_0x5addb4),_0x21b359+=_0x5addb4[_0x445ca2(0x176)];while(_0x21b359<_0x463cc4[_0x445ca2(0x176)]&&/\s/[_0x445ca2(0x146)](_0x463cc4[_0x21b359]??''))_0x21b359+=0x1;if(_0x463cc4[_0x21b359]!=='=')return![];_0x21b359+=0x1;while(_0x21b359<_0x463cc4[_0x445ca2(0x176)]&&/\s/[_0x445ca2(0x146)](_0x463cc4[_0x21b359]??''))_0x21b359+=0x1;const _0x3b0c21=_0x463cc4[_0x21b359];if(_0x3b0c21!=='\x22'&&_0x3b0c21!=='\x27')return![];_0x21b359+=0x1;const _0x5f0d3c=_0x463cc4['indexOf'](_0x3b0c21,_0x21b359);if(_0x5f0d3c<0x0)return![];if(decodeXmlEntities(_0x463cc4[_0x445ca2(0x13c)](_0x21b359,_0x5f0d3c))===null)return![];_0x21b359=_0x5f0d3c+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x48f870){const _0xc93d3c=a268_0x41b5cb;let _0x59aabc=0x0;const _0x443b95=()=>{const _0x563a68=a268_0x3365;while(_0x59aabc<_0x48f870[_0x563a68(0x176)]&&/\s/[_0x563a68(0x146)](_0x48f870[_0x59aabc]??''))_0x59aabc+=0x1;};_0x443b95();while(_0x59aabc<_0x48f870[_0xc93d3c(0x176)]){if(_0x48f870[_0xc93d3c(0x13d)](_0xc93d3c(0x16e),_0x59aabc)){const _0x125636=_0x48f870[_0xc93d3c(0x161)](_0xc93d3c(0x136),_0x59aabc+0x4);if(_0x125636<0x0)return!![];_0x59aabc=_0x125636+0x3,_0x443b95();continue;}if(_0x48f870[_0xc93d3c(0x13d)]('<?',_0x59aabc)){const _0x302b5a=_0x48f870['indexOf']('?>',_0x59aabc+0x2);if(_0x302b5a<0x0)return!![];_0x59aabc=_0x302b5a+0x2,_0x443b95();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0xc93d3c(0x146)](_0x48f870['slice'](_0x59aabc));}function invalidMybatisSource(_0x3d45c7){const _0x5f0cb7=a268_0x41b5cb;return{'sql':'','mode':_0x5f0cb7(0x13a),'error':_0x3d45c7};}function findXmlTagEnd(_0x253bc5,_0x5927a5){const _0x244691=a268_0x41b5cb;let _0x25cc3c;for(let _0x237ba8=_0x5927a5+0x1;_0x237ba8<_0x253bc5[_0x244691(0x176)];_0x237ba8+=0x1){const _0xa048fd=_0x253bc5[_0x237ba8];if(_0x25cc3c){if(_0xa048fd===_0x25cc3c)_0x25cc3c=undefined;continue;}if(_0xa048fd==='\x22'||_0xa048fd==='\x27'){_0x25cc3c=_0xa048fd;continue;}if(_0xa048fd==='>')return _0x237ba8;}return-0x1;}function decodeXmlEntities(_0x463e83){const _0x3fea88=a268_0x41b5cb;let _0xe5df44=![];const _0x176be3=_0x463e83[_0x3fea88(0x183)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x12d650=>{const _0x22b9d4=_0x3fea88;if(_0x12d650===_0x22b9d4(0x165))return'<';if(_0x12d650===_0x22b9d4(0x175))return'>';if(_0x12d650===_0x22b9d4(0x187))return'\x22';if(_0x12d650===_0x22b9d4(0x170))return'\x27';if(_0x12d650===_0x22b9d4(0x15a))return'&';const _0x1ad635=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x22b9d4(0x188)](_0x12d650);if(_0x1ad635){const _0x2c636d=_0x1ad635[0x1],_0x6a3d1a=_0x1ad635[0x2],_0x1708e5=Number[_0x22b9d4(0x194)](_0x2c636d??_0x6a3d1a??'',_0x2c636d?0x10:0xa);if(isValidXmlCharacter(_0x1708e5))return String['fromCodePoint'](_0x1708e5);}return _0xe5df44=!![],'';});return _0xe5df44?null:_0x176be3;}function a268_0x9e00(){const _0x5bb78e=['9685116VazhJv','isDangerous','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','66235nmegLN','when','4mkdWKL','967690zoBhBg','parseInt','1947705aYEckg','where','choose','insert','-->','matchAll','unknown\x20table(s)','include','mybatisXml','Unable\x20to\x20detect\x20SQL\x20type.\x20','slice','startsWith','81ZEWAlj','trim','Unterminated\x20CDATA\x20section.',']]>','reason','toUpperCase','type','delete','test','SELECT','\x20SET\x20','push','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','select','otherwise','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','set','statementType','split','keys','INSERT','UPDATE','Invalid\x20MyBatis\x20XML\x20tag.','match','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','property','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','string','&','outer','rawName','has','Unterminated\x20XML\x20declaration.','\x20query\x20targeting\x20','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','indexOf','sql','pop','719684pQKtQb','<','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','UNKNOWN','^<\x5cs*(?:','add','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','join','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','<!--','Unclosed\x20MyBatis\x20XML\x20tag:\x20<',''','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','error','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','>','length','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','Unterminated\x20MyBatis\x20XML\x20tag.','get','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','tagName','\x20WHERE\x20','14839080AcVWmD','foreach','WITH','replaceAll','DELETE','SQL\x20content\x20is\x20empty','replace','1418628yjaWEE','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','DDL','"','exec','Invalid\x20XML\x20entity\x20reference.','174DWFgNc','includes','toLowerCase'];a268_0x9e00=function(){return _0x5bb78e;};return a268_0x9e00();}function isValidXmlCharacter(_0x35ddfc){return _0x35ddfc===0x9||_0x35ddfc===0xa||_0x35ddfc===0xd||_0x35ddfc>=0x20&&_0x35ddfc<=0xd7ff||_0x35ddfc>=0xe000&&_0x35ddfc<=0xfffd||_0x35ddfc>=0x10000&&_0x35ddfc<=0x10ffff;}export function detectSqlType(_0x102580){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x102580));}function detectNormalizedSqlType(_0x580e29){const _0x73480=a268_0x41b5cb;if(_0x580e29[_0x73480(0x172)])return{'type':_0x73480(0x168),'isSelectOnly':![],'isDangerous':![],'reason':_0x580e29['error']};if(!_0x580e29[_0x73480(0x162)][_0x73480(0x13f)]())return{'type':_0x73480(0x168),'isSelectOnly':![],'isDangerous':![],'reason':_0x73480(0x182)};const _0x4a05ed=stripStaticAnalysisMarkers(_0x580e29['sql'])[_0x73480(0x183)](/#\{[^}]*\}/g,'?')[_0x73480(0x183)](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x73480(0x183)](/\/\*[\s\S]*?\*\//g,'')[_0x73480(0x13f)](),_0x22cf3e=_0x4a05ed[_0x73480(0x150)]('\x0a');let _0x21be17='';for(const _0x3c7e7f of _0x22cf3e){const _0x454d74=_0x3c7e7f[_0x73480(0x13f)]();if(!_0x454d74||_0x454d74[_0x73480(0x13d)]('--')||_0x454d74['startsWith']('/*'))continue;_0x21be17=_0x454d74;break;}const _0x4b803f=_0x21be17[_0x73480(0x143)](),_0x5e555d=_0x580e29[_0x73480(0x14f)],_0x45f004=maskSqlTextForBlockedKeywordScan(_0x4a05ed),_0x2cbc72=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x73480(0x146)](_0x45f004);if(_0x5e555d===_0x73480(0x147)||!_0x5e555d&&(_0x4b803f[_0x73480(0x13d)](_0x73480(0x147))||_0x4b803f[_0x73480(0x13d)](_0x73480(0x17f)))){const _0x100269=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x73480(0x146)](_0x4a05ed);return{'type':_0x73480(0x147),'isSelectOnly':!_0x100269,'isDangerous':_0x100269,'reason':_0x100269?_0x73480(0x177):undefined};}if(_0x5e555d===_0x73480(0x152)||!_0x5e555d&&_0x4b803f['startsWith'](_0x73480(0x152)))return{'type':_0x73480(0x152),'isSelectOnly':![],'isDangerous':_0x2cbc72,'reason':_0x2cbc72?_0x73480(0x14a):undefined};if(_0x5e555d===_0x73480(0x153)||!_0x5e555d&&_0x4b803f[_0x73480(0x13d)](_0x73480(0x153)))return{'type':'UPDATE','isSelectOnly':![],'isDangerous':_0x2cbc72,'reason':_0x2cbc72?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x5e555d===_0x73480(0x181)||!_0x5e555d&&_0x4b803f[_0x73480(0x13d)]('DELETE'))return{'type':_0x73480(0x181),'isSelectOnly':![],'isDangerous':!![],'reason':_0x73480(0x16d)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i['test'](_0x4b803f))return{'type':_0x73480(0x186),'isSelectOnly':![],'isDangerous':!![],'reason':_0x73480(0x156)};return{'type':_0x73480(0x168),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0xe87ae3){const _0x5ac29c=a268_0x41b5cb;return _0xe87ae3[_0x5ac29c(0x180)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x5ac29c(0x180)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x5ac29c(0x180)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x4d7eb5){const _0x149713=a268_0x41b5cb;return _0x4d7eb5[_0x149713(0x183)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x149713(0x183)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x149713(0x183)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x149713(0x183)](/--.*$/gm,'\x20')['replace'](/#.*$/gm,'\x20')[_0x149713(0x183)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x2ab3a8){const _0x209ac8=a268_0x41b5cb,_0x4a4a33=_0x2ab3a8[_0x209ac8(0x183)](/#\{[^}]*\}/g,'?')[_0x209ac8(0x183)](/\$\{[^}]*\}/g,'?')[_0x209ac8(0x183)](/'[^']*'/g,'\x27\x27')[_0x209ac8(0x183)](/--.*$/gm,'')[_0x209ac8(0x183)](/\/\*[\s\S]*?\*\//g,''),_0x5d8113=[],_0x16d41f=_0x4a4a33['match'](/FROM\s+([^\s,)(]+)/i);addTable(_0x5d8113,_0x16d41f?.[0x1]);for(const _0x590a59 of _0x4a4a33[_0x209ac8(0x137)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x5d8113,_0x590a59[0x1]);}const _0x3181f4=_0x4a4a33['match'](/INTO\s+([^\s(]+)/i);addTable(_0x5d8113,_0x3181f4?.[0x1]);const _0x2eb933=_0x4a4a33[_0x209ac8(0x155)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x5d8113,_0x2eb933?.[0x1]),_0x5d8113;}function addTable(_0x5cd50f,_0x3a8d38){const _0x35af89=a268_0x41b5cb,_0x410e59=_0x3a8d38?.[_0x35af89(0x183)](/[`"]/g,'');_0x410e59&&_0x410e59!==UNRESOLVED_SQL_FRAGMENT&&!_0x5cd50f[_0x35af89(0x18b)](_0x410e59)&&_0x5cd50f['push'](_0x410e59);}function extractParameters(_0x282b38){const _0x187a70=a268_0x41b5cb,_0x4149b7=new Set();for(const _0x2f36dc of _0x282b38[_0x187a70(0x137)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x2f36dc[0x1])_0x4149b7[_0x187a70(0x16a)](_0x2f36dc[0x1]);}return Array['from'](_0x4149b7);}export function validateSql(_0x5518db){const _0x457600=a268_0x41b5cb,_0x6afbdc=normalizeSqlForStaticAnalysis(_0x5518db),_0x101b75=detectNormalizedSqlType(_0x6afbdc),_0x26893f=stripStaticAnalysisMarkers(_0x6afbdc[_0x457600(0x162)]),_0x16c5b1=_0x6afbdc[_0x457600(0x172)]?[]:extractTables(_0x26893f),_0x360776=_0x6afbdc[_0x457600(0x172)]?[]:extractParameters(_0x26893f);if(_0x101b75[_0x457600(0x18e)])return{'valid':![],'sqlType':_0x101b75,'tables':_0x16c5b1,'parameters':_0x360776,'message':_0x101b75[_0x457600(0x142)]||_0x101b75[_0x457600(0x144)]+'\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.'};if(_0x101b75[_0x457600(0x144)]==='UNKNOWN')return{'valid':![],'sqlType':_0x101b75,'tables':_0x16c5b1,'parameters':_0x360776,'message':_0x6afbdc['error']?_0x457600(0x13b)+_0x6afbdc[_0x457600(0x172)]:_0x457600(0x185)};return{'valid':!![],'sqlType':_0x101b75,'tables':_0x16c5b1,'parameters':_0x360776,'message':_0x101b75[_0x457600(0x144)]+_0x457600(0x15f)+(_0x16c5b1[_0x457600(0x176)]?_0x16c5b1[_0x457600(0x16c)](',\x20'):_0x457600(0x138))+(_0x360776[_0x457600(0x176)]?'\x20with\x20parameters:\x20'+_0x360776[_0x457600(0x16c)](',\x20'):'')};}
|
|
1
|
+
const a266_0xdc311a=a266_0xc86e;(function(_0x2c26a5,_0x42cfcb){const _0xca6f0c=a266_0xc86e,_0x34e100=_0x2c26a5();while(!![]){try{const _0x47f317=-parseInt(_0xca6f0c(0x72))/0x1*(parseInt(_0xca6f0c(0xb0))/0x2)+-parseInt(_0xca6f0c(0x8d))/0x3*(parseInt(_0xca6f0c(0x93))/0x4)+parseInt(_0xca6f0c(0xcb))/0x5+-parseInt(_0xca6f0c(0x9c))/0x6*(parseInt(_0xca6f0c(0x9e))/0x7)+parseInt(_0xca6f0c(0x98))/0x8+-parseInt(_0xca6f0c(0x96))/0x9*(parseInt(_0xca6f0c(0xad))/0xa)+parseInt(_0xca6f0c(0xc9))/0xb;if(_0x47f317===_0x42cfcb)break;else _0x34e100['push'](_0x34e100['shift']());}catch(_0x58d394){_0x34e100['push'](_0x34e100['shift']());}}}(a266_0x2d9a,0x395cf));const MYBATIS_OUTER_TAGS=new Map([[a266_0xdc311a(0xb6),a266_0xdc311a(0x79)],[a266_0xdc311a(0xc6),a266_0xdc311a(0x7f)],[a266_0xdc311a(0xcc),'UPDATE'],[a266_0xdc311a(0xc8),'DELETE']]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a266_0xdc311a(0x71),a266_0xdc311a(0xac),a266_0xdc311a(0xcd),a266_0xdc311a(0x8c),'otherwise',a266_0xdc311a(0x88),'set',a266_0xdc311a(0xb4),'include',a266_0xdc311a(0x76)]),MYBATIS_BRANCH_TAGS=new Set(['if','foreach',a266_0xdc311a(0xcd),a266_0xdc311a(0x8c),a266_0xdc311a(0x83)]);export const MYBATIS_DYNAMIC_START_MARKER=a266_0xdc311a(0xd0);export const MYBATIS_DYNAMIC_END_MARKER='__RABETBASE_MYBATIS_DYNAMIC_END__';export const MYBATIS_INCLUDE_MARKER=a266_0xdc311a(0x8e);const UNRESOLVED_SQL_FRAGMENT='__RABETBASE_UNRESOLVED_SQL_FRAGMENT__',MYBATIS_OUTER_TAG_PATTERN=new RegExp(a266_0xdc311a(0xb1)+[...MYBATIS_OUTER_TAGS[a266_0xdc311a(0xab)]()][a266_0xdc311a(0xaa)]('|')+a266_0xdc311a(0x85),'i');export function normalizeSqlForStaticAnalysis(_0x4a10bf){const _0x5eca8f=a266_0xdc311a,_0x39d9dc=typeof _0x4a10bf===_0x5eca8f(0xc4)?_0x4a10bf:'';if(!startsWithMybatisStatementWrapper(_0x39d9dc))return{'sql':_0x39d9dc,'mode':'sql'};let _0x35de63=0x0,_0x3c8605='',_0x1d98ce,_0x374360=![],_0x1caa9d=![];const _0x50b2d7=[];while(_0x35de63<_0x39d9dc[_0x5eca8f(0x77)]){if(_0x39d9dc['startsWith'](_0x5eca8f(0xca),_0x35de63)){const _0x407b2c=_0x39d9dc[_0x5eca8f(0x91)](_0x5eca8f(0xa1),_0x35de63+0x4);if(_0x407b2c<0x0)return invalidMybatisSource('Unterminated\x20XML\x20comment.');_0x3c8605+='\x20',_0x35de63=_0x407b2c+0x3;continue;}if(_0x39d9dc[_0x5eca8f(0x8b)](_0x5eca8f(0xbf),_0x35de63)){if(!_0x374360||_0x1caa9d)return invalidMybatisSource(_0x5eca8f(0x84));const _0x49f170=_0x39d9dc[_0x5eca8f(0x91)](_0x5eca8f(0x7b),_0x35de63+0x9);if(_0x49f170<0x0)return invalidMybatisSource(_0x5eca8f(0xae));_0x3c8605+=_0x39d9dc[_0x5eca8f(0xc2)](_0x35de63+0x9,_0x49f170),_0x35de63=_0x49f170+0x3;continue;}if(_0x39d9dc[_0x5eca8f(0x8b)]('<?',_0x35de63)){if(_0x374360)return invalidMybatisSource(_0x5eca8f(0x87));const _0x563e58=_0x39d9dc['indexOf']('?>',_0x35de63+0x2);if(_0x563e58<0x0)return invalidMybatisSource(_0x5eca8f(0x9f));_0x3c8605+='\x20',_0x35de63=_0x563e58+0x2;continue;}if(_0x39d9dc[_0x35de63]!=='<'){const _0x1c0b7b=_0x39d9dc[_0x5eca8f(0x91)]('<',_0x35de63),_0x118502=_0x1c0b7b<0x0?_0x39d9dc[_0x5eca8f(0x77)]:_0x1c0b7b,_0x1f065e=_0x39d9dc[_0x5eca8f(0xc2)](_0x35de63,_0x118502);if((!_0x374360||_0x1caa9d)&&_0x1f065e[_0x5eca8f(0x88)]())return invalidMybatisSource(_0x5eca8f(0x81));if(_0x374360&&!_0x1caa9d){const _0x560c96=decodeXmlEntities(_0x1f065e);if(_0x560c96===null)return invalidMybatisSource(_0x5eca8f(0x94));_0x3c8605+=_0x560c96;}else _0x3c8605+='\x20';_0x35de63=_0x118502;continue;}const _0x2040eb=findXmlTagEnd(_0x39d9dc,_0x35de63);if(_0x2040eb<0x0)return invalidMybatisSource(_0x5eca8f(0x8f));const _0x1ad3c8=_0x39d9dc[_0x5eca8f(0xc2)](_0x35de63,_0x2040eb+0x1),_0x4a0e12=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x5eca8f(0x7a)](_0x1ad3c8);if(!_0x4a0e12)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20tag.');const _0x229365=_0x4a0e12[0x1]==='/',_0x21e34a=_0x4a0e12[0x2]??'',_0x4f6675=_0x21e34a[_0x5eca8f(0x92)](),_0x22aa4d=_0x4a0e12[0x3]??'',_0xb934a0=_0x4a0e12[0x4]==='/',_0x2add91=MYBATIS_OUTER_TAGS[_0x5eca8f(0x90)](_0x4f6675);if(!_0x2add91&&!MYBATIS_DYNAMIC_TAGS[_0x5eca8f(0x9b)](_0x4f6675))return invalidMybatisSource('Unsupported\x20MyBatis\x20XML\x20tag:\x20<'+_0x4f6675+'>.');if(!_0x2add91&&_0x21e34a!==_0x4f6675)return invalidMybatisSource(_0x5eca8f(0x7d)+_0x21e34a+'>.');if(_0x229365){if(_0x22aa4d[_0x5eca8f(0x88)]()||_0xb934a0)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x21e34a+'>.');const _0x47a9ea=_0x50b2d7['at'](-0x1);if(!_0x47a9ea||(_0x47a9ea[_0x5eca8f(0xb5)]?_0x47a9ea['tagName']!==_0x4f6675:_0x47a9ea[_0x5eca8f(0xa0)]!==_0x21e34a))return invalidMybatisSource(_0x5eca8f(0xc7)+_0x21e34a+'>.');_0x50b2d7[_0x5eca8f(0x7e)]();if(_0x47a9ea[_0x5eca8f(0xb5)])_0x1caa9d=!![];_0x3c8605+=MYBATIS_BRANCH_TAGS[_0x5eca8f(0x9b)](_0x4f6675)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x22aa4d))return invalidMybatisSource('Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<'+_0x21e34a+'>.');if(_0x4f6675===_0x5eca8f(0x76)&&(!_0xb934a0||_0x50b2d7['at'](-0x1)?.[_0x5eca8f(0xbc)]!==_0x5eca8f(0x89)))return invalidMybatisSource('MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.');if(_0x2add91){if(_0x374360||_0x50b2d7[_0x5eca8f(0x77)]>0x0)return invalidMybatisSource(_0x5eca8f(0xb7));_0x374360=!![],_0x1caa9d=_0xb934a0,_0x1d98ce=_0x2add91;}else{if(!_0x374360||_0x1caa9d)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<'+_0x21e34a+'>.');}_0x3c8605+=_0x4f6675===_0x5eca8f(0x71)?_0x5eca8f(0xcf):_0x4f6675===_0x5eca8f(0x9d)?'\x20SET\x20':_0x4f6675==='include'?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS['has'](_0x4f6675)&&!_0xb934a0?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0xb934a0&&_0x50b2d7[_0x5eca8f(0xc0)]({'rawName':_0x21e34a,'tagName':_0x4f6675,'outer':!!_0x2add91});}_0x35de63=_0x2040eb+0x1;}if(_0x50b2d7[_0x5eca8f(0x77)]>0x0)return invalidMybatisSource('Unclosed\x20MyBatis\x20XML\x20tag:\x20<'+_0x50b2d7['at'](-0x1)?.[_0x5eca8f(0xa0)]+'>.');if(!_0x374360||!_0x1caa9d)return invalidMybatisSource(_0x5eca8f(0xb2));return{'sql':_0x3c8605[_0x5eca8f(0x88)](),'mode':'mybatisXml',..._0x1d98ce?{'statementType':_0x1d98ce}:{}};}function hasWellFormedXmlAttributes(_0x2b634f){const _0xb1cabd=a266_0xdc311a;let _0x1b4691=0x0;const _0x489b84=new Set();while(_0x1b4691<_0x2b634f['length']){while(_0x1b4691<_0x2b634f[_0xb1cabd(0x77)]&&/\s/[_0xb1cabd(0x9a)](_0x2b634f[_0x1b4691]??''))_0x1b4691+=0x1;if(_0x1b4691>=_0x2b634f['length'])return!![];const _0x265fb7=/^[A-Za-z_:][\w:.-]*/[_0xb1cabd(0x7a)](_0x2b634f[_0xb1cabd(0xc2)](_0x1b4691)),_0x31dc43=_0x265fb7?.[0x0];if(!_0x31dc43||_0x489b84[_0xb1cabd(0x9b)](_0x31dc43))return![];_0x489b84[_0xb1cabd(0x99)](_0x31dc43),_0x1b4691+=_0x31dc43[_0xb1cabd(0x77)];while(_0x1b4691<_0x2b634f['length']&&/\s/[_0xb1cabd(0x9a)](_0x2b634f[_0x1b4691]??''))_0x1b4691+=0x1;if(_0x2b634f[_0x1b4691]!=='=')return![];_0x1b4691+=0x1;while(_0x1b4691<_0x2b634f[_0xb1cabd(0x77)]&&/\s/[_0xb1cabd(0x9a)](_0x2b634f[_0x1b4691]??''))_0x1b4691+=0x1;const _0x364b02=_0x2b634f[_0x1b4691];if(_0x364b02!=='\x22'&&_0x364b02!=='\x27')return![];_0x1b4691+=0x1;const _0xc3a8ab=_0x2b634f[_0xb1cabd(0x91)](_0x364b02,_0x1b4691);if(_0xc3a8ab<0x0)return![];if(decodeXmlEntities(_0x2b634f['slice'](_0x1b4691,_0xc3a8ab))===null)return![];_0x1b4691=_0xc3a8ab+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x14e381){const _0x3b10a2=a266_0xdc311a;let _0x43afc8=0x0;const _0x5d6e24=()=>{const _0x2ef967=a266_0xc86e;while(_0x43afc8<_0x14e381[_0x2ef967(0x77)]&&/\s/['test'](_0x14e381[_0x43afc8]??''))_0x43afc8+=0x1;};_0x5d6e24();while(_0x43afc8<_0x14e381[_0x3b10a2(0x77)]){if(_0x14e381['startsWith']('<!--',_0x43afc8)){const _0x9eb4c=_0x14e381[_0x3b10a2(0x91)]('-->',_0x43afc8+0x4);if(_0x9eb4c<0x0)return!![];_0x43afc8=_0x9eb4c+0x3,_0x5d6e24();continue;}if(_0x14e381[_0x3b10a2(0x8b)]('<?',_0x43afc8)){const _0x4c3aea=_0x14e381['indexOf']('?>',_0x43afc8+0x2);if(_0x4c3aea<0x0)return!![];_0x43afc8=_0x4c3aea+0x2,_0x5d6e24();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x3b10a2(0x9a)](_0x14e381[_0x3b10a2(0xc2)](_0x43afc8));}function a266_0x2d9a(){const _0x42490e=['includes','error','property','length','from','SELECT','exec',']]>','SQL\x20content\x20is\x20empty','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','pop','INSERT','matchAll','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','type','otherwise','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.',')\x5cb','\x20with\x20parameters:\x20','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','trim','include','statementType','startsWith','when','1617rTDqvL','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','Unterminated\x20MyBatis\x20XML\x20tag.','get','indexOf','toLowerCase','124DbfOpm','Invalid\x20XML\x20entity\x20reference.','mybatisXml','9OUnhjZ','reason','3474064KYblRf','add','test','has','40758cMHyXl','set','434fzrETr','Unterminated\x20XML\x20declaration.','rawName','-->','fromCodePoint','match','\x20query\x20targeting\x20','DELETE','UNKNOWN','toUpperCase','"','unknown\x20table(s)','join','keys','foreach','4209500GPezMK','Unterminated\x20CDATA\x20section.',''','3448kOtAAt','^<\x5cs*(?:','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','parseInt','bind','outer','select','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','WITH','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','replaceAll','replace','tagName','isDangerous','sql','<![CDATA[','push','UPDATE','slice','split','string','Unable\x20to\x20detect\x20SQL\x20type.\x20','insert','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','delete','7445878EFEqff','<!--','283800CFFdUt','update','choose','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','\x20WHERE\x20','__RABETBASE_MYBATIS_DYNAMIC_START__','where','43TBvRPE','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements'];a266_0x2d9a=function(){return _0x42490e;};return a266_0x2d9a();}function invalidMybatisSource(_0xd2cb48){const _0xf423af=a266_0xdc311a;return{'sql':'','mode':_0xf423af(0x95),'error':_0xd2cb48};}function findXmlTagEnd(_0x7a59c,_0x5854d8){let _0xccb0b2;for(let _0x5c7b96=_0x5854d8+0x1;_0x5c7b96<_0x7a59c['length'];_0x5c7b96+=0x1){const _0x3538a1=_0x7a59c[_0x5c7b96];if(_0xccb0b2){if(_0x3538a1===_0xccb0b2)_0xccb0b2=undefined;continue;}if(_0x3538a1==='\x22'||_0x3538a1==='\x27'){_0xccb0b2=_0x3538a1;continue;}if(_0x3538a1==='>')return _0x5c7b96;}return-0x1;}function decodeXmlEntities(_0x434705){let _0x2676bf=![];const _0x48059b=_0x434705['replace'](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x73600c=>{const _0x4dace8=a266_0xc86e;if(_0x73600c==='<')return'<';if(_0x73600c==='>')return'>';if(_0x73600c===_0x4dace8(0xa8))return'\x22';if(_0x73600c===_0x4dace8(0xaf))return'\x27';if(_0x73600c==='&')return'&';const _0x32effa=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x4dace8(0x7a)](_0x73600c);if(_0x32effa){const _0x13ed97=_0x32effa[0x1],_0x2e2f90=_0x32effa[0x2],_0x3aac91=Number[_0x4dace8(0xb3)](_0x13ed97??_0x2e2f90??'',_0x13ed97?0x10:0xa);if(isValidXmlCharacter(_0x3aac91))return String[_0x4dace8(0xa2)](_0x3aac91);}return _0x2676bf=!![],'';});return _0x2676bf?null:_0x48059b;}function isValidXmlCharacter(_0x44fc3d){return _0x44fc3d===0x9||_0x44fc3d===0xa||_0x44fc3d===0xd||_0x44fc3d>=0x20&&_0x44fc3d<=0xd7ff||_0x44fc3d>=0xe000&&_0x44fc3d<=0xfffd||_0x44fc3d>=0x10000&&_0x44fc3d<=0x10ffff;}export function detectSqlType(_0x1b38f3){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x1b38f3));}function a266_0xc86e(_0x54173a,_0x247e30){_0x54173a=_0x54173a-0x71;const _0x2d9a95=a266_0x2d9a();let _0xc86e3d=_0x2d9a95[_0x54173a];return _0xc86e3d;}function detectNormalizedSqlType(_0x5aadfa){const _0x5c8d70=a266_0xdc311a;if(_0x5aadfa[_0x5c8d70(0x75)])return{'type':_0x5c8d70(0xa6),'isSelectOnly':![],'isDangerous':![],'reason':_0x5aadfa[_0x5c8d70(0x75)]};if(!_0x5aadfa['sql'][_0x5c8d70(0x88)]())return{'type':_0x5c8d70(0xa6),'isSelectOnly':![],'isDangerous':![],'reason':_0x5c8d70(0x7c)};const _0x19cd07=stripStaticAnalysisMarkers(_0x5aadfa['sql'])[_0x5c8d70(0xbb)](/#\{[^}]*\}/g,'?')[_0x5c8d70(0xbb)](/\$\{[^}]*\}/g,'?')[_0x5c8d70(0xbb)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x5c8d70(0xbb)](/\/\*[\s\S]*?\*\//g,'')[_0x5c8d70(0x88)](),_0x3dd149=_0x19cd07[_0x5c8d70(0xc3)]('\x0a');let _0x8ca38='';for(const _0x2f28bb of _0x3dd149){const _0x287dce=_0x2f28bb[_0x5c8d70(0x88)]();if(!_0x287dce||_0x287dce[_0x5c8d70(0x8b)]('--')||_0x287dce[_0x5c8d70(0x8b)]('/*'))continue;_0x8ca38=_0x287dce;break;}const _0x1dc647=_0x8ca38[_0x5c8d70(0xa7)](),_0x204990=_0x5aadfa[_0x5c8d70(0x8a)],_0x10adc9=maskSqlTextForBlockedKeywordScan(_0x19cd07),_0x2d09b6=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x5c8d70(0x9a)](_0x10adc9);if(_0x204990===_0x5c8d70(0x79)||!_0x204990&&(_0x1dc647[_0x5c8d70(0x8b)](_0x5c8d70(0x79))||_0x1dc647[_0x5c8d70(0x8b)](_0x5c8d70(0xb8)))){const _0x5cde86=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x5c8d70(0x9a)](_0x19cd07);return{'type':_0x5c8d70(0x79),'isSelectOnly':!_0x5cde86,'isDangerous':_0x5cde86,'reason':_0x5cde86?_0x5c8d70(0xb9):undefined};}if(_0x204990==='INSERT'||!_0x204990&&_0x1dc647[_0x5c8d70(0x8b)](_0x5c8d70(0x7f)))return{'type':_0x5c8d70(0x7f),'isSelectOnly':![],'isDangerous':_0x2d09b6,'reason':_0x2d09b6?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x204990===_0x5c8d70(0xc1)||!_0x204990&&_0x1dc647[_0x5c8d70(0x8b)](_0x5c8d70(0xc1)))return{'type':_0x5c8d70(0xc1),'isSelectOnly':![],'isDangerous':_0x2d09b6,'reason':_0x2d09b6?_0x5c8d70(0x73):undefined};if(_0x204990===_0x5c8d70(0xa5)||!_0x204990&&_0x1dc647[_0x5c8d70(0x8b)]('DELETE'))return{'type':'DELETE','isSelectOnly':![],'isDangerous':!![],'reason':'DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save'};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x5c8d70(0x9a)](_0x1dc647))return{'type':'DDL','isSelectOnly':![],'isDangerous':!![],'reason':'DDL\x20statements\x20are\x20blocked\x20from\x20auto-save'};return{'type':_0x5c8d70(0xa6),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x42f373){const _0x3e652e=a266_0xdc311a;return _0x42f373[_0x3e652e(0xba)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x3e652e(0xba)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x3e652e(0xba)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x3e85c9){const _0xb29449=a266_0xdc311a;return _0x3e85c9[_0xb29449(0xbb)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0xb29449(0xbb)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0xb29449(0xbb)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0xb29449(0xbb)](/--.*$/gm,'\x20')['replace'](/#.*$/gm,'\x20')[_0xb29449(0xbb)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0xfe28ab){const _0x1ba020=a266_0xdc311a,_0x485c51=_0xfe28ab[_0x1ba020(0xbb)](/#\{[^}]*\}/g,'?')[_0x1ba020(0xbb)](/\$\{[^}]*\}/g,'?')[_0x1ba020(0xbb)](/'[^']*'/g,'\x27\x27')[_0x1ba020(0xbb)](/--.*$/gm,'')[_0x1ba020(0xbb)](/\/\*[\s\S]*?\*\//g,''),_0x2bc61a=[],_0x42b6f9=_0x485c51[_0x1ba020(0xa3)](/FROM\s+([^\s,)(]+)/i);addTable(_0x2bc61a,_0x42b6f9?.[0x1]);for(const _0x389cc3 of _0x485c51[_0x1ba020(0x80)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x2bc61a,_0x389cc3[0x1]);}const _0x4be7d9=_0x485c51[_0x1ba020(0xa3)](/INTO\s+([^\s(]+)/i);addTable(_0x2bc61a,_0x4be7d9?.[0x1]);const _0x5ca0a8=_0x485c51['match'](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x2bc61a,_0x5ca0a8?.[0x1]),_0x2bc61a;}function addTable(_0x2338f4,_0x7c84ef){const _0x1eb9b1=a266_0xdc311a,_0x472692=_0x7c84ef?.['replace'](/[`"]/g,'');_0x472692&&_0x472692!==UNRESOLVED_SQL_FRAGMENT&&!_0x2338f4[_0x1eb9b1(0x74)](_0x472692)&&_0x2338f4['push'](_0x472692);}function extractParameters(_0x2abb95){const _0x352db0=a266_0xdc311a,_0xca6def=new Set();for(const _0x1ee8ce of _0x2abb95['matchAll'](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x1ee8ce[0x1])_0xca6def[_0x352db0(0x99)](_0x1ee8ce[0x1]);}return Array[_0x352db0(0x78)](_0xca6def);}export function validateSql(_0x2fa6dd){const _0x2b5e89=a266_0xdc311a,_0x206eb1=normalizeSqlForStaticAnalysis(_0x2fa6dd),_0x254373=detectNormalizedSqlType(_0x206eb1),_0x37d1bd=stripStaticAnalysisMarkers(_0x206eb1[_0x2b5e89(0xbe)]),_0x1fee3a=_0x206eb1[_0x2b5e89(0x75)]?[]:extractTables(_0x37d1bd),_0x2aa4cb=_0x206eb1[_0x2b5e89(0x75)]?[]:extractParameters(_0x37d1bd);if(_0x254373[_0x2b5e89(0xbd)])return{'valid':![],'sqlType':_0x254373,'tables':_0x1fee3a,'parameters':_0x2aa4cb,'message':_0x254373[_0x2b5e89(0x97)]||_0x254373[_0x2b5e89(0x82)]+'\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.'};if(_0x254373[_0x2b5e89(0x82)]===_0x2b5e89(0xa6))return{'valid':![],'sqlType':_0x254373,'tables':_0x1fee3a,'parameters':_0x2aa4cb,'message':_0x206eb1['error']?_0x2b5e89(0xc5)+_0x206eb1[_0x2b5e89(0x75)]:_0x2b5e89(0xce)};return{'valid':!![],'sqlType':_0x254373,'tables':_0x1fee3a,'parameters':_0x2aa4cb,'message':_0x254373[_0x2b5e89(0x82)]+_0x2b5e89(0xa4)+(_0x1fee3a['length']?_0x1fee3a['join'](',\x20'):_0x2b5e89(0xa9))+(_0x2aa4cb[_0x2b5e89(0x77)]?_0x2b5e89(0x86)+_0x2aa4cb[_0x2b5e89(0xaa)](',\x20'):'')};}
|