@lovrabet/rabetbase-cli 2.5.2-beta.5 → 2.5.2-beta.7
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.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(_0x5cbb50,_0x447674){const _0x508ddb=a252_0x79f1,_0x877da1=_0x5cbb50();while(!![]){try{const _0x1cad53=-parseInt(_0x508ddb(0x109))/0x1*(parseInt(_0x508ddb(0x102))/0x2)+parseInt(_0x508ddb(0x105))/0x3+-parseInt(_0x508ddb(0x118))/0x4*(-parseInt(_0x508ddb(0x112))/0x5)+parseInt(_0x508ddb(0x106))/0x6+parseInt(_0x508ddb(0x116))/0x7*(parseInt(_0x508ddb(0x10e))/0x8)+parseInt(_0x508ddb(0x11d))/0x9*(parseInt(_0x508ddb(0x10c))/0xa)+-parseInt(_0x508ddb(0x114))/0xb;if(_0x1cad53===_0x447674)break;else _0x877da1['push'](_0x877da1['shift']());}catch(_0x4f2b3e){_0x877da1['push'](_0x877da1['shift']());}}}(a252_0x9e61,0x19676));import{listDatasets}from'../core/api-client.js';function a252_0x79f1(_0x307668,_0x22e00c){_0x307668=_0x307668-0x100;const _0x9e6181=a252_0x9e61();let _0x79f12b=_0x9e6181[_0x307668];return _0x79f12b;}const cache=new Map();export async function listDatabases(_0xd4962e){const _0x3eebbd=a252_0x79f1;if(cache[_0x3eebbd(0x11c)](_0xd4962e))return cache['get'](_0xd4962e);const _0x37ec39=await listDatasets(_0xd4962e),_0x34e08c=new Map();for(const _0x4f7d05 of _0x37ec39){const _0x1f3a99=_0x4f7d05[_0x3eebbd(0x110)];_0x1f3a99?.[_0x3eebbd(0x115)]!=null&&_0x34e08c[_0x3eebbd(0x108)](_0x1f3a99[_0x3eebbd(0x115)],_0x1f3a99[_0x3eebbd(0x101)]??'db-'+_0x1f3a99[_0x3eebbd(0x115)]);}const _0xa59772=[..._0x34e08c[_0x3eebbd(0x117)]()]['map'](([_0x41be7a,_0x335f01])=>({'dbId':_0x41be7a,'dbName':_0x335f01}));return cache[_0x3eebbd(0x108)](_0xd4962e,_0xa59772),_0xa59772;}export async function resolveDb(_0x141352,_0x35067b){const _0x598dd6=a252_0x79f1,_0x4cd5bf=await listDatabases(_0x141352);if(_0x4cd5bf[_0x598dd6(0x103)]===0x0)return{'resolved':[],'error':_0x598dd6(0x11b)+_0x141352+_0x598dd6(0x104)};if(!_0x35067b)return{'resolved':_0x4cd5bf};const _0x2c4c99=Number(_0x35067b);if(!Number[_0x598dd6(0x10a)](_0x2c4c99)){const _0x3145c8=_0x4cd5bf[_0x598dd6(0x119)](_0x30c523=>_0x30c523[_0x598dd6(0x115)]===_0x2c4c99);if(_0x3145c8)return{'resolved':[_0x3145c8]};}const _0x2fd12d=_0x35067b[_0x598dd6(0x100)](),_0x20fd3f=_0x4cd5bf[_0x598dd6(0x10d)](_0x9fa4bc=>_0x9fa4bc[_0x598dd6(0x101)][_0x598dd6(0x100)]()['includes'](_0x2fd12d));if(_0x20fd3f[_0x598dd6(0x103)]>0x0)return{'resolved':_0x20fd3f};const _0x1678bc=_0x4cd5bf[_0x598dd6(0x11a)](_0x3f4fbb=>_0x3f4fbb[_0x598dd6(0x101)]+'\x20('+_0x3f4fbb[_0x598dd6(0x115)]+')')[_0x598dd6(0x107)](',\x20');return{'resolved':[],'error':_0x598dd6(0x10b)+_0x35067b+_0x598dd6(0x111)+_0x141352+_0x598dd6(0x10f)+_0x1678bc+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x590dd0,_0x80d7b5){const _0x551217=a252_0x79f1,{resolved:_0x48ff99,error:_0x423755}=await resolveDb(_0x590dd0,_0x80d7b5);if(_0x423755)return{'db':null,'error':_0x423755};if(_0x48ff99['length']===0x1)return{'db':_0x48ff99[0x0]};if(!_0x80d7b5){const _0x4ca2f4=_0x48ff99['map'](_0x47cc68=>_0x47cc68[_0x551217(0x101)]+'\x20('+_0x47cc68[_0x551217(0x115)]+')')['join'](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x4ca2f4};}const _0x4a8d2d=_0x48ff99[_0x551217(0x11a)](_0x415b97=>_0x415b97[_0x551217(0x101)]+'\x20('+_0x415b97[_0x551217(0x115)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x80d7b5+'\x22\x20matches\x20multiple\x20databases:\x20'+_0x4a8d2d+_0x551217(0x113)};}function a252_0x9e61(){const _0x3b79d8=['132WOptKi','find','map','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','has','153seaFHg','toLowerCase','dbName','86910FuPqdI','length','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','554100wMzhtq','891552VYNILS','join','set','4CLUWZw','isNaN','No\x20database\x20matching\x20\x22','45550QIVJhm','filter','54616rZEUqp','\x22.\x20Available:\x20','dbtableConfig','\x22\x20under\x20app\x20\x22','3575oecvgg','.\x20Be\x20more\x20specific.','3748547aAdTmE','dbId','189wXLJxh','entries'];a252_0x9e61=function(){return _0x3b79d8;};return a252_0x9e61();}export async function getDbName(_0x2faa9b,_0x2e6858){const _0xc1b09c=a252_0x79f1,_0x230da6=await listDatabases(_0x2faa9b);return _0x230da6[_0xc1b09c(0x119)](_0x5a4ae8=>_0x5a4ae8['dbId']===_0x2e6858)?.['dbName'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a253_0x2157e0=a253_0x230c;(function(_0x3f9311,_0x33c41b){const _0x5978b8=a253_0x230c,_0x163d9d=_0x3f9311();while(!![]){try{const _0x4288c6=parseInt(_0x5978b8(0x19a))/0x1*(parseInt(_0x5978b8(0x19f))/0x2)+-parseInt(_0x5978b8(0x18d))/0x3+-parseInt(_0x5978b8(0x1ae))/0x4*(-parseInt(_0x5978b8(0x17a))/0x5)+parseInt(_0x5978b8(0x1a9))/0x6+-parseInt(_0x5978b8(0x176))/0x7*(-parseInt(_0x5978b8(0x198))/0x8)+parseInt(_0x5978b8(0x18f))/0x9*(parseInt(_0x5978b8(0x175))/0xa)+parseInt(_0x5978b8(0x174))/0xb*(-parseInt(_0x5978b8(0x180))/0xc);if(_0x4288c6===_0x33c41b)break;else _0x163d9d['push'](_0x163d9d['shift']());}catch(_0x56b695){_0x163d9d['push'](_0x163d9d['shift']());}}}(a253_0x10b4,0xa2751));import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';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=a253_0x2157e0(0x1ad);export const INSTANT_API_POLICY_FILE_NAME='policy.json';export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x2908df,_0x3b757a,_0x5182c9){return new CliError(_0x2908df,0x1,_0x3b757a,_0x5182c9);}export function loadInstantApiPolicyLocalConfig(_0x354014,_0x27e85a){assertSafeAppCode(_0x354014);const _0x598068=resolve(_0x27e85a??findProjectRootDirectory()),_0x38513d=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x354014+'/'+INSTANT_API_POLICY_FILE_NAME,_0x809bdb=resolve(_0x598068,INSTANT_API_POLICY_RELATIVE_ROOT,_0x354014),_0x55e64e=resolve(_0x809bdb,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x598068,'appCode':_0x354014,'policyRoot':_0x809bdb,'policyFilePath':_0x55e64e,'policyRelativePath':_0x38513d};}export function createDefaultInstantApiPolicyConfig(_0xfcc737,_0x299e2c=a253_0x2157e0(0x183)){return assertSafeAppCode(_0xfcc737),{'version':'1','appCode':_0xfcc737,'defaults':{'instantApi':_0x299e2c},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x57b4f6){const _0x46f713=a253_0x2157e0;let _0x5a7b6a;try{_0x5a7b6a=await stat(_0x57b4f6[_0x46f713(0x18b)]);}catch(_0x1cbcb){throw instantApiPolicyError(_0x46f713(0x188),'Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20'+_0x57b4f6[_0x46f713(0x18b)],_0x46f713(0x193));}if(!_0x5a7b6a[_0x46f713(0x194)]())throw instantApiPolicyError(_0x46f713(0x16b),'Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x57b4f6[_0x46f713(0x18b)]);if(_0x5a7b6a[_0x46f713(0x197)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');let _0x28c5b5;try{_0x28c5b5=await readFile(_0x57b4f6[_0x46f713(0x18b)]);}catch{throw instantApiPolicyError(_0x46f713(0x184),_0x46f713(0x178)+_0x57b4f6['policyFilePath']);}if(_0x28c5b5[_0x46f713(0x1a2)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x46f713(0x196),_0x46f713(0x187));let _0x2ddd5c;try{_0x2ddd5c=new TextDecoder(_0x46f713(0x17c),{'fatal':!![],'ignoreBOM':!![]})[_0x46f713(0x177)](_0x28c5b5);}catch{throw instantApiPolicyError(_0x46f713(0x16b),_0x46f713(0x19d)+_0x57b4f6['policyFilePath']);}let _0x66cc39;try{_0x66cc39=JSON[_0x46f713(0x173)](_0x2ddd5c);}catch{throw instantApiPolicyError(_0x46f713(0x190),_0x46f713(0x17d)+_0x57b4f6['policyFilePath']);}return assertLocalPolicyContract(_0x66cc39,_0x57b4f6[_0x46f713(0x16d)]);}export async function writeInstantApiPolicyConfigFile(_0x327ae6,_0x3958e7,_0x547b97={}){const _0x4974ca=a253_0x2157e0,_0x1c9499=assertLocalPolicyContract(_0x3958e7,_0x327ae6['appCode']),_0x5f9afc=JSON[_0x4974ca(0x1ac)](_0x1c9499,null,0x2)+'\x0a';if(Buffer[_0x4974ca(0x1a2)](_0x5f9afc,_0x4974ca(0x17f))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x4974ca(0x196),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');await mkdir(_0x327ae6[_0x4974ca(0x1a0)],{'recursive':!![]});let _0x1d359f;try{_0x1d359f=await readFile(_0x327ae6[_0x4974ca(0x18b)],'utf8');}catch(_0x56b4a5){if(!isMissingFile(_0x56b4a5))throw instantApiPolicyError('instant_api_policy_file_unreadable','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20'+_0x327ae6[_0x4974ca(0x18b)]);}if(_0x1d359f===_0x5f9afc)return{'action':_0x4974ca(0x179),'filePath':_0x327ae6[_0x4974ca(0x18b)]};if(_0x1d359f!==undefined&&!_0x547b97[_0x4974ca(0x191)])throw instantApiPolicyError(_0x4974ca(0x171),_0x4974ca(0x1a6)+_0x327ae6[_0x4974ca(0x18b)],_0x4974ca(0x192));if(_0x1d359f===undefined)try{return await writeFile(_0x327ae6[_0x4974ca(0x18b)],_0x5f9afc,{'encoding':_0x4974ca(0x17f),'flag':'wx'}),{'action':_0x4974ca(0x17b),'filePath':_0x327ae6[_0x4974ca(0x18b)]};}catch(_0x24a026){if(!isAlreadyExists(_0x24a026))throw instantApiPolicyError(_0x4974ca(0x1a4),_0x4974ca(0x181)+_0x327ae6[_0x4974ca(0x18b)]);if(!_0x547b97[_0x4974ca(0x191)])throw instantApiPolicyError('instant_api_policy_file_exists',_0x4974ca(0x16c)+_0x327ae6[_0x4974ca(0x18b)],_0x4974ca(0x19b));}const _0x4d247d=resolve(dirname(_0x327ae6[_0x4974ca(0x18b)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x4974ca(0x17e)]+'.'+randomUUID()+'.tmp');try{await writeFile(_0x4d247d,_0x5f9afc,{'encoding':_0x4974ca(0x17f),'flag':'wx'}),await rename(_0x4d247d,_0x327ae6[_0x4974ca(0x18b)]);}catch{await unlink(_0x4d247d)['catch'](()=>undefined);throw instantApiPolicyError(_0x4974ca(0x1a4),_0x4974ca(0x1aa)+_0x327ae6[_0x4974ca(0x18b)]);}return{'action':_0x4974ca(0x172),'filePath':_0x327ae6[_0x4974ca(0x18b)]};}function assertSafeAppCode(_0x1f3b3c){const _0x5aeb9c=a253_0x2157e0,_0x17448c=_0x1f3b3c[_0x5aeb9c(0x170)]();if(!_0x17448c||_0x17448c!==_0x1f3b3c||_0x17448c[_0x5aeb9c(0x185)]>0x64||_0x17448c==='.'||_0x17448c==='..'||_0x17448c[_0x5aeb9c(0x16f)]('/')||_0x17448c['includes']('\x5c')||_0x17448c[_0x5aeb9c(0x16f)]('\x00'))throw instantApiPolicyError(_0x5aeb9c(0x199),_0x5aeb9c(0x18a));}function assertLocalPolicyContract(_0x1385a2,_0xd57810){const _0x3ba03e=a253_0x2157e0;if(!isObject(_0x1385a2))throw instantApiPolicyError(_0x3ba03e(0x190),_0x3ba03e(0x1a1));if(_0x1385a2[_0x3ba03e(0x19c)]!=='1')throw instantApiPolicyError(_0x3ba03e(0x182),_0x3ba03e(0x1ab),_0x3ba03e(0x1a7));if(_0x1385a2[_0x3ba03e(0x16d)]!==_0xd57810)throw instantApiPolicyError('instant_api_policy_app_code_mismatch','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20'+_0xd57810+'.');if(!isObject(_0x1385a2[_0x3ba03e(0x189)])||typeof _0x1385a2[_0x3ba03e(0x189)]['instantApi']!==_0x3ba03e(0x1a3))throw instantApiPolicyError(_0x3ba03e(0x16e),'Policy\x20defaults.instantApi\x20is\x20required.');if(_0x1385a2[_0x3ba03e(0x186)]!==undefined&&_0x1385a2[_0x3ba03e(0x186)]!==null&&!Array['isArray'](_0x1385a2[_0x3ba03e(0x186)]))throw instantApiPolicyError(_0x3ba03e(0x18c),_0x3ba03e(0x19e));return _0x1385a2;}function isObject(_0x562394){const _0x221dfb=a253_0x2157e0;return _0x562394!==null&&typeof _0x562394===_0x221dfb(0x1a8)&&!Array[_0x221dfb(0x1a5)](_0x562394);}function a253_0x10b4(){const _0x14f912=['unchanged','4665MJyRNu','created','utf-8','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20','pid','utf8','12TwwHIi','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_version_invalid','allow','instant_api_policy_file_unreadable','length','rules','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','instant_api_policy_file_missing','defaults','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','policyFilePath','instant_api_policy_rules_invalid','39804iRmvHa','EEXIST','6147027TOyIJw','instant_api_policy_json_invalid','force','Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','isFile','ENOENT','instant_api_policy_file_too_large','size','6566128pbJvmC','instant_api_policy_app_code_invalid','9277qzaEMy','Review\x20the\x20file\x20before\x20retrying.','version','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','22DlHtqH','policyRoot','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','byteLength','string','instant_api_policy_file_unwritable','isArray','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','object','4702848GHCBpd','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22.','stringify','.rabetbase/instant-api-policy','1812wrfPfS','instant_api_policy_file_invalid','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','appCode','instant_api_policy_defaults_invalid','includes','trim','instant_api_policy_file_exists','overwritten','parse','23469380iWTIPe','10IINJSM','7pVKkVA','decode','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20'];a253_0x10b4=function(){return _0x14f912;};return a253_0x10b4();}function isMissingFile(_0xd0c32c){const _0x380156=a253_0x2157e0;return Boolean(_0xd0c32c&&typeof _0xd0c32c===_0x380156(0x1a8)&&_0xd0c32c['code']===_0x380156(0x195));}function a253_0x230c(_0x38a6d9,_0x255fab){_0x38a6d9=_0x38a6d9-0x16b;const _0x10b429=a253_0x10b4();let _0x230c9f=_0x10b429[_0x38a6d9];return _0x230c9f;}function isAlreadyExists(_0x420b94){const _0x21b97c=a253_0x2157e0;return Boolean(_0x420b94&&typeof _0x420b94===_0x21b97c(0x1a8)&&_0x420b94['code']===_0x21b97c(0x18e));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a254_0x575bd3=a254_0x371f;(function(_0x4d48be,_0x7219f2){const _0x2affa1=a254_0x371f,_0xe9bc24=_0x4d48be();while(!![]){try{const _0x481a59=parseInt(_0x2affa1(0xa4))/0x1+-parseInt(_0x2affa1(0xc4))/0x2*(-parseInt(_0x2affa1(0xb5))/0x3)+parseInt(_0x2affa1(0xd6))/0x4+-parseInt(_0x2affa1(0xad))/0x5*(parseInt(_0x2affa1(0xb2))/0x6)+parseInt(_0x2affa1(0x93))/0x7*(parseInt(_0x2affa1(0x96))/0x8)+parseInt(_0x2affa1(0xb9))/0x9*(parseInt(_0x2affa1(0x9e))/0xa)+-parseInt(_0x2affa1(0xcb))/0xb;if(_0x481a59===_0x7219f2)break;else _0xe9bc24['push'](_0xe9bc24['shift']());}catch(_0x4910a8){_0xe9bc24['push'](_0xe9bc24['shift']());}}}(a254_0x5959,0xa8ed8));import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';function a254_0x5959(){const _0x3fc1b4=['timingsMs','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','40CCdVUS','isArray','finalScore','/smartapi/knowledge/company-public/search','status','isSafeInteger','title','8961733WUdUyo','apiError','application/json','isFinite','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','no-store','topK','get','query','entries','Knowledge\x20search\x20query\x20is\x20required.','1149304jjPUIx','object','json','sort','authRequired','hits','chunkId','scoreKind','revision','74935azxIjB','text','profile','280eTfgFq','rank','name','cookie','content-type','tags','appCode','strategyFingerprint','626530uuhOuh','trim','rawScore','validation','number','total','308182Ecdffk','some','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','SmartCode\x20knowledge\x20search\x20request\x20failed.','scope','string','Knowledge\x20search\x20appCode\x20is\x20required.','toLowerCase','SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','644510cjMncH','SmartCode\x20knowledge\x20search\x20failed.','\x20contract.','schemaVersion','success','6HjXzGE','public','includes','5823VgSCDh','networkError','POST','test','90jTmAAt','data','score','length','company','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','response\x20envelope','cli:rabetbase'];a254_0x5959=function(){return _0x3fc1b4;};return a254_0x5959();}const RESPONSE_KEYS=['schemaVersion',a254_0x575bd3(0x95),'total',a254_0x575bd3(0x8f),a254_0x575bd3(0x9d),'timingsMs'],HIT_KEYS=['documentId',a254_0x575bd3(0x92),a254_0x575bd3(0x90),'scope',a254_0x575bd3(0xca),'text',a254_0x575bd3(0x9b),'rank',a254_0x575bd3(0xa0),'finalScore',a254_0x575bd3(0x91)];export async function searchDevelopmentKnowledge(_0xd2df29){const _0x3a12f9=a254_0x575bd3,_0x26fed4=_0xd2df29[_0x3a12f9(0x9c)]['trim'](),_0x3f0d79=_0xd2df29[_0x3a12f9(0xd3)][_0x3a12f9(0x9f)]();if(!_0x26fed4)throw CliErrors[_0x3a12f9(0xa1)](_0x3a12f9(0xaa));if(!_0xd2df29[_0x3a12f9(0x99)]['trim']())throw CliErrors[_0x3a12f9(0x8e)]();if(!_0x3f0d79)throw CliErrors[_0x3a12f9(0xa1)](_0x3a12f9(0xd5));validateTopK(_0xd2df29['topK']);const _0x2ba29c=getKbDomain()+_0x3a12f9(0xc7);let _0x45d56b;try{_0x45d56b=await fetch(_0x2ba29c,{'method':_0x3a12f9(0xb7),'headers':{'Content-Type':_0x3a12f9(0xcd),'Cookie':_0xd2df29[_0x3a12f9(0x99)],'X-Invoke-Source':_0x3a12f9(0xc0)},'body':JSON['stringify']({'appCode':_0x26fed4,'query':_0x3f0d79,..._0xd2df29[_0x3a12f9(0xd1)]!==undefined?{'topK':_0xd2df29[_0x3a12f9(0xd1)]}:{}}),'signal':_0xd2df29['signal']});}catch(_0x5c1141){if(_0x5c1141 instanceof CliError)throw _0x5c1141;if(_0x5c1141 instanceof Error&&_0x5c1141[_0x3a12f9(0x98)]==='AbortError')throw _0x5c1141;throw CliErrors[_0x3a12f9(0xb6)](_0x3a12f9(0xa7));}if(!hasNoStore(_0x45d56b['headers']))throw CliErrors[_0x3a12f9(0xcc)](_0x3a12f9(0xc3));if(_0x45d56b[_0x3a12f9(0xc8)]===0x191)throw CliErrors[_0x3a12f9(0x8e)]();if(!_0x45d56b['ok'])throw CliErrors[_0x3a12f9(0xcc)](_0x3a12f9(0xcf)+_0x45d56b[_0x3a12f9(0xc8)]+').');if(!(_0x45d56b['headers'][_0x3a12f9(0xd2)](_0x3a12f9(0x9a))??'')[_0x3a12f9(0xab)]()[_0x3a12f9(0xb4)](_0x3a12f9(0xcd)))throw CliErrors[_0x3a12f9(0xcc)](_0x3a12f9(0xbe));let _0x3ef0b7;try{_0x3ef0b7=await _0x45d56b[_0x3a12f9(0xd8)]();}catch{throw CliErrors[_0x3a12f9(0xcc)](_0x3a12f9(0xac));}return parseDevelopmentSearchResponse(readEnvelopeData(_0x3ef0b7),_0xd2df29[_0x3a12f9(0xd1)]);}function readEnvelopeData(_0x386d2f){const _0x755b01=a254_0x575bd3,_0x23aa19=requireRecord(_0x386d2f,_0x755b01(0xbf));if(_0x23aa19[_0x755b01(0xb1)]===![])throw CliErrors[_0x755b01(0xcc)](_0x755b01(0xae));if(!(_0x755b01(0xba)in _0x23aa19))throw invalidContract(_0x755b01(0xbf));return _0x23aa19[_0x755b01(0xba)];}function validateTopK(_0x299cd6){const _0x2a14db=a254_0x575bd3;if(_0x299cd6!==undefined&&(!Number['isSafeInteger'](_0x299cd6)||_0x299cd6<0x1||_0x299cd6>0x32))throw CliErrors['validation'](_0x2a14db(0xc2));}function hasNoStore(_0x18b7a3){const _0x512041=a254_0x575bd3;return(_0x18b7a3[_0x512041(0xd2)]('cache-control')??'')['split'](',')[_0x512041(0xa5)](_0x454fd0=>_0x454fd0[_0x512041(0x9f)]()[_0x512041(0xab)]()===_0x512041(0xd0));}function parseDevelopmentSearchResponse(_0x134e8d,_0x5f5004){const _0x1d557a=a254_0x575bd3,_0x454b2d=requireExactRecord(_0x134e8d,RESPONSE_KEYS,'response');if(_0x454b2d['schemaVersion']!==0x2||_0x454b2d[_0x1d557a(0x95)]!=='development')throw invalidContract(_0x1d557a(0x95));if(!Array['isArray'](_0x454b2d[_0x1d557a(0x8f)])||_0x454b2d[_0x1d557a(0x8f)][_0x1d557a(0xbc)]>(_0x5f5004??0x32))throw invalidContract(_0x1d557a(0x8f));if(typeof _0x454b2d['strategyFingerprint']!==_0x1d557a(0xa9)||!/^sha256:[0-9a-f]{64}$/[_0x1d557a(0xb8)](_0x454b2d[_0x1d557a(0x9d)]))throw invalidContract(_0x1d557a(0x9d));const _0x5db96d=requireRecord(_0x454b2d[_0x1d557a(0xc1)],_0x1d557a(0xc1)),_0xb1ea38={};for(const [_0x24ad21,_0x2be992]of Object[_0x1d557a(0xd4)](_0x5db96d)){if(!/^[A-Za-z][A-Za-z0-9]*$/['test'](_0x24ad21)||typeof _0x2be992!==_0x1d557a(0xa2)||!Number[_0x1d557a(0xce)](_0x2be992)||_0x2be992<0x0)throw invalidContract(_0x1d557a(0xc1));_0xb1ea38[_0x24ad21]=_0x2be992;}const _0xe2f356=_0x454b2d[_0x1d557a(0x8f)]['map']((_0x32f6a1,_0xc2b19b)=>parseHit(_0x32f6a1,_0xc2b19b));if(!Number[_0x1d557a(0xc9)](_0x454b2d[_0x1d557a(0xa3)])||_0x454b2d[_0x1d557a(0xa3)]!==_0xe2f356['length'])throw invalidContract(_0x1d557a(0xa3));return{'schemaVersion':_0x454b2d[_0x1d557a(0xb0)],'profile':_0x454b2d[_0x1d557a(0x95)],'total':_0x454b2d['total'],'strategyFingerprint':_0x454b2d['strategyFingerprint'],'timingsMs':_0xb1ea38,'hits':_0xe2f356};}function parseHit(_0x12bb0d,_0x40dec0){const _0x6e16a9=a254_0x575bd3,_0x11d07d=requireExactRecord(_0x12bb0d,HIT_KEYS,'hits['+_0x40dec0+']'),_0x4c1f0f=_0x1affe9=>{const _0x5d577c=a254_0x371f,_0x3a348c=_0x11d07d[_0x1affe9];if(typeof _0x3a348c!==_0x5d577c(0xa9)||!_0x3a348c)throw invalidContract(_0x1affe9);return _0x3a348c;};if(!Number[_0x6e16a9(0xc9)](_0x11d07d[_0x6e16a9(0x92)])||_0x11d07d[_0x6e16a9(0x92)]<0x1)throw invalidContract('revision');if(_0x11d07d[_0x6e16a9(0xa8)]!==_0x6e16a9(0xb3)&&_0x11d07d[_0x6e16a9(0xa8)]!==_0x6e16a9(0xbd))throw invalidContract(_0x6e16a9(0xa8));if(typeof _0x11d07d[_0x6e16a9(0xca)]!==_0x6e16a9(0xa9)||typeof _0x11d07d[_0x6e16a9(0x94)]!==_0x6e16a9(0xa9))throw invalidContract(_0x6e16a9(0x94));if(!Array[_0x6e16a9(0xc5)](_0x11d07d[_0x6e16a9(0x9b)])||_0x11d07d[_0x6e16a9(0x9b)][_0x6e16a9(0xa5)](_0x5e15ea=>typeof _0x5e15ea!==_0x6e16a9(0xa9)))throw invalidContract(_0x6e16a9(0x9b));if(!Number[_0x6e16a9(0xc9)](_0x11d07d[_0x6e16a9(0x97)])||_0x11d07d[_0x6e16a9(0x97)]!==_0x40dec0+0x1)throw invalidContract(_0x6e16a9(0x97));if(!isFiniteNumber(_0x11d07d['rawScore'])||!isFiniteNumber(_0x11d07d[_0x6e16a9(0xc6)]))throw invalidContract(_0x6e16a9(0xbb));return{'documentId':_0x4c1f0f('documentId'),'revision':_0x11d07d[_0x6e16a9(0x92)],'chunkId':_0x4c1f0f('chunkId'),'scope':_0x11d07d['scope'],'title':_0x11d07d['title'],'text':_0x11d07d[_0x6e16a9(0x94)],'tags':[..._0x11d07d[_0x6e16a9(0x9b)]],'rank':_0x11d07d[_0x6e16a9(0x97)],'rawScore':_0x11d07d['rawScore'],'finalScore':_0x11d07d[_0x6e16a9(0xc6)],'scoreKind':_0x4c1f0f(_0x6e16a9(0x91))};}function requireExactRecord(_0x473619,_0x41642a,_0x218c6b){const _0xcad5fb=a254_0x575bd3,_0x287333=requireRecord(_0x473619,_0x218c6b),_0x1b1655=Object['keys'](_0x287333)[_0xcad5fb(0xd9)](),_0x3c9fd2=[..._0x41642a][_0xcad5fb(0xd9)]();if(_0x1b1655[_0xcad5fb(0xbc)]!==_0x3c9fd2[_0xcad5fb(0xbc)]||_0x1b1655[_0xcad5fb(0xa5)]((_0xbd08e6,_0x1f0868)=>_0xbd08e6!==_0x3c9fd2[_0x1f0868]))throw invalidContract(_0x218c6b);return _0x287333;}function requireRecord(_0x5c8e8d,_0x17a748){const _0x17416b=a254_0x575bd3;if(!_0x5c8e8d||typeof _0x5c8e8d!==_0x17416b(0xd7)||Array[_0x17416b(0xc5)](_0x5c8e8d))throw invalidContract(_0x17a748);return _0x5c8e8d;}function a254_0x371f(_0x5af6de,_0x196ccf){_0x5af6de=_0x5af6de-0x8e;const _0x5959e3=a254_0x5959();let _0x371fef=_0x5959e3[_0x5af6de];return _0x371fef;}function isFiniteNumber(_0x4e7cf5){const _0x4cb7c4=a254_0x575bd3;return typeof _0x4e7cf5==='number'&&Number[_0x4cb7c4(0xce)](_0x4e7cf5);}function invalidContract(_0x161d4e){const _0x295ff7=a254_0x575bd3;return CliErrors[_0x295ff7(0xcc)](_0x295ff7(0xa6)+_0x161d4e+_0x295ff7(0xaf));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a255_0x2b8c3b=a255_0x18fd;(function(_0x4486d5,_0x563142){const _0x3d17ee=a255_0x18fd,_0x332fbd=_0x4486d5();while(!![]){try{const _0x468662=parseInt(_0x3d17ee(0x130))/0x1+-parseInt(_0x3d17ee(0x126))/0x2*(-parseInt(_0x3d17ee(0x112))/0x3)+-parseInt(_0x3d17ee(0x115))/0x4*(parseInt(_0x3d17ee(0x118))/0x5)+parseInt(_0x3d17ee(0x124))/0x6+-parseInt(_0x3d17ee(0x11a))/0x7+-parseInt(_0x3d17ee(0x113))/0x8+-parseInt(_0x3d17ee(0x12a))/0x9*(-parseInt(_0x3d17ee(0x11f))/0xa);if(_0x468662===_0x563142)break;else _0x332fbd['push'](_0x332fbd['shift']());}catch(_0x53a4cd){_0x332fbd['push'](_0x332fbd['shift']());}}}(a255_0x1848,0xc7f47));import{constants}from'node:fs';function a255_0x1848(){const _0xaf3e67=['isFile','split','74709mohFEU','Unsupported\x20file\x20in\x20page\x20directory:\x20','join','.json','sort','validation','1359740rzWXCV','cwd','285EPGBMB','6966024LOcUSr','.rabetbase','3412VeOULU','trim','toUpperCase','985rOYphu','page','10459183gFYDBE','appPagesDir','flagMissing','Page\x20directory\x20not\x20found:\x20','F_OK','1550jCyxMb','isDirectory','page.lock.json','page-dir','utf8','1282608CYsklr','name','10354TDKCkQ','localeCompare'];a255_0x1848=function(){return _0xaf3e67;};return a255_0x1848();}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(_0x4cf2f7,_0x4517f1=process[a255_0x2b8c3b(0x131)]()){const _0x56fd7f=a255_0x2b8c3b,_0x516b52=resolve(_0x4517f1),_0x184f6d=join(_0x516b52,_0x56fd7f(0x114),_0x56fd7f(0x119));return{'projectRoot':_0x516b52,'pagesBaseDir':_0x184f6d,'appPagesDir':join(_0x184f6d,_0x4cf2f7),'lockFilePath':join(_0x516b52,'.rabetbase',_0x56fd7f(0x121))};}export function buildPageFileName(_0x32dbf8,_0x1019c5){const _0xfc9597=a255_0x2b8c3b;return _0x32dbf8+'-'+_0x1019c5[_0xfc9597(0x117)]()+_0xfc9597(0x12d);}export function resolvePageFilePath(_0x24cda9,_0x390f1e,_0x4d19cd){const _0x41863c=a255_0x2b8c3b;return join(_0x24cda9[_0x41863c(0x11b)],buildPageFileName(_0x390f1e,_0x4d19cd));}export async function ensureParentDirectory(_0x10e574){await mkdir(dirname(_0x10e574),{'recursive':!![]});}export async function fileExists(_0x35fa72){const _0x209bd6=a255_0x2b8c3b;try{return await access(_0x35fa72,constants[_0x209bd6(0x11e)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0x2852ae){const _0x3facad=a255_0x2b8c3b,_0x169bed=_0x2852ae[_0x3facad(0x116)]();if(!_0x169bed)throw CliErrors[_0x3facad(0x11c)](_0x3facad(0x122));const _0x23fb26=resolve(_0x169bed);let _0x406991;try{_0x406991=await lstat(_0x23fb26);}catch{throw CliErrors[_0x3facad(0x12f)](_0x3facad(0x11d)+_0x169bed);}if(!_0x406991[_0x3facad(0x120)]())throw CliErrors['validation']('Page\x20directory\x20is\x20not\x20a\x20directory:\x20'+_0x169bed);const _0x6cc459={};return await readDirectory(_0x23fb26,_0x23fb26,_0x6cc459),_0x6cc459;}function a255_0x18fd(_0x56fc10,_0xe06026){_0x56fc10=_0x56fc10-0x112;const _0x184881=a255_0x1848();let _0x18fd77=_0x184881[_0x56fc10];return _0x18fd77;}async function readDirectory(_0x4e9ca2,_0x1cf530,_0x52d657){const _0x2e1765=a255_0x2b8c3b,_0xdb987d=await readdir(_0x1cf530,{'withFileTypes':!![]});for(const _0xfe0d14 of _0xdb987d[_0x2e1765(0x12e)]((_0x430e5c,_0x3c15ee)=>_0x430e5c[_0x2e1765(0x125)][_0x2e1765(0x127)](_0x3c15ee[_0x2e1765(0x125)]))){const _0x3bd3d6=join(_0x1cf530,_0xfe0d14[_0x2e1765(0x125)]);if(_0xfe0d14[_0x2e1765(0x120)]()){await readDirectory(_0x4e9ca2,_0x3bd3d6,_0x52d657);continue;}if(!_0xfe0d14[_0x2e1765(0x128)]())throw CliErrors['validation'](_0x2e1765(0x12b)+_0x3bd3d6);_0x52d657[relative(_0x4e9ca2,_0x3bd3d6)[_0x2e1765(0x129)](sep)[_0x2e1765(0x12c)]('/')]=await readFile(_0x3bd3d6,_0x2e1765(0x123));}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a256_0x4997(_0x199d1f,_0x2d55c1){_0x199d1f=_0x199d1f-0x158;const _0x5065e5=a256_0x5065();let _0x499707=_0x5065e5[_0x199d1f];return _0x499707;}(function(_0x4fd53e,_0x5a5ed7){const _0x4686d1=a256_0x4997,_0x10101c=_0x4fd53e();while(!![]){try{const _0x1394c9=parseInt(_0x4686d1(0x163))/0x1+parseInt(_0x4686d1(0x15e))/0x2+parseInt(_0x4686d1(0x165))/0x3+parseInt(_0x4686d1(0x15b))/0x4+parseInt(_0x4686d1(0x161))/0x5+-parseInt(_0x4686d1(0x15c))/0x6*(parseInt(_0x4686d1(0x15d))/0x7)+-parseInt(_0x4686d1(0x158))/0x8;if(_0x1394c9===_0x5a5ed7)break;else _0x10101c['push'](_0x10101c['shift']());}catch(_0x389575){_0x10101c['push'](_0x10101c['shift']());}}}(a256_0x5065,0x25ff1));import a256_0x52100f from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x77718a){const _0x45441b=a256_0x4997;return JSON[_0x45441b(0x162)](JSON[_0x45441b(0x15a)](_0x77718a),null,0x2)+'\x0a';}export function computePageContentHash(_0x56b56a){const _0x300a85=a256_0x4997;return a256_0x52100f[_0x300a85(0x159)](_0x300a85(0x166))['update'](_0x56b56a)[_0x300a85(0x160)](_0x300a85(0x164));}export function computeSerializedSchemaHash(_0x2c3099){return computePageContentHash(serializePageSchemaForFile(_0x2c3099));}function a256_0x5065(){const _0x42a2a4=['utf8','digest','1237885WLiXJt','stringify','203763zUsFbh','hex','380985yVBwGG','md5','3808536LjXnrv','createHash','parse','35884pmZNKC','402TxNmPO','15267bCifIr','381042XhmydH'];a256_0x5065=function(){return _0x42a2a4;};return a256_0x5065();}export async function computePageFileHash(_0x7617e2){const _0x225c12=a256_0x4997,_0x55d600=await readFile(_0x7617e2,_0x225c12(0x15f));return computePageContentHash(_0x55d600);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3fe5d7,_0x248219){const _0x2c8f45=a257_0x29ec,_0x39f90f=_0x3fe5d7();while(!![]){try{const _0x1291f7=parseInt(_0x2c8f45(0xdf))/0x1*(parseInt(_0x2c8f45(0xdb))/0x2)+parseInt(_0x2c8f45(0xd4))/0x3+parseInt(_0x2c8f45(0xd9))/0x4+-parseInt(_0x2c8f45(0xde))/0x5+parseInt(_0x2c8f45(0xe3))/0x6*(parseInt(_0x2c8f45(0xdc))/0x7)+-parseInt(_0x2c8f45(0xd6))/0x8+-parseInt(_0x2c8f45(0xd7))/0x9*(parseInt(_0x2c8f45(0xd3))/0xa);if(_0x1291f7===_0x248219)break;else _0x39f90f['push'](_0x39f90f['shift']());}catch(_0x4a5c10){_0x39f90f['push'](_0x39f90f['shift']());}}}(a257_0x2b20,0x59c7c));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a257_0x2b20(){const _0xff213c=['utf8','31938UioDwG','lastSync','20YXjgYo','601284yiMjNf','pages','2745880xZqnAD','218772IFPkcI','parse','2544068BKFWHN','apps','10ILmPvs','259nyJImk','object','3489075wIjiGX','84802VhvBZe','ENOENT','code'];a257_0x2b20=function(){return _0xff213c;};return a257_0x2b20();}function a257_0x29ec(_0x1c8fe4,_0x42298b){_0x1c8fe4=_0x1c8fe4-0xd2;const _0x2b20dc=a257_0x2b20();let _0x29ecb3=_0x2b20dc[_0x1c8fe4];return _0x29ecb3;}export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x4e9a42,_0xaffed2){const _0x4a4737=a257_0x29ec,_0x26f10b={'apps':_0x4e9a42[_0x4a4737(0xda)]&&typeof _0x4e9a42[_0x4a4737(0xda)]===_0x4a4737(0xdd)?_0x4e9a42[_0x4a4737(0xda)]:{}};let _0x244156=_0x26f10b['apps'][_0xaffed2];if(!_0x244156)return _0x244156={'lastSync':'','pages':{}},_0x26f10b[_0x4a4737(0xda)][_0xaffed2]=_0x244156,{'lockData':_0x26f10b,'appLock':_0x244156};return!_0x244156['lastSync']&&(_0x244156[_0x4a4737(0xd2)]=''),(!_0x244156[_0x4a4737(0xd5)]||typeof _0x244156['pages']!==_0x4a4737(0xdd))&&(_0x244156[_0x4a4737(0xd5)]={}),{'lockData':_0x26f10b,'appLock':_0x244156};}export async function readPageLockFile(_0x41d323){const _0x49191b=a257_0x29ec;try{const _0x4d66c3=await readFile(_0x41d323,_0x49191b(0xe2)),_0x2a62ca=JSON[_0x49191b(0xd8)](_0x4d66c3);return{'apps':_0x2a62ca[_0x49191b(0xda)]&&typeof _0x2a62ca[_0x49191b(0xda)]===_0x49191b(0xdd)?_0x2a62ca[_0x49191b(0xda)]:{}};}catch(_0x18b0b8){if(_0x18b0b8[_0x49191b(0xe1)]===_0x49191b(0xe0))return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0x18b0b8));}}export async function writePageLockFile(_0x201c4b,_0xba7d3f){const _0x363a1f=a257_0x29ec;await mkdir(dirname(_0x201c4b),{'recursive':!![]}),await writeFile(_0x201c4b,JSON['stringify'](_0xba7d3f,null,0x2),_0x363a1f(0xe2));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a261_0x1dd8(_0x315d3d,_0x269c4a){_0x315d3d=_0x315d3d-0xa0;const _0x1c0bef=a261_0x1c0b();let _0x1dd86d=_0x1c0bef[_0x315d3d];return _0x1dd86d;}(function(_0x5453fa,_0xb9414d){const _0xa9ea4a=a261_0x1dd8,_0x6118cd=_0x5453fa();while(!![]){try{const _0x4378f5=-parseInt(_0xa9ea4a(0xae))/0x1*(parseInt(_0xa9ea4a(0xa6))/0x2)+-parseInt(_0xa9ea4a(0xe3))/0x3+-parseInt(_0xa9ea4a(0xc6))/0x4+-parseInt(_0xa9ea4a(0xa9))/0x5+parseInt(_0xa9ea4a(0xcf))/0x6*(parseInt(_0xa9ea4a(0xe7))/0x7)+-parseInt(_0xa9ea4a(0xd4))/0x8*(parseInt(_0xa9ea4a(0xda))/0x9)+parseInt(_0xa9ea4a(0xcd))/0xa;if(_0x4378f5===_0xb9414d)break;else _0x6118cd['push'](_0x6118cd['shift']());}catch(_0x370c80){_0x6118cd['push'](_0x6118cd['shift']());}}}(a261_0x1c0b,0xacf62));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x2bb37b,_0x1b9df7){const _0x586b69=a261_0x1dd8,_0x79d2f7=[],_0xc28273=normalizeSqlForStaticAnalysis(_0x2bb37b),_0x22470c=(_0xc28273[_0x586b69(0xc3)]?[]:extractJoinFacts(_0xc28273[_0x586b69(0xa0)]))['map'](_0x2bacec=>{const _0x38e867=_0x586b69;if(_0x2bacec['unsupportedPredicate']||_0x2bacec[_0x38e867(0xbc)][_0x38e867(0xd7)]===0x0)return _0x79d2f7[_0x38e867(0xca)]({'code':_0x38e867(0xac),'table':_0x2bacec['table'],'alias':_0x2bacec[_0x38e867(0xbe)],'columns':_0x2bacec[_0x38e867(0xbc)],'reason':_0x2bacec[_0x38e867(0xe6)]??_0x38e867(0xd8)}),{'table':_0x2bacec[_0x38e867(0xa8)],'alias':_0x2bacec[_0x38e867(0xbe)],'columns':_0x2bacec[_0x38e867(0xbc)],'status':'unavailable'};const _0xe23934=resolveTableMetadata(_0x1b9df7,_0x2bacec[_0x38e867(0xa8)]),_0x5c7e38=(_0xe23934?.[_0x38e867(0xcb)]??[])['map'](_0x3d137f=>({'index':_0x3d137f,'matchedPrefix':findEqualityPrefix(_0x3d137f[_0x38e867(0xbc)],_0x2bacec[_0x38e867(0xbc)])}))['filter'](_0xd55834=>_0xd55834[_0x38e867(0xdc)][_0x38e867(0xd7)]>0x0),_0x42aae6=_0x5c7e38[_0x38e867(0xdb)]((_0x55a5eb,_0x545003)=>!_0x55a5eb||_0x545003[_0x38e867(0xdc)]['length']>_0x55a5eb['matchedPrefix'][_0x38e867(0xd7)]?_0x545003:_0x55a5eb,_0x5c7e38[0x0]);if(_0x42aae6)return{'table':_0x2bacec[_0x38e867(0xa8)],'alias':_0x2bacec[_0x38e867(0xbe)],'columns':_0x2bacec[_0x38e867(0xbc)],'status':_0x38e867(0xb3),'matchedIndex':{..._0x42aae6['index'],'matchedPrefix':_0x42aae6[_0x38e867(0xdc)]}};const _0x59b866=_0xe23934?.['indexes'][_0x38e867(0xa4)](_0x1daf0a=>_0x1daf0a[_0x38e867(0xbc)][_0x38e867(0xe1)](_0x48ae0f=>_0x2bacec[_0x38e867(0xbc)][_0x38e867(0xe1)](_0xf11f96=>columnNamesMatch(_0x48ae0f,_0xf11f96))))??[];if(_0x59b866[_0x38e867(0xd7)]>0x0)return _0x79d2f7[_0x38e867(0xca)]({'code':_0x38e867(0xa1),'table':_0x2bacec[_0x38e867(0xa8)],'alias':_0x2bacec[_0x38e867(0xbe)],'columns':_0x2bacec['columns'],'reason':_0x38e867(0xaa)}),{'table':_0x2bacec['table'],'alias':_0x2bacec[_0x38e867(0xbe)],'columns':_0x2bacec[_0x38e867(0xbc)],'status':_0x38e867(0xde),'candidateIndexes':_0x59b866};if(_0xe23934&&_0xe23934[_0x38e867(0xd0)]!==![]&&_0xe23934[_0x38e867(0xcb)]['length']>0x0&&_0x2bacec[_0x38e867(0xbc)][_0x38e867(0xd7)]>0x0)return _0x79d2f7[_0x38e867(0xca)]({'code':_0x38e867(0xa2),'table':_0x2bacec[_0x38e867(0xa8)],'alias':_0x2bacec[_0x38e867(0xbe)],'columns':_0x2bacec[_0x38e867(0xbc)],'reason':_0x38e867(0xab)}),{'table':_0x2bacec[_0x38e867(0xa8)],'alias':_0x2bacec[_0x38e867(0xbe)],'columns':_0x2bacec[_0x38e867(0xbc)],'status':_0x38e867(0xde)};return _0x79d2f7[_0x38e867(0xca)]({'code':_0x38e867(0xa5),'table':_0x2bacec['table'],'alias':_0x2bacec['alias'],'columns':_0x2bacec[_0x38e867(0xbc)],'reason':_0xe23934?_0x38e867(0xc7):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x2bacec[_0x38e867(0xa8)],'alias':_0x2bacec[_0x38e867(0xbe)],'columns':_0x2bacec[_0x38e867(0xbc)],'status':'unavailable'};});return{'checked':_0x22470c[_0x586b69(0xd7)]>0x0,'joins':_0x22470c,'warnings':_0x79d2f7};}function extractJoinFacts(_0x31a394){const _0x7c16e=a261_0x1dd8,_0x431dac=maskNestedQueries(stripSqlNoise(_0x31a394)),_0x567bb2=maskQuotedIdentifiers(_0x431dac),_0x1b5a4e=[],_0x3706e3=new Set(),_0x2aaeba=/\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 _0x1091eb of _0x431dac[_0x7c16e(0xc0)](_0x2aaeba)){const _0x1d7fa5=_0x1091eb['index']??0x0,_0x44e9d7=_0x1091eb[0x0]['search'](/\bJOIN\b/i),_0x59e1b3=_0x1d7fa5+Math[_0x7c16e(0xe4)](0x0,_0x44e9d7);if(!/^JOIN\b/i[_0x7c16e(0xb8)](_0x567bb2[_0x7c16e(0xbb)](_0x59e1b3)))continue;_0x3706e3['add'](_0x59e1b3);const _0x33f4d1=normalizeIdentifier(_0x1091eb[0x1]||_0x7c16e(0xa3)),_0x30e72b=normalizeIdentifier(_0x1091eb[0x2]??''),_0xec1274=normalizeIdentifier(_0x1091eb[0x3]||_0x30e72b[_0x7c16e(0xdd)]('.')['at'](-0x1)||_0x30e72b),_0x19c1c9=[],_0x3057ea=_0x30e72b===_0x7c16e(0xb9);let _0x421425=_0x33f4d1===_0x7c16e(0xb0)||_0x33f4d1===_0x7c16e(0xb2)||_0x3057ea,_0x888d5b=_0x421425?_0x3057ea?_0x7c16e(0xb6):_0x33f4d1[_0x7c16e(0xc2)]()+'\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.':undefined;const _0x5c2a09=stripOuterParentheses(_0x1091eb[0x4]??''),_0x1a5ff6=_0x5c2a09[_0x7c16e(0xd1)](MYBATIS_DYNAMIC_START_MARKER)||_0x5c2a09[_0x7c16e(0xd1)](MYBATIS_DYNAMIC_END_MARKER),_0x3a6df8=_0x5c2a09['includes'](MYBATIS_INCLUDE_MARKER);_0x1a5ff6&&(_0x421425=!![],_0x888d5b??='MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.');_0x3a6df8&&(_0x421425=!![],_0x888d5b??=_0x7c16e(0xb5));const _0x12e479=_0x5c2a09[_0x7c16e(0xd2)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x7c16e(0xd2)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x12e479,'OR')&&(_0x421425=!![],_0x888d5b??=_0x7c16e(0xa7));for(const _0x7a5431 of splitTopLevelAnd(_0x12e479)){const _0x2bf8d1=stripOuterParentheses(_0x7a5431);if(hasTopLevelKeyword(_0x2bf8d1,'OR')){_0x421425=!![],_0x888d5b??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x2e9afd=splitEquality(_0x2bf8d1);if(!_0x2e9afd){containsColumnReference(_0x7a5431,_0xec1274)&&(_0x421425=!![]);continue;}const _0x27d896=parseDirectColumnReference(_0x2e9afd[0x0],_0xec1274),_0x5b8caa=parseDirectColumnReference(_0x2e9afd[0x1],_0xec1274),_0x47447e=containsColumnReference(_0x2e9afd[0x0],_0xec1274),_0x1f1fd7=containsColumnReference(_0x2e9afd[0x1],_0xec1274),_0x3eef3c=_0x27d896&&!_0x1f1fd7?_0x27d896:_0x5b8caa&&!_0x47447e?_0x5b8caa:null;if(_0x3eef3c&&!_0x19c1c9[_0x7c16e(0xd1)](_0x3eef3c))_0x19c1c9['push'](_0x3eef3c);else!_0x3eef3c&&containsColumnReference(_0x7a5431,_0xec1274)&&(_0x421425=!![]);}_0x1b5a4e[_0x7c16e(0xca)]({'table':_0x30e72b,'alias':_0xec1274,'columns':_0x19c1c9,'unsupportedPredicate':_0x421425,'unsupportedReason':_0x888d5b,'containsUnresolvedInclude':_0x3a6df8,'position':_0x59e1b3});}for(const _0x111e0a of _0x567bb2[_0x7c16e(0xc0)](/\bJOIN\b/gi)){const _0x8f4807=_0x111e0a[_0x7c16e(0xc1)]??0x0;if(_0x3706e3['has'](_0x8f4807))continue;const _0x4c63ac=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x7c16e(0xc4)](_0x431dac[_0x7c16e(0xbb)](_0x8f4807+_0x111e0a[0x0][_0x7c16e(0xd7)])),_0x487791=normalizeIdentifier(_0x4c63ac?.[0x1]||_0x7c16e(0xd5)),_0x5c2636=normalizeIdentifier(_0x4c63ac?.[0x2]||''),_0x5a7a91=isSqlClauseKeyword(_0x5c2636)?_0x487791[_0x7c16e(0xdd)]('.')['at'](-0x1)||_0x487791:_0x5c2636||_0x487791[_0x7c16e(0xdd)]('.')['at'](-0x1)||_0x487791;_0x1b5a4e['push']({'table':_0x487791,'alias':_0x5a7a91,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x8f4807});}const _0x49ab77=_0x567bb2[_0x7c16e(0xb1)](MYBATIS_INCLUDE_MARKER);return _0x49ab77>=0x0&&!_0x1b5a4e['some'](_0x421ac7=>_0x421ac7[_0x7c16e(0xd3)])&&_0x1b5a4e[_0x7c16e(0xca)]({'table':'unknown','alias':_0x7c16e(0xd5),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x7c16e(0xc9),'containsUnresolvedInclude':!![],'position':_0x49ab77}),_0x1b5a4e['sort']((_0x14aac3,_0x54285d)=>_0x14aac3['position']-_0x54285d[_0x7c16e(0xce)]);}function stripSqlNoise(_0xe405c8){const _0x38c4be=a261_0x1dd8,_0x2c8778=Array[_0x38c4be(0xd9)](_0xe405c8),_0x547c33=(_0x3819ba,_0x5961f7)=>{for(let _0xb910cd=_0x3819ba;_0xb910cd<_0x5961f7;_0xb910cd+=0x1){_0x2c8778[_0xb910cd]!=='\x0a'&&_0x2c8778[_0xb910cd]!=='\x0d'&&(_0x2c8778[_0xb910cd]='\x20');}};for(let _0x412b97=0x0;_0x412b97<_0x2c8778[_0x38c4be(0xd7)];_0x412b97+=0x1){const _0x404cea=_0x2c8778[_0x412b97],_0x167d7e=_0x2c8778[_0x412b97+0x1];if(_0x404cea==='\x27'||_0x404cea==='\x22'||_0x404cea==='`'){const _0x2c1f05=_0x404cea,_0x4fd759=_0x412b97;_0x412b97+=0x1;while(_0x412b97<_0x2c8778[_0x38c4be(0xd7)]){if(_0x2c8778[_0x412b97]==='\x5c'&&_0x412b97+0x1<_0x2c8778[_0x38c4be(0xd7)]){_0x412b97+=0x2;continue;}if(_0x2c8778[_0x412b97]!==_0x2c1f05){_0x412b97+=0x1;continue;}if(_0x2c8778[_0x412b97+0x1]===_0x2c1f05){_0x412b97+=0x2;continue;}break;}if(_0x2c1f05==='\x27')_0x547c33(_0x4fd759,Math[_0x38c4be(0xbd)](_0x412b97+0x1,_0x2c8778[_0x38c4be(0xd7)]));continue;}if(_0x404cea==='-'&&_0x167d7e==='-'){const _0x5b4fa8=_0x412b97;while(_0x412b97<_0x2c8778[_0x38c4be(0xd7)]&&_0x2c8778[_0x412b97]!=='\x0a')_0x412b97+=0x1;_0x547c33(_0x5b4fa8,_0x412b97);continue;}if(_0x404cea==='/'&&_0x167d7e==='*'){const _0x425834=_0x412b97;_0x412b97+=0x2;while(_0x412b97<_0x2c8778['length']&&!(_0x2c8778[_0x412b97]==='*'&&_0x2c8778[_0x412b97+0x1]==='/')){_0x412b97+=0x1;}_0x412b97=Math[_0x38c4be(0xbd)](_0x412b97+0x1,_0x2c8778[_0x38c4be(0xd7)]-0x1),_0x547c33(_0x425834,_0x412b97+0x1);continue;}if(_0x404cea==='#'&&_0x167d7e!=='{'){const _0x399d9b=_0x412b97;while(_0x412b97<_0x2c8778[_0x38c4be(0xd7)]&&_0x2c8778[_0x412b97]!=='\x0a')_0x412b97+=0x1;_0x547c33(_0x399d9b,_0x412b97);continue;}if((_0x404cea==='#'||_0x404cea==='$')&&_0x167d7e==='{'){const _0x24b745=_0x412b97;_0x412b97+=0x2;while(_0x412b97<_0x2c8778['length']&&_0x2c8778[_0x412b97]!=='}')_0x412b97+=0x1;_0x547c33(_0x24b745,Math[_0x38c4be(0xbd)](_0x412b97+0x1,_0x2c8778['length']));}}return _0x2c8778[_0x38c4be(0xaf)]('');}function maskQuotedIdentifiers(_0x2421f6){const _0x3ab3d3=a261_0x1dd8,_0x51c29e=Array[_0x3ab3d3(0xd9)](_0x2421f6);for(let _0x49d77d=0x0;_0x49d77d<_0x51c29e[_0x3ab3d3(0xd7)];_0x49d77d+=0x1){const _0x119437=_0x51c29e[_0x49d77d];if(_0x119437!=='\x22'&&_0x119437!=='`')continue;_0x49d77d+=0x1;while(_0x49d77d<_0x51c29e[_0x3ab3d3(0xd7)]){if(_0x51c29e[_0x49d77d]===_0x119437){if(_0x51c29e[_0x49d77d+0x1]===_0x119437){_0x51c29e[_0x49d77d]='\x20',_0x51c29e[_0x49d77d+0x1]='\x20',_0x49d77d+=0x2;continue;}break;}_0x51c29e[_0x49d77d]='\x20',_0x49d77d+=0x1;}}return _0x51c29e[_0x3ab3d3(0xaf)]('');}function maskNestedQueries(_0x23aabe){const _0x2ae9f8=a261_0x1dd8,_0x3ce5ea=Array[_0x2ae9f8(0xd9)](_0x23aabe);for(let _0x52017b=0x0;_0x52017b<_0x3ce5ea[_0x2ae9f8(0xd7)];_0x52017b+=0x1){if(_0x3ce5ea[_0x52017b]!=='(')continue;const _0x42f357=_0x23aabe[_0x2ae9f8(0xbb)](_0x52017b+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x2ae9f8(0xb8)](_0x42f357))continue;let _0x4cd3e4=0x1,_0x2ce4b6=_0x52017b+0x1;for(;_0x2ce4b6<_0x3ce5ea[_0x2ae9f8(0xd7)]&&_0x4cd3e4>0x0;_0x2ce4b6+=0x1){if(_0x3ce5ea[_0x2ce4b6]==='(')_0x4cd3e4+=0x1;if(_0x3ce5ea[_0x2ce4b6]===')')_0x4cd3e4-=0x1;}if(_0x4cd3e4!==0x0)continue;for(let _0x38c8d1=_0x52017b;_0x38c8d1<_0x2ce4b6;_0x38c8d1+=0x1){_0x3ce5ea[_0x38c8d1]='\x20';}const _0x3c0ae0=_0x2ae9f8(0xb9);for(let _0x52d9ce=0x0;_0x52d9ce<_0x3c0ae0[_0x2ae9f8(0xd7)]&&_0x52017b+_0x52d9ce<_0x2ce4b6;_0x52d9ce+=0x1){_0x3ce5ea[_0x52017b+_0x52d9ce]=_0x3c0ae0[_0x52d9ce];}_0x52017b=_0x2ce4b6-0x1;}return _0x3ce5ea[_0x2ae9f8(0xaf)]('');}function splitTopLevelAnd(_0x10ea5a){const _0x3ddc3c=a261_0x1dd8,_0x454601=[];let _0x19ffe2=0x0,_0x5826ab=0x0;for(let _0x548760=0x0;_0x548760<_0x10ea5a['length'];_0x548760+=0x1){const _0x175805=_0x10ea5a[_0x548760];if(_0x175805==='(')_0x19ffe2+=0x1;if(_0x175805===')')_0x19ffe2=Math[_0x3ddc3c(0xe4)](0x0,_0x19ffe2-0x1);_0x19ffe2===0x0&&_0x10ea5a['slice'](_0x548760)[_0x3ddc3c(0xad)](/^AND\b/i)&&(_0x548760===0x0||/\s/[_0x3ddc3c(0xb8)](_0x10ea5a[_0x548760-0x1]??''))&&(_0x454601[_0x3ddc3c(0xca)](_0x10ea5a[_0x3ddc3c(0xbb)](_0x5826ab,_0x548760)['trim']()),_0x548760+=0x2,_0x5826ab=_0x548760+0x1);}const _0x52ce73=_0x10ea5a['slice'](_0x5826ab)[_0x3ddc3c(0xe0)]();if(_0x52ce73)_0x454601[_0x3ddc3c(0xca)](_0x52ce73);return _0x454601;}function hasTopLevelKeyword(_0xdf8529,_0x4b05bb){const _0x340587=a261_0x1dd8;let _0x477934=0x0;for(let _0x488418=0x0;_0x488418<_0xdf8529[_0x340587(0xd7)];_0x488418+=0x1){const _0x12ec1e=_0xdf8529[_0x488418];if(_0x12ec1e==='(')_0x477934+=0x1;if(_0x12ec1e===')')_0x477934=Math[_0x340587(0xe4)](0x0,_0x477934-0x1);if(_0x477934!==0x0)continue;const _0xef62d0=_0xdf8529['slice'](_0x488418,_0x488418+_0x4b05bb[_0x340587(0xd7)]),_0x54bb7d=_0xdf8529[_0x488418-0x1]??'\x20',_0x44d5fd=_0xdf8529[_0x488418+_0x4b05bb[_0x340587(0xd7)]]??'\x20';if(_0xef62d0[_0x340587(0xc2)]()===_0x4b05bb[_0x340587(0xc2)]()&&!/[\w$]/[_0x340587(0xb8)](_0x54bb7d)&&!/[\w$]/[_0x340587(0xb8)](_0x44d5fd))return!![];}return![];}function splitEquality(_0x90c5ff){const _0x2a0864=a261_0x1dd8,_0x4da28f=stripOuterParentheses(_0x90c5ff);let _0x1c0747=0x0,_0x326adb;for(let _0x4f3d6e=0x0;_0x4f3d6e<_0x4da28f[_0x2a0864(0xd7)];_0x4f3d6e+=0x1){const _0x4896e5=_0x4da28f[_0x4f3d6e];if(_0x4896e5==='(')_0x1c0747+=0x1;if(_0x4896e5===')')_0x1c0747=Math['max'](0x0,_0x1c0747-0x1);const _0x2347c6=_0x4da28f[_0x4f3d6e-0x1]??'',_0x5402d8=_0x4da28f[_0x4f3d6e+0x1]??'';if(_0x4896e5==='='&&_0x1c0747===0x0&&!/[!<>=:]/[_0x2a0864(0xb8)](_0x2347c6)&&_0x5402d8!=='='){if(_0x326adb!==undefined)return null;_0x326adb=_0x4f3d6e;}}return _0x326adb===undefined?null:[_0x4da28f[_0x2a0864(0xbb)](0x0,_0x326adb)[_0x2a0864(0xe0)](),_0x4da28f[_0x2a0864(0xbb)](_0x326adb+0x1)[_0x2a0864(0xe0)]()];}function parseDirectColumnReference(_0x587883,_0x5ac411){const _0x3a561a=a261_0x1dd8,_0x4086ea=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x3a561a(0xc4)](stripOuterParentheses(_0x587883));if(!_0x4086ea)return null;if(normalizeIdentifier(_0x4086ea[0x1]??'')!==normalizeIdentifier(_0x5ac411))return null;return normalizeIdentifier(_0x4086ea[0x2]??'');}function containsColumnReference(_0x9a10f4,_0x5605bd){const _0x43a60d=a261_0x1dd8,_0xa64b7d=_0x9a10f4[_0x43a60d(0xcc)](/[`"]/g,''),_0x275386=_0x5605bd[_0x43a60d(0xcc)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x43a60d(0xbf)+_0x275386+_0x43a60d(0xb4),'i')[_0x43a60d(0xb8)](_0xa64b7d);}function a261_0x1c0b(){const _0x43a4e8=['filter','INDEX_METADATA_UNAVAILABLE','236420kXNtUq','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','table','2394595gWgWyB','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','JOIN_PREDICATE_UNSUPPORTED','match','8hJKpbx','join','right','indexOf','full','covered','\x5cs*\x5c.\x5cs*[\x5cw$]+','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','using','test','__sq__','toLowerCase','slice','columns','min','alias','(?:^|[^\x5cw$])','matchAll','index','toUpperCase','error','exec','tableName','1620864OrVrgY','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','has','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','push','indexes','replace','36669590sWPCxH','position','28596nNVjqi','metadataAvailable','includes','replaceAll','containsUnresolvedInclude','64tDLIVu','unknown','endsWith','length','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','from','799911hSosEH','reduce','matchedPrefix','split','warning','left','trim','some','where','1453158MDPXjK','max','natural','unsupportedReason','98RhALAs','sql','JOIN_INDEX_NOT_USABLE','JOIN_INDEX_MISSING','INNER'];a261_0x1c0b=function(){return _0x43a4e8;};return a261_0x1c0b();}function findEqualityPrefix(_0x39bea6,_0x555716){const _0xfe3df5=a261_0x1dd8,_0x52ee5a=new Set(_0x555716['map'](normalizeIdentifier)),_0x4af9bc=[];for(const _0x5ac1c4 of _0x39bea6){if(!_0x52ee5a[_0xfe3df5(0xc8)](normalizeIdentifier(_0x5ac1c4)))break;_0x4af9bc['push'](_0x5ac1c4);}return _0x4af9bc;}function resolveTableMetadata(_0x4767a0,_0x4e1a7f){const _0x20db8d=a261_0x1dd8,_0x3080db=normalizeIdentifier(_0x4e1a7f),_0x186cb9=_0x4767a0[_0x20db8d(0xa4)](_0xb7b0a2=>normalizeIdentifier(_0xb7b0a2[_0x20db8d(0xc5)])===_0x3080db);if(_0x186cb9[_0x20db8d(0xd7)]===0x1)return _0x186cb9[0x0];const _0x40d6ff=_0x3080db[_0x20db8d(0xd1)]('.'),_0x2dd9e0=_0x3080db['split']('.')['at'](-0x1),_0x1183e9=_0x4767a0[_0x20db8d(0xa4)](_0x268df3=>{const _0x1d67ce=_0x20db8d,_0x1d052b=normalizeIdentifier(_0x268df3[_0x1d67ce(0xc5)]);if(_0x40d6ff&&_0x1d052b['includes']('.'))return![];return _0x1d052b['split']('.')['at'](-0x1)===_0x2dd9e0;});return _0x1183e9['length']===0x1?_0x1183e9[0x0]:undefined;}function columnNamesMatch(_0x192502,_0x3fdec9){return normalizeIdentifier(_0x192502)===normalizeIdentifier(_0x3fdec9);}function normalizeIdentifier(_0x96b814){const _0x13dea7=a261_0x1dd8;return _0x96b814['replace'](/[`"]/g,'')[_0x13dea7(0xe0)]()[_0x13dea7(0xba)]();}function isSqlClauseKeyword(_0x55d93a){const _0x3d8a54=a261_0x1dd8;return new Set(['on',_0x3d8a54(0xb7),_0x3d8a54(0xe2),'join','inner',_0x3d8a54(0xdf),_0x3d8a54(0xb0),'full','cross',_0x3d8a54(0xe5)])[_0x3d8a54(0xc8)](_0x55d93a);}function stripOuterParentheses(_0x22ea81){const _0x345a4b=a261_0x1dd8;let _0x587eb6=_0x22ea81[_0x345a4b(0xe0)]();while(_0x587eb6['startsWith']('(')&&_0x587eb6[_0x345a4b(0xd6)](')')){let _0x1abad0=0x0,_0x40a9a9=!![];for(let _0x4a60e2=0x0;_0x4a60e2<_0x587eb6[_0x345a4b(0xd7)];_0x4a60e2+=0x1){if(_0x587eb6[_0x4a60e2]==='(')_0x1abad0+=0x1;if(_0x587eb6[_0x4a60e2]===')')_0x1abad0-=0x1;if(_0x1abad0===0x0&&_0x4a60e2<_0x587eb6['length']-0x1){_0x40a9a9=![];break;}}if(!_0x40a9a9||_0x1abad0!==0x0)break;_0x587eb6=_0x587eb6[_0x345a4b(0xbb)](0x1,-0x1)[_0x345a4b(0xe0)]();}return _0x587eb6;}
|
|
1
|
+
(function(_0xba06f6,_0xe8da6e){const _0x23a0ec=a259_0x406a,_0x3d120a=_0xba06f6();while(!![]){try{const _0xd74145=parseInt(_0x23a0ec(0x1fd))/0x1*(-parseInt(_0x23a0ec(0x1e6))/0x2)+parseInt(_0x23a0ec(0x1e0))/0x3*(-parseInt(_0x23a0ec(0x1fc))/0x4)+parseInt(_0x23a0ec(0x20a))/0x5+parseInt(_0x23a0ec(0x1d5))/0x6*(parseInt(_0x23a0ec(0x219))/0x7)+parseInt(_0x23a0ec(0x212))/0x8+parseInt(_0x23a0ec(0x1ee))/0x9+-parseInt(_0x23a0ec(0x211))/0xa*(parseInt(_0x23a0ec(0x206))/0xb);if(_0xd74145===_0xe8da6e)break;else _0x3d120a['push'](_0x3d120a['shift']());}catch(_0x4fb2ab){_0x3d120a['push'](_0x3d120a['shift']());}}}(a259_0x492a,0xf0db6));function a259_0x406a(_0x4658b8,_0x367679){_0x4658b8=_0x4658b8-0x1ce;const _0x492aae=a259_0x492a();let _0x406a00=_0x492aae[_0x4658b8];return _0x406a00;}import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x52cca7,_0x3a049f){const _0x5b23f6=a259_0x406a,_0x1ad96e=[],_0x2e4b80=normalizeSqlForStaticAnalysis(_0x52cca7),_0x3e70e9=(_0x2e4b80[_0x5b23f6(0x20d)]?[]:extractJoinFacts(_0x2e4b80['sql']))[_0x5b23f6(0x21a)](_0x1f6751=>{const _0x517c14=_0x5b23f6;if(_0x1f6751[_0x517c14(0x1d4)]||_0x1f6751[_0x517c14(0x1ff)][_0x517c14(0x1d6)]===0x0)return _0x1ad96e[_0x517c14(0x1ce)]({'code':_0x517c14(0x201),'table':_0x1f6751['table'],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'reason':_0x1f6751[_0x517c14(0x1e3)]??_0x517c14(0x1f1)}),{'table':_0x1f6751['table'],'alias':_0x1f6751['alias'],'columns':_0x1f6751[_0x517c14(0x1ff)],'status':_0x517c14(0x1f4)};const _0x17fd35=resolveTableMetadata(_0x3a049f,_0x1f6751[_0x517c14(0x200)]),_0x212445=(_0x17fd35?.[_0x517c14(0x218)]??[])['map'](_0x206b6e=>({'index':_0x206b6e,'matchedPrefix':findEqualityPrefix(_0x206b6e[_0x517c14(0x1ff)],_0x1f6751['columns'])}))[_0x517c14(0x1ed)](_0x299ac1=>_0x299ac1[_0x517c14(0x1ef)][_0x517c14(0x1d6)]>0x0),_0x42513f=_0x212445[_0x517c14(0x202)]((_0x303dea,_0x47547d)=>!_0x303dea||_0x47547d[_0x517c14(0x1ef)]['length']>_0x303dea['matchedPrefix'][_0x517c14(0x1d6)]?_0x47547d:_0x303dea,_0x212445[0x0]);if(_0x42513f)return{'table':_0x1f6751[_0x517c14(0x200)],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'status':_0x517c14(0x1f8),'matchedIndex':{..._0x42513f['index'],'matchedPrefix':_0x42513f['matchedPrefix']}};const _0x1081bb=_0x17fd35?.[_0x517c14(0x218)]['filter'](_0x4d6af3=>_0x4d6af3['columns']['some'](_0x4a630f=>_0x1f6751[_0x517c14(0x1ff)][_0x517c14(0x208)](_0x20c3c7=>columnNamesMatch(_0x4a630f,_0x20c3c7))))??[];if(_0x1081bb[_0x517c14(0x1d6)]>0x0)return _0x1ad96e[_0x517c14(0x1ce)]({'code':'JOIN_INDEX_NOT_USABLE','table':_0x1f6751[_0x517c14(0x200)],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'reason':_0x517c14(0x1dd)}),{'table':_0x1f6751[_0x517c14(0x200)],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'status':'warning','candidateIndexes':_0x1081bb};if(_0x17fd35&&_0x17fd35[_0x517c14(0x20c)]!==![]&&_0x17fd35[_0x517c14(0x218)]['length']>0x0&&_0x1f6751[_0x517c14(0x1ff)][_0x517c14(0x1d6)]>0x0)return _0x1ad96e[_0x517c14(0x1ce)]({'code':'JOIN_INDEX_MISSING','table':_0x1f6751['table'],'alias':_0x1f6751['alias'],'columns':_0x1f6751['columns'],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x1f6751['table'],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751['columns'],'status':'warning'};return _0x1ad96e['push']({'code':_0x517c14(0x1d3),'table':_0x1f6751[_0x517c14(0x200)],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'reason':_0x17fd35?_0x517c14(0x1e4):_0x517c14(0x1f3)}),{'table':_0x1f6751['table'],'alias':_0x1f6751['alias'],'columns':_0x1f6751['columns'],'status':_0x517c14(0x1f4)};});return{'checked':_0x3e70e9[_0x5b23f6(0x1d6)]>0x0,'joins':_0x3e70e9,'warnings':_0x1ad96e};}function extractJoinFacts(_0x287eb3){const _0x5b737d=a259_0x406a,_0x39460b=maskNestedQueries(stripSqlNoise(_0x287eb3)),_0x2bd80e=maskQuotedIdentifiers(_0x39460b),_0x5f3848=[],_0x4500ee=new Set(),_0x2bcfd0=/\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 _0x385b50 of _0x39460b[_0x5b737d(0x20b)](_0x2bcfd0)){const _0x54e40f=_0x385b50[_0x5b737d(0x215)]??0x0,_0x171a79=_0x385b50[0x0][_0x5b737d(0x1f9)](/\bJOIN\b/i),_0x1c7a6f=_0x54e40f+Math[_0x5b737d(0x1d0)](0x0,_0x171a79);if(!/^JOIN\b/i[_0x5b737d(0x1d7)](_0x2bd80e['slice'](_0x1c7a6f)))continue;_0x4500ee[_0x5b737d(0x1f6)](_0x1c7a6f);const _0x57dafd=normalizeIdentifier(_0x385b50[0x1]||'INNER'),_0x1f9000=normalizeIdentifier(_0x385b50[0x2]??''),_0x85fa54=normalizeIdentifier(_0x385b50[0x3]||_0x1f9000['split']('.')['at'](-0x1)||_0x1f9000),_0x397090=[],_0x21749a=_0x1f9000===_0x5b737d(0x1d9);let _0x2cf847=_0x57dafd===_0x5b737d(0x217)||_0x57dafd===_0x5b737d(0x1e1)||_0x21749a,_0x3f8ae4=_0x2cf847?_0x21749a?_0x5b737d(0x1e9):_0x57dafd[_0x5b737d(0x1f0)]()+_0x5b737d(0x205):undefined;const _0x5a7ff9=stripOuterParentheses(_0x385b50[0x4]??''),_0x5663b4=_0x5a7ff9[_0x5b737d(0x1e2)](MYBATIS_DYNAMIC_START_MARKER)||_0x5a7ff9['includes'](MYBATIS_DYNAMIC_END_MARKER),_0x21c7b4=_0x5a7ff9['includes'](MYBATIS_INCLUDE_MARKER);_0x5663b4&&(_0x2cf847=!![],_0x3f8ae4??=_0x5b737d(0x216));_0x21c7b4&&(_0x2cf847=!![],_0x3f8ae4??=_0x5b737d(0x1d2));const _0x3ad73a=_0x5a7ff9[_0x5b737d(0x1da)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x5b737d(0x1da)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x5b737d(0x1da)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x3ad73a,'OR')&&(_0x2cf847=!![],_0x3f8ae4??=_0x5b737d(0x20e));for(const _0x2f13ff of splitTopLevelAnd(_0x3ad73a)){const _0x18024e=stripOuterParentheses(_0x2f13ff);if(hasTopLevelKeyword(_0x18024e,'OR')){_0x2cf847=!![],_0x3f8ae4??=_0x5b737d(0x20e);continue;}const _0x468861=splitEquality(_0x18024e);if(!_0x468861){containsColumnReference(_0x2f13ff,_0x85fa54)&&(_0x2cf847=!![]);continue;}const _0x3a00bb=parseDirectColumnReference(_0x468861[0x0],_0x85fa54),_0x5c8060=parseDirectColumnReference(_0x468861[0x1],_0x85fa54),_0x3e9c6e=containsColumnReference(_0x468861[0x0],_0x85fa54),_0x9d9352=containsColumnReference(_0x468861[0x1],_0x85fa54),_0x4def59=_0x3a00bb&&!_0x9d9352?_0x3a00bb:_0x5c8060&&!_0x3e9c6e?_0x5c8060:null;if(_0x4def59&&!_0x397090['includes'](_0x4def59))_0x397090[_0x5b737d(0x1ce)](_0x4def59);else!_0x4def59&&containsColumnReference(_0x2f13ff,_0x85fa54)&&(_0x2cf847=!![]);}_0x5f3848['push']({'table':_0x1f9000,'alias':_0x85fa54,'columns':_0x397090,'unsupportedPredicate':_0x2cf847,'unsupportedReason':_0x3f8ae4,'containsUnresolvedInclude':_0x21c7b4,'position':_0x1c7a6f});}for(const _0x330a56 of _0x2bd80e[_0x5b737d(0x20b)](/\bJOIN\b/gi)){const _0x38b971=_0x330a56[_0x5b737d(0x215)]??0x0;if(_0x4500ee['has'](_0x38b971))continue;const _0x404d1b=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x5b737d(0x1de)](_0x39460b[_0x5b737d(0x1e8)](_0x38b971+_0x330a56[0x0][_0x5b737d(0x1d6)])),_0x40e2c0=normalizeIdentifier(_0x404d1b?.[0x1]||_0x5b737d(0x1e7)),_0x38d39f=normalizeIdentifier(_0x404d1b?.[0x2]||''),_0x57dfad=isSqlClauseKeyword(_0x38d39f)?_0x40e2c0['split']('.')['at'](-0x1)||_0x40e2c0:_0x38d39f||_0x40e2c0[_0x5b737d(0x203)]('.')['at'](-0x1)||_0x40e2c0;_0x5f3848[_0x5b737d(0x1ce)]({'table':_0x40e2c0,'alias':_0x57dfad,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x5b737d(0x214),'position':_0x38b971});}const _0x5b9008=_0x2bd80e[_0x5b737d(0x1cf)](MYBATIS_INCLUDE_MARKER);return _0x5b9008>=0x0&&!_0x5f3848[_0x5b737d(0x208)](_0x570ce2=>_0x570ce2[_0x5b737d(0x1d8)])&&_0x5f3848[_0x5b737d(0x1ce)]({'table':_0x5b737d(0x1e7),'alias':_0x5b737d(0x1e7),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x5b737d(0x1dc),'containsUnresolvedInclude':!![],'position':_0x5b9008}),_0x5f3848[_0x5b737d(0x210)]((_0x2d00ef,_0x3f44ce)=>_0x2d00ef[_0x5b737d(0x1fb)]-_0x3f44ce[_0x5b737d(0x1fb)]);}function stripSqlNoise(_0x34389a){const _0x4105d9=a259_0x406a,_0x1c150a=Array[_0x4105d9(0x1f2)](_0x34389a),_0x587598=(_0x4c49ce,_0x31a48e)=>{for(let _0x189a9a=_0x4c49ce;_0x189a9a<_0x31a48e;_0x189a9a+=0x1){_0x1c150a[_0x189a9a]!=='\x0a'&&_0x1c150a[_0x189a9a]!=='\x0d'&&(_0x1c150a[_0x189a9a]='\x20');}};for(let _0x42c1fe=0x0;_0x42c1fe<_0x1c150a['length'];_0x42c1fe+=0x1){const _0xc0b01=_0x1c150a[_0x42c1fe],_0x15b5a9=_0x1c150a[_0x42c1fe+0x1];if(_0xc0b01==='\x27'||_0xc0b01==='\x22'||_0xc0b01==='`'){const _0x502651=_0xc0b01,_0x4421b5=_0x42c1fe;_0x42c1fe+=0x1;while(_0x42c1fe<_0x1c150a['length']){if(_0x1c150a[_0x42c1fe]==='\x5c'&&_0x42c1fe+0x1<_0x1c150a['length']){_0x42c1fe+=0x2;continue;}if(_0x1c150a[_0x42c1fe]!==_0x502651){_0x42c1fe+=0x1;continue;}if(_0x1c150a[_0x42c1fe+0x1]===_0x502651){_0x42c1fe+=0x2;continue;}break;}if(_0x502651==='\x27')_0x587598(_0x4421b5,Math[_0x4105d9(0x1db)](_0x42c1fe+0x1,_0x1c150a[_0x4105d9(0x1d6)]));continue;}if(_0xc0b01==='-'&&_0x15b5a9==='-'){const _0x40b3aa=_0x42c1fe;while(_0x42c1fe<_0x1c150a[_0x4105d9(0x1d6)]&&_0x1c150a[_0x42c1fe]!=='\x0a')_0x42c1fe+=0x1;_0x587598(_0x40b3aa,_0x42c1fe);continue;}if(_0xc0b01==='/'&&_0x15b5a9==='*'){const _0x38efa1=_0x42c1fe;_0x42c1fe+=0x2;while(_0x42c1fe<_0x1c150a['length']&&!(_0x1c150a[_0x42c1fe]==='*'&&_0x1c150a[_0x42c1fe+0x1]==='/')){_0x42c1fe+=0x1;}_0x42c1fe=Math['min'](_0x42c1fe+0x1,_0x1c150a[_0x4105d9(0x1d6)]-0x1),_0x587598(_0x38efa1,_0x42c1fe+0x1);continue;}if(_0xc0b01==='#'&&_0x15b5a9!=='{'){const _0x2bdd2a=_0x42c1fe;while(_0x42c1fe<_0x1c150a[_0x4105d9(0x1d6)]&&_0x1c150a[_0x42c1fe]!=='\x0a')_0x42c1fe+=0x1;_0x587598(_0x2bdd2a,_0x42c1fe);continue;}if((_0xc0b01==='#'||_0xc0b01==='$')&&_0x15b5a9==='{'){const _0x4e8dd4=_0x42c1fe;_0x42c1fe+=0x2;while(_0x42c1fe<_0x1c150a[_0x4105d9(0x1d6)]&&_0x1c150a[_0x42c1fe]!=='}')_0x42c1fe+=0x1;_0x587598(_0x4e8dd4,Math['min'](_0x42c1fe+0x1,_0x1c150a[_0x4105d9(0x1d6)]));}}return _0x1c150a['join']('');}function maskQuotedIdentifiers(_0x202001){const _0x2e9447=a259_0x406a,_0x33d8ce=Array['from'](_0x202001);for(let _0x46e6d5=0x0;_0x46e6d5<_0x33d8ce[_0x2e9447(0x1d6)];_0x46e6d5+=0x1){const _0x140112=_0x33d8ce[_0x46e6d5];if(_0x140112!=='\x22'&&_0x140112!=='`')continue;_0x46e6d5+=0x1;while(_0x46e6d5<_0x33d8ce[_0x2e9447(0x1d6)]){if(_0x33d8ce[_0x46e6d5]===_0x140112){if(_0x33d8ce[_0x46e6d5+0x1]===_0x140112){_0x33d8ce[_0x46e6d5]='\x20',_0x33d8ce[_0x46e6d5+0x1]='\x20',_0x46e6d5+=0x2;continue;}break;}_0x33d8ce[_0x46e6d5]='\x20',_0x46e6d5+=0x1;}}return _0x33d8ce['join']('');}function maskNestedQueries(_0x34135a){const _0x380269=a259_0x406a,_0xefdaed=Array[_0x380269(0x1f2)](_0x34135a);for(let _0x57141a=0x0;_0x57141a<_0xefdaed['length'];_0x57141a+=0x1){if(_0xefdaed[_0x57141a]!=='(')continue;const _0x20d43f=_0x34135a[_0x380269(0x1e8)](_0x57141a+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x380269(0x1d7)](_0x20d43f))continue;let _0x4be040=0x1,_0x5c56ae=_0x57141a+0x1;for(;_0x5c56ae<_0xefdaed[_0x380269(0x1d6)]&&_0x4be040>0x0;_0x5c56ae+=0x1){if(_0xefdaed[_0x5c56ae]==='(')_0x4be040+=0x1;if(_0xefdaed[_0x5c56ae]===')')_0x4be040-=0x1;}if(_0x4be040!==0x0)continue;for(let _0x493d86=_0x57141a;_0x493d86<_0x5c56ae;_0x493d86+=0x1){_0xefdaed[_0x493d86]='\x20';}const _0x3a9210=_0x380269(0x1d9);for(let _0x18d8b1=0x0;_0x18d8b1<_0x3a9210[_0x380269(0x1d6)]&&_0x57141a+_0x18d8b1<_0x5c56ae;_0x18d8b1+=0x1){_0xefdaed[_0x57141a+_0x18d8b1]=_0x3a9210[_0x18d8b1];}_0x57141a=_0x5c56ae-0x1;}return _0xefdaed[_0x380269(0x207)]('');}function splitTopLevelAnd(_0x51eb39){const _0x5de0e3=a259_0x406a,_0x21b1e6=[];let _0x3f7946=0x0,_0x47d8f7=0x0;for(let _0x533f2e=0x0;_0x533f2e<_0x51eb39['length'];_0x533f2e+=0x1){const _0x332c1c=_0x51eb39[_0x533f2e];if(_0x332c1c==='(')_0x3f7946+=0x1;if(_0x332c1c===')')_0x3f7946=Math[_0x5de0e3(0x1d0)](0x0,_0x3f7946-0x1);_0x3f7946===0x0&&_0x51eb39[_0x5de0e3(0x1e8)](_0x533f2e)['match'](/^AND\b/i)&&(_0x533f2e===0x0||/\s/[_0x5de0e3(0x1d7)](_0x51eb39[_0x533f2e-0x1]??''))&&(_0x21b1e6[_0x5de0e3(0x1ce)](_0x51eb39[_0x5de0e3(0x1e8)](_0x47d8f7,_0x533f2e)[_0x5de0e3(0x20f)]()),_0x533f2e+=0x2,_0x47d8f7=_0x533f2e+0x1);}const _0x3e7d0e=_0x51eb39['slice'](_0x47d8f7)['trim']();if(_0x3e7d0e)_0x21b1e6[_0x5de0e3(0x1ce)](_0x3e7d0e);return _0x21b1e6;}function hasTopLevelKeyword(_0x5bf8e6,_0x4a9c2e){const _0x35fdb6=a259_0x406a;let _0x3c6272=0x0;for(let _0x31662a=0x0;_0x31662a<_0x5bf8e6['length'];_0x31662a+=0x1){const _0x5d401c=_0x5bf8e6[_0x31662a];if(_0x5d401c==='(')_0x3c6272+=0x1;if(_0x5d401c===')')_0x3c6272=Math[_0x35fdb6(0x1d0)](0x0,_0x3c6272-0x1);if(_0x3c6272!==0x0)continue;const _0x4cc213=_0x5bf8e6['slice'](_0x31662a,_0x31662a+_0x4a9c2e['length']),_0x59abff=_0x5bf8e6[_0x31662a-0x1]??'\x20',_0x118e3b=_0x5bf8e6[_0x31662a+_0x4a9c2e[_0x35fdb6(0x1d6)]]??'\x20';if(_0x4cc213[_0x35fdb6(0x1f0)]()===_0x4a9c2e['toUpperCase']()&&!/[\w$]/[_0x35fdb6(0x1d7)](_0x59abff)&&!/[\w$]/[_0x35fdb6(0x1d7)](_0x118e3b))return!![];}return![];}function splitEquality(_0x3b22a2){const _0x291231=a259_0x406a,_0x3de43f=stripOuterParentheses(_0x3b22a2);let _0xe23c74=0x0,_0x4f6e99;for(let _0xf6c248=0x0;_0xf6c248<_0x3de43f[_0x291231(0x1d6)];_0xf6c248+=0x1){const _0x7098f7=_0x3de43f[_0xf6c248];if(_0x7098f7==='(')_0xe23c74+=0x1;if(_0x7098f7===')')_0xe23c74=Math[_0x291231(0x1d0)](0x0,_0xe23c74-0x1);const _0x276974=_0x3de43f[_0xf6c248-0x1]??'',_0x3e99ee=_0x3de43f[_0xf6c248+0x1]??'';if(_0x7098f7==='='&&_0xe23c74===0x0&&!/[!<>=:]/[_0x291231(0x1d7)](_0x276974)&&_0x3e99ee!=='='){if(_0x4f6e99!==undefined)return null;_0x4f6e99=_0xf6c248;}}return _0x4f6e99===undefined?null:[_0x3de43f['slice'](0x0,_0x4f6e99)[_0x291231(0x20f)](),_0x3de43f[_0x291231(0x1e8)](_0x4f6e99+0x1)[_0x291231(0x20f)]()];}function parseDirectColumnReference(_0x332a43,_0x51c940){const _0x53d892=a259_0x406a,_0x530575=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x53d892(0x1de)](stripOuterParentheses(_0x332a43));if(!_0x530575)return null;if(normalizeIdentifier(_0x530575[0x1]??'')!==normalizeIdentifier(_0x51c940))return null;return normalizeIdentifier(_0x530575[0x2]??'');}function containsColumnReference(_0x35208b,_0x3afecd){const _0x4435e5=a259_0x406a,_0x3b3a96=_0x35208b[_0x4435e5(0x1f5)](/[`"]/g,''),_0x594638=_0x3afecd[_0x4435e5(0x1f5)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x4435e5(0x1fe)+_0x594638+_0x4435e5(0x1ea),'i')[_0x4435e5(0x1d7)](_0x3b3a96);}function a259_0x492a(){const _0x11d3dc=['JOIN_PREDICATE_UNSUPPORTED','reduce','split','has','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','5933279jmLHtF','join','some','using','8318085kNUvjd','matchAll','metadataAvailable','error','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','trim','sort','20HupxBq','12303384FXYdls','natural','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','index','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','right','indexes','495019pmJtvg','map','push','indexOf','max','toLowerCase','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','INDEX_METADATA_UNAVAILABLE','unsupportedPredicate','18zcFUed','length','test','containsUnresolvedInclude','__sq__','replaceAll','min','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','exec','endsWith','5103xYRkmj','full','includes','unsupportedReason','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','inner','2cCIMXY','unknown','slice','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','\x5cs*\x5c.\x5cs*[\x5cw$]+','where','alias','filter','2510847DpqVyq','matchedPrefix','toUpperCase','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','from','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','unavailable','replace','add','tableName','covered','search','cross','position','1464iNCmqn','1004780wPaWfs','(?:^|[^\x5cw$])','columns','table'];a259_0x492a=function(){return _0x11d3dc;};return a259_0x492a();}function findEqualityPrefix(_0x4cac26,_0x4fcd1f){const _0x107bdb=a259_0x406a,_0x23f733=new Set(_0x4fcd1f[_0x107bdb(0x21a)](normalizeIdentifier)),_0x194722=[];for(const _0x2f40ed of _0x4cac26){if(!_0x23f733['has'](normalizeIdentifier(_0x2f40ed)))break;_0x194722[_0x107bdb(0x1ce)](_0x2f40ed);}return _0x194722;}function resolveTableMetadata(_0x25bbeb,_0x445e10){const _0x17ae48=a259_0x406a,_0x4f5e9e=normalizeIdentifier(_0x445e10),_0x2b7281=_0x25bbeb[_0x17ae48(0x1ed)](_0x1f7361=>normalizeIdentifier(_0x1f7361[_0x17ae48(0x1f7)])===_0x4f5e9e);if(_0x2b7281['length']===0x1)return _0x2b7281[0x0];const _0x35dbbe=_0x4f5e9e[_0x17ae48(0x1e2)]('.'),_0x1eef15=_0x4f5e9e[_0x17ae48(0x203)]('.')['at'](-0x1),_0x453a6c=_0x25bbeb[_0x17ae48(0x1ed)](_0x448fff=>{const _0x56bb66=_0x17ae48,_0x481dbf=normalizeIdentifier(_0x448fff[_0x56bb66(0x1f7)]);if(_0x35dbbe&&_0x481dbf[_0x56bb66(0x1e2)]('.'))return![];return _0x481dbf[_0x56bb66(0x203)]('.')['at'](-0x1)===_0x1eef15;});return _0x453a6c['length']===0x1?_0x453a6c[0x0]:undefined;}function columnNamesMatch(_0x2ad73a,_0x58f2e9){return normalizeIdentifier(_0x2ad73a)===normalizeIdentifier(_0x58f2e9);}function normalizeIdentifier(_0x1c79c6){const _0x209253=a259_0x406a;return _0x1c79c6[_0x209253(0x1f5)](/[`"]/g,'')[_0x209253(0x20f)]()[_0x209253(0x1d1)]();}function isSqlClauseKeyword(_0x1b7cbb){const _0x565bd0=a259_0x406a;return new Set(['on',_0x565bd0(0x209),_0x565bd0(0x1eb),_0x565bd0(0x207),_0x565bd0(0x1e5),'left',_0x565bd0(0x217),_0x565bd0(0x1e1),_0x565bd0(0x1fa),_0x565bd0(0x213)])[_0x565bd0(0x204)](_0x1b7cbb);}function stripOuterParentheses(_0x2efb6d){const _0x2370ac=a259_0x406a;let _0x2cb5fb=_0x2efb6d['trim']();while(_0x2cb5fb['startsWith']('(')&&_0x2cb5fb[_0x2370ac(0x1df)](')')){let _0x5a45ba=0x0,_0x54dbc7=!![];for(let _0x267486=0x0;_0x267486<_0x2cb5fb[_0x2370ac(0x1d6)];_0x267486+=0x1){if(_0x2cb5fb[_0x267486]==='(')_0x5a45ba+=0x1;if(_0x2cb5fb[_0x267486]===')')_0x5a45ba-=0x1;if(_0x5a45ba===0x0&&_0x267486<_0x2cb5fb['length']-0x1){_0x54dbc7=![];break;}}if(!_0x54dbc7||_0x5a45ba!==0x0)break;_0x2cb5fb=_0x2cb5fb[_0x2370ac(0x1e8)](0x1,-0x1)['trim']();}return _0x2cb5fb;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a260_0x2c79(_0x8d6a86,_0x13514c){_0x8d6a86=_0x8d6a86-0x10e;const _0x26c219=a260_0x26c2();let _0x2c798b=_0x26c219[_0x8d6a86];return _0x2c798b;}const a260_0x667cf1=a260_0x2c79;function a260_0x26c2(){const _0x287157=['21088AZSBJl','sql-trash','100470qKoBWO','sql','698073kVIXKa','1467yYLoto','/sql','388986pJmRgG','444puQShd','sql.lock.json','.rabetbase','671LBzRFY','7lnjWdk','124MyRsxo','31870dJSbYd','3tsxeAs','751907FMIvma','2446650kfHddL'];a260_0x26c2=function(){return _0x287157;};return a260_0x26c2();}(function(_0x5c80f6,_0x11167b){const _0x36ad26=a260_0x2c79,_0x3263a1=_0x5c80f6();while(!![]){try{const _0x49ab14=-parseInt(_0x36ad26(0x11c))/0x1+parseInt(_0x36ad26(0x11f))/0x2*(parseInt(_0x36ad26(0x115))/0x3)+-parseInt(_0x36ad26(0x113))/0x4*(-parseInt(_0x36ad26(0x114))/0x5)+-parseInt(_0x36ad26(0x117))/0x6*(parseInt(_0x36ad26(0x112))/0x7)+parseInt(_0x36ad26(0x118))/0x8*(-parseInt(_0x36ad26(0x11d))/0x9)+parseInt(_0x36ad26(0x11a))/0xa*(-parseInt(_0x36ad26(0x111))/0xb)+parseInt(_0x36ad26(0x10e))/0xc*(parseInt(_0x36ad26(0x116))/0xd);if(_0x49ab14===_0x11167b)break;else _0x3263a1['push'](_0x3263a1['shift']());}catch(_0x44a452){_0x3263a1['push'](_0x3263a1['shift']());}}}(a260_0x26c2,0x5db03));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a260_0x667cf1(0x110),LOCK_FILE_NAME=a260_0x667cf1(0x10f),TRASH_DIR_NAME=a260_0x667cf1(0x119);export function loadSqlProjectConfig(_0x87a7ee,_0x12a251){const _0x78e08c=a260_0x667cf1,_0x1bc9bf=resolve(_0x12a251??findProjectRootDirectory()),_0x15f7b5=DOT_DIR+_0x78e08c(0x11e),_0x54608a=_0x15f7b5+'/'+_0x87a7ee;return{'projectRoot':_0x1bc9bf,'appCode':_0x87a7ee,'sqlWorkspaceRoot':_0x15f7b5,'sqlRoot':_0x54608a,'sqlRootDir':resolve(_0x1bc9bf,DOT_DIR,_0x78e08c(0x11b),_0x87a7ee),'lockFilePath':resolve(_0x1bc9bf,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x1bc9bf,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xb3e30e,_0x5023a8){const _0x2f1bed=a261_0x3649,_0xec0684=_0xb3e30e();while(!![]){try{const _0x37b8c5=-parseInt(_0x2f1bed(0x1a3))/0x1*(parseInt(_0x2f1bed(0x1b7))/0x2)+-parseInt(_0x2f1bed(0x1a1))/0x3*(parseInt(_0x2f1bed(0x1b5))/0x4)+-parseInt(_0x2f1bed(0x1c2))/0x5*(-parseInt(_0x2f1bed(0x1a5))/0x6)+parseInt(_0x2f1bed(0x1ae))/0x7*(parseInt(_0x2f1bed(0x1bc))/0x8)+-parseInt(_0x2f1bed(0x1a7))/0x9*(parseInt(_0x2f1bed(0x1b2))/0xa)+parseInt(_0x2f1bed(0x1b9))/0xb+parseInt(_0x2f1bed(0x19f))/0xc;if(_0x37b8c5===_0x5023a8)break;else _0xec0684['push'](_0xec0684['shift']());}catch(_0x172775){_0xec0684['push'](_0xec0684['shift']());}}}(a261_0x336c,0xc8a82));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x513a0f){const _0x10a561=a261_0x3649;if(_0x513a0f===_0x10a561(0x1bf))return _0x10a561(0x1b1);if(_0x513a0f===_0x10a561(0x1a2))return _0x10a561(0x1bb);return undefined;}function a261_0x3649(_0x24de7b,_0x6794ab){_0x24de7b=_0x24de7b-0x19f;const _0x336c06=a261_0x336c();let _0x36494a=_0x336c06[_0x24de7b];return _0x36494a;}function a261_0x336c(){const _0x1073e2=['mode','1031566hZfpBk','split','5947579kNONSQ','replace','mybatisXml','1120816bMOBfX','filter','push','.sql','dbId','sqlRootDir','85vDGnPt','6692472cVnkaJ','sqlCode','361689dGWctF','.xml','1RxtDFc','dbName','167298cjuInV','isFile','3343554qHzqWx','ENOENT','path','name','code','indexOf','sqlName','49eXEiJn','toLowerCase','length','sql','10qPVqBk','slice','isDirectory','28mxldEj'];a261_0x336c=function(){return _0x1073e2;};return a261_0x336c();}async function scanSqlFilesRecursively(_0x16bb39,_0x3c7710){const _0x2b7f50=a261_0x3649,_0x3adf29=[];try{const _0x2d5522=await readdir(_0x16bb39,{'withFileTypes':!![]});for(const _0x4a8551 of _0x2d5522){const _0x321fff=join(_0x16bb39,_0x4a8551[_0x2b7f50(0x1aa)]);if(_0x4a8551[_0x2b7f50(0x1b4)]()){_0x3adf29[_0x2b7f50(0x1be)](...await scanSqlFilesRecursively(_0x321fff,_0x3c7710));continue;}if(!_0x4a8551[_0x2b7f50(0x1a6)]())continue;const _0x16e4be=extname(_0x4a8551[_0x2b7f50(0x1aa)])[_0x2b7f50(0x1af)](),_0xcccee6=extensionToMode(_0x16e4be);if(!_0xcccee6)continue;const _0x2c6718=relative(_0x3c7710,_0x321fff)[_0x2b7f50(0x1ba)](/\\/g,'/'),_0x59cfdc=_0x2c6718[_0x2b7f50(0x1b8)]('/')[_0x2b7f50(0x1bd)](Boolean),_0x2e9420=parseSqlPath(_0x59cfdc,_0x4a8551[_0x2b7f50(0x1aa)],_0x16e4be);if(!_0x2e9420)continue;_0x3adf29['push']({'sqlCode':_0x2e9420[_0x2b7f50(0x1a0)],'sqlName':_0x2e9420[_0x2b7f50(0x1ad)],'dbDirectory':_0x59cfdc[0x0],'filePath':_0x321fff,'relativePath':_0x2c6718,'lockKey':_0x2e9420[_0x2b7f50(0x1a0)],'mode':_0xcccee6});}}catch(_0x4a9544){if(_0x4a9544[_0x2b7f50(0x1ab)]!==_0x2b7f50(0x1a8))throw _0x4a9544;}return _0x3adf29;}export async function scanLocalSqlQueries(_0x44262f){const _0x68b187=a261_0x3649;return scanSqlFilesRecursively(_0x44262f['sqlRootDir'],_0x44262f[_0x68b187(0x1c1)]);}export function resolveLocalSqlFilePath(_0x56ea98,_0x15f4da,_0x295285){const _0x40d5ea=a261_0x3649,_0x1b0248=_0x295285?.[_0x40d5ea(0x1a9)]||(_0x295285?.['sqlName']||_0x295285?.[_0x40d5ea(0x1a4)]?buildSqlRelativePath(_0x15f4da,_0x295285?.[_0x40d5ea(0x1ad)],_0x295285?.[_0x40d5ea(0x1a4)],_0x295285?.['mode']||_0x40d5ea(0x1b1),_0x295285?.[_0x40d5ea(0x1c0)]):buildDefaultSqlFileName(_0x15f4da,_0x295285?.[_0x40d5ea(0x1b6)]||_0x40d5ea(0x1b1)));return join(_0x56ea98[_0x40d5ea(0x1c1)],_0x1b0248);}export async function directoryExists(_0x5debe8){const _0x2241ca=a261_0x3649;try{const _0x42a31a=await stat(_0x5debe8);return _0x42a31a[_0x2241ca(0x1b4)]();}catch{return![];}}function parseSqlPath(_0x542dfd,_0x18db66,_0x27cff1){const _0x64f452=a261_0x3649,_0x3fb49f=_0x18db66['slice'](0x0,-_0x27cff1['length']);if(_0x542dfd[_0x64f452(0x1b0)]<0x2)return null;const _0x471ae2=_0x3fb49f[_0x64f452(0x1ac)]('_');if(_0x471ae2<=0x0||_0x471ae2>=_0x3fb49f[_0x64f452(0x1b0)]-0x1)return null;const _0x9016f2=_0x3fb49f[_0x64f452(0x1b3)](0x0,_0x471ae2);if(!isLikelySqlCode(_0x9016f2))return null;return{'sqlCode':_0x9016f2,'sqlName':_0x3fb49f['slice'](_0x471ae2+0x1)};}function isLikelySqlCode(_0x1e266a){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0x1e266a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x430bb7,_0x2695ba){const _0xd4a9ad=a262_0x99be,_0x36daa1=_0x430bb7();while(!![]){try{const _0x395119=-parseInt(_0xd4a9ad(0x8d))/0x1*(parseInt(_0xd4a9ad(0x90))/0x2)+-parseInt(_0xd4a9ad(0x8a))/0x3*(-parseInt(_0xd4a9ad(0x96))/0x4)+parseInt(_0xd4a9ad(0x95))/0x5*(parseInt(_0xd4a9ad(0x92))/0x6)+parseInt(_0xd4a9ad(0x89))/0x7*(-parseInt(_0xd4a9ad(0x97))/0x8)+-parseInt(_0xd4a9ad(0x99))/0x9+-parseInt(_0xd4a9ad(0x93))/0xa+parseInt(_0xd4a9ad(0x98))/0xb;if(_0x395119===_0x2695ba)break;else _0x36daa1['push'](_0x36daa1['shift']());}catch(_0x37c18a){_0x36daa1['push'](_0x36daa1['shift']());}}}(a262_0x5178,0xe9de8));function a262_0x5178(){const _0x32983f=['1279240MIEBTL','update','199190OZIInE','4ZDHGpe','584cqZCWD','4651240KsTpog','2796147UlHBFt','83041lvZvNP','4198521LUcTdk','utf8','createHash','476087tBSkrA','digest','hex','2TApOCj','md5','138OgGUBr'];a262_0x5178=function(){return _0x32983f;};return a262_0x5178();}import{readFile}from'node:fs/promises';function a262_0x99be(_0x1d1b9e,_0x5be38a){_0x1d1b9e=_0x1d1b9e-0x89;const _0x51781a=a262_0x5178();let _0x99beba=_0x51781a[_0x1d1b9e];return _0x99beba;}import a262_0x46efd8 from'node:crypto';export function computeSqlContentHash(_0x165297){const _0x30c265=a262_0x99be;return a262_0x46efd8[_0x30c265(0x8c)](_0x30c265(0x91))[_0x30c265(0x94)](_0x165297)[_0x30c265(0x8e)](_0x30c265(0x8f));}export async function computeSqlFileHash(_0x4054f9){const _0x284d9d=a262_0x99be,_0x3af50e=await readFile(_0x4054f9,_0x284d9d(0x8b));return computeSqlContentHash(_0x3af50e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a263_0x3eac(_0x59cf89,_0xddb87c){_0x59cf89=_0x59cf89-0xfd;const _0xf0be5d=a263_0xf0be();let _0x3eac14=_0xf0be5d[_0x59cf89];return _0x3eac14;}(function(_0x2086a3,_0x285fc8){const _0x4909fa=a263_0x3eac,_0xd06944=_0x2086a3();while(!![]){try{const _0x120ffc=-parseInt(_0x4909fa(0x107))/0x1*(parseInt(_0x4909fa(0xfd))/0x2)+-parseInt(_0x4909fa(0x106))/0x3*(parseInt(_0x4909fa(0x112))/0x4)+parseInt(_0x4909fa(0x116))/0x5+parseInt(_0x4909fa(0x10e))/0x6*(parseInt(_0x4909fa(0x111))/0x7)+parseInt(_0x4909fa(0x10c))/0x8+parseInt(_0x4909fa(0xfe))/0x9*(-parseInt(_0x4909fa(0x105))/0xa)+-parseInt(_0x4909fa(0x10b))/0xb*(parseInt(_0x4909fa(0x109))/0xc);if(_0x120ffc===_0x285fc8)break;else _0xd06944['push'](_0xd06944['shift']());}catch(_0x3b7fe8){_0xd06944['push'](_0xd06944['shift']());}}}(a263_0xf0be,0x52fff));function a263_0xf0be(){const _0x28416c=['sqlRoot','230064qpROlh','parse','22lUIGHk','3954416csQYVX','utf8','3624VmoKqM','sqls','apps','4942krkwDo','4Toiaki','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','\x22\x20vs\x20lock\x20\x22','ENOENT','2300820iSSvle','2878ENOnfh','477qUYFYO',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','code','stringify','\x22.\x20','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','lastSync','3320nsjDFO','1465584euvKsM','345kFMPiS'];a263_0xf0be=function(){return _0x28416c;};return a263_0xf0be();}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x21cb22,_0x252c4c,_0x314d6f,_0x4400f3){const _0x48ba22=a263_0x3eac,_0x589d65=_0x21cb22??createEmptySqlLock();let _0x2cabed=_0x589d65[_0x48ba22(0x110)][_0x252c4c];if(!_0x2cabed)return _0x2cabed={'sqlRoot':_0x314d6f,'lastSync':'','sqls':{}},_0x589d65[_0x48ba22(0x110)][_0x252c4c]=_0x2cabed,{'lockData':_0x589d65,'appLock':_0x2cabed};if(!_0x2cabed[_0x48ba22(0x108)])_0x2cabed[_0x48ba22(0x108)]=_0x314d6f;else{if(_0x2cabed[_0x48ba22(0x108)]!==_0x314d6f)throw new Error(_0x4400f3+_0x48ba22(0xff)+_0x314d6f+_0x48ba22(0x114)+_0x2cabed[_0x48ba22(0x108)]+_0x48ba22(0x102)+_0x48ba22(0x113));}return!_0x2cabed[_0x48ba22(0x10f)]&&(_0x2cabed[_0x48ba22(0x10f)]={}),!_0x2cabed[_0x48ba22(0x104)]&&(_0x2cabed[_0x48ba22(0x104)]=''),{'lockData':_0x589d65,'appLock':_0x2cabed};}export async function readSqlLockFile(_0x409f76){const _0x316ed6=a263_0x3eac;try{const _0x2bf0e2=await readFile(_0x409f76,_0x316ed6(0x10d));return JSON[_0x316ed6(0x10a)](_0x2bf0e2);}catch(_0x268694){if(_0x268694[_0x316ed6(0x100)]===_0x316ed6(0x115))return null;throw new Error(_0x316ed6(0x103)+String(_0x268694));}}export async function writeSqlLockFile(_0x200cb9,_0x4290c4){const _0x445f9d=a263_0x3eac;await mkdir(dirname(_0x200cb9),{'recursive':!![]}),await writeFile(_0x200cb9,JSON[_0x445f9d(0x101)](_0x4290c4,null,0x2),'utf8');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a265_0x2dc5(_0x443634,_0x523032){_0x443634=_0x443634-0x10a;const _0x15cac6=a265_0x15ca();let _0x2dc5a6=_0x15cac6[_0x443634];return _0x2dc5a6;}function a265_0x15ca(){const _0x1a08fc=['.xml','6HbqgzC','1604500sIyIeK','unknown-db','460014eETDQQ','.sql','trim','2000Itrufz','3TgMSqA','272770IutIJd','test','4555480cTXQAH','unknown-sql','5384277egisas','1024196vVrhYd','replace','1351UJhxNc','mybatisXml'];a265_0x15ca=function(){return _0x1a08fc;};return a265_0x15ca();}(function(_0x34ab99,_0x382805){const _0x2c2212=a265_0x2dc5,_0x5a8251=_0x34ab99();while(!![]){try{const _0x17498e=-parseInt(_0x2c2212(0x10b))/0x1+parseInt(_0x2c2212(0x115))/0x2+parseInt(_0x2c2212(0x10f))/0x3*(parseInt(_0x2c2212(0x11b))/0x4)+parseInt(_0x2c2212(0x110))/0x5*(parseInt(_0x2c2212(0x11a))/0x6)+parseInt(_0x2c2212(0x117))/0x7*(parseInt(_0x2c2212(0x10e))/0x8)+-parseInt(_0x2c2212(0x114))/0x9+parseInt(_0x2c2212(0x112))/0xa;if(_0x17498e===_0x382805)break;else _0x5a8251['push'](_0x5a8251['shift']());}catch(_0x5e09e1){_0x5a8251['push'](_0x5a8251['shift']());}}}(a265_0x15ca,0x64e7c));export function detectSqlMode(_0x176ed0){const _0x8b1d4=a265_0x2dc5,_0x4e4697=_0x176ed0['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x8b1d4(0x111)](_0x4e4697))return _0x8b1d4(0x118);return'sql';}export function getSqlFileExtension(_0x1c87c6){const _0x53b121=a265_0x2dc5;return _0x1c87c6===_0x53b121(0x118)?_0x53b121(0x119):_0x53b121(0x10c);}export function buildDefaultSqlFileName(_0x3a9962,_0x3757d5){return''+_0x3a9962+getSqlFileExtension(_0x3757d5);}export function sanitizeSqlPathSegment(_0x12df93,_0x1dea43){const _0x3c4834=a265_0x2dc5,_0x3299b6=String(_0x12df93??'')[_0x3c4834(0x10d)](),_0x42f6d6=_0x3299b6[_0x3c4834(0x116)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x3c4834(0x116)](/\s+/g,'-')[_0x3c4834(0x116)](/-+/g,'-')[_0x3c4834(0x116)](/^\.+/,'')[_0x3c4834(0x116)](/\.+$/,'')[_0x3c4834(0x116)](/^-+/,'')[_0x3c4834(0x116)](/-+$/,'');return _0x42f6d6||_0x1dea43;}export function buildDbDirectoryName(_0x3a2785,_0x405209){const _0x45aa96=a265_0x2dc5;return sanitizeSqlPathSegment(_0x3a2785,_0x405209!=null?'db-'+_0x405209:_0x45aa96(0x10a));}export function buildSqlRelativePath(_0x17d6d7,_0x50a868,_0x2eb53f,_0x46e1b3,_0x56e498){const _0x1c18be=a265_0x2dc5,_0x285e49=buildDbDirectoryName(_0x2eb53f,_0x56e498),_0x35040e=sanitizeSqlPathSegment(_0x17d6d7,_0x1c18be(0x113)),_0x14019e=sanitizeSqlPathSegment(_0x50a868,_0x35040e);return _0x285e49+'/'+_0x35040e+'_'+_0x14019e+getSqlFileExtension(_0x46e1b3);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a268_0x5dfc68=a268_0x5340;(function(_0x93dede,_0x4a3ce3){const _0x7abe72=a268_0x5340,_0x1aa4c6=_0x93dede();while(!![]){try{const _0x297549=-parseInt(_0x7abe72(0x130))/0x1*(parseInt(_0x7abe72(0x141))/0x2)+parseInt(_0x7abe72(0x12a))/0x3*(-parseInt(_0x7abe72(0x126))/0x4)+parseInt(_0x7abe72(0x112))/0x5+-parseInt(_0x7abe72(0x122))/0x6*(parseInt(_0x7abe72(0x10b))/0x7)+parseInt(_0x7abe72(0x159))/0x8+-parseInt(_0x7abe72(0x109))/0x9+parseInt(_0x7abe72(0x133))/0xa;if(_0x297549===_0x4a3ce3)break;else _0x1aa4c6['push'](_0x1aa4c6['shift']());}catch(_0xfb9069){_0x1aa4c6['push'](_0x1aa4c6['shift']());}}}(a268_0x5d97,0xdb757));const MYBATIS_OUTER_TAGS=new Map([[a268_0x5dfc68(0x136),a268_0x5dfc68(0x101)],[a268_0x5dfc68(0x118),a268_0x5dfc68(0x143)],[a268_0x5dfc68(0x15a),'UPDATE'],[a268_0x5dfc68(0x12b),a268_0x5dfc68(0x13a)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a268_0x5dfc68(0xfe),a268_0x5dfc68(0x117),'choose',a268_0x5dfc68(0x13b),a268_0x5dfc68(0x144),a268_0x5dfc68(0x140),a268_0x5dfc68(0x105),a268_0x5dfc68(0x146),a268_0x5dfc68(0x134),a268_0x5dfc68(0x153)]),MYBATIS_BRANCH_TAGS=new Set(['if',a268_0x5dfc68(0x117),a268_0x5dfc68(0x10c),a268_0x5dfc68(0x13b),a268_0x5dfc68(0x144)]);export const MYBATIS_DYNAMIC_START_MARKER='__RABETBASE_MYBATIS_DYNAMIC_START__';export const MYBATIS_DYNAMIC_END_MARKER=a268_0x5dfc68(0x12e);export const MYBATIS_INCLUDE_MARKER=a268_0x5dfc68(0x10d);const UNRESOLVED_SQL_FRAGMENT=a268_0x5dfc68(0x108),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a268_0x5dfc68(0x138)+[...MYBATIS_OUTER_TAGS[a268_0x5dfc68(0x13d)]()][a268_0x5dfc68(0x11a)]('|')+a268_0x5dfc68(0x100),'i');export function normalizeSqlForStaticAnalysis(_0x4c9cb4){const _0x38988f=a268_0x5dfc68,_0x45e79c=typeof _0x4c9cb4==='string'?_0x4c9cb4:'';if(!startsWithMybatisStatementWrapper(_0x45e79c))return{'sql':_0x45e79c,'mode':_0x38988f(0x10f)};let _0x4aa367=0x0,_0x444a77='',_0x3102f9,_0x2c0dcb=![],_0x2b39fb=![];const _0xcaac8a=[];while(_0x4aa367<_0x45e79c[_0x38988f(0x142)]){if(_0x45e79c[_0x38988f(0x104)](_0x38988f(0x11e),_0x4aa367)){const _0x47597b=_0x45e79c['indexOf']('-->',_0x4aa367+0x4);if(_0x47597b<0x0)return invalidMybatisSource(_0x38988f(0x111));_0x444a77+='\x20',_0x4aa367=_0x47597b+0x3;continue;}if(_0x45e79c[_0x38988f(0x104)](_0x38988f(0x14d),_0x4aa367)){if(!_0x2c0dcb||_0x2b39fb)return invalidMybatisSource(_0x38988f(0x129));const _0x11e018=_0x45e79c[_0x38988f(0x147)](_0x38988f(0x114),_0x4aa367+0x9);if(_0x11e018<0x0)return invalidMybatisSource(_0x38988f(0x14f));_0x444a77+=_0x45e79c[_0x38988f(0x148)](_0x4aa367+0x9,_0x11e018),_0x4aa367=_0x11e018+0x3;continue;}if(_0x45e79c['startsWith']('<?',_0x4aa367)){if(_0x2c0dcb)return invalidMybatisSource(_0x38988f(0x106));const _0x263822=_0x45e79c['indexOf']('?>',_0x4aa367+0x2);if(_0x263822<0x0)return invalidMybatisSource(_0x38988f(0x152));_0x444a77+='\x20',_0x4aa367=_0x263822+0x2;continue;}if(_0x45e79c[_0x4aa367]!=='<'){const _0x3f1355=_0x45e79c[_0x38988f(0x147)]('<',_0x4aa367),_0x1b09b5=_0x3f1355<0x0?_0x45e79c[_0x38988f(0x142)]:_0x3f1355,_0xbbc1ed=_0x45e79c[_0x38988f(0x148)](_0x4aa367,_0x1b09b5);if((!_0x2c0dcb||_0x2b39fb)&&_0xbbc1ed[_0x38988f(0x140)]())return invalidMybatisSource(_0x38988f(0x151));if(_0x2c0dcb&&!_0x2b39fb){const _0x9bda5b=decodeXmlEntities(_0xbbc1ed);if(_0x9bda5b===null)return invalidMybatisSource(_0x38988f(0x125));_0x444a77+=_0x9bda5b;}else _0x444a77+='\x20';_0x4aa367=_0x1b09b5;continue;}const _0x465759=findXmlTagEnd(_0x45e79c,_0x4aa367);if(_0x465759<0x0)return invalidMybatisSource(_0x38988f(0x128));const _0x251a87=_0x45e79c[_0x38988f(0x148)](_0x4aa367,_0x465759+0x1),_0x209e53=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x38988f(0x155)](_0x251a87);if(!_0x209e53)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20tag.');const _0x1c8693=_0x209e53[0x1]==='/',_0x5bf268=_0x209e53[0x2]??'',_0x10141c=_0x5bf268['toLowerCase'](),_0x58798f=_0x209e53[0x3]??'',_0x8e235d=_0x209e53[0x4]==='/',_0x2aad9a=MYBATIS_OUTER_TAGS[_0x38988f(0x127)](_0x10141c);if(!_0x2aad9a&&!MYBATIS_DYNAMIC_TAGS[_0x38988f(0x120)](_0x10141c))return invalidMybatisSource(_0x38988f(0x10a)+_0x10141c+'>.');if(!_0x2aad9a&&_0x5bf268!==_0x10141c)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<'+_0x5bf268+'>.');if(_0x1c8693){if(_0x58798f[_0x38988f(0x140)]()||_0x8e235d)return invalidMybatisSource(_0x38988f(0x13e)+_0x5bf268+'>.');const _0x1d9e23=_0xcaac8a['at'](-0x1);if(!_0x1d9e23||(_0x1d9e23[_0x38988f(0x12c)]?_0x1d9e23[_0x38988f(0x145)]!==_0x10141c:_0x1d9e23[_0x38988f(0x110)]!==_0x5bf268))return invalidMybatisSource('Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x5bf268+'>.');_0xcaac8a[_0x38988f(0x11f)]();if(_0x1d9e23['outer'])_0x2b39fb=!![];_0x444a77+=MYBATIS_BRANCH_TAGS[_0x38988f(0x120)](_0x10141c)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x58798f))return invalidMybatisSource(_0x38988f(0x150)+_0x5bf268+'>.');if(_0x10141c==='property'&&(!_0x8e235d||_0xcaac8a['at'](-0x1)?.[_0x38988f(0x145)]!==_0x38988f(0x134)))return invalidMybatisSource(_0x38988f(0x121));if(_0x2aad9a){if(_0x2c0dcb||_0xcaac8a[_0x38988f(0x142)]>0x0)return invalidMybatisSource(_0x38988f(0x157));_0x2c0dcb=!![],_0x2b39fb=_0x8e235d,_0x3102f9=_0x2aad9a;}else{if(!_0x2c0dcb||_0x2b39fb)return invalidMybatisSource(_0x38988f(0x156)+_0x5bf268+'>.');}_0x444a77+=_0x10141c===_0x38988f(0xfe)?_0x38988f(0x124):_0x10141c===_0x38988f(0x105)?'\x20SET\x20':_0x10141c===_0x38988f(0x134)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x38988f(0x120)](_0x10141c)&&!_0x8e235d?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x8e235d&&_0xcaac8a['push']({'rawName':_0x5bf268,'tagName':_0x10141c,'outer':!!_0x2aad9a});}_0x4aa367=_0x465759+0x1;}if(_0xcaac8a['length']>0x0)return invalidMybatisSource(_0x38988f(0x14c)+_0xcaac8a['at'](-0x1)?.['rawName']+'>.');if(!_0x2c0dcb||!_0x2b39fb)return invalidMybatisSource(_0x38988f(0x132));return{'sql':_0x444a77[_0x38988f(0x140)](),'mode':_0x38988f(0x103),..._0x3102f9?{'statementType':_0x3102f9}:{}};}function hasWellFormedXmlAttributes(_0x591a31){const _0x28c84c=a268_0x5dfc68;let _0x49674f=0x0;const _0x189f6f=new Set();while(_0x49674f<_0x591a31[_0x28c84c(0x142)]){while(_0x49674f<_0x591a31[_0x28c84c(0x142)]&&/\s/[_0x28c84c(0x14b)](_0x591a31[_0x49674f]??''))_0x49674f+=0x1;if(_0x49674f>=_0x591a31[_0x28c84c(0x142)])return!![];const _0x4133ff=/^[A-Za-z_:][\w:.-]*/[_0x28c84c(0x155)](_0x591a31[_0x28c84c(0x148)](_0x49674f)),_0x1ce4af=_0x4133ff?.[0x0];if(!_0x1ce4af||_0x189f6f[_0x28c84c(0x120)](_0x1ce4af))return![];_0x189f6f[_0x28c84c(0x115)](_0x1ce4af),_0x49674f+=_0x1ce4af['length'];while(_0x49674f<_0x591a31[_0x28c84c(0x142)]&&/\s/[_0x28c84c(0x14b)](_0x591a31[_0x49674f]??''))_0x49674f+=0x1;if(_0x591a31[_0x49674f]!=='=')return![];_0x49674f+=0x1;while(_0x49674f<_0x591a31['length']&&/\s/[_0x28c84c(0x14b)](_0x591a31[_0x49674f]??''))_0x49674f+=0x1;const _0x36504d=_0x591a31[_0x49674f];if(_0x36504d!=='\x22'&&_0x36504d!=='\x27')return![];_0x49674f+=0x1;const _0xb66cfe=_0x591a31[_0x28c84c(0x147)](_0x36504d,_0x49674f);if(_0xb66cfe<0x0)return![];if(decodeXmlEntities(_0x591a31[_0x28c84c(0x148)](_0x49674f,_0xb66cfe))===null)return![];_0x49674f=_0xb66cfe+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x5a3a3f){const _0x2f8863=a268_0x5dfc68;let _0x2088d2=0x0;const _0x1ad3e3=()=>{const _0x3295e4=a268_0x5340;while(_0x2088d2<_0x5a3a3f[_0x3295e4(0x142)]&&/\s/[_0x3295e4(0x14b)](_0x5a3a3f[_0x2088d2]??''))_0x2088d2+=0x1;};_0x1ad3e3();while(_0x2088d2<_0x5a3a3f[_0x2f8863(0x142)]){if(_0x5a3a3f[_0x2f8863(0x104)](_0x2f8863(0x11e),_0x2088d2)){const _0x11a290=_0x5a3a3f['indexOf'](_0x2f8863(0x13f),_0x2088d2+0x4);if(_0x11a290<0x0)return!![];_0x2088d2=_0x11a290+0x3,_0x1ad3e3();continue;}if(_0x5a3a3f[_0x2f8863(0x104)]('<?',_0x2088d2)){const _0x1e5aaf=_0x5a3a3f[_0x2f8863(0x147)]('?>',_0x2088d2+0x2);if(_0x1e5aaf<0x0)return!![];_0x2088d2=_0x1e5aaf+0x2,_0x1ad3e3();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x2f8863(0x14b)](_0x5a3a3f['slice'](_0x2088d2));}function invalidMybatisSource(_0x2b0a2d){const _0x75fce7=a268_0x5dfc68;return{'sql':'','mode':_0x75fce7(0x103),'error':_0x2b0a2d};}function findXmlTagEnd(_0x56cbcf,_0x3d2eec){let _0x1f2db6;for(let _0x49a637=_0x3d2eec+0x1;_0x49a637<_0x56cbcf['length'];_0x49a637+=0x1){const _0x10b7cd=_0x56cbcf[_0x49a637];if(_0x1f2db6){if(_0x10b7cd===_0x1f2db6)_0x1f2db6=undefined;continue;}if(_0x10b7cd==='\x22'||_0x10b7cd==='\x27'){_0x1f2db6=_0x10b7cd;continue;}if(_0x10b7cd==='>')return _0x49a637;}return-0x1;}function decodeXmlEntities(_0x2b9ecc){const _0x5c5f93=a268_0x5dfc68;let _0xc5e7fc=![];const _0x3bed07=_0x2b9ecc[_0x5c5f93(0x113)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x52885e=>{const _0x446936=_0x5c5f93;if(_0x52885e===_0x446936(0x135))return'<';if(_0x52885e===_0x446936(0x14e))return'>';if(_0x52885e==='"')return'\x22';if(_0x52885e===''')return'\x27';if(_0x52885e===_0x446936(0x107))return'&';const _0x5efb53=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x446936(0x155)](_0x52885e);if(_0x5efb53){const _0x3523fd=_0x5efb53[0x1],_0x6eb945=_0x5efb53[0x2],_0x4e17c5=Number['parseInt'](_0x3523fd??_0x6eb945??'',_0x3523fd?0x10:0xa);if(isValidXmlCharacter(_0x4e17c5))return String['fromCodePoint'](_0x4e17c5);}return _0xc5e7fc=!![],'';});return _0xc5e7fc?null:_0x3bed07;}function isValidXmlCharacter(_0x5e3144){return _0x5e3144===0x9||_0x5e3144===0xa||_0x5e3144===0xd||_0x5e3144>=0x20&&_0x5e3144<=0xd7ff||_0x5e3144>=0xe000&&_0x5e3144<=0xfffd||_0x5e3144>=0x10000&&_0x5e3144<=0x10ffff;}export function detectSqlType(_0x1dc2e7){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x1dc2e7));}function detectNormalizedSqlType(_0x56ce25){const _0x4e884a=a268_0x5dfc68;if(_0x56ce25[_0x4e884a(0x154)])return{'type':_0x4e884a(0xff),'isSelectOnly':![],'isDangerous':![],'reason':_0x56ce25[_0x4e884a(0x154)]};if(!_0x56ce25[_0x4e884a(0x10f)]['trim']())return{'type':_0x4e884a(0xff),'isSelectOnly':![],'isDangerous':![],'reason':_0x4e884a(0x102)};const _0xa07679=stripStaticAnalysisMarkers(_0x56ce25[_0x4e884a(0x10f)])[_0x4e884a(0x113)](/#\{[^}]*\}/g,'?')[_0x4e884a(0x113)](/\$\{[^}]*\}/g,'?')[_0x4e884a(0x113)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x4e884a(0x113)](/\/\*[\s\S]*?\*\//g,'')[_0x4e884a(0x140)](),_0x1d70ee=_0xa07679['split']('\x0a');let _0x189f59='';for(const _0x4e9c80 of _0x1d70ee){const _0x2bbcf1=_0x4e9c80[_0x4e884a(0x140)]();if(!_0x2bbcf1||_0x2bbcf1['startsWith']('--')||_0x2bbcf1[_0x4e884a(0x104)]('/*'))continue;_0x189f59=_0x2bbcf1;break;}const _0x545840=_0x189f59[_0x4e884a(0x13c)](),_0x3e9ffb=_0x56ce25['statementType'],_0x4046e8=maskSqlTextForBlockedKeywordScan(_0xa07679),_0x24b3e5=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x4e884a(0x14b)](_0x4046e8);if(_0x3e9ffb==='SELECT'||!_0x3e9ffb&&(_0x545840[_0x4e884a(0x104)]('SELECT')||_0x545840['startsWith']('WITH'))){const _0x4d3f35=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i['test'](_0xa07679);return{'type':_0x4e884a(0x101),'isSelectOnly':!_0x4d3f35,'isDangerous':_0x4d3f35,'reason':_0x4d3f35?_0x4e884a(0x149):undefined};}if(_0x3e9ffb==='INSERT'||!_0x3e9ffb&&_0x545840[_0x4e884a(0x104)]('INSERT'))return{'type':_0x4e884a(0x143),'isSelectOnly':![],'isDangerous':_0x24b3e5,'reason':_0x24b3e5?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x3e9ffb===_0x4e884a(0x12f)||!_0x3e9ffb&&_0x545840[_0x4e884a(0x104)](_0x4e884a(0x12f)))return{'type':_0x4e884a(0x12f),'isSelectOnly':![],'isDangerous':_0x24b3e5,'reason':_0x24b3e5?_0x4e884a(0x10e):undefined};if(_0x3e9ffb===_0x4e884a(0x13a)||!_0x3e9ffb&&_0x545840[_0x4e884a(0x104)]('DELETE'))return{'type':_0x4e884a(0x13a),'isSelectOnly':![],'isDangerous':!![],'reason':'DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save'};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i['test'](_0x545840))return{'type':_0x4e884a(0x158),'isSelectOnly':![],'isDangerous':!![],'reason':'DDL\x20statements\x20are\x20blocked\x20from\x20auto-save'};return{'type':_0x4e884a(0xff),'isSelectOnly':![],'isDangerous':![]};}function a268_0x5340(_0x191b2b,_0x1f7f0f){_0x191b2b=_0x191b2b-0xfd;const _0x5d979e=a268_0x5d97();let _0x534085=_0x5d979e[_0x191b2b];return _0x534085;}function stripStaticAnalysisMarkers(_0x21eaf1){const _0x5ebd9d=a268_0x5dfc68;return _0x21eaf1[_0x5ebd9d(0x15b)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x5ebd9d(0x15b)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x5ebd9d(0x15b)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x1bea3a){const _0x5eb6b5=a268_0x5dfc68;return _0x1bea3a['replace'](/'(?:''|\\.|[^'])*'/g,'\x20')['replace'](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x5eb6b5(0x113)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x5eb6b5(0x113)](/--.*$/gm,'\x20')[_0x5eb6b5(0x113)](/#.*$/gm,'\x20')['replace'](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x3a0585){const _0x87b74b=a268_0x5dfc68,_0x45f03c=_0x3a0585[_0x87b74b(0x113)](/#\{[^}]*\}/g,'?')[_0x87b74b(0x113)](/\$\{[^}]*\}/g,'?')[_0x87b74b(0x113)](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')[_0x87b74b(0x113)](/\/\*[\s\S]*?\*\//g,''),_0x2ee452=[],_0x14161b=_0x45f03c['match'](/FROM\s+([^\s,)(]+)/i);addTable(_0x2ee452,_0x14161b?.[0x1]);for(const _0x113ad0 of _0x45f03c[_0x87b74b(0x139)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x2ee452,_0x113ad0[0x1]);}const _0x25d403=_0x45f03c['match'](/INTO\s+([^\s(]+)/i);addTable(_0x2ee452,_0x25d403?.[0x1]);const _0x166c1b=_0x45f03c[_0x87b74b(0x137)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x2ee452,_0x166c1b?.[0x1]),_0x2ee452;}function a268_0x5d97(){const _0x3b14b5=['537276PFRgLu','push','\x20WHERE\x20','Invalid\x20XML\x20entity\x20reference.','10028hnynRe','get','Unterminated\x20MyBatis\x20XML\x20tag.','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','726UyscFT','delete','outer','\x20query\x20targeting\x20','__RABETBASE_MYBATIS_DYNAMIC_END__','UPDATE','3wQeXNx','\x20with\x20parameters:\x20','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','28202470uLBGAU','include','<','select','match','^<\x5cs*(?:','matchAll','DELETE','when','toUpperCase','keys','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','-->','trim','987982EQwxqS','length','INSERT','otherwise','tagName','bind','indexOf','slice','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','unknown\x20table(s)','test','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','<![CDATA[','>','Unterminated\x20CDATA\x20section.','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','Unterminated\x20XML\x20declaration.','property','error','exec','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','DDL','8984400JyTmdx','update','replaceAll','from','where','UNKNOWN',')\x5cb','SELECT','SQL\x20content\x20is\x20empty','mybatisXml','startsWith','set','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','&','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','10263762QXQXNC','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','56KlTMVp','choose','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','sql','rawName','Unterminated\x20XML\x20comment.','4505295pAhzbm','replace',']]>','add','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','foreach','insert','reason','join','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','type','includes','<!--','pop','has','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.'];a268_0x5d97=function(){return _0x3b14b5;};return a268_0x5d97();}function addTable(_0x695ded,_0x129f99){const _0x4a8cdb=a268_0x5dfc68,_0x33e3f0=_0x129f99?.[_0x4a8cdb(0x113)](/[`"]/g,'');_0x33e3f0&&_0x33e3f0!==UNRESOLVED_SQL_FRAGMENT&&!_0x695ded[_0x4a8cdb(0x11d)](_0x33e3f0)&&_0x695ded[_0x4a8cdb(0x123)](_0x33e3f0);}function extractParameters(_0x46090d){const _0x2d7d21=a268_0x5dfc68,_0x15f9f0=new Set();for(const _0x48b84a of _0x46090d[_0x2d7d21(0x139)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x48b84a[0x1])_0x15f9f0[_0x2d7d21(0x115)](_0x48b84a[0x1]);}return Array[_0x2d7d21(0xfd)](_0x15f9f0);}export function validateSql(_0x317ece){const _0x13e0a1=a268_0x5dfc68,_0x53952c=normalizeSqlForStaticAnalysis(_0x317ece),_0x44e8d5=detectNormalizedSqlType(_0x53952c),_0x10de1c=stripStaticAnalysisMarkers(_0x53952c[_0x13e0a1(0x10f)]),_0x1cfc6c=_0x53952c[_0x13e0a1(0x154)]?[]:extractTables(_0x10de1c),_0x45319f=_0x53952c['error']?[]:extractParameters(_0x10de1c);if(_0x44e8d5['isDangerous'])return{'valid':![],'sqlType':_0x44e8d5,'tables':_0x1cfc6c,'parameters':_0x45319f,'message':_0x44e8d5[_0x13e0a1(0x119)]||_0x44e8d5['type']+_0x13e0a1(0x116)};if(_0x44e8d5[_0x13e0a1(0x11c)]===_0x13e0a1(0xff))return{'valid':![],'sqlType':_0x44e8d5,'tables':_0x1cfc6c,'parameters':_0x45319f,'message':_0x53952c['error']?'Unable\x20to\x20detect\x20SQL\x20type.\x20'+_0x53952c['error']:_0x13e0a1(0x11b)};return{'valid':!![],'sqlType':_0x44e8d5,'tables':_0x1cfc6c,'parameters':_0x45319f,'message':_0x44e8d5[_0x13e0a1(0x11c)]+_0x13e0a1(0x12d)+(_0x1cfc6c['length']?_0x1cfc6c[_0x13e0a1(0x11a)](',\x20'):_0x13e0a1(0x14a))+(_0x45319f[_0x13e0a1(0x142)]?_0x13e0a1(0x131)+_0x45319f[_0x13e0a1(0x11a)](',\x20'):'')};}
|
|
1
|
+
const a266_0x486c15=a266_0x2ec7;(function(_0xf8d8f2,_0x228a62){const _0xa6346=a266_0x2ec7,_0x2c5899=_0xf8d8f2();while(!![]){try{const _0x1ebaf0=parseInt(_0xa6346(0x1f4))/0x1*(-parseInt(_0xa6346(0x1fe))/0x2)+-parseInt(_0xa6346(0x20c))/0x3*(parseInt(_0xa6346(0x1ea))/0x4)+parseInt(_0xa6346(0x1f7))/0x5+-parseInt(_0xa6346(0x1d3))/0x6+-parseInt(_0xa6346(0x1ee))/0x7*(parseInt(_0xa6346(0x1ef))/0x8)+-parseInt(_0xa6346(0x1d7))/0x9*(-parseInt(_0xa6346(0x210))/0xa)+parseInt(_0xa6346(0x213))/0xb;if(_0x1ebaf0===_0x228a62)break;else _0x2c5899['push'](_0x2c5899['shift']());}catch(_0x1e28df){_0x2c5899['push'](_0x2c5899['shift']());}}}(a266_0x1adf,0x2e425));const MYBATIS_OUTER_TAGS=new Map([[a266_0x486c15(0x20a),a266_0x486c15(0x221)],[a266_0x486c15(0x1cc),a266_0x486c15(0x1df)],[a266_0x486c15(0x211),a266_0x486c15(0x1f8)],[a266_0x486c15(0x20b),a266_0x486c15(0x202)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a266_0x486c15(0x1eb),a266_0x486c15(0x1e3),a266_0x486c15(0x1dd),'when',a266_0x486c15(0x222),a266_0x486c15(0x200),a266_0x486c15(0x204),a266_0x486c15(0x1f0),a266_0x486c15(0x220),'property']),MYBATIS_BRANCH_TAGS=new Set(['if','foreach','choose','when',a266_0x486c15(0x222)]);export const MYBATIS_DYNAMIC_START_MARKER=a266_0x486c15(0x228);export const MYBATIS_DYNAMIC_END_MARKER=a266_0x486c15(0x21a);export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT=a266_0x486c15(0x205),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a266_0x486c15(0x208)+[...MYBATIS_OUTER_TAGS[a266_0x486c15(0x1d2)]()]['join']('|')+a266_0x486c15(0x21c),'i');export function normalizeSqlForStaticAnalysis(_0x2bf2ad){const _0x4d39c7=a266_0x486c15,_0x51310e=typeof _0x2bf2ad===_0x4d39c7(0x1f3)?_0x2bf2ad:'';if(!startsWithMybatisStatementWrapper(_0x51310e))return{'sql':_0x51310e,'mode':_0x4d39c7(0x1ec)};let _0x17a8b3=0x0,_0xd1e60a='',_0x1fe036,_0x32d573=![],_0x15088e=![];const _0x2cfea3=[];while(_0x17a8b3<_0x51310e[_0x4d39c7(0x21f)]){if(_0x51310e['startsWith'](_0x4d39c7(0x216),_0x17a8b3)){const _0x390546=_0x51310e[_0x4d39c7(0x1e6)](_0x4d39c7(0x1f6),_0x17a8b3+0x4);if(_0x390546<0x0)return invalidMybatisSource(_0x4d39c7(0x215));_0xd1e60a+='\x20',_0x17a8b3=_0x390546+0x3;continue;}if(_0x51310e[_0x4d39c7(0x1e8)](_0x4d39c7(0x209),_0x17a8b3)){if(!_0x32d573||_0x15088e)return invalidMybatisSource(_0x4d39c7(0x1fd));const _0x193d59=_0x51310e[_0x4d39c7(0x1e6)](']]>',_0x17a8b3+0x9);if(_0x193d59<0x0)return invalidMybatisSource(_0x4d39c7(0x223));_0xd1e60a+=_0x51310e['slice'](_0x17a8b3+0x9,_0x193d59),_0x17a8b3=_0x193d59+0x3;continue;}if(_0x51310e[_0x4d39c7(0x1e8)]('<?',_0x17a8b3)){if(_0x32d573)return invalidMybatisSource(_0x4d39c7(0x1de));const _0x5ae82e=_0x51310e[_0x4d39c7(0x1e6)]('?>',_0x17a8b3+0x2);if(_0x5ae82e<0x0)return invalidMybatisSource(_0x4d39c7(0x201));_0xd1e60a+='\x20',_0x17a8b3=_0x5ae82e+0x2;continue;}if(_0x51310e[_0x17a8b3]!=='<'){const _0x4aca52=_0x51310e['indexOf']('<',_0x17a8b3),_0x42c858=_0x4aca52<0x0?_0x51310e[_0x4d39c7(0x21f)]:_0x4aca52,_0x279ca0=_0x51310e[_0x4d39c7(0x217)](_0x17a8b3,_0x42c858);if((!_0x32d573||_0x15088e)&&_0x279ca0[_0x4d39c7(0x200)]())return invalidMybatisSource('SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');if(_0x32d573&&!_0x15088e){const _0x4251cb=decodeXmlEntities(_0x279ca0);if(_0x4251cb===null)return invalidMybatisSource(_0x4d39c7(0x219));_0xd1e60a+=_0x4251cb;}else _0xd1e60a+='\x20';_0x17a8b3=_0x42c858;continue;}const _0x1d48cd=findXmlTagEnd(_0x51310e,_0x17a8b3);if(_0x1d48cd<0x0)return invalidMybatisSource('Unterminated\x20MyBatis\x20XML\x20tag.');const _0x46ed4f=_0x51310e['slice'](_0x17a8b3,_0x1d48cd+0x1),_0x1dd7ca=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x4d39c7(0x21b)](_0x46ed4f);if(!_0x1dd7ca)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20tag.');const _0x68d395=_0x1dd7ca[0x1]==='/',_0x33987c=_0x1dd7ca[0x2]??'',_0x5b256e=_0x33987c['toLowerCase'](),_0x2569a8=_0x1dd7ca[0x3]??'',_0x1dbed7=_0x1dd7ca[0x4]==='/',_0x24abc2=MYBATIS_OUTER_TAGS['get'](_0x5b256e);if(!_0x24abc2&&!MYBATIS_DYNAMIC_TAGS[_0x4d39c7(0x207)](_0x5b256e))return invalidMybatisSource(_0x4d39c7(0x1d0)+_0x5b256e+'>.');if(!_0x24abc2&&_0x33987c!==_0x5b256e)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<'+_0x33987c+'>.');if(_0x68d395){if(_0x2569a8[_0x4d39c7(0x200)]()||_0x1dbed7)return invalidMybatisSource(_0x4d39c7(0x225)+_0x33987c+'>.');const _0x20e866=_0x2cfea3['at'](-0x1);if(!_0x20e866||(_0x20e866[_0x4d39c7(0x1e9)]?_0x20e866[_0x4d39c7(0x1d5)]!==_0x5b256e:_0x20e866[_0x4d39c7(0x1e0)]!==_0x33987c))return invalidMybatisSource(_0x4d39c7(0x218)+_0x33987c+'>.');_0x2cfea3['pop']();if(_0x20e866['outer'])_0x15088e=!![];_0xd1e60a+=MYBATIS_BRANCH_TAGS[_0x4d39c7(0x207)](_0x5b256e)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x2569a8))return invalidMybatisSource('Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<'+_0x33987c+'>.');if(_0x5b256e==='property'&&(!_0x1dbed7||_0x2cfea3['at'](-0x1)?.[_0x4d39c7(0x1d5)]!=='include'))return invalidMybatisSource(_0x4d39c7(0x1f5));if(_0x24abc2){if(_0x32d573||_0x2cfea3['length']>0x0)return invalidMybatisSource('Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.');_0x32d573=!![],_0x15088e=_0x1dbed7,_0x1fe036=_0x24abc2;}else{if(!_0x32d573||_0x15088e)return invalidMybatisSource(_0x4d39c7(0x1d1)+_0x33987c+'>.');}_0xd1e60a+=_0x5b256e==='where'?_0x4d39c7(0x1da):_0x5b256e===_0x4d39c7(0x204)?'\x20SET\x20':_0x5b256e===_0x4d39c7(0x220)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x4d39c7(0x207)](_0x5b256e)&&!_0x1dbed7?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x1dbed7&&_0x2cfea3[_0x4d39c7(0x1fb)]({'rawName':_0x33987c,'tagName':_0x5b256e,'outer':!!_0x24abc2});}_0x17a8b3=_0x1d48cd+0x1;}if(_0x2cfea3[_0x4d39c7(0x21f)]>0x0)return invalidMybatisSource('Unclosed\x20MyBatis\x20XML\x20tag:\x20<'+_0x2cfea3['at'](-0x1)?.['rawName']+'>.');if(!_0x32d573||!_0x15088e)return invalidMybatisSource(_0x4d39c7(0x21d));return{'sql':_0xd1e60a[_0x4d39c7(0x200)](),'mode':_0x4d39c7(0x1fc),..._0x1fe036?{'statementType':_0x1fe036}:{}};}function hasWellFormedXmlAttributes(_0x3ed5d2){const _0x160941=a266_0x486c15;let _0x4ec0a3=0x0;const _0x337dd5=new Set();while(_0x4ec0a3<_0x3ed5d2[_0x160941(0x21f)]){while(_0x4ec0a3<_0x3ed5d2[_0x160941(0x21f)]&&/\s/[_0x160941(0x1e4)](_0x3ed5d2[_0x4ec0a3]??''))_0x4ec0a3+=0x1;if(_0x4ec0a3>=_0x3ed5d2[_0x160941(0x21f)])return!![];const _0x3aaba0=/^[A-Za-z_:][\w:.-]*/[_0x160941(0x21b)](_0x3ed5d2[_0x160941(0x217)](_0x4ec0a3)),_0x5957bc=_0x3aaba0?.[0x0];if(!_0x5957bc||_0x337dd5[_0x160941(0x207)](_0x5957bc))return![];_0x337dd5[_0x160941(0x1db)](_0x5957bc),_0x4ec0a3+=_0x5957bc['length'];while(_0x4ec0a3<_0x3ed5d2['length']&&/\s/['test'](_0x3ed5d2[_0x4ec0a3]??''))_0x4ec0a3+=0x1;if(_0x3ed5d2[_0x4ec0a3]!=='=')return![];_0x4ec0a3+=0x1;while(_0x4ec0a3<_0x3ed5d2[_0x160941(0x21f)]&&/\s/[_0x160941(0x1e4)](_0x3ed5d2[_0x4ec0a3]??''))_0x4ec0a3+=0x1;const _0x277ef5=_0x3ed5d2[_0x4ec0a3];if(_0x277ef5!=='\x22'&&_0x277ef5!=='\x27')return![];_0x4ec0a3+=0x1;const _0x4efa21=_0x3ed5d2[_0x160941(0x1e6)](_0x277ef5,_0x4ec0a3);if(_0x4efa21<0x0)return![];if(decodeXmlEntities(_0x3ed5d2[_0x160941(0x217)](_0x4ec0a3,_0x4efa21))===null)return![];_0x4ec0a3=_0x4efa21+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x96d266){const _0x565730=a266_0x486c15;let _0x42312c=0x0;const _0x56a0ce=()=>{const _0x5975ad=a266_0x2ec7;while(_0x42312c<_0x96d266[_0x5975ad(0x21f)]&&/\s/[_0x5975ad(0x1e4)](_0x96d266[_0x42312c]??''))_0x42312c+=0x1;};_0x56a0ce();while(_0x42312c<_0x96d266[_0x565730(0x21f)]){if(_0x96d266[_0x565730(0x1e8)](_0x565730(0x216),_0x42312c)){const _0x12f490=_0x96d266[_0x565730(0x1e6)](_0x565730(0x1f6),_0x42312c+0x4);if(_0x12f490<0x0)return!![];_0x42312c=_0x12f490+0x3,_0x56a0ce();continue;}if(_0x96d266['startsWith']('<?',_0x42312c)){const _0xc58b9b=_0x96d266[_0x565730(0x1e6)]('?>',_0x42312c+0x2);if(_0xc58b9b<0x0)return!![];_0x42312c=_0xc58b9b+0x2,_0x56a0ce();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN['test'](_0x96d266['slice'](_0x42312c));}function invalidMybatisSource(_0x5f0ca3){const _0x192d55=a266_0x486c15;return{'sql':'','mode':_0x192d55(0x1fc),'error':_0x5f0ca3};}function findXmlTagEnd(_0x242340,_0xb39772){const _0x203e9e=a266_0x486c15;let _0x4c433f;for(let _0x5cd3b2=_0xb39772+0x1;_0x5cd3b2<_0x242340[_0x203e9e(0x21f)];_0x5cd3b2+=0x1){const _0x240d6d=_0x242340[_0x5cd3b2];if(_0x4c433f){if(_0x240d6d===_0x4c433f)_0x4c433f=undefined;continue;}if(_0x240d6d==='\x22'||_0x240d6d==='\x27'){_0x4c433f=_0x240d6d;continue;}if(_0x240d6d==='>')return _0x5cd3b2;}return-0x1;}function decodeXmlEntities(_0x2f5f36){const _0x2d8131=a266_0x486c15;let _0x26000f=![];const _0x1df3e8=_0x2f5f36[_0x2d8131(0x1e7)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0xc4cf65=>{const _0x382c0d=_0x2d8131;if(_0xc4cf65==='<')return'<';if(_0xc4cf65===_0x382c0d(0x1d8))return'>';if(_0xc4cf65==='"')return'\x22';if(_0xc4cf65===_0x382c0d(0x206))return'\x27';if(_0xc4cf65===_0x382c0d(0x1ce))return'&';const _0x58a39f=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x382c0d(0x21b)](_0xc4cf65);if(_0x58a39f){const _0x4948e5=_0x58a39f[0x1],_0x4a8f09=_0x58a39f[0x2],_0x4d186e=Number[_0x382c0d(0x1d9)](_0x4948e5??_0x4a8f09??'',_0x4948e5?0x10:0xa);if(isValidXmlCharacter(_0x4d186e))return String['fromCodePoint'](_0x4d186e);}return _0x26000f=!![],'';});return _0x26000f?null:_0x1df3e8;}function isValidXmlCharacter(_0x54fed3){return _0x54fed3===0x9||_0x54fed3===0xa||_0x54fed3===0xd||_0x54fed3>=0x20&&_0x54fed3<=0xd7ff||_0x54fed3>=0xe000&&_0x54fed3<=0xfffd||_0x54fed3>=0x10000&&_0x54fed3<=0x10ffff;}export function detectSqlType(_0x53ac85){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x53ac85));}function detectNormalizedSqlType(_0xbbbcfc){const _0x42ba37=a266_0x486c15;if(_0xbbbcfc[_0x42ba37(0x1d4)])return{'type':_0x42ba37(0x224),'isSelectOnly':![],'isDangerous':![],'reason':_0xbbbcfc['error']};if(!_0xbbbcfc[_0x42ba37(0x1ec)][_0x42ba37(0x200)]())return{'type':_0x42ba37(0x224),'isSelectOnly':![],'isDangerous':![],'reason':_0x42ba37(0x227)};const _0x526138=stripStaticAnalysisMarkers(_0xbbbcfc[_0x42ba37(0x1ec)])[_0x42ba37(0x1e7)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x42ba37(0x1e7)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x42ba37(0x1e7)](/\/\*[\s\S]*?\*\//g,'')[_0x42ba37(0x200)](),_0x165a1b=_0x526138[_0x42ba37(0x1dc)]('\x0a');let _0x50dca2='';for(const _0xfefb1d of _0x165a1b){const _0x573d14=_0xfefb1d['trim']();if(!_0x573d14||_0x573d14[_0x42ba37(0x1e8)]('--')||_0x573d14[_0x42ba37(0x1e8)]('/*'))continue;_0x50dca2=_0x573d14;break;}const _0xb33d41=_0x50dca2[_0x42ba37(0x1cf)](),_0x4dfd9f=_0xbbbcfc[_0x42ba37(0x20d)],_0x3dfaf2=maskSqlTextForBlockedKeywordScan(_0x526138),_0x444506=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x42ba37(0x1e4)](_0x3dfaf2);if(_0x4dfd9f==='SELECT'||!_0x4dfd9f&&(_0xb33d41[_0x42ba37(0x1e8)]('SELECT')||_0xb33d41[_0x42ba37(0x1e8)](_0x42ba37(0x1f9)))){const _0x2446a0=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x42ba37(0x1e4)](_0x526138);return{'type':_0x42ba37(0x221),'isSelectOnly':!_0x2446a0,'isDangerous':_0x2446a0,'reason':_0x2446a0?_0x42ba37(0x1fa):undefined};}if(_0x4dfd9f===_0x42ba37(0x1df)||!_0x4dfd9f&&_0xb33d41[_0x42ba37(0x1e8)](_0x42ba37(0x1df)))return{'type':_0x42ba37(0x1df),'isSelectOnly':![],'isDangerous':_0x444506,'reason':_0x444506?_0x42ba37(0x1e1):undefined};if(_0x4dfd9f===_0x42ba37(0x1f8)||!_0x4dfd9f&&_0xb33d41[_0x42ba37(0x1e8)](_0x42ba37(0x1f8)))return{'type':'UPDATE','isSelectOnly':![],'isDangerous':_0x444506,'reason':_0x444506?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x4dfd9f===_0x42ba37(0x202)||!_0x4dfd9f&&_0xb33d41[_0x42ba37(0x1e8)]('DELETE'))return{'type':_0x42ba37(0x202),'isSelectOnly':![],'isDangerous':!![],'reason':'DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save'};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x42ba37(0x1e4)](_0xb33d41))return{'type':_0x42ba37(0x21e),'isSelectOnly':![],'isDangerous':!![],'reason':_0x42ba37(0x1ff)};return{'type':_0x42ba37(0x224),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x2fdd41){const _0x441c37=a266_0x486c15;return _0x2fdd41[_0x441c37(0x1f2)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x441c37(0x1f2)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x441c37(0x1f2)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function a266_0x1adf(){const _0x25240c=['replace','startsWith','outer','4sTJGwY','where','sql','type','1130906LHwArJ','16lMDNFQ','bind','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','replaceAll','string','7393ecrcPG','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','-->','1121910piOiZC','UPDATE','WITH','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','push','mybatisXml','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','6EVSAMe','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','trim','Unterminated\x20XML\x20declaration.','DELETE','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','set','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__',''','has','^<\x5cs*(?:','<![CDATA[','select','delete','345894HNaUij','statementType','Unable\x20to\x20detect\x20SQL\x20type.\x20','join','4840UjywZa','update','\x20query\x20targeting\x20','3170552OoWjzb','match','Unterminated\x20XML\x20comment.','<!--','slice','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','Invalid\x20XML\x20entity\x20reference.','__RABETBASE_MYBATIS_DYNAMIC_END__','exec',')\x5cb','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','DDL','length','include','SELECT','otherwise','Unterminated\x20CDATA\x20section.','UNKNOWN','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','from','SQL\x20content\x20is\x20empty','__RABETBASE_MYBATIS_DYNAMIC_START__','insert','isDangerous','&','toUpperCase','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','keys','737616pUWBQH','error','tagName','includes','4842LDBBCO','>','parseInt','\x20WHERE\x20','add','split','choose','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','INSERT','rawName','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','matchAll','foreach','test','unknown\x20table(s)','indexOf'];a266_0x1adf=function(){return _0x25240c;};return a266_0x1adf();}function maskSqlTextForBlockedKeywordScan(_0x357c49){const _0x26cee9=a266_0x486c15;return _0x357c49[_0x26cee9(0x1e7)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x26cee9(0x1e7)](/"(?:""|\\.|[^"])*"/g,'\x20')['replace'](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x26cee9(0x1e7)](/--.*$/gm,'\x20')[_0x26cee9(0x1e7)](/#.*$/gm,'\x20')['replace'](/\/\*[\s\S]*?\*\//g,'\x20');}function a266_0x2ec7(_0x2112a4,_0x37da8f){_0x2112a4=_0x2112a4-0x1cc;const _0x1adf74=a266_0x1adf();let _0x2ec7b6=_0x1adf74[_0x2112a4];return _0x2ec7b6;}function extractTables(_0x562759){const _0x5a0236=a266_0x486c15,_0x351195=_0x562759[_0x5a0236(0x1e7)](/#\{[^}]*\}/g,'?')[_0x5a0236(0x1e7)](/\$\{[^}]*\}/g,'?')['replace'](/'[^']*'/g,'\x27\x27')[_0x5a0236(0x1e7)](/--.*$/gm,'')[_0x5a0236(0x1e7)](/\/\*[\s\S]*?\*\//g,''),_0x315420=[],_0x2c2767=_0x351195[_0x5a0236(0x214)](/FROM\s+([^\s,)(]+)/i);addTable(_0x315420,_0x2c2767?.[0x1]);for(const _0x863857 of _0x351195['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x315420,_0x863857[0x1]);}const _0x2f16a9=_0x351195[_0x5a0236(0x214)](/INTO\s+([^\s(]+)/i);addTable(_0x315420,_0x2f16a9?.[0x1]);const _0x9e3c9b=_0x351195['match'](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x315420,_0x9e3c9b?.[0x1]),_0x315420;}function addTable(_0x2f6648,_0x2548b6){const _0x40df86=a266_0x486c15,_0x1e4660=_0x2548b6?.[_0x40df86(0x1e7)](/[`"]/g,'');_0x1e4660&&_0x1e4660!==UNRESOLVED_SQL_FRAGMENT&&!_0x2f6648[_0x40df86(0x1d6)](_0x1e4660)&&_0x2f6648['push'](_0x1e4660);}function extractParameters(_0x4e3fe0){const _0x2f90d2=a266_0x486c15,_0x2ea85a=new Set();for(const _0x58b20a of _0x4e3fe0[_0x2f90d2(0x1e2)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x58b20a[0x1])_0x2ea85a[_0x2f90d2(0x1db)](_0x58b20a[0x1]);}return Array[_0x2f90d2(0x226)](_0x2ea85a);}export function validateSql(_0x2a0644){const _0x4cf1f1=a266_0x486c15,_0x165e23=normalizeSqlForStaticAnalysis(_0x2a0644),_0x4c4be5=detectNormalizedSqlType(_0x165e23),_0x416e07=stripStaticAnalysisMarkers(_0x165e23[_0x4cf1f1(0x1ec)]),_0x2ae8d0=_0x165e23[_0x4cf1f1(0x1d4)]?[]:extractTables(_0x416e07),_0x261755=_0x165e23[_0x4cf1f1(0x1d4)]?[]:extractParameters(_0x416e07);if(_0x4c4be5[_0x4cf1f1(0x1cd)])return{'valid':![],'sqlType':_0x4c4be5,'tables':_0x2ae8d0,'parameters':_0x261755,'message':_0x4c4be5['reason']||_0x4c4be5[_0x4cf1f1(0x1ed)]+_0x4cf1f1(0x1f1)};if(_0x4c4be5['type']===_0x4cf1f1(0x224))return{'valid':![],'sqlType':_0x4c4be5,'tables':_0x2ae8d0,'parameters':_0x261755,'message':_0x165e23['error']?_0x4cf1f1(0x20e)+_0x165e23['error']:_0x4cf1f1(0x203)};return{'valid':!![],'sqlType':_0x4c4be5,'tables':_0x2ae8d0,'parameters':_0x261755,'message':_0x4c4be5[_0x4cf1f1(0x1ed)]+_0x4cf1f1(0x212)+(_0x2ae8d0[_0x4cf1f1(0x21f)]?_0x2ae8d0[_0x4cf1f1(0x20f)](',\x20'):_0x4cf1f1(0x1e5))+(_0x261755['length']?'\x20with\x20parameters:\x20'+_0x261755[_0x4cf1f1(0x20f)](',\x20'):'')};}
|