@lovrabet/rabetbase-cli 2.4.1-beta.1 → 2.4.1
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/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/get.js +1 -1
- package/lib/commands/config/index.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/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/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/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.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/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.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/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.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/non-interactive.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/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.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/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/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/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.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/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/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/copy-directory.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/rules-cdn.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 +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x229589,_0x1384b6){const _0x3d0d13=a230_0x5964,_0x46cea6=_0x229589();while(!![]){try{const _0x4206a6=parseInt(_0x3d0d13(0x1fc))/0x1+parseInt(_0x3d0d13(0x212))/0x2+-parseInt(_0x3d0d13(0x1fe))/0x3*(parseInt(_0x3d0d13(0x1ce))/0x4)+parseInt(_0x3d0d13(0x205))/0x5+-parseInt(_0x3d0d13(0x1dc))/0x6*(parseInt(_0x3d0d13(0x1e7))/0x7)+-parseInt(_0x3d0d13(0x1f9))/0x8*(-parseInt(_0x3d0d13(0x1df))/0x9)+-parseInt(_0x3d0d13(0x1fa))/0xa;if(_0x4206a6===_0x1384b6)break;else _0x46cea6['push'](_0x46cea6['shift']());}catch(_0x2e2d51){_0x46cea6['push'](_0x46cea6['shift']());}}}(a230_0x2581,0xbe958));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x550f1f,_0x206ce2){const _0x80d1dd=a230_0x5964,_0x2e1339=[],_0x2694f6=normalizeSqlForStaticAnalysis(_0x550f1f),_0x19cd70=(_0x2694f6[_0x80d1dd(0x1f4)]?[]:extractJoinFacts(_0x2694f6[_0x80d1dd(0x215)]))[_0x80d1dd(0x20c)](_0x4fb73f=>{const _0x4670e6=_0x80d1dd;if(_0x4fb73f[_0x4670e6(0x1d8)]||_0x4fb73f['columns']['length']===0x0)return _0x2e1339[_0x4670e6(0x1de)]({'code':_0x4670e6(0x1e3),'table':_0x4fb73f['table'],'alias':_0x4fb73f[_0x4670e6(0x203)],'columns':_0x4fb73f[_0x4670e6(0x1e1)],'reason':_0x4fb73f[_0x4670e6(0x1e5)]??_0x4670e6(0x208)}),{'table':_0x4fb73f[_0x4670e6(0x209)],'alias':_0x4fb73f[_0x4670e6(0x203)],'columns':_0x4fb73f[_0x4670e6(0x1e1)],'status':_0x4670e6(0x1f7)};const _0x275ea4=resolveTableMetadata(_0x206ce2,_0x4fb73f[_0x4670e6(0x209)]),_0x3cb2eb=(_0x275ea4?.[_0x4670e6(0x1d5)]??[])[_0x4670e6(0x20c)](_0x288cf1=>({'index':_0x288cf1,'matchedPrefix':findEqualityPrefix(_0x288cf1[_0x4670e6(0x1e1)],_0x4fb73f[_0x4670e6(0x1e1)])}))[_0x4670e6(0x204)](_0x51770e=>_0x51770e[_0x4670e6(0x1ec)][_0x4670e6(0x1e6)]>0x0),_0x5a0f3d=_0x3cb2eb[_0x4670e6(0x201)]((_0x2c2a3e,_0x4e13d2)=>!_0x2c2a3e||_0x4e13d2['matchedPrefix']['length']>_0x2c2a3e[_0x4670e6(0x1ec)][_0x4670e6(0x1e6)]?_0x4e13d2:_0x2c2a3e,_0x3cb2eb[0x0]);if(_0x5a0f3d)return{'table':_0x4fb73f[_0x4670e6(0x209)],'alias':_0x4fb73f[_0x4670e6(0x203)],'columns':_0x4fb73f[_0x4670e6(0x1e1)],'status':'covered','matchedIndex':{..._0x5a0f3d[_0x4670e6(0x1e4)],'matchedPrefix':_0x5a0f3d[_0x4670e6(0x1ec)]}};const _0x383e66=_0x275ea4?.['indexes'][_0x4670e6(0x204)](_0x5d908c=>_0x5d908c[_0x4670e6(0x1e1)][_0x4670e6(0x20e)](_0x24110c=>_0x4fb73f[_0x4670e6(0x1e1)][_0x4670e6(0x20e)](_0x323d07=>columnNamesMatch(_0x24110c,_0x323d07))))??[];if(_0x383e66[_0x4670e6(0x1e6)]>0x0)return _0x2e1339[_0x4670e6(0x1de)]({'code':'JOIN_INDEX_NOT_USABLE','table':_0x4fb73f[_0x4670e6(0x209)],'alias':_0x4fb73f[_0x4670e6(0x203)],'columns':_0x4fb73f['columns'],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x4fb73f['table'],'alias':_0x4fb73f[_0x4670e6(0x203)],'columns':_0x4fb73f[_0x4670e6(0x1e1)],'status':_0x4670e6(0x1ea),'candidateIndexes':_0x383e66};if(_0x275ea4&&_0x275ea4[_0x4670e6(0x1cf)]!==![]&&_0x275ea4[_0x4670e6(0x1d5)]['length']>0x0&&_0x4fb73f[_0x4670e6(0x1e1)][_0x4670e6(0x1e6)]>0x0)return _0x2e1339[_0x4670e6(0x1de)]({'code':_0x4670e6(0x200),'table':_0x4fb73f['table'],'alias':_0x4fb73f[_0x4670e6(0x203)],'columns':_0x4fb73f[_0x4670e6(0x1e1)],'reason':_0x4670e6(0x1cd)}),{'table':_0x4fb73f[_0x4670e6(0x209)],'alias':_0x4fb73f[_0x4670e6(0x203)],'columns':_0x4fb73f[_0x4670e6(0x1e1)],'status':'warning'};return _0x2e1339[_0x4670e6(0x1de)]({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x4fb73f['table'],'alias':_0x4fb73f['alias'],'columns':_0x4fb73f['columns'],'reason':_0x275ea4?_0x4670e6(0x214):_0x4670e6(0x1fb)}),{'table':_0x4fb73f[_0x4670e6(0x209)],'alias':_0x4fb73f[_0x4670e6(0x203)],'columns':_0x4fb73f[_0x4670e6(0x1e1)],'status':_0x4670e6(0x1f7)};});return{'checked':_0x19cd70[_0x80d1dd(0x1e6)]>0x0,'joins':_0x19cd70,'warnings':_0x2e1339};}function extractJoinFacts(_0x3c3424){const _0x1be5f5=a230_0x5964,_0x9d75f=maskNestedQueries(stripSqlNoise(_0x3c3424)),_0x4c78a1=maskQuotedIdentifiers(_0x9d75f),_0x389f33=[],_0x4f2312=new Set(),_0x3a6b07=/\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 _0x3a19fb of _0x9d75f['matchAll'](_0x3a6b07)){const _0x392edd=_0x3a19fb[_0x1be5f5(0x1e4)]??0x0,_0x388b28=_0x3a19fb[0x0][_0x1be5f5(0x1d4)](/\bJOIN\b/i),_0x52a195=_0x392edd+Math[_0x1be5f5(0x20d)](0x0,_0x388b28);if(!/^JOIN\b/i['test'](_0x4c78a1[_0x1be5f5(0x210)](_0x52a195)))continue;_0x4f2312[_0x1be5f5(0x1d9)](_0x52a195);const _0x1dcb0c=normalizeIdentifier(_0x3a19fb[0x1]||'INNER'),_0x48fbb6=normalizeIdentifier(_0x3a19fb[0x2]??''),_0x4aa0e0=normalizeIdentifier(_0x3a19fb[0x3]||_0x48fbb6[_0x1be5f5(0x20f)]('.')['at'](-0x1)||_0x48fbb6),_0x5ba125=[],_0x4ac8c5=_0x48fbb6===_0x1be5f5(0x206);let _0x95f89a=_0x1dcb0c===_0x1be5f5(0x1e9)||_0x1dcb0c===_0x1be5f5(0x1fd)||_0x4ac8c5,_0x24eff9=_0x95f89a?_0x4ac8c5?'Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.':_0x1dcb0c[_0x1be5f5(0x1ef)]()+_0x1be5f5(0x1e0):undefined;const _0x3f451c=stripOuterParentheses(_0x3a19fb[0x4]??''),_0x31e055=_0x3f451c[_0x1be5f5(0x213)](MYBATIS_DYNAMIC_START_MARKER)||_0x3f451c[_0x1be5f5(0x213)](MYBATIS_DYNAMIC_END_MARKER),_0x4e2c9a=_0x3f451c[_0x1be5f5(0x213)](MYBATIS_INCLUDE_MARKER);_0x31e055&&(_0x95f89a=!![],_0x24eff9??=_0x1be5f5(0x1da));_0x4e2c9a&&(_0x95f89a=!![],_0x24eff9??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0x3b64a0=_0x3f451c[_0x1be5f5(0x1d2)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x1be5f5(0x1d2)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x3b64a0,'OR')&&(_0x95f89a=!![],_0x24eff9??=_0x1be5f5(0x1ff));for(const _0x1763a5 of splitTopLevelAnd(_0x3b64a0)){const _0xd51e5e=stripOuterParentheses(_0x1763a5);if(hasTopLevelKeyword(_0xd51e5e,'OR')){_0x95f89a=!![],_0x24eff9??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x4c63a6=splitEquality(_0xd51e5e);if(!_0x4c63a6){containsColumnReference(_0x1763a5,_0x4aa0e0)&&(_0x95f89a=!![]);continue;}const _0x15a5f6=parseDirectColumnReference(_0x4c63a6[0x0],_0x4aa0e0),_0x4d707b=parseDirectColumnReference(_0x4c63a6[0x1],_0x4aa0e0),_0x2e18a2=containsColumnReference(_0x4c63a6[0x0],_0x4aa0e0),_0x585700=containsColumnReference(_0x4c63a6[0x1],_0x4aa0e0),_0x39c29c=_0x15a5f6&&!_0x585700?_0x15a5f6:_0x4d707b&&!_0x2e18a2?_0x4d707b:null;if(_0x39c29c&&!_0x5ba125[_0x1be5f5(0x213)](_0x39c29c))_0x5ba125[_0x1be5f5(0x1de)](_0x39c29c);else!_0x39c29c&&containsColumnReference(_0x1763a5,_0x4aa0e0)&&(_0x95f89a=!![]);}_0x389f33[_0x1be5f5(0x1de)]({'table':_0x48fbb6,'alias':_0x4aa0e0,'columns':_0x5ba125,'unsupportedPredicate':_0x95f89a,'unsupportedReason':_0x24eff9,'containsUnresolvedInclude':_0x4e2c9a,'position':_0x52a195});}for(const _0x47ce12 of _0x4c78a1['matchAll'](/\bJOIN\b/gi)){const _0x41d88d=_0x47ce12[_0x1be5f5(0x1e4)]??0x0;if(_0x4f2312[_0x1be5f5(0x20a)](_0x41d88d))continue;const _0x358ffa=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/['exec'](_0x9d75f[_0x1be5f5(0x210)](_0x41d88d+_0x47ce12[0x0][_0x1be5f5(0x1e6)])),_0x35ca2c=normalizeIdentifier(_0x358ffa?.[0x1]||'unknown'),_0xc5b874=normalizeIdentifier(_0x358ffa?.[0x2]||''),_0x392155=isSqlClauseKeyword(_0xc5b874)?_0x35ca2c[_0x1be5f5(0x20f)]('.')['at'](-0x1)||_0x35ca2c:_0xc5b874||_0x35ca2c[_0x1be5f5(0x20f)]('.')['at'](-0x1)||_0x35ca2c;_0x389f33[_0x1be5f5(0x1de)]({'table':_0x35ca2c,'alias':_0x392155,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1be5f5(0x1f3),'position':_0x41d88d});}const _0x769d10=_0x4c78a1[_0x1be5f5(0x1d0)](MYBATIS_INCLUDE_MARKER);return _0x769d10>=0x0&&!_0x389f33[_0x1be5f5(0x20e)](_0x3c1f9f=>_0x3c1f9f[_0x1be5f5(0x1dd)])&&_0x389f33[_0x1be5f5(0x1de)]({'table':_0x1be5f5(0x1f8),'alias':'unknown','columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1be5f5(0x1f1),'containsUnresolvedInclude':!![],'position':_0x769d10}),_0x389f33[_0x1be5f5(0x1f5)]((_0x4dba05,_0x18a8b8)=>_0x4dba05['position']-_0x18a8b8[_0x1be5f5(0x20b)]);}function stripSqlNoise(_0xb885b2){const _0x352a7a=a230_0x5964,_0x917b04=Array[_0x352a7a(0x211)](_0xb885b2),_0xe840fc=(_0x210c63,_0x789c0f)=>{for(let _0x2b4c2c=_0x210c63;_0x2b4c2c<_0x789c0f;_0x2b4c2c+=0x1){_0x917b04[_0x2b4c2c]!=='\x0a'&&_0x917b04[_0x2b4c2c]!=='\x0d'&&(_0x917b04[_0x2b4c2c]='\x20');}};for(let _0xff7564=0x0;_0xff7564<_0x917b04[_0x352a7a(0x1e6)];_0xff7564+=0x1){const _0x5511f9=_0x917b04[_0xff7564],_0x59ced0=_0x917b04[_0xff7564+0x1];if(_0x5511f9==='\x27'||_0x5511f9==='\x22'||_0x5511f9==='`'){const _0x136c94=_0x5511f9,_0x6fc26a=_0xff7564;_0xff7564+=0x1;while(_0xff7564<_0x917b04['length']){if(_0x917b04[_0xff7564]==='\x5c'&&_0xff7564+0x1<_0x917b04[_0x352a7a(0x1e6)]){_0xff7564+=0x2;continue;}if(_0x917b04[_0xff7564]!==_0x136c94){_0xff7564+=0x1;continue;}if(_0x917b04[_0xff7564+0x1]===_0x136c94){_0xff7564+=0x2;continue;}break;}if(_0x136c94==='\x27')_0xe840fc(_0x6fc26a,Math['min'](_0xff7564+0x1,_0x917b04[_0x352a7a(0x1e6)]));continue;}if(_0x5511f9==='-'&&_0x59ced0==='-'){const _0x4c1220=_0xff7564;while(_0xff7564<_0x917b04[_0x352a7a(0x1e6)]&&_0x917b04[_0xff7564]!=='\x0a')_0xff7564+=0x1;_0xe840fc(_0x4c1220,_0xff7564);continue;}if(_0x5511f9==='/'&&_0x59ced0==='*'){const _0x1d9db5=_0xff7564;_0xff7564+=0x2;while(_0xff7564<_0x917b04['length']&&!(_0x917b04[_0xff7564]==='*'&&_0x917b04[_0xff7564+0x1]==='/')){_0xff7564+=0x1;}_0xff7564=Math[_0x352a7a(0x1f6)](_0xff7564+0x1,_0x917b04[_0x352a7a(0x1e6)]-0x1),_0xe840fc(_0x1d9db5,_0xff7564+0x1);continue;}if(_0x5511f9==='#'&&_0x59ced0!=='{'){const _0x227e34=_0xff7564;while(_0xff7564<_0x917b04[_0x352a7a(0x1e6)]&&_0x917b04[_0xff7564]!=='\x0a')_0xff7564+=0x1;_0xe840fc(_0x227e34,_0xff7564);continue;}if((_0x5511f9==='#'||_0x5511f9==='$')&&_0x59ced0==='{'){const _0x108647=_0xff7564;_0xff7564+=0x2;while(_0xff7564<_0x917b04['length']&&_0x917b04[_0xff7564]!=='}')_0xff7564+=0x1;_0xe840fc(_0x108647,Math[_0x352a7a(0x1f6)](_0xff7564+0x1,_0x917b04[_0x352a7a(0x1e6)]));}}return _0x917b04[_0x352a7a(0x1e8)]('');}function maskQuotedIdentifiers(_0x335d40){const _0x1f16d0=a230_0x5964,_0x246bee=Array[_0x1f16d0(0x211)](_0x335d40);for(let _0x1d691e=0x0;_0x1d691e<_0x246bee[_0x1f16d0(0x1e6)];_0x1d691e+=0x1){const _0x5a7990=_0x246bee[_0x1d691e];if(_0x5a7990!=='\x22'&&_0x5a7990!=='`')continue;_0x1d691e+=0x1;while(_0x1d691e<_0x246bee[_0x1f16d0(0x1e6)]){if(_0x246bee[_0x1d691e]===_0x5a7990){if(_0x246bee[_0x1d691e+0x1]===_0x5a7990){_0x246bee[_0x1d691e]='\x20',_0x246bee[_0x1d691e+0x1]='\x20',_0x1d691e+=0x2;continue;}break;}_0x246bee[_0x1d691e]='\x20',_0x1d691e+=0x1;}}return _0x246bee['join']('');}function maskNestedQueries(_0x5640e7){const _0x10167a=a230_0x5964,_0x25135b=Array['from'](_0x5640e7);for(let _0x17ba8a=0x0;_0x17ba8a<_0x25135b[_0x10167a(0x1e6)];_0x17ba8a+=0x1){if(_0x25135b[_0x17ba8a]!=='(')continue;const _0x1e0daa=_0x5640e7[_0x10167a(0x210)](_0x17ba8a+0x1);if(!/^\s*(?:SELECT|WITH)\b/i['test'](_0x1e0daa))continue;let _0xdc0731=0x1,_0x4a85d=_0x17ba8a+0x1;for(;_0x4a85d<_0x25135b[_0x10167a(0x1e6)]&&_0xdc0731>0x0;_0x4a85d+=0x1){if(_0x25135b[_0x4a85d]==='(')_0xdc0731+=0x1;if(_0x25135b[_0x4a85d]===')')_0xdc0731-=0x1;}if(_0xdc0731!==0x0)continue;for(let _0x2ea757=_0x17ba8a;_0x2ea757<_0x4a85d;_0x2ea757+=0x1){_0x25135b[_0x2ea757]='\x20';}const _0x278b59=_0x10167a(0x206);for(let _0x6218cb=0x0;_0x6218cb<_0x278b59[_0x10167a(0x1e6)]&&_0x17ba8a+_0x6218cb<_0x4a85d;_0x6218cb+=0x1){_0x25135b[_0x17ba8a+_0x6218cb]=_0x278b59[_0x6218cb];}_0x17ba8a=_0x4a85d-0x1;}return _0x25135b[_0x10167a(0x1e8)]('');}function splitTopLevelAnd(_0x412dc8){const _0x26e158=a230_0x5964,_0x148f6e=[];let _0x4e66d6=0x0,_0x41a5d0=0x0;for(let _0x20cf88=0x0;_0x20cf88<_0x412dc8[_0x26e158(0x1e6)];_0x20cf88+=0x1){const _0x25a49d=_0x412dc8[_0x20cf88];if(_0x25a49d==='(')_0x4e66d6+=0x1;if(_0x25a49d===')')_0x4e66d6=Math[_0x26e158(0x20d)](0x0,_0x4e66d6-0x1);_0x4e66d6===0x0&&_0x412dc8[_0x26e158(0x210)](_0x20cf88)[_0x26e158(0x1d7)](/^AND\b/i)&&(_0x20cf88===0x0||/\s/['test'](_0x412dc8[_0x20cf88-0x1]??''))&&(_0x148f6e[_0x26e158(0x1de)](_0x412dc8[_0x26e158(0x210)](_0x41a5d0,_0x20cf88)[_0x26e158(0x1ed)]()),_0x20cf88+=0x2,_0x41a5d0=_0x20cf88+0x1);}const _0x2a1d98=_0x412dc8[_0x26e158(0x210)](_0x41a5d0)[_0x26e158(0x1ed)]();if(_0x2a1d98)_0x148f6e[_0x26e158(0x1de)](_0x2a1d98);return _0x148f6e;}function hasTopLevelKeyword(_0x2a0e5a,_0x461da6){const _0x2cef37=a230_0x5964;let _0x5e5126=0x0;for(let _0x2fb955=0x0;_0x2fb955<_0x2a0e5a[_0x2cef37(0x1e6)];_0x2fb955+=0x1){const _0x92e132=_0x2a0e5a[_0x2fb955];if(_0x92e132==='(')_0x5e5126+=0x1;if(_0x92e132===')')_0x5e5126=Math[_0x2cef37(0x20d)](0x0,_0x5e5126-0x1);if(_0x5e5126!==0x0)continue;const _0x52c0d3=_0x2a0e5a[_0x2cef37(0x210)](_0x2fb955,_0x2fb955+_0x461da6[_0x2cef37(0x1e6)]),_0x376ac1=_0x2a0e5a[_0x2fb955-0x1]??'\x20',_0x227ac6=_0x2a0e5a[_0x2fb955+_0x461da6[_0x2cef37(0x1e6)]]??'\x20';if(_0x52c0d3['toUpperCase']()===_0x461da6[_0x2cef37(0x1ef)]()&&!/[\w$]/['test'](_0x376ac1)&&!/[\w$]/['test'](_0x227ac6))return!![];}return![];}function a230_0x5964(_0x401d6d,_0x51a0d1){_0x401d6d=_0x401d6d-0x1cb;const _0x2581da=a230_0x2581();let _0x596420=_0x2581da[_0x401d6d];return _0x596420;}function splitEquality(_0x1f4dd1){const _0x15f33d=a230_0x5964,_0x70ccfb=stripOuterParentheses(_0x1f4dd1);let _0x447499=0x0,_0x350c55;for(let _0x13c8a0=0x0;_0x13c8a0<_0x70ccfb[_0x15f33d(0x1e6)];_0x13c8a0+=0x1){const _0x3b348c=_0x70ccfb[_0x13c8a0];if(_0x3b348c==='(')_0x447499+=0x1;if(_0x3b348c===')')_0x447499=Math[_0x15f33d(0x20d)](0x0,_0x447499-0x1);const _0x4c0c9b=_0x70ccfb[_0x13c8a0-0x1]??'',_0xe433e6=_0x70ccfb[_0x13c8a0+0x1]??'';if(_0x3b348c==='='&&_0x447499===0x0&&!/[!<>=:]/[_0x15f33d(0x1d1)](_0x4c0c9b)&&_0xe433e6!=='='){if(_0x350c55!==undefined)return null;_0x350c55=_0x13c8a0;}}return _0x350c55===undefined?null:[_0x70ccfb['slice'](0x0,_0x350c55)[_0x15f33d(0x1ed)](),_0x70ccfb[_0x15f33d(0x210)](_0x350c55+0x1)[_0x15f33d(0x1ed)]()];}function parseDirectColumnReference(_0x51067b,_0x55f767){const _0x22a1f7=a230_0x5964,_0x1a22fb=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x22a1f7(0x1d3)](stripOuterParentheses(_0x51067b));if(!_0x1a22fb)return null;if(normalizeIdentifier(_0x1a22fb[0x1]??'')!==normalizeIdentifier(_0x55f767))return null;return normalizeIdentifier(_0x1a22fb[0x2]??'');}function containsColumnReference(_0x467761,_0x24505c){const _0x4a0e8d=a230_0x5964,_0x1d0cdf=_0x467761[_0x4a0e8d(0x1db)](/[`"]/g,''),_0x5a4a3f=_0x24505c[_0x4a0e8d(0x1db)](/[.*+?^${}()|[\]\\]/g,_0x4a0e8d(0x207));return new RegExp('(?:^|[^\x5cw$])'+_0x5a4a3f+_0x4a0e8d(0x1f2),'i')[_0x4a0e8d(0x1d1)](_0x1d0cdf);}function findEqualityPrefix(_0x361560,_0x278219){const _0x51d941=a230_0x5964,_0x2e5b52=new Set(_0x278219[_0x51d941(0x20c)](normalizeIdentifier)),_0x2bca81=[];for(const _0x31f040 of _0x361560){if(!_0x2e5b52[_0x51d941(0x20a)](normalizeIdentifier(_0x31f040)))break;_0x2bca81['push'](_0x31f040);}return _0x2bca81;}function resolveTableMetadata(_0xe9039d,_0x37eeb1){const _0x4e89d3=a230_0x5964,_0x1bf42b=normalizeIdentifier(_0x37eeb1),_0x49b312=_0xe9039d[_0x4e89d3(0x204)](_0x56955a=>normalizeIdentifier(_0x56955a[_0x4e89d3(0x1d6)])===_0x1bf42b);if(_0x49b312[_0x4e89d3(0x1e6)]===0x1)return _0x49b312[0x0];const _0x5a23de=_0x1bf42b['includes']('.'),_0x5e8271=_0x1bf42b[_0x4e89d3(0x20f)]('.')['at'](-0x1),_0x3d264b=_0xe9039d[_0x4e89d3(0x204)](_0x3ca52f=>{const _0x2ec9de=_0x4e89d3,_0x219e8f=normalizeIdentifier(_0x3ca52f[_0x2ec9de(0x1d6)]);if(_0x5a23de&&_0x219e8f[_0x2ec9de(0x213)]('.'))return![];return _0x219e8f[_0x2ec9de(0x20f)]('.')['at'](-0x1)===_0x5e8271;});return _0x3d264b['length']===0x1?_0x3d264b[0x0]:undefined;}function a230_0x2581(){const _0x3ad2de=['Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','table','has','position','map','max','some','split','slice','from','678258EhyhRB','includes','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','sql','startsWith','cross','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','4WeVwsy','metadataAvailable','indexOf','test','replaceAll','exec','search','indexes','tableName','match','unsupportedPredicate','add','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','replace','6ozUefs','containsUnresolvedInclude','push','1356903IKGNfv','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','columns','left','JOIN_PREDICATE_UNSUPPORTED','index','unsupportedReason','length','7246526uyeCLp','join','right','warning','where','matchedPrefix','trim','natural','toUpperCase','toLowerCase','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','\x5cs*\x5c.\x5cs*[\x5cw$]+','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','error','sort','min','unavailable','unknown','40sinmuk','10847610ijlrgm','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','717555iNjuvP','full','587757BNszxo','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','JOIN_INDEX_MISSING','reduce','endsWith','alias','filter','6430055URAlce','__sq__','\x5c$&'];a230_0x2581=function(){return _0x3ad2de;};return a230_0x2581();}function columnNamesMatch(_0x3addf9,_0x3fbb09){return normalizeIdentifier(_0x3addf9)===normalizeIdentifier(_0x3fbb09);}function normalizeIdentifier(_0xe844ad){const _0xad2fc9=a230_0x5964;return _0xe844ad[_0xad2fc9(0x1db)](/[`"]/g,'')[_0xad2fc9(0x1ed)]()[_0xad2fc9(0x1f0)]();}function isSqlClauseKeyword(_0x45dcb8){const _0x5ae3b8=a230_0x5964;return new Set(['on','using',_0x5ae3b8(0x1eb),_0x5ae3b8(0x1e8),'inner',_0x5ae3b8(0x1e2),_0x5ae3b8(0x1e9),_0x5ae3b8(0x1fd),_0x5ae3b8(0x1cc),_0x5ae3b8(0x1ee)])[_0x5ae3b8(0x20a)](_0x45dcb8);}function stripOuterParentheses(_0x4e649a){const _0x5a32b1=a230_0x5964;let _0x487cb5=_0x4e649a[_0x5a32b1(0x1ed)]();while(_0x487cb5[_0x5a32b1(0x1cb)]('(')&&_0x487cb5[_0x5a32b1(0x202)](')')){let _0xa950a=0x0,_0x532d1c=!![];for(let _0x18030e=0x0;_0x18030e<_0x487cb5[_0x5a32b1(0x1e6)];_0x18030e+=0x1){if(_0x487cb5[_0x18030e]==='(')_0xa950a+=0x1;if(_0x487cb5[_0x18030e]===')')_0xa950a-=0x1;if(_0xa950a===0x0&&_0x18030e<_0x487cb5[_0x5a32b1(0x1e6)]-0x1){_0x532d1c=![];break;}}if(!_0x532d1c||_0xa950a!==0x0)break;_0x487cb5=_0x487cb5['slice'](0x1,-0x1)[_0x5a32b1(0x1ed)]();}return _0x487cb5;}
|
|
1
|
+
function a230_0x2a4a(){const _0x565c14=['JOIN_INDEX_MISSING','test','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','INNER','2376990YbxPxw','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','startsWith','88YHnXxC','3359332DWGtyl','map','exec','slice','trim','covered','length','table','3039160gvgjjw','5123880DMihZc','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','push','unknown','unavailable','matchAll','some','19914DZAykY','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','using','join','1263106NhxCDD','matchedPrefix','metadataAvailable','right','warning','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','max','sort','__sq__','search','min','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','left','alias','from','tableName','sql','match','194NmvUom','endsWith','error','index','unsupportedPredicate','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','reduce','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','JOIN_INDEX_NOT_USABLE','unsupportedReason','filter','split','toUpperCase','has','columns','\x5c$&','replace','includes','full','where','indexes','2943045QpgYtw','cross','replaceAll','(?:^|[^\x5cw$])','INDEX_METADATA_UNAVAILABLE'];a230_0x2a4a=function(){return _0x565c14;};return a230_0x2a4a();}(function(_0x4e596b,_0x389797){const _0x34d8d5=a230_0x5c7e,_0x537352=_0x4e596b();while(!![]){try{const _0x127c71=-parseInt(_0x34d8d5(0x103))/0x1+-parseInt(_0x34d8d5(0x115))/0x2*(parseInt(_0x34d8d5(0xff))/0x3)+parseInt(_0x34d8d5(0x13a))/0x4+-parseInt(_0x34d8d5(0xf7))/0x5+-parseInt(_0x34d8d5(0xf8))/0x6+-parseInt(_0x34d8d5(0x133))/0x7+parseInt(_0x34d8d5(0x139))/0x8*(parseInt(_0x34d8d5(0x12a))/0x9);if(_0x127c71===_0x389797)break;else _0x537352['push'](_0x537352['shift']());}catch(_0x333752){_0x537352['push'](_0x537352['shift']());}}}(a230_0x2a4a,0xb1dc2));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';function a230_0x5c7e(_0x5cf14f,_0x478644){_0x5cf14f=_0x5cf14f-0xf0;const _0x2a4ab4=a230_0x2a4a();let _0x5c7e17=_0x2a4ab4[_0x5cf14f];return _0x5c7e17;}export function auditSqlJoinIndexes(_0x2572c0,_0x5284c8){const _0x5a344d=a230_0x5c7e,_0x200b1f=[],_0x3b0b15=normalizeSqlForStaticAnalysis(_0x2572c0),_0x283eee=(_0x3b0b15[_0x5a344d(0x117)]?[]:extractJoinFacts(_0x3b0b15[_0x5a344d(0x113)]))[_0x5a344d(0xf0)](_0x50fc21=>{const _0x4198b6=_0x5a344d;if(_0x50fc21[_0x4198b6(0x119)]||_0x50fc21['columns'][_0x4198b6(0xf5)]===0x0)return _0x200b1f[_0x4198b6(0xfa)]({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0x50fc21[_0x4198b6(0xf6)],'alias':_0x50fc21[_0x4198b6(0x110)],'columns':_0x50fc21[_0x4198b6(0x123)],'reason':_0x50fc21[_0x4198b6(0x11e)]??_0x4198b6(0x137)}),{'table':_0x50fc21[_0x4198b6(0xf6)],'alias':_0x50fc21[_0x4198b6(0x110)],'columns':_0x50fc21[_0x4198b6(0x123)],'status':'unavailable'};const _0x2cc0c8=resolveTableMetadata(_0x5284c8,_0x50fc21['table']),_0x20a82b=(_0x2cc0c8?.[_0x4198b6(0x129)]??[])[_0x4198b6(0xf0)](_0x134de9=>({'index':_0x134de9,'matchedPrefix':findEqualityPrefix(_0x134de9['columns'],_0x50fc21['columns'])}))['filter'](_0x3801c3=>_0x3801c3[_0x4198b6(0x104)][_0x4198b6(0xf5)]>0x0),_0x1095ef=_0x20a82b[_0x4198b6(0x11b)]((_0x447916,_0x1c0f09)=>!_0x447916||_0x1c0f09[_0x4198b6(0x104)]['length']>_0x447916[_0x4198b6(0x104)]['length']?_0x1c0f09:_0x447916,_0x20a82b[0x0]);if(_0x1095ef)return{'table':_0x50fc21[_0x4198b6(0xf6)],'alias':_0x50fc21[_0x4198b6(0x110)],'columns':_0x50fc21[_0x4198b6(0x123)],'status':_0x4198b6(0xf4),'matchedIndex':{..._0x1095ef['index'],'matchedPrefix':_0x1095ef['matchedPrefix']}};const _0x4271ae=_0x2cc0c8?.[_0x4198b6(0x129)][_0x4198b6(0x11f)](_0x2a2122=>_0x2a2122[_0x4198b6(0x123)][_0x4198b6(0xfe)](_0x4591ef=>_0x50fc21[_0x4198b6(0x123)][_0x4198b6(0xfe)](_0xbb2ced=>columnNamesMatch(_0x4591ef,_0xbb2ced))))??[];if(_0x4271ae['length']>0x0)return _0x200b1f['push']({'code':_0x4198b6(0x11d),'table':_0x50fc21['table'],'alias':_0x50fc21[_0x4198b6(0x110)],'columns':_0x50fc21[_0x4198b6(0x123)],'reason':_0x4198b6(0x10e)}),{'table':_0x50fc21[_0x4198b6(0xf6)],'alias':_0x50fc21['alias'],'columns':_0x50fc21[_0x4198b6(0x123)],'status':_0x4198b6(0x107),'candidateIndexes':_0x4271ae};if(_0x2cc0c8&&_0x2cc0c8[_0x4198b6(0x105)]!==![]&&_0x2cc0c8[_0x4198b6(0x129)][_0x4198b6(0xf5)]>0x0&&_0x50fc21[_0x4198b6(0x123)][_0x4198b6(0xf5)]>0x0)return _0x200b1f[_0x4198b6(0xfa)]({'code':_0x4198b6(0x12f),'table':_0x50fc21[_0x4198b6(0xf6)],'alias':_0x50fc21[_0x4198b6(0x110)],'columns':_0x50fc21[_0x4198b6(0x123)],'reason':_0x4198b6(0x100)}),{'table':_0x50fc21[_0x4198b6(0xf6)],'alias':_0x50fc21['alias'],'columns':_0x50fc21['columns'],'status':'warning'};return _0x200b1f['push']({'code':_0x4198b6(0x12e),'table':_0x50fc21['table'],'alias':_0x50fc21[_0x4198b6(0x110)],'columns':_0x50fc21[_0x4198b6(0x123)],'reason':_0x2cc0c8?_0x4198b6(0xf9):_0x4198b6(0x136)}),{'table':_0x50fc21[_0x4198b6(0xf6)],'alias':_0x50fc21[_0x4198b6(0x110)],'columns':_0x50fc21[_0x4198b6(0x123)],'status':_0x4198b6(0xfc)};});return{'checked':_0x283eee[_0x5a344d(0xf5)]>0x0,'joins':_0x283eee,'warnings':_0x200b1f};}function extractJoinFacts(_0x30b21c){const _0x155933=a230_0x5c7e,_0x1d8cf7=maskNestedQueries(stripSqlNoise(_0x30b21c)),_0x314a28=maskQuotedIdentifiers(_0x1d8cf7),_0x47660f=[],_0x234a49=new Set(),_0x39c552=/\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 _0x344274 of _0x1d8cf7[_0x155933(0xfd)](_0x39c552)){const _0x5d150f=_0x344274[_0x155933(0x118)]??0x0,_0x15c146=_0x344274[0x0][_0x155933(0x10c)](/\bJOIN\b/i),_0x1489e7=_0x5d150f+Math['max'](0x0,_0x15c146);if(!/^JOIN\b/i[_0x155933(0x130)](_0x314a28[_0x155933(0xf2)](_0x1489e7)))continue;_0x234a49['add'](_0x1489e7);const _0x1d1093=normalizeIdentifier(_0x344274[0x1]||_0x155933(0x132)),_0x4f1c90=normalizeIdentifier(_0x344274[0x2]??''),_0x40ce5b=normalizeIdentifier(_0x344274[0x3]||_0x4f1c90[_0x155933(0x120)]('.')['at'](-0x1)||_0x4f1c90),_0xb29a30=[],_0x4e3cc1=_0x4f1c90==='__sq__';let _0x16a480=_0x1d1093===_0x155933(0x106)||_0x1d1093===_0x155933(0x127)||_0x4e3cc1,_0xfc2ff0=_0x16a480?_0x4e3cc1?_0x155933(0x135):_0x1d1093[_0x155933(0x121)]()+_0x155933(0x11c):undefined;const _0x4f9438=stripOuterParentheses(_0x344274[0x4]??''),_0x2877eb=_0x4f9438[_0x155933(0x126)](MYBATIS_DYNAMIC_START_MARKER)||_0x4f9438[_0x155933(0x126)](MYBATIS_DYNAMIC_END_MARKER),_0x3e2b71=_0x4f9438[_0x155933(0x126)](MYBATIS_INCLUDE_MARKER);_0x2877eb&&(_0x16a480=!![],_0xfc2ff0??='MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.');_0x3e2b71&&(_0x16a480=!![],_0xfc2ff0??=_0x155933(0x11a));const _0x42fc75=_0x4f9438['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x155933(0x12c)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x155933(0x12c)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x42fc75,'OR')&&(_0x16a480=!![],_0xfc2ff0??=_0x155933(0x108));for(const _0x241c24 of splitTopLevelAnd(_0x42fc75)){const _0x5aa007=stripOuterParentheses(_0x241c24);if(hasTopLevelKeyword(_0x5aa007,'OR')){_0x16a480=!![],_0xfc2ff0??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x384200=splitEquality(_0x5aa007);if(!_0x384200){containsColumnReference(_0x241c24,_0x40ce5b)&&(_0x16a480=!![]);continue;}const _0x3aa67e=parseDirectColumnReference(_0x384200[0x0],_0x40ce5b),_0x28196b=parseDirectColumnReference(_0x384200[0x1],_0x40ce5b),_0x45fe02=containsColumnReference(_0x384200[0x0],_0x40ce5b),_0x3bb827=containsColumnReference(_0x384200[0x1],_0x40ce5b),_0x56a4cf=_0x3aa67e&&!_0x3bb827?_0x3aa67e:_0x28196b&&!_0x45fe02?_0x28196b:null;if(_0x56a4cf&&!_0xb29a30[_0x155933(0x126)](_0x56a4cf))_0xb29a30[_0x155933(0xfa)](_0x56a4cf);else!_0x56a4cf&&containsColumnReference(_0x241c24,_0x40ce5b)&&(_0x16a480=!![]);}_0x47660f[_0x155933(0xfa)]({'table':_0x4f1c90,'alias':_0x40ce5b,'columns':_0xb29a30,'unsupportedPredicate':_0x16a480,'unsupportedReason':_0xfc2ff0,'containsUnresolvedInclude':_0x3e2b71,'position':_0x1489e7});}for(const _0x86a829 of _0x314a28[_0x155933(0xfd)](/\bJOIN\b/gi)){const _0x1cc194=_0x86a829[_0x155933(0x118)]??0x0;if(_0x234a49[_0x155933(0x122)](_0x1cc194))continue;const _0x35b629=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x155933(0xf1)](_0x1d8cf7[_0x155933(0xf2)](_0x1cc194+_0x86a829[0x0][_0x155933(0xf5)])),_0x11e3cf=normalizeIdentifier(_0x35b629?.[0x1]||_0x155933(0xfb)),_0x36c37c=normalizeIdentifier(_0x35b629?.[0x2]||''),_0xb0ac56=isSqlClauseKeyword(_0x36c37c)?_0x11e3cf[_0x155933(0x120)]('.')['at'](-0x1)||_0x11e3cf:_0x36c37c||_0x11e3cf[_0x155933(0x120)]('.')['at'](-0x1)||_0x11e3cf;_0x47660f[_0x155933(0xfa)]({'table':_0x11e3cf,'alias':_0xb0ac56,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x155933(0x134),'position':_0x1cc194});}const _0x2bc95a=_0x314a28['indexOf'](MYBATIS_INCLUDE_MARKER);return _0x2bc95a>=0x0&&!_0x47660f[_0x155933(0xfe)](_0x3a0480=>_0x3a0480['containsUnresolvedInclude'])&&_0x47660f[_0x155933(0xfa)]({'table':_0x155933(0xfb),'alias':_0x155933(0xfb),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x155933(0x131),'containsUnresolvedInclude':!![],'position':_0x2bc95a}),_0x47660f[_0x155933(0x10a)]((_0x55ca11,_0x208b8a)=>_0x55ca11['position']-_0x208b8a['position']);}function stripSqlNoise(_0x48de5c){const _0x4f368d=a230_0x5c7e,_0xcc4714=Array[_0x4f368d(0x111)](_0x48de5c),_0x83d05b=(_0x404b4a,_0xb5315)=>{for(let _0x219180=_0x404b4a;_0x219180<_0xb5315;_0x219180+=0x1){_0xcc4714[_0x219180]!=='\x0a'&&_0xcc4714[_0x219180]!=='\x0d'&&(_0xcc4714[_0x219180]='\x20');}};for(let _0x3a576e=0x0;_0x3a576e<_0xcc4714[_0x4f368d(0xf5)];_0x3a576e+=0x1){const _0x4d51f4=_0xcc4714[_0x3a576e],_0x3c4d6c=_0xcc4714[_0x3a576e+0x1];if(_0x4d51f4==='\x27'||_0x4d51f4==='\x22'||_0x4d51f4==='`'){const _0x3d4617=_0x4d51f4,_0x59474c=_0x3a576e;_0x3a576e+=0x1;while(_0x3a576e<_0xcc4714[_0x4f368d(0xf5)]){if(_0xcc4714[_0x3a576e]==='\x5c'&&_0x3a576e+0x1<_0xcc4714['length']){_0x3a576e+=0x2;continue;}if(_0xcc4714[_0x3a576e]!==_0x3d4617){_0x3a576e+=0x1;continue;}if(_0xcc4714[_0x3a576e+0x1]===_0x3d4617){_0x3a576e+=0x2;continue;}break;}if(_0x3d4617==='\x27')_0x83d05b(_0x59474c,Math[_0x4f368d(0x10d)](_0x3a576e+0x1,_0xcc4714[_0x4f368d(0xf5)]));continue;}if(_0x4d51f4==='-'&&_0x3c4d6c==='-'){const _0x5b4e54=_0x3a576e;while(_0x3a576e<_0xcc4714['length']&&_0xcc4714[_0x3a576e]!=='\x0a')_0x3a576e+=0x1;_0x83d05b(_0x5b4e54,_0x3a576e);continue;}if(_0x4d51f4==='/'&&_0x3c4d6c==='*'){const _0x4e91cc=_0x3a576e;_0x3a576e+=0x2;while(_0x3a576e<_0xcc4714[_0x4f368d(0xf5)]&&!(_0xcc4714[_0x3a576e]==='*'&&_0xcc4714[_0x3a576e+0x1]==='/')){_0x3a576e+=0x1;}_0x3a576e=Math[_0x4f368d(0x10d)](_0x3a576e+0x1,_0xcc4714[_0x4f368d(0xf5)]-0x1),_0x83d05b(_0x4e91cc,_0x3a576e+0x1);continue;}if(_0x4d51f4==='#'&&_0x3c4d6c!=='{'){const _0x14f43b=_0x3a576e;while(_0x3a576e<_0xcc4714[_0x4f368d(0xf5)]&&_0xcc4714[_0x3a576e]!=='\x0a')_0x3a576e+=0x1;_0x83d05b(_0x14f43b,_0x3a576e);continue;}if((_0x4d51f4==='#'||_0x4d51f4==='$')&&_0x3c4d6c==='{'){const _0x190bf4=_0x3a576e;_0x3a576e+=0x2;while(_0x3a576e<_0xcc4714[_0x4f368d(0xf5)]&&_0xcc4714[_0x3a576e]!=='}')_0x3a576e+=0x1;_0x83d05b(_0x190bf4,Math[_0x4f368d(0x10d)](_0x3a576e+0x1,_0xcc4714[_0x4f368d(0xf5)]));}}return _0xcc4714[_0x4f368d(0x102)]('');}function maskQuotedIdentifiers(_0x588dbd){const _0x573f3c=a230_0x5c7e,_0x27dac1=Array[_0x573f3c(0x111)](_0x588dbd);for(let _0x12eeaf=0x0;_0x12eeaf<_0x27dac1['length'];_0x12eeaf+=0x1){const _0x427467=_0x27dac1[_0x12eeaf];if(_0x427467!=='\x22'&&_0x427467!=='`')continue;_0x12eeaf+=0x1;while(_0x12eeaf<_0x27dac1['length']){if(_0x27dac1[_0x12eeaf]===_0x427467){if(_0x27dac1[_0x12eeaf+0x1]===_0x427467){_0x27dac1[_0x12eeaf]='\x20',_0x27dac1[_0x12eeaf+0x1]='\x20',_0x12eeaf+=0x2;continue;}break;}_0x27dac1[_0x12eeaf]='\x20',_0x12eeaf+=0x1;}}return _0x27dac1['join']('');}function maskNestedQueries(_0x16fe46){const _0x16ebe6=a230_0x5c7e,_0x3202ae=Array[_0x16ebe6(0x111)](_0x16fe46);for(let _0x5c397f=0x0;_0x5c397f<_0x3202ae[_0x16ebe6(0xf5)];_0x5c397f+=0x1){if(_0x3202ae[_0x5c397f]!=='(')continue;const _0x3b6bcf=_0x16fe46[_0x16ebe6(0xf2)](_0x5c397f+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x16ebe6(0x130)](_0x3b6bcf))continue;let _0x53508f=0x1,_0x2cf24a=_0x5c397f+0x1;for(;_0x2cf24a<_0x3202ae[_0x16ebe6(0xf5)]&&_0x53508f>0x0;_0x2cf24a+=0x1){if(_0x3202ae[_0x2cf24a]==='(')_0x53508f+=0x1;if(_0x3202ae[_0x2cf24a]===')')_0x53508f-=0x1;}if(_0x53508f!==0x0)continue;for(let _0x376a77=_0x5c397f;_0x376a77<_0x2cf24a;_0x376a77+=0x1){_0x3202ae[_0x376a77]='\x20';}const _0x7fc79=_0x16ebe6(0x10b);for(let _0x28656c=0x0;_0x28656c<_0x7fc79['length']&&_0x5c397f+_0x28656c<_0x2cf24a;_0x28656c+=0x1){_0x3202ae[_0x5c397f+_0x28656c]=_0x7fc79[_0x28656c];}_0x5c397f=_0x2cf24a-0x1;}return _0x3202ae[_0x16ebe6(0x102)]('');}function splitTopLevelAnd(_0x59627d){const _0x4d7881=a230_0x5c7e,_0x523032=[];let _0x1b5ca5=0x0,_0x2db006=0x0;for(let _0x482dde=0x0;_0x482dde<_0x59627d['length'];_0x482dde+=0x1){const _0x463c00=_0x59627d[_0x482dde];if(_0x463c00==='(')_0x1b5ca5+=0x1;if(_0x463c00===')')_0x1b5ca5=Math['max'](0x0,_0x1b5ca5-0x1);_0x1b5ca5===0x0&&_0x59627d['slice'](_0x482dde)[_0x4d7881(0x114)](/^AND\b/i)&&(_0x482dde===0x0||/\s/['test'](_0x59627d[_0x482dde-0x1]??''))&&(_0x523032['push'](_0x59627d['slice'](_0x2db006,_0x482dde)[_0x4d7881(0xf3)]()),_0x482dde+=0x2,_0x2db006=_0x482dde+0x1);}const _0xdd6d02=_0x59627d[_0x4d7881(0xf2)](_0x2db006)['trim']();if(_0xdd6d02)_0x523032[_0x4d7881(0xfa)](_0xdd6d02);return _0x523032;}function hasTopLevelKeyword(_0x59cc07,_0x2d341a){const _0xf951d6=a230_0x5c7e;let _0xc1a83e=0x0;for(let _0x32c877=0x0;_0x32c877<_0x59cc07['length'];_0x32c877+=0x1){const _0x319e27=_0x59cc07[_0x32c877];if(_0x319e27==='(')_0xc1a83e+=0x1;if(_0x319e27===')')_0xc1a83e=Math[_0xf951d6(0x109)](0x0,_0xc1a83e-0x1);if(_0xc1a83e!==0x0)continue;const _0x1a06fd=_0x59cc07['slice'](_0x32c877,_0x32c877+_0x2d341a[_0xf951d6(0xf5)]),_0x3b35f2=_0x59cc07[_0x32c877-0x1]??'\x20',_0x4e324a=_0x59cc07[_0x32c877+_0x2d341a[_0xf951d6(0xf5)]]??'\x20';if(_0x1a06fd[_0xf951d6(0x121)]()===_0x2d341a['toUpperCase']()&&!/[\w$]/[_0xf951d6(0x130)](_0x3b35f2)&&!/[\w$]/[_0xf951d6(0x130)](_0x4e324a))return!![];}return![];}function splitEquality(_0x3ad44c){const _0x897363=a230_0x5c7e,_0x5147b6=stripOuterParentheses(_0x3ad44c);let _0x41daac=0x0,_0x33b010;for(let _0x3ab9e7=0x0;_0x3ab9e7<_0x5147b6['length'];_0x3ab9e7+=0x1){const _0x410ca4=_0x5147b6[_0x3ab9e7];if(_0x410ca4==='(')_0x41daac+=0x1;if(_0x410ca4===')')_0x41daac=Math[_0x897363(0x109)](0x0,_0x41daac-0x1);const _0x5a3225=_0x5147b6[_0x3ab9e7-0x1]??'',_0x49ebd2=_0x5147b6[_0x3ab9e7+0x1]??'';if(_0x410ca4==='='&&_0x41daac===0x0&&!/[!<>=:]/['test'](_0x5a3225)&&_0x49ebd2!=='='){if(_0x33b010!==undefined)return null;_0x33b010=_0x3ab9e7;}}return _0x33b010===undefined?null:[_0x5147b6[_0x897363(0xf2)](0x0,_0x33b010)[_0x897363(0xf3)](),_0x5147b6['slice'](_0x33b010+0x1)[_0x897363(0xf3)]()];}function parseDirectColumnReference(_0x127704,_0x5b919b){const _0x236561=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/['exec'](stripOuterParentheses(_0x127704));if(!_0x236561)return null;if(normalizeIdentifier(_0x236561[0x1]??'')!==normalizeIdentifier(_0x5b919b))return null;return normalizeIdentifier(_0x236561[0x2]??'');}function containsColumnReference(_0x3e70c7,_0x38eeca){const _0x3abfd8=a230_0x5c7e,_0x5e2f59=_0x3e70c7[_0x3abfd8(0x125)](/[`"]/g,''),_0x280dbe=_0x38eeca['replace'](/[.*+?^${}()|[\]\\]/g,_0x3abfd8(0x124));return new RegExp(_0x3abfd8(0x12d)+_0x280dbe+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x3abfd8(0x130)](_0x5e2f59);}function findEqualityPrefix(_0x4af0ff,_0x5363ff){const _0x4e3fdf=a230_0x5c7e,_0x2fe01f=new Set(_0x5363ff[_0x4e3fdf(0xf0)](normalizeIdentifier)),_0x347305=[];for(const _0x392aea of _0x4af0ff){if(!_0x2fe01f['has'](normalizeIdentifier(_0x392aea)))break;_0x347305['push'](_0x392aea);}return _0x347305;}function resolveTableMetadata(_0x4a12d9,_0x194c20){const _0x4ff3fa=a230_0x5c7e,_0x440198=normalizeIdentifier(_0x194c20),_0x2fe461=_0x4a12d9[_0x4ff3fa(0x11f)](_0x2605ae=>normalizeIdentifier(_0x2605ae['tableName'])===_0x440198);if(_0x2fe461[_0x4ff3fa(0xf5)]===0x1)return _0x2fe461[0x0];const _0x261b8c=_0x440198[_0x4ff3fa(0x126)]('.'),_0x5e5765=_0x440198['split']('.')['at'](-0x1),_0x184077=_0x4a12d9[_0x4ff3fa(0x11f)](_0x106b70=>{const _0x531681=_0x4ff3fa,_0xad1ed2=normalizeIdentifier(_0x106b70[_0x531681(0x112)]);if(_0x261b8c&&_0xad1ed2['includes']('.'))return![];return _0xad1ed2[_0x531681(0x120)]('.')['at'](-0x1)===_0x5e5765;});return _0x184077[_0x4ff3fa(0xf5)]===0x1?_0x184077[0x0]:undefined;}function columnNamesMatch(_0xc2450b,_0x2779fb){return normalizeIdentifier(_0xc2450b)===normalizeIdentifier(_0x2779fb);}function normalizeIdentifier(_0x17c71c){const _0xddb37d=a230_0x5c7e;return _0x17c71c[_0xddb37d(0x125)](/[`"]/g,'')[_0xddb37d(0xf3)]()['toLowerCase']();}function isSqlClauseKeyword(_0x5a9911){const _0x4c89a4=a230_0x5c7e;return new Set(['on',_0x4c89a4(0x101),_0x4c89a4(0x128),_0x4c89a4(0x102),'inner',_0x4c89a4(0x10f),_0x4c89a4(0x106),_0x4c89a4(0x127),_0x4c89a4(0x12b),'natural'])[_0x4c89a4(0x122)](_0x5a9911);}function stripOuterParentheses(_0x52eacd){const _0x51270d=a230_0x5c7e;let _0x5f5459=_0x52eacd[_0x51270d(0xf3)]();while(_0x5f5459[_0x51270d(0x138)]('(')&&_0x5f5459[_0x51270d(0x116)](')')){let _0x53f520=0x0,_0x114aa2=!![];for(let _0x387332=0x0;_0x387332<_0x5f5459[_0x51270d(0xf5)];_0x387332+=0x1){if(_0x5f5459[_0x387332]==='(')_0x53f520+=0x1;if(_0x5f5459[_0x387332]===')')_0x53f520-=0x1;if(_0x53f520===0x0&&_0x387332<_0x5f5459[_0x51270d(0xf5)]-0x1){_0x114aa2=![];break;}}if(!_0x114aa2||_0x53f520!==0x0)break;_0x5f5459=_0x5f5459[_0x51270d(0xf2)](0x1,-0x1)[_0x51270d(0xf3)]();}return _0x5f5459;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a231_0x30a404=a231_0x291c;(function(_0x446d05,_0x524c97){const _0x178a52=a231_0x291c,_0x1bd87d=_0x446d05();while(!![]){try{const _0x1f6299=parseInt(_0x178a52(0x1d8))/0x1+parseInt(_0x178a52(0x1db))/0x2*(-parseInt(_0x178a52(0x1e1))/0x3)+-parseInt(_0x178a52(0x1d9))/0x4*(parseInt(_0x178a52(0x1e4))/0x5)+-parseInt(_0x178a52(0x1e0))/0x6+parseInt(_0x178a52(0x1dc))/0x7+parseInt(_0x178a52(0x1de))/0x8*(-parseInt(_0x178a52(0x1da))/0x9)+parseInt(_0x178a52(0x1e3))/0xa;if(_0x1f6299===_0x524c97)break;else _0x1bd87d['push'](_0x1bd87d['shift']());}catch(_0x32dcfc){_0x1bd87d['push'](_0x1bd87d['shift']());}}}(a231_0x2787,0x6d89b));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a231_0x30a404(0x1d7),LOCK_FILE_NAME=a231_0x30a404(0x1df),TRASH_DIR_NAME=a231_0x30a404(0x1dd);export function loadSqlProjectConfig(_0x16e9c6,_0x2226dd){const _0x8399a=a231_0x30a404,_0x1bea4e=resolve(_0x2226dd??findProjectRootDirectory()),_0xafd870=DOT_DIR+'/sql',_0x593684=_0xafd870+'/'+_0x16e9c6;return{'projectRoot':_0x1bea4e,'appCode':_0x16e9c6,'sqlWorkspaceRoot':_0xafd870,'sqlRoot':_0x593684,'sqlRootDir':resolve(_0x1bea4e,DOT_DIR,_0x8399a(0x1e2),_0x16e9c6),'lockFilePath':resolve(_0x1bea4e,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x1bea4e,DOT_DIR,TRASH_DIR_NAME)};}function a231_0x291c(_0x1a20c8,_0x176bb9){_0x1a20c8=_0x1a20c8-0x1d7;const _0x2787ff=a231_0x2787();let _0x291c6e=_0x2787ff[_0x1a20c8];return _0x291c6e;}function a231_0x2787(){const _0x3864aa=['sql.lock.json','925494TyNDza','1697421uUKokh','sql','9674070GaSGGA','335GmFbHm','.rabetbase','482012otnWou','45988ucPBxU','81bQJTXo','2xZJHbO','3636759QOdEPm','sql-trash','26608PLRVBV'];a231_0x2787=function(){return _0x3864aa;};return a231_0x2787();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x18b146,_0x49debd){const _0x5ec2ee=a232_0xe6c6,_0x22cd0c=_0x18b146();while(!![]){try{const _0x4de149=-parseInt(_0x5ec2ee(0xfb))/0x1+parseInt(_0x5ec2ee(0x108))/0x2*(parseInt(_0x5ec2ee(0x113))/0x3)+parseInt(_0x5ec2ee(0x10f))/0x4*(parseInt(_0x5ec2ee(0xf6))/0x5)+parseInt(_0x5ec2ee(0xff))/0x6+parseInt(_0x5ec2ee(0x10c))/0x7*(parseInt(_0x5ec2ee(0x100))/0x8)+-parseInt(_0x5ec2ee(0x10d))/0x9*(parseInt(_0x5ec2ee(0xfa))/0xa)+parseInt(_0x5ec2ee(0x110))/0xb;if(_0x4de149===_0x49debd)break;else _0x22cd0c['push'](_0x22cd0c['shift']());}catch(_0x3fbd9e){_0x22cd0c['push'](_0x22cd0c['shift']());}}}(a232_0x33cb,0xc1780));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x21f198){const _0x39ffb9=a232_0xe6c6;if(_0x21f198==='.sql')return'sql';if(_0x21f198==='.xml')return _0x39ffb9(0x111);return undefined;}async function scanSqlFilesRecursively(_0x34b81e,_0x304091){const _0x441c1e=a232_0xe6c6,_0x37ac63=[];try{const _0x1fa8ea=await readdir(_0x34b81e,{'withFileTypes':!![]});for(const _0x2dc9bb of _0x1fa8ea){const _0x3fcf0d=join(_0x34b81e,_0x2dc9bb['name']);if(_0x2dc9bb[_0x441c1e(0xfc)]()){_0x37ac63[_0x441c1e(0x114)](...await scanSqlFilesRecursively(_0x3fcf0d,_0x304091));continue;}if(!_0x2dc9bb[_0x441c1e(0x102)]())continue;const _0x1d5e37=extname(_0x2dc9bb[_0x441c1e(0x115)])[_0x441c1e(0x107)](),_0x4ec281=extensionToMode(_0x1d5e37);if(!_0x4ec281)continue;const _0x1155b1=relative(_0x304091,_0x3fcf0d)[_0x441c1e(0x10a)](/\\/g,'/'),_0x26d65d=_0x1155b1[_0x441c1e(0x10b)]('/')[_0x441c1e(0x104)](Boolean),_0xe348b=parseSqlPath(_0x26d65d,_0x2dc9bb[_0x441c1e(0x115)],_0x1d5e37);if(!_0xe348b)continue;_0x37ac63['push']({'sqlCode':_0xe348b[_0x441c1e(0xfe)],'sqlName':_0xe348b[_0x441c1e(0x116)],'dbDirectory':_0x26d65d[0x0],'filePath':_0x3fcf0d,'relativePath':_0x1155b1,'lockKey':_0xe348b['sqlCode'],'mode':_0x4ec281});}}catch(_0x13989d){if(_0x13989d[_0x441c1e(0x106)]!==_0x441c1e(0x101))throw _0x13989d;}return _0x37ac63;}export async function scanLocalSqlQueries(_0x15f1de){const _0x275795=a232_0xe6c6;return scanSqlFilesRecursively(_0x15f1de[_0x275795(0x103)],_0x15f1de[_0x275795(0x103)]);}export function resolveLocalSqlFilePath(_0x478230,_0x1cbfc3,_0x6ced8e){const _0x14aefa=a232_0xe6c6,_0x3038e5=_0x6ced8e?.[_0x14aefa(0xf7)]||(_0x6ced8e?.[_0x14aefa(0x116)]||_0x6ced8e?.[_0x14aefa(0x117)]?buildSqlRelativePath(_0x1cbfc3,_0x6ced8e?.[_0x14aefa(0x116)],_0x6ced8e?.['dbName'],_0x6ced8e?.[_0x14aefa(0x112)]||_0x14aefa(0x109),_0x6ced8e?.[_0x14aefa(0xf8)]):buildDefaultSqlFileName(_0x1cbfc3,_0x6ced8e?.[_0x14aefa(0x112)]||'sql'));return join(_0x478230[_0x14aefa(0x103)],_0x3038e5);}export async function directoryExists(_0x205178){const _0x21837e=a232_0xe6c6;try{const _0x320ac3=await stat(_0x205178);return _0x320ac3[_0x21837e(0xfc)]();}catch{return![];}}function parseSqlPath(_0x5e2d3f,_0x23d468,_0x1733e){const _0x45913d=a232_0xe6c6,_0x544954=_0x23d468['slice'](0x0,-_0x1733e[_0x45913d(0xfd)]);if(_0x5e2d3f[_0x45913d(0xfd)]<0x2)return null;const _0x1b63a2=_0x544954[_0x45913d(0x105)]('_');if(_0x1b63a2<=0x0||_0x1b63a2>=_0x544954[_0x45913d(0xfd)]-0x1)return null;const _0x382ec8=_0x544954['slice'](0x0,_0x1b63a2);if(!isLikelySqlCode(_0x382ec8))return null;return{'sqlCode':_0x382ec8,'sqlName':_0x544954[_0x45913d(0xf9)](_0x1b63a2+0x1)};}function a232_0xe6c6(_0x1a825b,_0x5f35ea){_0x1a825b=_0x1a825b-0xf6;const _0x33cb54=a232_0x33cb();let _0xe6c6c8=_0x33cb54[_0x1a825b];return _0xe6c6c8;}function isLikelySqlCode(_0x112f01){const _0x4c7b1c=a232_0xe6c6;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x4c7b1c(0x10e)](_0x112f01);}function a232_0x33cb(){const _0x207ab6=['slice','20VrFjQO','905063gVJUkN','isDirectory','length','sqlCode','1133646ZxRlsN','8vPojtJ','ENOENT','isFile','sqlRootDir','filter','indexOf','code','toLowerCase','19226Gmvgjm','sql','replace','split','2168768krgpUg','5465808SDCmdc','test','1696588AYQJZM','16052663gWfspP','mybatisXml','mode','33cNROdy','push','name','sqlName','dbName','10pbsDYT','path','dbId'];a232_0x33cb=function(){return _0x207ab6;};return a232_0x33cb();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a233_0x3a97(){const _0x4d3cc9=['md5','57672pNcwBv','459586PLXCbr','digest','306120iladKT','1209943inQaPJ','18nRMpIV','hex','580735rGxmip','update','11895720XbNVie','createHash','611225ImrtyK','utf8'];a233_0x3a97=function(){return _0x4d3cc9;};return a233_0x3a97();}(function(_0x35adb7,_0x4ea698){const _0x5c6d1c=a233_0x4591,_0xa8dfe6=_0x35adb7();while(!![]){try{const _0x450ac2=-parseInt(_0x5c6d1c(0x127))/0x1+parseInt(_0x5c6d1c(0x12f))/0x2+-parseInt(_0x5c6d1c(0x123))/0x3+parseInt(_0x5c6d1c(0x12e))/0x4+-parseInt(_0x5c6d1c(0x12b))/0x5+parseInt(_0x5c6d1c(0x125))/0x6*(-parseInt(_0x5c6d1c(0x124))/0x7)+parseInt(_0x5c6d1c(0x129))/0x8;if(_0x450ac2===_0x4ea698)break;else _0xa8dfe6['push'](_0xa8dfe6['shift']());}catch(_0xb0b200){_0xa8dfe6['push'](_0xa8dfe6['shift']());}}}(a233_0x3a97,0x63839));import{readFile}from'node:fs/promises';import a233_0x1b727a from'node:crypto';function a233_0x4591(_0x1f9a3f,_0x4fbdb5){_0x1f9a3f=_0x1f9a3f-0x123;const _0x3a979b=a233_0x3a97();let _0x459130=_0x3a979b[_0x1f9a3f];return _0x459130;}export function computeSqlContentHash(_0x588c48){const _0x496829=a233_0x4591;return a233_0x1b727a[_0x496829(0x12a)](_0x496829(0x12d))[_0x496829(0x128)](_0x588c48)[_0x496829(0x130)](_0x496829(0x126));}export async function computeSqlFileHash(_0x46ffca){const _0x327da6=a233_0x4591,_0x518fd0=await readFile(_0x46ffca,_0x327da6(0x12c));return computeSqlContentHash(_0x518fd0);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x531f29,_0x3ffcaf){const _0x5abdae=a234_0x4b2a,_0x156b86=_0x531f29();while(!![]){try{const _0x50de4f=-parseInt(_0x5abdae(0x13b))/0x1+-parseInt(_0x5abdae(0x13c))/0x2*(-parseInt(_0x5abdae(0x12d))/0x3)+-parseInt(_0x5abdae(0x13d))/0x4+parseInt(_0x5abdae(0x134))/0x5*(-parseInt(_0x5abdae(0x133))/0x6)+-parseInt(_0x5abdae(0x132))/0x7+parseInt(_0x5abdae(0x12e))/0x8+parseInt(_0x5abdae(0x13a))/0x9;if(_0x50de4f===_0x3ffcaf)break;else _0x156b86['push'](_0x156b86['shift']());}catch(_0x13cfb7){_0x156b86['push'](_0x156b86['shift']());}}}(a234_0x4f93,0xdd83a));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a234_0x4b2a(_0xfbb23f,_0x10a1bd){_0xfbb23f=_0xfbb23f-0x129;const _0x4f93fb=a234_0x4f93();let _0x4b2a08=_0x4f93fb[_0xfbb23f];return _0x4b2a08;}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x224b9e,_0x45cfab,_0x154523,_0x88e7d){const _0x4f5b01=a234_0x4b2a,_0x1be2de=_0x224b9e??createEmptySqlLock();let _0x3feda3=_0x1be2de[_0x4f5b01(0x13e)][_0x45cfab];if(!_0x3feda3)return _0x3feda3={'sqlRoot':_0x154523,'lastSync':'','sqls':{}},_0x1be2de[_0x4f5b01(0x13e)][_0x45cfab]=_0x3feda3,{'lockData':_0x1be2de,'appLock':_0x3feda3};if(!_0x3feda3[_0x4f5b01(0x12a)])_0x3feda3['sqlRoot']=_0x154523;else{if(_0x3feda3[_0x4f5b01(0x12a)]!==_0x154523)throw new Error(_0x88e7d+_0x4f5b01(0x135)+_0x154523+_0x4f5b01(0x129)+_0x3feda3['sqlRoot']+_0x4f5b01(0x138)+_0x4f5b01(0x12f));}return!_0x3feda3[_0x4f5b01(0x131)]&&(_0x3feda3[_0x4f5b01(0x131)]={}),!_0x3feda3[_0x4f5b01(0x130)]&&(_0x3feda3[_0x4f5b01(0x130)]=''),{'lockData':_0x1be2de,'appLock':_0x3feda3};}export async function readSqlLockFile(_0x40510e){const _0x3ced0a=a234_0x4b2a;try{const _0x40df8c=await readFile(_0x40510e,'utf8');return JSON['parse'](_0x40df8c);}catch(_0xb7c51d){if(_0xb7c51d[_0x3ced0a(0x12b)]===_0x3ced0a(0x137))return null;throw new Error(_0x3ced0a(0x12c)+String(_0xb7c51d));}}function a234_0x4f93(){const _0x1fb77e=['stringify','ENOENT','\x22.\x20','utf8','25426161RncJwZ','109642HxteVP','107574gdBuxw','1715332dfXUgf','apps','\x22\x20vs\x20lock\x20\x22','sqlRoot','code','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','6SwGoXG','7295560fOesyA','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','lastSync','sqls','4814908xAVAsC','114NMfKaE','450265ivEVUC',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'];a234_0x4f93=function(){return _0x1fb77e;};return a234_0x4f93();}export async function writeSqlLockFile(_0x6fdaf5,_0x1f5b52){const _0xdc72e=a234_0x4b2a;await mkdir(dirname(_0x6fdaf5),{'recursive':!![]}),await writeFile(_0x6fdaf5,JSON[_0xdc72e(0x136)](_0x1f5b52,null,0x2),_0xdc72e(0x139));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x9d5db4,_0x4f06df){const _0x1b418e=a236_0x3ee8,_0x82b6da=_0x9d5db4();while(!![]){try{const _0x40744e=parseInt(_0x1b418e(0xa2))/0x1+-parseInt(_0x1b418e(0xa3))/0x2+parseInt(_0x1b418e(0xa4))/0x3*(-parseInt(_0x1b418e(0x9f))/0x4)+parseInt(_0x1b418e(0x9b))/0x5+-parseInt(_0x1b418e(0xaa))/0x6+parseInt(_0x1b418e(0xa5))/0x7+parseInt(_0x1b418e(0xa1))/0x8*(parseInt(_0x1b418e(0x9e))/0x9);if(_0x40744e===_0x4f06df)break;else _0x82b6da['push'](_0x82b6da['shift']());}catch(_0x30b863){_0x82b6da['push'](_0x82b6da['shift']());}}}(a236_0x5328,0xd73f8));function a236_0x3ee8(_0x8612a1,_0x18e59c){_0x8612a1=_0x8612a1-0x98;const _0x532842=a236_0x5328();let _0x3ee80d=_0x532842[_0x8612a1];return _0x3ee80d;}export function detectSqlMode(_0x407149){const _0x45e4d6=a236_0x3ee8,_0x9c4816=_0x407149[_0x45e4d6(0x99)]();if(/^<(select|insert|update|delete)\b/i[_0x45e4d6(0x9d)](_0x9c4816))return _0x45e4d6(0xa0);return _0x45e4d6(0xa8);}export function getSqlFileExtension(_0x67f93a){const _0x6fb678=a236_0x3ee8;return _0x67f93a===_0x6fb678(0xa0)?_0x6fb678(0xa9):'.sql';}export function buildDefaultSqlFileName(_0x4286d3,_0x579599){return''+_0x4286d3+getSqlFileExtension(_0x579599);}export function sanitizeSqlPathSegment(_0x54e75a,_0x563e74){const _0x200483=a236_0x3ee8,_0x109cb7=String(_0x54e75a??'')[_0x200483(0x9a)](),_0x2f144a=_0x109cb7[_0x200483(0x9c)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')['replace'](/\s+/g,'-')[_0x200483(0x9c)](/-+/g,'-')[_0x200483(0x9c)](/^\.+/,'')[_0x200483(0x9c)](/\.+$/,'')[_0x200483(0x9c)](/^-+/,'')['replace'](/-+$/,'');return _0x2f144a||_0x563e74;}export function buildDbDirectoryName(_0x991d72,_0x3931c5){const _0x5c6953=a236_0x3ee8;return sanitizeSqlPathSegment(_0x991d72,_0x3931c5!=null?_0x5c6953(0x98)+_0x3931c5:_0x5c6953(0xa6));}function a236_0x5328(){const _0x2ff431=['trimStart','trim','288050RtNIEG','replace','test','81GzKMGc','4gCAtkX','mybatisXml','2434424TQhYYU','1003119QQTeHt','3380330ANsIBy','865425USFBNt','38493arvAQR','unknown-db','unknown-sql','sql','.xml','5667954soyIDR','db-'];a236_0x5328=function(){return _0x2ff431;};return a236_0x5328();}export function buildSqlRelativePath(_0x105e77,_0x3985c4,_0x53a870,_0x4577b7,_0x3a39d8){const _0x2c1738=a236_0x3ee8,_0x13f05b=buildDbDirectoryName(_0x53a870,_0x3a39d8),_0x2d0a33=sanitizeSqlPathSegment(_0x105e77,_0x2c1738(0xa7)),_0x609d1f=sanitizeSqlPathSegment(_0x3985c4,_0x2d0a33);return _0x13f05b+'/'+_0x2d0a33+'_'+_0x609d1f+getSqlFileExtension(_0x4577b7);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a237_0x5604ec=a237_0x1552;(function(_0xa0ab2c,_0x1968bf){const _0x357110=a237_0x1552,_0x5ab12f=_0xa0ab2c();while(!![]){try{const _0x4b1977=-parseInt(_0x357110(0xba))/0x1+parseInt(_0x357110(0xb4))/0x2*(parseInt(_0x357110(0xca))/0x3)+-parseInt(_0x357110(0xcb))/0x4+parseInt(_0x357110(0xb2))/0x5+-parseInt(_0x357110(0x94))/0x6+parseInt(_0x357110(0x97))/0x7*(-parseInt(_0x357110(0xa6))/0x8)+parseInt(_0x357110(0xa0))/0x9;if(_0x4b1977===_0x1968bf)break;else _0x5ab12f['push'](_0x5ab12f['shift']());}catch(_0x1e15e6){_0x5ab12f['push'](_0x5ab12f['shift']());}}}(a237_0x86ed,0x18c7e));const MYBATIS_OUTER_TAGS=new Map([[a237_0x5604ec(0xb5),'SELECT'],[a237_0x5604ec(0xcd),a237_0x5604ec(0xd7)],[a237_0x5604ec(0xb1),'UPDATE'],['delete','DELETE']]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a237_0x5604ec(0x82),a237_0x5604ec(0xa5),a237_0x5604ec(0xc9),a237_0x5604ec(0x91),'otherwise',a237_0x5604ec(0xb8),a237_0x5604ec(0x9e),a237_0x5604ec(0xd9),a237_0x5604ec(0xb9),a237_0x5604ec(0x8a)]),MYBATIS_BRANCH_TAGS=new Set(['if',a237_0x5604ec(0xa5),a237_0x5604ec(0xc9),'when',a237_0x5604ec(0x98)]);export const MYBATIS_DYNAMIC_START_MARKER='__RABETBASE_MYBATIS_DYNAMIC_START__';export const MYBATIS_DYNAMIC_END_MARKER=a237_0x5604ec(0x85);function a237_0x86ed(){const _0x4a660e=['190466nsRnCL','DELETE','WITH','outer','rawName','UNKNOWN','toLowerCase','\x20SET\x20','<!--','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','-->','unknown\x20table(s)','length','pop','choose','2703VQjvkU','675584gOPzQs',')\x5cb','insert','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','\x20with\x20parameters:\x20','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','DDL','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','"','split','&','slice','INSERT','UPDATE','bind','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','Unterminated\x20XML\x20declaration.','replaceAll','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','Unterminated\x20MyBatis\x20XML\x20tag.','type','add','mybatisXml','^<\x5cs*(?:','error','where',''','exec','__RABETBASE_MYBATIS_DYNAMIC_END__','SQL\x20content\x20is\x20empty','Invalid\x20XML\x20entity\x20reference.','reason','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','property','tagName','keys','replace','match','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','sql','when','join','startsWith','894954uloBqG','\x20WHERE\x20','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','15442JntMaB','otherwise','<','fromCodePoint','matchAll','statementType','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','set','parseInt','5365242apzUhh','Invalid\x20MyBatis\x20XML\x20tag.','>','string','toUpperCase','foreach','584xmySLo','Unable\x20to\x20detect\x20SQL\x20type.\x20','SELECT','from','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','has','get','includes','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','Unterminated\x20XML\x20comment.','indexOf','update','288965zJmwjd','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','260DHxBqi','select','test','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','trim','include'];a237_0x86ed=function(){return _0x4a660e;};return a237_0x86ed();}export const MYBATIS_INCLUDE_MARKER=a237_0x5604ec(0xb7);const UNRESOLVED_SQL_FRAGMENT=a237_0x5604ec(0xda),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a237_0x5604ec(0x80)+[...MYBATIS_OUTER_TAGS[a237_0x5604ec(0x8c)]()][a237_0x5604ec(0x92)]('|')+a237_0x5604ec(0xcc),'i');export function normalizeSqlForStaticAnalysis(_0x7ac26d){const _0xe6fa27=a237_0x5604ec,_0x39b543=typeof _0x7ac26d===_0xe6fa27(0xa3)?_0x7ac26d:'';if(!startsWithMybatisStatementWrapper(_0x39b543))return{'sql':_0x39b543,'mode':_0xe6fa27(0x90)};let _0x3172a1=0x0,_0x6f5ad0='',_0xed4f8e,_0x518747=![],_0xf5d7e0=![];const _0x23064d=[];while(_0x3172a1<_0x39b543[_0xe6fa27(0xc7)]){if(_0x39b543[_0xe6fa27(0x93)]('<!--',_0x3172a1)){const _0x1b4f33=_0x39b543[_0xe6fa27(0xb0)](_0xe6fa27(0xc5),_0x3172a1+0x4);if(_0x1b4f33<0x0)return invalidMybatisSource(_0xe6fa27(0xaf));_0x6f5ad0+='\x20',_0x3172a1=_0x1b4f33+0x3;continue;}if(_0x39b543['startsWith']('<;if(_0x4d0604<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x6f5ad0+=_0x39b543[_0xe6fa27(0xd6)](_0x3172a1+0x9,_0x4d0604),_0x3172a1=_0x4d0604+0x3;continue;}if(_0x39b543[_0xe6fa27(0x93)]('<?',_0x3172a1)){if(_0x518747)return invalidMybatisSource(_0xe6fa27(0xdc));const _0x1f5467=_0x39b543[_0xe6fa27(0xb0)]('?>',_0x3172a1+0x2);if(_0x1f5467<0x0)return invalidMybatisSource(_0xe6fa27(0xdd));_0x6f5ad0+='\x20',_0x3172a1=_0x1f5467+0x2;continue;}if(_0x39b543[_0x3172a1]!=='<'){const _0x1e93ff=_0x39b543[_0xe6fa27(0xb0)]('<',_0x3172a1),_0x45b71e=_0x1e93ff<0x0?_0x39b543[_0xe6fa27(0xc7)]:_0x1e93ff,_0x4745d1=_0x39b543['slice'](_0x3172a1,_0x45b71e);if((!_0x518747||_0xf5d7e0)&&_0x4745d1['trim']())return invalidMybatisSource('SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');if(_0x518747&&!_0xf5d7e0){const _0x4dc961=decodeXmlEntities(_0x4745d1);if(_0x4dc961===null)return invalidMybatisSource(_0xe6fa27(0x87));_0x6f5ad0+=_0x4dc961;}else _0x6f5ad0+='\x20';_0x3172a1=_0x45b71e;continue;}const _0x353aee=findXmlTagEnd(_0x39b543,_0x3172a1);if(_0x353aee<0x0)return invalidMybatisSource(_0xe6fa27(0x7c));const _0x5ae5ce=_0x39b543[_0xe6fa27(0xd6)](_0x3172a1,_0x353aee+0x1),_0x3489c3=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0xe6fa27(0x84)](_0x5ae5ce);if(!_0x3489c3)return invalidMybatisSource(_0xe6fa27(0xa1));const _0xfe63f6=_0x3489c3[0x1]==='/',_0x51d2eb=_0x3489c3[0x2]??'',_0x557210=_0x51d2eb[_0xe6fa27(0xc0)](),_0x4877ac=_0x3489c3[0x3]??'',_0xfe163f=_0x3489c3[0x4]==='/',_0x5110d5=MYBATIS_OUTER_TAGS[_0xe6fa27(0xac)](_0x557210);if(!_0x5110d5&&!MYBATIS_DYNAMIC_TAGS[_0xe6fa27(0xab)](_0x557210))return invalidMybatisSource(_0xe6fa27(0xc3)+_0x557210+'>.');if(!_0x5110d5&&_0x51d2eb!==_0x557210)return invalidMybatisSource(_0xe6fa27(0x7b)+_0x51d2eb+'>.');if(_0xfe63f6){if(_0x4877ac[_0xe6fa27(0xb8)]()||_0xfe163f)return invalidMybatisSource(_0xe6fa27(0x8f)+_0x51d2eb+'>.');const _0x5f562b=_0x23064d['at'](-0x1);if(!_0x5f562b||(_0x5f562b[_0xe6fa27(0xbd)]?_0x5f562b[_0xe6fa27(0x8b)]!==_0x557210:_0x5f562b[_0xe6fa27(0xbe)]!==_0x51d2eb))return invalidMybatisSource(_0xe6fa27(0xd0)+_0x51d2eb+'>.');_0x23064d[_0xe6fa27(0xc8)]();if(_0x5f562b[_0xe6fa27(0xbd)])_0xf5d7e0=!![];_0x6f5ad0+=MYBATIS_BRANCH_TAGS[_0xe6fa27(0xab)](_0x557210)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x4877ac))return invalidMybatisSource(_0xe6fa27(0xaa)+_0x51d2eb+'>.');if(_0x557210===_0xe6fa27(0x8a)&&(!_0xfe163f||_0x23064d['at'](-0x1)?.[_0xe6fa27(0x8b)]!==_0xe6fa27(0xb9)))return invalidMybatisSource(_0xe6fa27(0xc4));if(_0x5110d5){if(_0x518747||_0x23064d[_0xe6fa27(0xc7)]>0x0)return invalidMybatisSource(_0xe6fa27(0xdb));_0x518747=!![],_0xf5d7e0=_0xfe163f,_0xed4f8e=_0x5110d5;}else{if(!_0x518747||_0xf5d7e0)return invalidMybatisSource(_0xe6fa27(0xb3)+_0x51d2eb+'>.');}_0x6f5ad0+=_0x557210===_0xe6fa27(0x82)?_0xe6fa27(0x95):_0x557210==='set'?_0xe6fa27(0xc1):_0x557210===_0xe6fa27(0xb9)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0xe6fa27(0xab)](_0x557210)&&!_0xfe163f?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0xfe163f&&_0x23064d['push']({'rawName':_0x51d2eb,'tagName':_0x557210,'outer':!!_0x5110d5});}_0x3172a1=_0x353aee+0x1;}if(_0x23064d[_0xe6fa27(0xc7)]>0x0)return invalidMybatisSource(_0xe6fa27(0x9d)+_0x23064d['at'](-0x1)?.[_0xe6fa27(0xbe)]+'>.');if(!_0x518747||!_0xf5d7e0)return invalidMybatisSource(_0xe6fa27(0x89));return{'sql':_0x6f5ad0[_0xe6fa27(0xb8)](),'mode':_0xe6fa27(0x7f),..._0xed4f8e?{'statementType':_0xed4f8e}:{}};}function hasWellFormedXmlAttributes(_0x460283){const _0x1ba6d0=a237_0x5604ec;let _0x5d65f1=0x0;const _0x50757c=new Set();while(_0x5d65f1<_0x460283[_0x1ba6d0(0xc7)]){while(_0x5d65f1<_0x460283['length']&&/\s/['test'](_0x460283[_0x5d65f1]??''))_0x5d65f1+=0x1;if(_0x5d65f1>=_0x460283[_0x1ba6d0(0xc7)])return!![];const _0xe8c55b=/^[A-Za-z_:][\w:.-]*/[_0x1ba6d0(0x84)](_0x460283[_0x1ba6d0(0xd6)](_0x5d65f1)),_0x4f78f0=_0xe8c55b?.[0x0];if(!_0x4f78f0||_0x50757c['has'](_0x4f78f0))return![];_0x50757c[_0x1ba6d0(0x7e)](_0x4f78f0),_0x5d65f1+=_0x4f78f0[_0x1ba6d0(0xc7)];while(_0x5d65f1<_0x460283[_0x1ba6d0(0xc7)]&&/\s/[_0x1ba6d0(0xb6)](_0x460283[_0x5d65f1]??''))_0x5d65f1+=0x1;if(_0x460283[_0x5d65f1]!=='=')return![];_0x5d65f1+=0x1;while(_0x5d65f1<_0x460283['length']&&/\s/[_0x1ba6d0(0xb6)](_0x460283[_0x5d65f1]??''))_0x5d65f1+=0x1;const _0xd2e969=_0x460283[_0x5d65f1];if(_0xd2e969!=='\x22'&&_0xd2e969!=='\x27')return![];_0x5d65f1+=0x1;const _0x5f1877=_0x460283['indexOf'](_0xd2e969,_0x5d65f1);if(_0x5f1877<0x0)return![];if(decodeXmlEntities(_0x460283[_0x1ba6d0(0xd6)](_0x5d65f1,_0x5f1877))===null)return![];_0x5d65f1=_0x5f1877+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x1a1d89){const _0x496368=a237_0x5604ec;let _0x2afe53=0x0;const _0x142734=()=>{const _0x2496e6=a237_0x1552;while(_0x2afe53<_0x1a1d89[_0x2496e6(0xc7)]&&/\s/[_0x2496e6(0xb6)](_0x1a1d89[_0x2afe53]??''))_0x2afe53+=0x1;};_0x142734();while(_0x2afe53<_0x1a1d89['length']){if(_0x1a1d89[_0x496368(0x93)](_0x496368(0xc2),_0x2afe53)){const _0x3f8850=_0x1a1d89[_0x496368(0xb0)](_0x496368(0xc5),_0x2afe53+0x4);if(_0x3f8850<0x0)return!![];_0x2afe53=_0x3f8850+0x3,_0x142734();continue;}if(_0x1a1d89[_0x496368(0x93)]('<?',_0x2afe53)){const _0x5f3464=_0x1a1d89[_0x496368(0xb0)]('?>',_0x2afe53+0x2);if(_0x5f3464<0x0)return!![];_0x2afe53=_0x5f3464+0x2,_0x142734();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x496368(0xb6)](_0x1a1d89[_0x496368(0xd6)](_0x2afe53));}function invalidMybatisSource(_0x4fcb66){const _0x3b9284=a237_0x5604ec;return{'sql':'','mode':_0x3b9284(0x7f),'error':_0x4fcb66};}function findXmlTagEnd(_0x3a9f35,_0x25ee66){const _0x265c15=a237_0x5604ec;let _0x3a0d8f;for(let _0x4daf03=_0x25ee66+0x1;_0x4daf03<_0x3a9f35[_0x265c15(0xc7)];_0x4daf03+=0x1){const _0x38ad25=_0x3a9f35[_0x4daf03];if(_0x3a0d8f){if(_0x38ad25===_0x3a0d8f)_0x3a0d8f=undefined;continue;}if(_0x38ad25==='\x22'||_0x38ad25==='\x27'){_0x3a0d8f=_0x38ad25;continue;}if(_0x38ad25==='>')return _0x4daf03;}return-0x1;}function decodeXmlEntities(_0x32989e){const _0x4703dc=a237_0x5604ec;let _0x77abf9=![];const _0x488d85=_0x32989e[_0x4703dc(0x8d)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x435c8c=>{const _0x30e371=_0x4703dc;if(_0x435c8c===_0x30e371(0x99))return'<';if(_0x435c8c===_0x30e371(0xa2))return'>';if(_0x435c8c===_0x30e371(0xd3))return'\x22';if(_0x435c8c===_0x30e371(0x83))return'\x27';if(_0x435c8c===_0x30e371(0xd5))return'&';const _0x36fb1f=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x30e371(0x84)](_0x435c8c);if(_0x36fb1f){const _0x2e3985=_0x36fb1f[0x1],_0x42910a=_0x36fb1f[0x2],_0x292b72=Number[_0x30e371(0x9f)](_0x2e3985??_0x42910a??'',_0x2e3985?0x10:0xa);if(isValidXmlCharacter(_0x292b72))return String[_0x30e371(0x9a)](_0x292b72);}return _0x77abf9=!![],'';});return _0x77abf9?null:_0x488d85;}function isValidXmlCharacter(_0x3fcc54){return _0x3fcc54===0x9||_0x3fcc54===0xa||_0x3fcc54===0xd||_0x3fcc54>=0x20&&_0x3fcc54<=0xd7ff||_0x3fcc54>=0xe000&&_0x3fcc54<=0xfffd||_0x3fcc54>=0x10000&&_0x3fcc54<=0x10ffff;}export function detectSqlType(_0x3d172d){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x3d172d));}function a237_0x1552(_0x296ff3,_0x3f99e1){_0x296ff3=_0x296ff3-0x7a;const _0x86edf4=a237_0x86ed();let _0x155276=_0x86edf4[_0x296ff3];return _0x155276;}function detectNormalizedSqlType(_0x2b8c19){const _0x578f49=a237_0x5604ec;if(_0x2b8c19['error'])return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x2b8c19[_0x578f49(0x81)]};if(!_0x2b8c19[_0x578f49(0x90)][_0x578f49(0xb8)]())return{'type':_0x578f49(0xbf),'isSelectOnly':![],'isDangerous':![],'reason':_0x578f49(0x86)};const _0x266934=stripStaticAnalysisMarkers(_0x2b8c19['sql'])[_0x578f49(0x8d)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x578f49(0x8d)](/\/\*[\s\S]*?\*\//g,'')[_0x578f49(0xb8)](),_0x784b68=_0x266934[_0x578f49(0xd4)]('\x0a');let _0x431b61='';for(const _0x7da48b of _0x784b68){const _0x36f1e9=_0x7da48b[_0x578f49(0xb8)]();if(!_0x36f1e9||_0x36f1e9[_0x578f49(0x93)]('--')||_0x36f1e9[_0x578f49(0x93)]('/*'))continue;_0x431b61=_0x36f1e9;break;}const _0x1295df=_0x431b61[_0x578f49(0xa4)](),_0x3e9cb0=_0x2b8c19[_0x578f49(0x9c)],_0x435185=maskSqlTextForBlockedKeywordScan(_0x266934),_0x286080=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x578f49(0xb6)](_0x435185);if(_0x3e9cb0===_0x578f49(0xa8)||!_0x3e9cb0&&(_0x1295df[_0x578f49(0x93)](_0x578f49(0xa8))||_0x1295df[_0x578f49(0x93)](_0x578f49(0xbc)))){const _0x78806f=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x578f49(0xb6)](_0x266934);return{'type':_0x578f49(0xa8),'isSelectOnly':!_0x78806f,'isDangerous':_0x78806f,'reason':_0x78806f?_0x578f49(0xae):undefined};}if(_0x3e9cb0===_0x578f49(0xd7)||!_0x3e9cb0&&_0x1295df[_0x578f49(0x93)](_0x578f49(0xd7)))return{'type':_0x578f49(0xd7),'isSelectOnly':![],'isDangerous':_0x286080,'reason':_0x286080?_0x578f49(0xd2):undefined};if(_0x3e9cb0===_0x578f49(0xd8)||!_0x3e9cb0&&_0x1295df['startsWith'](_0x578f49(0xd8)))return{'type':_0x578f49(0xd8),'isSelectOnly':![],'isDangerous':_0x286080,'reason':_0x286080?_0x578f49(0xd2):undefined};if(_0x3e9cb0===_0x578f49(0xbb)||!_0x3e9cb0&&_0x1295df[_0x578f49(0x93)](_0x578f49(0xbb)))return{'type':_0x578f49(0xbb),'isSelectOnly':![],'isDangerous':!![],'reason':_0x578f49(0x7a)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x578f49(0xb6)](_0x1295df))return{'type':_0x578f49(0xd1),'isSelectOnly':![],'isDangerous':!![],'reason':_0x578f49(0x96)};return{'type':_0x578f49(0xbf),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x3b5811){const _0x50a0c4=a237_0x5604ec;return _0x3b5811[_0x50a0c4(0xde)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x50a0c4(0xde)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x50a0c4(0xde)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x4a46d8){const _0x22cb47=a237_0x5604ec;return _0x4a46d8[_0x22cb47(0x8d)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x22cb47(0x8d)](/"(?:""|\\.|[^"])*"/g,'\x20')['replace'](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x22cb47(0x8d)](/--.*$/gm,'\x20')[_0x22cb47(0x8d)](/#.*$/gm,'\x20')['replace'](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x3a899e){const _0xb0d102=a237_0x5604ec,_0x20ca00=_0x3a899e[_0xb0d102(0x8d)](/#\{[^}]*\}/g,'?')[_0xb0d102(0x8d)](/\$\{[^}]*\}/g,'?')[_0xb0d102(0x8d)](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')[_0xb0d102(0x8d)](/\/\*[\s\S]*?\*\//g,''),_0x585a9a=[],_0x5831cf=_0x20ca00['match'](/FROM\s+([^\s,)(]+)/i);addTable(_0x585a9a,_0x5831cf?.[0x1]);for(const _0x82f822 of _0x20ca00['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x585a9a,_0x82f822[0x1]);}const _0x15261e=_0x20ca00[_0xb0d102(0x8e)](/INTO\s+([^\s(]+)/i);addTable(_0x585a9a,_0x15261e?.[0x1]);const _0x5de30d=_0x20ca00['match'](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x585a9a,_0x5de30d?.[0x1]),_0x585a9a;}function addTable(_0x135db3,_0x576a3c){const _0x2e013c=a237_0x5604ec,_0x4d178f=_0x576a3c?.[_0x2e013c(0x8d)](/[`"]/g,'');_0x4d178f&&_0x4d178f!==UNRESOLVED_SQL_FRAGMENT&&!_0x135db3[_0x2e013c(0xad)](_0x4d178f)&&_0x135db3['push'](_0x4d178f);}function extractParameters(_0x10842e){const _0x420b71=a237_0x5604ec,_0xaf55a1=new Set();for(const _0x10ffa1 of _0x10842e[_0x420b71(0x9b)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x10ffa1[0x1])_0xaf55a1[_0x420b71(0x7e)](_0x10ffa1[0x1]);}return Array[_0x420b71(0xa9)](_0xaf55a1);}export function validateSql(_0x5b82a5){const _0x13ae36=a237_0x5604ec,_0x4fae8b=normalizeSqlForStaticAnalysis(_0x5b82a5),_0x209604=detectNormalizedSqlType(_0x4fae8b),_0x540587=stripStaticAnalysisMarkers(_0x4fae8b[_0x13ae36(0x90)]),_0x3ac43b=_0x4fae8b[_0x13ae36(0x81)]?[]:extractTables(_0x540587),_0x1e3e2c=_0x4fae8b['error']?[]:extractParameters(_0x540587);if(_0x209604['isDangerous'])return{'valid':![],'sqlType':_0x209604,'tables':_0x3ac43b,'parameters':_0x1e3e2c,'message':_0x209604[_0x13ae36(0x88)]||_0x209604[_0x13ae36(0x7d)]+'\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.'};if(_0x209604[_0x13ae36(0x7d)]===_0x13ae36(0xbf))return{'valid':![],'sqlType':_0x209604,'tables':_0x3ac43b,'parameters':_0x1e3e2c,'message':_0x4fae8b['error']?_0x13ae36(0xa7)+_0x4fae8b[_0x13ae36(0x81)]:_0x13ae36(0xce)};return{'valid':!![],'sqlType':_0x209604,'tables':_0x3ac43b,'parameters':_0x1e3e2c,'message':_0x209604[_0x13ae36(0x7d)]+'\x20query\x20targeting\x20'+(_0x3ac43b[_0x13ae36(0xc7)]?_0x3ac43b[_0x13ae36(0x92)](',\x20'):_0x13ae36(0xc6))+(_0x1e3e2c[_0x13ae36(0xc7)]?_0x13ae36(0xcf)+_0x1e3e2c[_0x13ae36(0x92)](',\x20'):'')};}
|
|
1
|
+
const a237_0x46e7a9=a237_0x23ca;(function(_0x8b3a79,_0x3b70bb){const _0x32c994=a237_0x23ca,_0xa1df68=_0x8b3a79();while(!![]){try{const _0x4dff8a=-parseInt(_0x32c994(0x142))/0x1*(parseInt(_0x32c994(0x147))/0x2)+-parseInt(_0x32c994(0x122))/0x3*(-parseInt(_0x32c994(0x141))/0x4)+-parseInt(_0x32c994(0x135))/0x5+parseInt(_0x32c994(0xf5))/0x6+-parseInt(_0x32c994(0xf3))/0x7*(-parseInt(_0x32c994(0x109))/0x8)+-parseInt(_0x32c994(0x123))/0x9+parseInt(_0x32c994(0x111))/0xa;if(_0x4dff8a===_0x3b70bb)break;else _0xa1df68['push'](_0xa1df68['shift']());}catch(_0x286400){_0xa1df68['push'](_0xa1df68['shift']());}}}(a237_0xeead,0x5788a));const MYBATIS_OUTER_TAGS=new Map([['select',a237_0x46e7a9(0x12f)],['insert','INSERT'],[a237_0x46e7a9(0x126),a237_0x46e7a9(0x11a)],[a237_0x46e7a9(0xf6),a237_0x46e7a9(0x114)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a237_0x46e7a9(0x12a),a237_0x46e7a9(0xf9),a237_0x46e7a9(0x144),a237_0x46e7a9(0x100),a237_0x46e7a9(0x130),'trim',a237_0x46e7a9(0x136),a237_0x46e7a9(0xfa),'include',a237_0x46e7a9(0x129)]),MYBATIS_BRANCH_TAGS=new Set(['if',a237_0x46e7a9(0xf9),a237_0x46e7a9(0x144),a237_0x46e7a9(0x100),a237_0x46e7a9(0x130)]);export const MYBATIS_DYNAMIC_START_MARKER=a237_0x46e7a9(0xf4);export const MYBATIS_DYNAMIC_END_MARKER=a237_0x46e7a9(0x12b);export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT=a237_0x46e7a9(0x149),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a237_0x46e7a9(0x10d)+[...MYBATIS_OUTER_TAGS['keys']()][a237_0x46e7a9(0xfd)]('|')+a237_0x46e7a9(0x12c),'i');export function normalizeSqlForStaticAnalysis(_0x7cf517){const _0x5bb3d7=a237_0x46e7a9,_0x2c10be=typeof _0x7cf517===_0x5bb3d7(0x150)?_0x7cf517:'';if(!startsWithMybatisStatementWrapper(_0x2c10be))return{'sql':_0x2c10be,'mode':_0x5bb3d7(0x10e)};let _0x5ec650=0x0,_0x465dae='',_0x3deb35,_0x275635=![],_0xb8654=![];const _0x5dac53=[];while(_0x5ec650<_0x2c10be['length']){if(_0x2c10be[_0x5bb3d7(0xf1)](_0x5bb3d7(0x12e),_0x5ec650)){const _0x2e2c40=_0x2c10be[_0x5bb3d7(0x106)](_0x5bb3d7(0x121),_0x5ec650+0x4);if(_0x2e2c40<0x0)return invalidMybatisSource(_0x5bb3d7(0x14b));_0x465dae+='\x20',_0x5ec650=_0x2e2c40+0x3;continue;}if(_0x2c10be[_0x5bb3d7(0xf1)](_0x5bb3d7(0xfb),_0x5ec650)){if(!_0x275635||_0xb8654)return invalidMybatisSource(_0x5bb3d7(0x105));const _0x86eb1e=_0x2c10be[_0x5bb3d7(0x106)](_0x5bb3d7(0x133),_0x5ec650+0x9);if(_0x86eb1e<0x0)return invalidMybatisSource(_0x5bb3d7(0x140));_0x465dae+=_0x2c10be[_0x5bb3d7(0x101)](_0x5ec650+0x9,_0x86eb1e),_0x5ec650=_0x86eb1e+0x3;continue;}if(_0x2c10be['startsWith']('<?',_0x5ec650)){if(_0x275635)return invalidMybatisSource(_0x5bb3d7(0x14d));const _0x533b44=_0x2c10be[_0x5bb3d7(0x106)]('?>',_0x5ec650+0x2);if(_0x533b44<0x0)return invalidMybatisSource(_0x5bb3d7(0x13a));_0x465dae+='\x20',_0x5ec650=_0x533b44+0x2;continue;}if(_0x2c10be[_0x5ec650]!=='<'){const _0x3c940f=_0x2c10be[_0x5bb3d7(0x106)]('<',_0x5ec650),_0x30ad04=_0x3c940f<0x0?_0x2c10be[_0x5bb3d7(0x107)]:_0x3c940f,_0x201c6f=_0x2c10be['slice'](_0x5ec650,_0x30ad04);if((!_0x275635||_0xb8654)&&_0x201c6f[_0x5bb3d7(0xf2)]())return invalidMybatisSource(_0x5bb3d7(0x110));if(_0x275635&&!_0xb8654){const _0x2b81db=decodeXmlEntities(_0x201c6f);if(_0x2b81db===null)return invalidMybatisSource(_0x5bb3d7(0x11b));_0x465dae+=_0x2b81db;}else _0x465dae+='\x20';_0x5ec650=_0x30ad04;continue;}const _0x49811e=findXmlTagEnd(_0x2c10be,_0x5ec650);if(_0x49811e<0x0)return invalidMybatisSource(_0x5bb3d7(0x127));const _0x598b9d=_0x2c10be['slice'](_0x5ec650,_0x49811e+0x1),_0x1e30a5=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/['exec'](_0x598b9d);if(!_0x1e30a5)return invalidMybatisSource(_0x5bb3d7(0x124));const _0x2b9668=_0x1e30a5[0x1]==='/',_0x35a4c8=_0x1e30a5[0x2]??'',_0xd437af=_0x35a4c8[_0x5bb3d7(0x137)](),_0xce582=_0x1e30a5[0x3]??'',_0x42e397=_0x1e30a5[0x4]==='/',_0x54ee49=MYBATIS_OUTER_TAGS[_0x5bb3d7(0x102)](_0xd437af);if(!_0x54ee49&&!MYBATIS_DYNAMIC_TAGS[_0x5bb3d7(0x13d)](_0xd437af))return invalidMybatisSource(_0x5bb3d7(0x115)+_0xd437af+'>.');if(!_0x54ee49&&_0x35a4c8!==_0xd437af)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<'+_0x35a4c8+'>.');if(_0x2b9668){if(_0xce582['trim']()||_0x42e397)return invalidMybatisSource(_0x5bb3d7(0x10a)+_0x35a4c8+'>.');const _0x14f162=_0x5dac53['at'](-0x1);if(!_0x14f162||(_0x14f162[_0x5bb3d7(0x14c)]?_0x14f162['tagName']!==_0xd437af:_0x14f162['rawName']!==_0x35a4c8))return invalidMybatisSource(_0x5bb3d7(0x11c)+_0x35a4c8+'>.');_0x5dac53[_0x5bb3d7(0x108)]();if(_0x14f162['outer'])_0xb8654=!![];_0x465dae+=MYBATIS_BRANCH_TAGS['has'](_0xd437af)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0xce582))return invalidMybatisSource(_0x5bb3d7(0x143)+_0x35a4c8+'>.');if(_0xd437af==='property'&&(!_0x42e397||_0x5dac53['at'](-0x1)?.['tagName']!==_0x5bb3d7(0x134)))return invalidMybatisSource(_0x5bb3d7(0x103));if(_0x54ee49){if(_0x275635||_0x5dac53[_0x5bb3d7(0x107)]>0x0)return invalidMybatisSource('Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.');_0x275635=!![],_0xb8654=_0x42e397,_0x3deb35=_0x54ee49;}else{if(!_0x275635||_0xb8654)return invalidMybatisSource(_0x5bb3d7(0x119)+_0x35a4c8+'>.');}_0x465dae+=_0xd437af===_0x5bb3d7(0x12a)?_0x5bb3d7(0x13c):_0xd437af===_0x5bb3d7(0x136)?_0x5bb3d7(0x116):_0xd437af===_0x5bb3d7(0x134)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS['has'](_0xd437af)&&!_0x42e397?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x42e397&&_0x5dac53[_0x5bb3d7(0x13b)]({'rawName':_0x35a4c8,'tagName':_0xd437af,'outer':!!_0x54ee49});}_0x5ec650=_0x49811e+0x1;}if(_0x5dac53[_0x5bb3d7(0x107)]>0x0)return invalidMybatisSource('Unclosed\x20MyBatis\x20XML\x20tag:\x20<'+_0x5dac53['at'](-0x1)?.['rawName']+'>.');if(!_0x275635||!_0xb8654)return invalidMybatisSource(_0x5bb3d7(0x13f));return{'sql':_0x465dae[_0x5bb3d7(0xf2)](),'mode':'mybatisXml',..._0x3deb35?{'statementType':_0x3deb35}:{}};}function hasWellFormedXmlAttributes(_0x4a3c96){const _0x466fde=a237_0x46e7a9;let _0x5df746=0x0;const _0xd246ef=new Set();while(_0x5df746<_0x4a3c96[_0x466fde(0x107)]){while(_0x5df746<_0x4a3c96['length']&&/\s/[_0x466fde(0x113)](_0x4a3c96[_0x5df746]??''))_0x5df746+=0x1;if(_0x5df746>=_0x4a3c96[_0x466fde(0x107)])return!![];const _0x950bda=/^[A-Za-z_:][\w:.-]*/[_0x466fde(0xf7)](_0x4a3c96[_0x466fde(0x101)](_0x5df746)),_0x31b8ff=_0x950bda?.[0x0];if(!_0x31b8ff||_0xd246ef['has'](_0x31b8ff))return![];_0xd246ef[_0x466fde(0x14e)](_0x31b8ff),_0x5df746+=_0x31b8ff[_0x466fde(0x107)];while(_0x5df746<_0x4a3c96[_0x466fde(0x107)]&&/\s/[_0x466fde(0x113)](_0x4a3c96[_0x5df746]??''))_0x5df746+=0x1;if(_0x4a3c96[_0x5df746]!=='=')return![];_0x5df746+=0x1;while(_0x5df746<_0x4a3c96[_0x466fde(0x107)]&&/\s/['test'](_0x4a3c96[_0x5df746]??''))_0x5df746+=0x1;const _0x4e5f2a=_0x4a3c96[_0x5df746];if(_0x4e5f2a!=='\x22'&&_0x4e5f2a!=='\x27')return![];_0x5df746+=0x1;const _0x3f29fb=_0x4a3c96[_0x466fde(0x106)](_0x4e5f2a,_0x5df746);if(_0x3f29fb<0x0)return![];if(decodeXmlEntities(_0x4a3c96[_0x466fde(0x101)](_0x5df746,_0x3f29fb))===null)return![];_0x5df746=_0x3f29fb+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x33b225){const _0x408d0a=a237_0x46e7a9;let _0x4f4160=0x0;const _0x574490=()=>{const _0x32f725=a237_0x23ca;while(_0x4f4160<_0x33b225[_0x32f725(0x107)]&&/\s/[_0x32f725(0x113)](_0x33b225[_0x4f4160]??''))_0x4f4160+=0x1;};_0x574490();while(_0x4f4160<_0x33b225[_0x408d0a(0x107)]){if(_0x33b225['startsWith'](_0x408d0a(0x12e),_0x4f4160)){const _0x5498f9=_0x33b225[_0x408d0a(0x106)](_0x408d0a(0x121),_0x4f4160+0x4);if(_0x5498f9<0x0)return!![];_0x4f4160=_0x5498f9+0x3,_0x574490();continue;}if(_0x33b225[_0x408d0a(0xf1)]('<?',_0x4f4160)){const _0x516d7b=_0x33b225[_0x408d0a(0x106)]('?>',_0x4f4160+0x2);if(_0x516d7b<0x0)return!![];_0x4f4160=_0x516d7b+0x2,_0x574490();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN['test'](_0x33b225[_0x408d0a(0x101)](_0x4f4160));}function a237_0xeead(){const _0x46939d=['1183500rADbwv','set','toLowerCase','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','fromCodePoint','Unterminated\x20XML\x20declaration.','push','\x20WHERE\x20','has','SQL\x20content\x20is\x20empty','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','Unterminated\x20CDATA\x20section.','224RoUgJA','99FauXeK','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','choose','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','error','12124lQajEd','<','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__',''','Unterminated\x20XML\x20comment.','outer','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','add','includes','string','UNKNOWN','startsWith','trim','230517CZzFlB','__RABETBASE_MYBATIS_DYNAMIC_START__','869304RaIhhQ','delete','exec','type','foreach','bind','<![CDATA[','unknown\x20table(s)','join','replaceAll','Unable\x20to\x20detect\x20SQL\x20type.\x20','when','slice','get','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','matchAll','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','indexOf','length','pop','8aSDfJB','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','WITH','reason','^<\x5cs*(?:','sql','INSERT','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','8233970weTreF','statementType','test','DELETE','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','\x20SET\x20','mybatisXml','\x20with\x20parameters:\x20','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','UPDATE','Invalid\x20XML\x20entity\x20reference.','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','"','match','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','replace','-->','14319XhgWYV','658116tQstCp','Invalid\x20MyBatis\x20XML\x20tag.','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','update','Unterminated\x20MyBatis\x20XML\x20tag.','&','property','where','__RABETBASE_MYBATIS_DYNAMIC_END__',')\x5cb','split','<!--','SELECT','otherwise','DDL','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements',']]>','include'];a237_0xeead=function(){return _0x46939d;};return a237_0xeead();}function invalidMybatisSource(_0x3c2546){const _0x963c66=a237_0x46e7a9;return{'sql':'','mode':_0x963c66(0x117),'error':_0x3c2546};}function findXmlTagEnd(_0x350e79,_0x1429c2){const _0x1a55c0=a237_0x46e7a9;let _0x32c7ca;for(let _0x21bb28=_0x1429c2+0x1;_0x21bb28<_0x350e79[_0x1a55c0(0x107)];_0x21bb28+=0x1){const _0xb910e2=_0x350e79[_0x21bb28];if(_0x32c7ca){if(_0xb910e2===_0x32c7ca)_0x32c7ca=undefined;continue;}if(_0xb910e2==='\x22'||_0xb910e2==='\x27'){_0x32c7ca=_0xb910e2;continue;}if(_0xb910e2==='>')return _0x21bb28;}return-0x1;}function decodeXmlEntities(_0x4e0fe0){let _0x2b4582=![];const _0x546640=_0x4e0fe0['replace'](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x1c81a5=>{const _0x3c67f5=a237_0x23ca;if(_0x1c81a5===_0x3c67f5(0x148))return'<';if(_0x1c81a5==='>')return'>';if(_0x1c81a5===_0x3c67f5(0x11d))return'\x22';if(_0x1c81a5===_0x3c67f5(0x14a))return'\x27';if(_0x1c81a5===_0x3c67f5(0x128))return'&';const _0x4a6a27=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x3c67f5(0xf7)](_0x1c81a5);if(_0x4a6a27){const _0x5c9017=_0x4a6a27[0x1],_0x3e3c3f=_0x4a6a27[0x2],_0x2469d3=Number['parseInt'](_0x5c9017??_0x3e3c3f??'',_0x5c9017?0x10:0xa);if(isValidXmlCharacter(_0x2469d3))return String[_0x3c67f5(0x139)](_0x2469d3);}return _0x2b4582=!![],'';});return _0x2b4582?null:_0x546640;}function isValidXmlCharacter(_0x17ce03){return _0x17ce03===0x9||_0x17ce03===0xa||_0x17ce03===0xd||_0x17ce03>=0x20&&_0x17ce03<=0xd7ff||_0x17ce03>=0xe000&&_0x17ce03<=0xfffd||_0x17ce03>=0x10000&&_0x17ce03<=0x10ffff;}export function detectSqlType(_0x4b3937){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x4b3937));}function detectNormalizedSqlType(_0x507456){const _0x31b327=a237_0x46e7a9;if(_0x507456[_0x31b327(0x146)])return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x507456['error']};if(!_0x507456[_0x31b327(0x10e)][_0x31b327(0xf2)]())return{'type':_0x31b327(0x151),'isSelectOnly':![],'isDangerous':![],'reason':_0x31b327(0x13e)};const _0x441a24=stripStaticAnalysisMarkers(_0x507456[_0x31b327(0x10e)])['replace'](/#\{[^}]*\}/g,'?')[_0x31b327(0x120)](/\$\{[^}]*\}/g,'?')[_0x31b327(0x120)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x31b327(0x120)](/\/\*[\s\S]*?\*\//g,'')[_0x31b327(0xf2)](),_0x345d7e=_0x441a24[_0x31b327(0x12d)]('\x0a');let _0x205de5='';for(const _0x21b9ec of _0x345d7e){const _0xb67531=_0x21b9ec[_0x31b327(0xf2)]();if(!_0xb67531||_0xb67531[_0x31b327(0xf1)]('--')||_0xb67531[_0x31b327(0xf1)]('/*'))continue;_0x205de5=_0xb67531;break;}const _0x492d90=_0x205de5['toUpperCase'](),_0x1ba041=_0x507456[_0x31b327(0x112)],_0x27d5a1=maskSqlTextForBlockedKeywordScan(_0x441a24),_0x3b3322=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x31b327(0x113)](_0x27d5a1);if(_0x1ba041===_0x31b327(0x12f)||!_0x1ba041&&(_0x492d90[_0x31b327(0xf1)](_0x31b327(0x12f))||_0x492d90[_0x31b327(0xf1)](_0x31b327(0x10b)))){const _0x56607b=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x31b327(0x113)](_0x441a24);return{'type':'SELECT','isSelectOnly':!_0x56607b,'isDangerous':_0x56607b,'reason':_0x56607b?_0x31b327(0x145):undefined};}if(_0x1ba041===_0x31b327(0x10f)||!_0x1ba041&&_0x492d90[_0x31b327(0xf1)](_0x31b327(0x10f)))return{'type':'INSERT','isSelectOnly':![],'isDangerous':_0x3b3322,'reason':_0x3b3322?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x1ba041===_0x31b327(0x11a)||!_0x1ba041&&_0x492d90['startsWith'](_0x31b327(0x11a)))return{'type':'UPDATE','isSelectOnly':![],'isDangerous':_0x3b3322,'reason':_0x3b3322?_0x31b327(0x132):undefined};if(_0x1ba041===_0x31b327(0x114)||!_0x1ba041&&_0x492d90[_0x31b327(0xf1)]('DELETE'))return{'type':_0x31b327(0x114),'isSelectOnly':![],'isDangerous':!![],'reason':_0x31b327(0x138)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i['test'](_0x492d90))return{'type':_0x31b327(0x131),'isSelectOnly':![],'isDangerous':!![],'reason':_0x31b327(0x11f)};return{'type':_0x31b327(0x151),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x2bd137){const _0x404d75=a237_0x46e7a9;return _0x2bd137[_0x404d75(0xfe)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x404d75(0xfe)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x404d75(0xfe)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function a237_0x23ca(_0x25f088,_0x5e5aa4){_0x25f088=_0x25f088-0xf1;const _0xeead0d=a237_0xeead();let _0x23cadf=_0xeead0d[_0x25f088];return _0x23cadf;}function maskSqlTextForBlockedKeywordScan(_0x2b120a){const _0x351401=a237_0x46e7a9;return _0x2b120a[_0x351401(0x120)](/'(?:''|\\.|[^'])*'/g,'\x20')['replace'](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x351401(0x120)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x351401(0x120)](/--.*$/gm,'\x20')['replace'](/#.*$/gm,'\x20')['replace'](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x24d995){const _0x21726b=a237_0x46e7a9,_0x38f437=_0x24d995[_0x21726b(0x120)](/#\{[^}]*\}/g,'?')[_0x21726b(0x120)](/\$\{[^}]*\}/g,'?')[_0x21726b(0x120)](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')[_0x21726b(0x120)](/\/\*[\s\S]*?\*\//g,''),_0x634f40=[],_0x5b3b76=_0x38f437['match'](/FROM\s+([^\s,)(]+)/i);addTable(_0x634f40,_0x5b3b76?.[0x1]);for(const _0x164356 of _0x38f437[_0x21726b(0x104)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x634f40,_0x164356[0x1]);}const _0x415363=_0x38f437[_0x21726b(0x11e)](/INTO\s+([^\s(]+)/i);addTable(_0x634f40,_0x415363?.[0x1]);const _0x189133=_0x38f437[_0x21726b(0x11e)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x634f40,_0x189133?.[0x1]),_0x634f40;}function addTable(_0x159eea,_0x541997){const _0x416756=a237_0x46e7a9,_0x1f5676=_0x541997?.[_0x416756(0x120)](/[`"]/g,'');_0x1f5676&&_0x1f5676!==UNRESOLVED_SQL_FRAGMENT&&!_0x159eea[_0x416756(0x14f)](_0x1f5676)&&_0x159eea[_0x416756(0x13b)](_0x1f5676);}function extractParameters(_0x16b062){const _0x4afd03=a237_0x46e7a9,_0x1c0845=new Set();for(const _0x33d835 of _0x16b062[_0x4afd03(0x104)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x33d835[0x1])_0x1c0845[_0x4afd03(0x14e)](_0x33d835[0x1]);}return Array['from'](_0x1c0845);}export function validateSql(_0x4b4630){const _0x1cdd52=a237_0x46e7a9,_0x5dd65d=normalizeSqlForStaticAnalysis(_0x4b4630),_0x550d1b=detectNormalizedSqlType(_0x5dd65d),_0x514881=stripStaticAnalysisMarkers(_0x5dd65d['sql']),_0x256735=_0x5dd65d[_0x1cdd52(0x146)]?[]:extractTables(_0x514881),_0x52b7b2=_0x5dd65d['error']?[]:extractParameters(_0x514881);if(_0x550d1b['isDangerous'])return{'valid':![],'sqlType':_0x550d1b,'tables':_0x256735,'parameters':_0x52b7b2,'message':_0x550d1b[_0x1cdd52(0x10c)]||_0x550d1b[_0x1cdd52(0xf8)]+_0x1cdd52(0x125)};if(_0x550d1b[_0x1cdd52(0xf8)]==='UNKNOWN')return{'valid':![],'sqlType':_0x550d1b,'tables':_0x256735,'parameters':_0x52b7b2,'message':_0x5dd65d[_0x1cdd52(0x146)]?_0x1cdd52(0xff)+_0x5dd65d['error']:'Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.'};return{'valid':!![],'sqlType':_0x550d1b,'tables':_0x256735,'parameters':_0x52b7b2,'message':_0x550d1b[_0x1cdd52(0xf8)]+'\x20query\x20targeting\x20'+(_0x256735[_0x1cdd52(0x107)]?_0x256735[_0x1cdd52(0xfd)](',\x20'):_0x1cdd52(0xfc))+(_0x52b7b2[_0x1cdd52(0x107)]?_0x1cdd52(0x118)+_0x52b7b2[_0x1cdd52(0xfd)](',\x20'):'')};}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a238_0x3516aa=a238_0xdb70;function a238_0xdb70(_0x5540b7,_0x27f676){_0x5540b7=_0x5540b7-0x65;const _0x27bfd6=a238_0x27bf();let _0xdb7033=_0x27bfd6[_0x5540b7];return _0xdb7033;}(function(_0x98706f,_0x1119b1){const _0x44b872=a238_0xdb70,_0x5f0451=_0x98706f();while(!![]){try{const _0x51ddbd=parseInt(_0x44b872(0x6f))/0x1+parseInt(_0x44b872(0x72))/0x2*(parseInt(_0x44b872(0x73))/0x3)+-parseInt(_0x44b872(0x71))/0x4*(parseInt(_0x44b872(0x69))/0x5)+parseInt(_0x44b872(0x66))/0x6+-parseInt(_0x44b872(0x6c))/0x7*(-parseInt(_0x44b872(0x6b))/0x8)+parseInt(_0x44b872(0x70))/0x9+parseInt(_0x44b872(0x6a))/0xa*(-parseInt(_0x44b872(0x68))/0xb);if(_0x51ddbd===_0x1119b1)break;else _0x5f0451['push'](_0x5f0451['shift']());}catch(_0xbbb259){_0x5f0451['push'](_0x5f0451['shift']());}}}(a238_0x27bf,0x604c6));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';export{CliError};export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a238_0x3516aa(0x6d)+CLI_BIN_NAME+'\x20auth`\x20to\x20login\x20first.','configMissingHint':[a238_0x3516aa(0x6e)+CLI_BIN_NAME+'\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','Tip:\x20`'+CLI_BIN_NAME+a238_0x3516aa(0x74)][a238_0x3516aa(0x65)](a238_0x3516aa(0x67)),'notInProjectHint':'Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.'});function a238_0x27bf(){const _0x5b0a76=['11dDYDmd','3070330VWWFdD','11283770BWmeRX','1405048EfYALH','7xxPTIn','Run\x20`','Set\x20appcode\x20via\x20`','54084KLelUT','6941178yULCbB','4LGYthM','6xNwkgk','740769JhefDq','\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.','join','2370930hzVWEN','\x0a\x20\x20\x20\x20\x20\x20\x20'];a238_0x27bf=function(){return _0x5b0a76;};return a238_0x27bf();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38ef15,_0x53f951){const _0x29b6a9=a239_0x57dc,_0x5cebbc=_0x38ef15();while(!![]){try{const _0x628835=-parseInt(_0x29b6a9(0x89))/0x1+parseInt(_0x29b6a9(0x8a))/0x2*(parseInt(_0x29b6a9(0x8f))/0x3)+parseInt(_0x29b6a9(0x8c))/0x4+parseInt(_0x29b6a9(0x91))/0x5*(parseInt(_0x29b6a9(0x86))/0x6)+-parseInt(_0x29b6a9(0x8e))/0x7*(parseInt(_0x29b6a9(0x8d))/0x8)+parseInt(_0x29b6a9(0x8b))/0x9*(-parseInt(_0x29b6a9(0x87))/0xa)+parseInt(_0x29b6a9(0x88))/0xb*(parseInt(_0x29b6a9(0x90))/0xc);if(_0x628835===_0x53f951)break;else _0x5cebbc['push'](_0x5cebbc['shift']());}catch(_0x3c557f){_0x5cebbc['push'](_0x5cebbc['shift']());}}}(a239_0x6401,0x37648));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';function a239_0x57dc(_0x25b437,_0x4ed0ac){_0x25b437=_0x25b437-0x86;const _0x6401ee=a239_0x6401();let _0x57dc5c=_0x6401ee[_0x25b437];return _0x57dc5c;}import{buildAllFlags as a239_0x4aec39}from'@lovrabet/cli-framework';function a239_0x6401(){const _0x526dc6=['3706812gMXwDS','10uNKNxi','yes','name','852900fGTjLj','10yMRJkI','11uhHNOR','394760cQnRIE','20118xFJZjs','2923317vjeJCn','1417336RRWSaF','8pgtnKm','1204539dHwwVo','51SVQFma'];a239_0x6401=function(){return _0x526dc6;};return a239_0x6401();}import{EXPLICIT_YES_FLAG_DESCRIPTION,requiresExplicitYes}from'../framework/explicit-yes.js';export function buildAllFlags(_0x1acd92){const _0x1075e8=a239_0x57dc,_0x52ba94=a239_0x4aec39(_0x1acd92,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});if(!requiresExplicitYes(_0x1acd92))return _0x52ba94;return _0x52ba94['map'](_0x154d18=>_0x154d18[_0x1075e8(0x93)]===_0x1075e8(0x92)?{..._0x154d18,'description':EXPLICIT_YES_FLAG_DESCRIPTION}:_0x154d18);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a240_0x160b(_0x41ed10,_0x592aa3){_0x41ed10=_0x41ed10-0xd9;var _0x430b92=a240_0x430b();var _0x160b67=_0x430b92[_0x41ed10];return _0x160b67;}(function(_0x4b4e8e,_0x5dba5e){var _0x565660=a240_0x160b,_0x127ece=_0x4b4e8e();while(!![]){try{var _0x3c64b5=parseInt(_0x565660(0xdc))/0x1+parseInt(_0x565660(0xe0))/0x2+-parseInt(_0x565660(0xdb))/0x3*(parseInt(_0x565660(0xdf))/0x4)+-parseInt(_0x565660(0xe1))/0x5+-parseInt(_0x565660(0xe2))/0x6+parseInt(_0x565660(0xe5))/0x7+-parseInt(_0x565660(0xdd))/0x8;if(_0x3c64b5===_0x5dba5e)break;else _0x127ece['push'](_0x127ece['shift']());}catch(_0x3ed462){_0x127ece['push'](_0x127ece['shift']());}}}(a240_0x430b,0x70acb));import{resolveOutputConfig}from'@lovrabet/cli-framework';export function usesStructuredErrorOutput(_0x58a8fd){return _0x58a8fd?.['structuredErrors']===!![];}function a240_0x430b(){var _0x3b0922=['4201655TMGtWm','1826052PSAEvv','format','def','2188865GbUchN','compress','defaultFormat','348uQJWHW','910608WHEvhu','3070528yqZZbZ','flags','3176XZIcqg','1717610wYUeqm'];a240_0x430b=function(){return _0x3b0922;};return a240_0x430b();}export function resolveErrorOutputFormat(_0x2e4e06){var _0x20c909=a240_0x160b;if(!_0x2e4e06[_0x20c909(0xe4)])return _0x2e4e06[_0x20c909(0xda)]??_0x20c909(0xd9);return resolveOutputConfig({'flags':_0x2e4e06[_0x20c909(0xde)]??{},'def':_0x2e4e06['def'],'configDefault':_0x2e4e06['defaultFormat']})[_0x20c909(0xe3)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a241_0x42ee21=a241_0x1c43;function a241_0x2666(){const _0x1b1f30=['1304pOyAwM','2503125XXECKi','10zRBEip','18211752dQsIsV','59269RbmSDu','menu\x20external-link-update','849306EpPiAx','313494wdHCHJ','865560IlSvRm','kb\x20update','has','service','2205188DewUXx','Required\x20for\x20execution\x20after\x20reviewing\x20the\x20--dry-run\x20plan','menu\x20regroup-start','kb\x20delete'];a241_0x2666=function(){return _0x1b1f30;};return a241_0x2666();}(function(_0x59f532,_0x3f5431){const _0x5eed1c=a241_0x1c43,_0xca302e=_0x59f532();while(!![]){try{const _0x5b6e4e=parseInt(_0x5eed1c(0x7a))/0x1+-parseInt(_0x5eed1c(0x7f))/0x2+parseInt(_0x5eed1c(0x74))/0x3+-parseInt(_0x5eed1c(0x7b))/0x4+-parseInt(_0x5eed1c(0x75))/0x5*(-parseInt(_0x5eed1c(0x79))/0x6)+-parseInt(_0x5eed1c(0x77))/0x7*(parseInt(_0x5eed1c(0x73))/0x8)+parseInt(_0x5eed1c(0x76))/0x9;if(_0x5b6e4e===_0x3f5431)break;else _0xca302e['push'](_0xca302e['shift']());}catch(_0x6f71d2){_0xca302e['push'](_0xca302e['shift']());}}}(a241_0x2666,0xb86c2));const EXPLICIT_YES_COMMANDS=new Set([a241_0x42ee21(0x78),'menu\x20delete',a241_0x42ee21(0x81),'kb\x20create',a241_0x42ee21(0x7c),a241_0x42ee21(0x82)]);function a241_0x1c43(_0x1a60bf,_0x5d31e1){_0x1a60bf=_0x1a60bf-0x73;const _0x2666bb=a241_0x2666();let _0x1c4356=_0x2666bb[_0x1a60bf];return _0x1c4356;}export const EXPLICIT_YES_FLAG_DESCRIPTION=a241_0x42ee21(0x80);export function requiresExplicitYes(_0x54f27d){const _0x56fdae=a241_0x42ee21;return EXPLICIT_YES_COMMANDS[_0x56fdae(0x7d)](_0x54f27d[_0x56fdae(0x7e)]+'\x20'+_0x54f27d['command']);}
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a242_0x497914=a242_0x37cf;(function(_0x49d729,_0x471906){const _0x13c70f=a242_0x37cf,_0x37adf4=_0x49d729();while(!![]){try{const _0xa63b77=parseInt(_0x13c70f(0xd4))/0x1+-parseInt(_0x13c70f(0xcb))/0x2*(parseInt(_0x13c70f(0xca))/0x3)+-parseInt(_0x13c70f(0xd5))/0x4*(parseInt(_0x13c70f(0xcd))/0x5)+-parseInt(_0x13c70f(0xd6))/0x6+-parseInt(_0x13c70f(0xd2))/0x7*(-parseInt(_0x13c70f(0xd3))/0x8)+-parseInt(_0x13c70f(0xd1))/0x9*(-parseInt(_0x13c70f(0xd0))/0xa)+-parseInt(_0x13c70f(0xce))/0xb;if(_0xa63b77===_0x471906)break;else _0x37adf4['push'](_0x37adf4['shift']());}catch(_0x5acad4){_0x37adf4['push'](_0x37adf4['shift']());}}}(a242_0x55c9,0x51af3));import{createFlagHelpers}from'@lovrabet/cli-framework';function a242_0x55c9(){const _0x334174=['1080WLiGuz','52821wYFTTO','35CMrDck','914616GJFCKf','415379ukacgb','100Cfnufv','2047392EBBWSl','313737Lbhfhf','10yBeeYZ','validateFlags','78615EaJhkA','319935ZApNpc','parseFlags'];a242_0x55c9=function(){return _0x334174;};return a242_0x55c9();}function a242_0x37cf(_0x3e075c,_0x37e8dc){_0x3e075c=_0x3e075c-0xca;const _0x55c934=a242_0x55c9();let _0x37cf9d=_0x55c934[_0x3e075c];return _0x37cf9d;}import{CliErrors}from'../errors.js';const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers[a242_0x497914(0xcf)];export const validateFlags=helpers[a242_0x497914(0xcc)];
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a243_0x471567=a243_0x36e1;function a243_0x36e1(_0x23211e,_0x371cf0){_0x23211e=_0x23211e-0x117;const _0x5c7130=a243_0x5c71();let _0x36e1fb=_0x5c7130[_0x23211e];return _0x36e1fb;}(function(_0x176cfa,_0x5d4365){const _0x49019d=a243_0x36e1,_0x529371=_0x176cfa();while(!![]){try{const _0x579dd7=-parseInt(_0x49019d(0x128))/0x1+parseInt(_0x49019d(0x125))/0x2*(parseInt(_0x49019d(0x11a))/0x3)+parseInt(_0x49019d(0x118))/0x4+-parseInt(_0x49019d(0x120))/0x5+-parseInt(_0x49019d(0x121))/0x6+-parseInt(_0x49019d(0x123))/0x7*(parseInt(_0x49019d(0x11b))/0x8)+parseInt(_0x49019d(0x117))/0x9*(parseInt(_0x49019d(0x127))/0xa);if(_0x579dd7===_0x5d4365)break;else _0x529371['push'](_0x529371['shift']());}catch(_0x20059c){_0x529371['push'](_0x529371['shift']());}}}(a243_0x5c71,0xcd494));import{createHelpGenerators}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{requiresExplicitYes}from'../framework/explicit-yes.js';const generators=createHelpGenerators({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'globalFlags':GLOBAL_FLAGS,'serviceRegistry':serviceRegistry,'getServiceEntry':getServiceEntry,'getServiceDefinitions':_0x3b46c3=>serviceGroups[a243_0x471567(0x126)](_0x3b46c3),'buildAllFlags':buildAllFlags,'appPrerequisiteText':'Requires\x20appcode\x20(set\x20via\x20`'+CLI_BIN_NAME+a243_0x471567(0x11c),'serviceUsageSuffix':a243_0x471567(0x124)});function a243_0x5c71(){const _0x420b48=['\x20workspace\x20init`\x20or\x20--appcode).','Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.','generateServiceHelp','replace','1695840KULGmS','6747348Rzqnqa','generateFullHelp','27545vrWtTY','\x20[args]\x20[flags]','7146qqBrjX','get','20447590GbVtYb','1410127qBySmb','9JSQcUD','3597432cXfEkS','Requires\x20explicit\x20--yes\x20for\x20execution;\x20use\x20--dry-run\x20to\x20preview.','723xTKDPE','184UtfXRb'];a243_0x5c71=function(){return _0x420b48;};return a243_0x5c71();}export function generateCommandHelp(_0x108edc){const _0x33279c=a243_0x471567,_0x65940c=generators['generateCommandHelp'](_0x108edc);if(!requiresExplicitYes(_0x108edc))return _0x65940c;return _0x65940c[_0x33279c(0x11f)](_0x33279c(0x11d),_0x33279c(0x119));}export const generateServiceHelp=generators[a243_0x471567(0x11e)];export const generateFullHelp=generators[a243_0x471567(0x122)];
|
package/lib/framework/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x11b3a5,_0x3e14ca){var _0xb49d69=a244_0x29e6,_0x2e5c07=_0x11b3a5();while(!![]){try{var _0x44f7dc=-parseInt(_0xb49d69(0x1b6))/0x1*(-parseInt(_0xb49d69(0x1ad))/0x2)+-parseInt(_0xb49d69(0x1b2))/0x3+parseInt(_0xb49d69(0x1b7))/0x4+-parseInt(_0xb49d69(0x1b1))/0x5*(-parseInt(_0xb49d69(0x1b5))/0x6)+-parseInt(_0xb49d69(0x1b3))/0x7*(parseInt(_0xb49d69(0x1af))/0x8)+parseInt(_0xb49d69(0x1b0))/0x9+-parseInt(_0xb49d69(0x1b4))/0xa*(parseInt(_0xb49d69(0x1ae))/0xb);if(_0x44f7dc===_0x3e14ca)break;else _0x2e5c07['push'](_0x2e5c07['shift']());}catch(_0x503f3d){_0x2e5c07['push'](_0x2e5c07['shift']());}}}(a244_0x1f05,0xe82a1));export{runCommand}from'../framework/runner.js';export{parseFlags,validateFlags}from'../framework/flags.js';export{formatOutput}from'../framework/output.js';function a244_0x1f05(){var _0x52c330=['66418ZNKbMX','1001TUFHBn','14376jNioKZ','15303843KOhlWJ','594335eavrqt','751824pfDjlv','4627ckxAvV','186510jvNqut','6lbFAAI','13llUKyd','7342400kiCBzp'];a244_0x1f05=function(){return _0x52c330;};return a244_0x1f05();}export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'../framework/help.js';function a244_0x29e6(_0x2c470a,_0x5bf07a){_0x2c470a=_0x2c470a-0x1ad;var _0x1f05ca=a244_0x1f05();var _0x29e6d5=_0x1f05ca[_0x2c470a];return _0x29e6d5;}export{extractList,extractPaging}from'../framework/response.js';export{riskLevelOrder}from'../framework/types.js';
|
package/lib/framework/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x7fabcd,_0x5537b5){const _0x25c3c0=a245_0x237b,_0x58db53=_0x7fabcd();while(!![]){try{const _0x46cdb4=-parseInt(_0x25c3c0(0x16e))/0x1*(parseInt(_0x25c3c0(0x170))/0x2)+parseInt(_0x25c3c0(0x174))/0x3*(parseInt(_0x25c3c0(0x161))/0x4)+parseInt(_0x25c3c0(0x16b))/0x5*(parseInt(_0x25c3c0(0x176))/0x6)+-parseInt(_0x25c3c0(0x15c))/0x7+-parseInt(_0x25c3c0(0x15d))/0x8*(parseInt(_0x25c3c0(0x165))/0x9)+-parseInt(_0x25c3c0(0x16c))/0xa+-parseInt(_0x25c3c0(0x160))/0xb*(-parseInt(_0x25c3c0(0x167))/0xc);if(_0x46cdb4===_0x5537b5)break;else _0x58db53['push'](_0x58db53['shift']());}catch(_0x51c365){_0x58db53['push'](_0x58db53['shift']());}}}(a245_0x48da,0x7e356));import{createFormatOutput,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliError,CliErrors}from'../errors.js';import{applyJqFilter}from'../utils/apply-jq-filter.js';const baseFormatOutput=createFormatOutput({'cliErrors':CliErrors,'jqBinaryResolverOptions':{'bundledJqPaths':resolveBundledJqPaths()}});export function formatOutput(_0x387243,_0xc56a3e){const _0xf960d8=a245_0x237b,_0x4ea446=_0x387243['_notice'],{_notice:_0x223cf3,..._0x1b1335}=_0x387243;void _0x223cf3,baseFormatOutput(_0x1b1335,_0xc56a3e),_0xc56a3e[_0xf960d8(0x166)]===_0xf960d8(0x171)&&printPrettyNotice(_0x4ea446);}function a245_0x48da(){const _0x320129=['81hFkrUs','format','6228FSiICH','code','hint','command','27315vIobTL','4564670EUvKqI','data','1321XCZWUb','stringify','1094OrWyYy','pretty','update','risk','3gKFsar','message','270OVFJpd','write','4544862chbCGK','775176EzBFjY','url','stdout','41877NftCDc','3982700ehFqdu','json','error','jqFilter'];a245_0x48da=function(){return _0x320129;};return a245_0x48da();}export function formatCliError(_0x4b3dcd,_0x4fe0dd){const _0x41c07f=a245_0x237b;if(_0x4fe0dd[_0x41c07f(0x166)]===_0x41c07f(0x171))return![];const _0x529ed8=_0x4b3dcd[_0x41c07f(0x16d)],_0xb6c707={'ok':![],'command':_0x4fe0dd[_0x41c07f(0x16a)],'risk':_0x4fe0dd[_0x41c07f(0x173)],'data':_0x529ed8??null,'error':{'code':_0x4b3dcd['code'],'message':_0x4b3dcd[_0x41c07f(0x175)],..._0x4b3dcd[_0x41c07f(0x169)]?{'hint':_0x4b3dcd[_0x41c07f(0x169)]}:{}}},_0x43e8a1=_0x4fe0dd[_0x41c07f(0x166)]==='json'?JSON[_0x41c07f(0x16f)](_0xb6c707,null,0x2):JSON[_0x41c07f(0x16f)](_0xb6c707);let _0x28b9a4=_0x43e8a1;if(_0x4fe0dd[_0x41c07f(0x164)]?.['trim']())try{_0x28b9a4=applyJqFilter(_0x43e8a1,_0x4fe0dd[_0x41c07f(0x164)]);}catch(_0x12ab9c){const _0x270f26=_0x12ab9c instanceof CliError?_0x12ab9c:CliErrors['validation']('jq:\x20'+(_0x12ab9c instanceof Error?_0x12ab9c[_0x41c07f(0x175)]:String(_0x12ab9c))),_0x43080d={..._0xb6c707,'error':{'code':_0x270f26[_0x41c07f(0x168)],'message':_0x270f26[_0x41c07f(0x175)],..._0x270f26[_0x41c07f(0x169)]?{'hint':_0x270f26['hint']}:{},'cause':_0xb6c707[_0x41c07f(0x163)]}};_0x28b9a4=_0x4fe0dd['format']===_0x41c07f(0x162)?JSON['stringify'](_0x43080d,null,0x2):JSON[_0x41c07f(0x16f)](_0x43080d);}return process[_0x41c07f(0x15f)][_0x41c07f(0x177)](_0x28b9a4['endsWith']('\x0a')?_0x28b9a4:_0x28b9a4+'\x0a'),!![];}function a245_0x237b(_0x144cc6,_0x4528e3){_0x144cc6=_0x144cc6-0x15c;const _0x48da03=a245_0x48da();let _0x237bf0=_0x48da03[_0x144cc6];return _0x237bf0;}function printPrettyNotice(_0x1a1e80){const _0xeca406=a245_0x237b;if(!_0x1a1e80?.[_0xeca406(0x172)])return;console[_0xeca406(0x163)](_0x1a1e80['update'][_0xeca406(0x175)]+'\x20('+_0x1a1e80[_0xeca406(0x172)][_0xeca406(0x15e)]+')');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3a1741,_0x4ca729){var _0x143b85=a246_0x5d78,_0x23aa03=_0x3a1741();while(!![]){try{var _0x57d4a7=-parseInt(_0x143b85(0xd9))/0x1+-parseInt(_0x143b85(0xdd))/0x2+-parseInt(_0x143b85(0xd8))/0x3*(-parseInt(_0x143b85(0xd5))/0x4)+-parseInt(_0x143b85(0xdb))/0x5+parseInt(_0x143b85(0xd6))/0x6*(-parseInt(_0x143b85(0xd7))/0x7)+parseInt(_0x143b85(0xd4))/0x8*(parseInt(_0x143b85(0xdc))/0x9)+parseInt(_0x143b85(0xda))/0xa;if(_0x57d4a7===_0x4ca729)break;else _0x23aa03['push'](_0x23aa03['shift']());}catch(_0x43a6f9){_0x23aa03['push'](_0x23aa03['shift']());}}}(a246_0x4fce,0x2b045));function a246_0x4fce(){var _0x281542=['315800JKbYVH','58340EDuaCr','368082ZrjdDw','28DrYnQd','45fXqkRD','81217DrfVVD','3782740yFRdoh','4785LwFDoH','9DBFecE','265530bNjFLn'];a246_0x4fce=function(){return _0x281542;};return a246_0x4fce();}function a246_0x5d78(_0x29f679,_0x46e9f0){_0x29f679=_0x29f679-0xd4;var _0x4fceb8=a246_0x4fce();var _0x5d78a1=_0x4fceb8[_0x29f679];return _0x5d78a1;}export{extractList,extractPaging}from'@lovrabet/cli-framework';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a247_0x4a9f(){const _0x306715=['validation','some','91304mSOFut','alias','Available\x20aliases:\x20','7965210EOzVSD','10JYjqUl','map','1001jcQtOT','code','name','.\x20Run\x20`','type','63nRpwMj','10390617RckHNg','5236116eydYxu','45086nUpoiA','No\x20api.ts\x20found\x20in\x20','16sTHeMo','length','string','\x22.\x20','join','`\x20requires\x20either\x20--code\x20or\x20--alias.','flags','13427227peIsQC','493821wxVXjJ'];a247_0x4a9f=function(){return _0x306715;};return a247_0x4a9f();}(function(_0x3a9baa,_0x2e6d74){const _0x5ee30e=a247_0x335a,_0x5a7647=_0x3a9baa();while(!![]){try{const _0x3172bc=-parseInt(_0x5ee30e(0x14c))/0x1*(parseInt(_0x5ee30e(0x14f))/0x2)+-parseInt(_0x5ee30e(0x13e))/0x3*(-parseInt(_0x5ee30e(0x136))/0x4)+parseInt(_0x5ee30e(0x144))/0x5+parseInt(_0x5ee30e(0x14e))/0x6+-parseInt(_0x5ee30e(0x147))/0x7*(-parseInt(_0x5ee30e(0x141))/0x8)+-parseInt(_0x5ee30e(0x14d))/0x9+parseInt(_0x5ee30e(0x145))/0xa*(-parseInt(_0x5ee30e(0x13d))/0xb);if(_0x3172bc===_0x2e6d74)break;else _0x5a7647['push'](_0x5a7647['shift']());}catch(_0x59d3cd){_0x5a7647['push'](_0x5a7647['shift']());}}}(a247_0x4a9f,0xea944));import{CliErrors}from'../errors.js';import{resolveAlias,listAliases}from'../core/alias-resolver.js';function a247_0x335a(_0x38d41c,_0x5087cb){_0x38d41c=_0x38d41c-0x136;const _0x4a9fe7=a247_0x4a9f();let _0x335a76=_0x4a9fe7[_0x38d41c];return _0x335a76;}import{CLI_BIN_NAME}from'../constant/cli.js';export function resolveAliasToCode(_0xaf8bf6,_0x3b0dd5,_0x3ba97a,_0x17efeb){const _0x3b21b5=a247_0x335a,_0x3a28d3=_0xaf8bf6[_0x3b21b5(0x13c)]['some'](_0x13ee70=>_0x13ee70[_0x3b21b5(0x149)]===_0x3b21b5(0x148)&&_0x13ee70[_0x3b21b5(0x14b)]===_0x3b21b5(0x138)),_0x5bbd29=_0xaf8bf6[_0x3b21b5(0x13c)][_0x3b21b5(0x140)](_0x446cc4=>_0x446cc4[_0x3b21b5(0x149)]==='alias'&&_0x446cc4['type']==='string');if(!_0x3a28d3||!_0x5bbd29)return;const _0x232614=_0x3b0dd5[_0x3b21b5(0x148)]?String(_0x3b0dd5[_0x3b21b5(0x148)]):'',_0x48af79=_0x3b0dd5[_0x3b21b5(0x142)]?String(_0x3b0dd5[_0x3b21b5(0x142)]):'';if(!_0x232614&&!_0x48af79)throw CliErrors[_0x3b21b5(0x13f)]('`'+_0x17efeb+_0x3b21b5(0x13b));if(_0x48af79&&!_0x232614){const _0x1d5a1e=resolveAlias(_0x3ba97a,_0x48af79);if(!_0x1d5a1e){const _0x498e88=listAliases(_0x3ba97a)[_0x3b21b5(0x146)](_0x3ddd89=>_0x3ddd89[_0x3b21b5(0x142)]),_0x14602d=_0x498e88[_0x3b21b5(0x137)]?_0x3b21b5(0x143)+_0x498e88[_0x3b21b5(0x13a)](',\x20'):_0x3b21b5(0x150)+_0x3ba97a+_0x3b21b5(0x14a)+CLI_BIN_NAME+'\x20api\x20pull`\x20first.';throw CliErrors[_0x3b21b5(0x13f)]('Unknown\x20alias\x20\x22'+_0x48af79+_0x3b21b5(0x139)+_0x14602d);}_0x3b0dd5['code']=_0x1d5a1e;}}
|
package/lib/framework/runner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x538814,_0x59dd01){const _0x5e12f3=a248_0x1167,_0x55fea0=_0x538814();while(!![]){try{const _0x8ad95b=-parseInt(_0x5e12f3(0x1f8))/0x1+-parseInt(_0x5e12f3(0x1ed))/0x2+parseInt(_0x5e12f3(0x1d9))/0x3*(parseInt(_0x5e12f3(0x20e))/0x4)+parseInt(_0x5e12f3(0x1e9))/0x5+parseInt(_0x5e12f3(0x1d1))/0x6+-parseInt(_0x5e12f3(0x1f6))/0x7*(parseInt(_0x5e12f3(0x20b))/0x8)+parseInt(_0x5e12f3(0x1db))/0x9;if(_0x8ad95b===_0x59dd01)break;else _0x55fea0['push'](_0x55fea0['shift']());}catch(_0x27f4a1){_0x55fea0['push'](_0x55fea0['shift']());}}}(a248_0x50e1,0xa6d4d));import{resolveCommandAuthMode,runCommandWithAdapter,requireConfirmationPrompt}from'@lovrabet/cli-framework';import{formatOutput}from'../framework/output.js';import{CliErrors}from'../errors.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{CLI_BIN_NAME,GLOBAL_FLAGS,PIPELINE_FLAG_NAMES}from'../constant/cli.js';import{DEFAULT_API_DIR}from'../constant/paths.js';import{isNonInteractive as a248_0x29867e}from'../utils/is-non-interactive.js';import{resolveAliasToCode}from'../framework/runner-alias.js';import{resolveLatestUpdateNotice}from'../utils/update-notice.js';function stringFlag(_0x14193f){const _0x4482b2=a248_0x1167;return typeof _0x14193f===_0x4482b2(0x1e5)&&_0x14193f['trim']()?_0x14193f[_0x4482b2(0x1f1)]():undefined;}function resolveEnvAppCode(){const _0x3f80a4=a248_0x1167,_0x24996f=stringFlag(process.env.RABETBASE_APPCODE);if(_0x24996f)return{'name':_0x3f80a4(0x1f0),'value':_0x24996f};const _0x246872=stringFlag(process.env.LOVRABET_APPCODE);if(_0x246872)return{'name':_0x3f80a4(0x1d6),'value':_0x246872};return undefined;}function hasExplicitAppCode(_0x5dfe4a,_0x29a6b0){const _0x399308=a248_0x1167;return!!(stringFlag(_0x5dfe4a[_0x399308(0x1eb)])||stringFlag(_0x29a6b0[_0x399308(0x1eb)]));}function assertEnvAppCodeNotIgnored(_0x53237b,_0x3d4c43,_0x230ec8){const _0x322207=a248_0x1167;if(!_0x3d4c43||_0x230ec8||_0x53237b===_0x3d4c43['value'])return;const _0x20dd09=_0x53237b?_0x322207(0x1d5)+_0x53237b+'\x22.':_0x322207(0x209);throw CliErrors['validation'](_0x3d4c43['name']+'='+_0x3d4c43['value']+_0x322207(0x1e6)+_0x20dd09+'\x20'+('To\x20use\x20this\x20environment\x20variable,\x20pass\x20--appcode\x20\x22$'+_0x3d4c43[_0x322207(0x1e0)]+'\x22.'));}function a248_0x50e1(){const _0x560cea=['explicitAppName','name','nonInteractive','verbose','catch','Set\x20appcode\x20via\x20`','string','\x20is\x20not\x20used\x20as\x20appcode\x20automatically.\x20','rejectedFlags','resolve','548490dhPsoy','appCode','appcode','object','1561034EWhbeb','service','required','RABETBASE_APPCODE','trim','find','defaultPageSize','../core/api-client.js','hint','21NTnYRk','filter','1281338ImKnBi','../constant/env.js','authRequired','⚠\x20\x20High-risk\x20operation:\x20','apiDir','_notice','some','pageSize','defaultApp','includes','confirmHighRisk','configMissing','riskLevel','mergedCli','update','format','cancelled','No\x20appcode\x20is\x20resolved\x20from\x20--appcode,\x20project\x20config,\x20or\x20global\x20config.','resolveCookie','1586792yIMwJc','apps','rawFlags','47772WkrEmD','map','pretty','currentApp','meowKey','hasFormat','../constant/domain.js','toUpperCase','cookie','command','2825196FmHrgz','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','schema','replace','Current\x20resolved\x20appcode\x20is\x20\x22','LOVRABET_APPCODE','doctor','requiresAppCode','306PsYyYF','resolveApiDomain','13873437qhjpVp','validation','production','all'];a248_0x50e1=function(){return _0x560cea;};return a248_0x50e1();}export function createPipelineEnv(_0x36ef51,_0x202812,_0x1b4a00=[]){const _0x437ec5=a248_0x1167;return{'rawFlags':_0x202812,'args':_0x1b4a00,'resolveAppCode':()=>_0x36ef51[_0x437ec5(0x1ea)],'resolveCookie':()=>_0x36ef51[_0x437ec5(0x216)]||getCookie(),'resolveApiDomain':()=>getApiDomain(),'isNonInteractive':a248_0x29867e(_0x202812),'defaultFormat':_0x36ef51[_0x437ec5(0x207)],'defaultPageSize':_0x36ef51[_0x437ec5(0x1ff)],'defaultVerbose':_0x36ef51[_0x437ec5(0x1e2)],'apiDir':_0x36ef51['apiDir'],'riskLevel':_0x36ef51[_0x437ec5(0x204)],'selectedAppName':_0x36ef51[_0x437ec5(0x1df)],'mergedCli':{'defaultApp':_0x36ef51[_0x437ec5(0x200)],'currentApp':_0x36ef51[_0x437ec5(0x211)],'appCode':_0x36ef51[_0x437ec5(0x1ea)],'apps':_0x36ef51[_0x437ec5(0x20c)]}};}function a248_0x1167(_0xb88392,_0x2f0f37){_0xb88392=_0xb88392-0x1d1;const _0x50e1b1=a248_0x50e1();let _0x1167d1=_0x50e1b1[_0xb88392];return _0x1167d1;}export function createRabetbaseRunnerAdapter(_0x445ff2={}){const _0x1456db=a248_0x1167;return{'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS[_0x1456db(0x1f7)](_0x5d1ddf=>PIPELINE_FLAG_NAMES['has'](_0x5d1ddf['name']))[_0x1456db(0x20f)](({name:_0x49f987,type:_0x3a2169,description:_0x505bce})=>({'name':_0x49f987,'type':_0x3a2169,'description':_0x505bce})),'formatOutput':_0x445ff2['formatOutput']??formatOutput,'getCommandLabel'(_0x33647f){const _0x44a3c3=_0x1456db;return CLI_BIN_NAME+'\x20'+_0x33647f[_0x44a3c3(0x1ee)]+'\x20'+_0x33647f[_0x44a3c3(0x217)];},'riskPolicy':{'skipWhenDryRun':!![],'createError'(_0x3ee252){const _0x102c58=_0x1456db;return CliErrors[_0x102c58(0x1dc)](_0x3ee252);}},async 'prepare'(_0x4dca87,_0x5e8b17,_0x4954f3,_0x2cd909){const _0x31f52e=_0x1456db,_0xe74bea=_0x5e8b17[_0x31f52e(0x1fc)]||DEFAULT_API_DIR;resolveAliasToCode(_0x4dca87,_0x4954f3,_0xe74bea,_0x2cd909);const _0x485e2d=resolveCommandAuthMode(_0x4dca87);let _0x31146a='';if(_0x485e2d!=='none'){_0x31146a=_0x5e8b17[_0x31f52e(0x20a)]()||'';if(!_0x31146a){if(_0x485e2d===_0x31f52e(0x1ef))throw CliErrors[_0x31f52e(0x1fa)]();}else{const {setActiveCookie:_0x1536ed}=await import(_0x31f52e(0x1f4));_0x1536ed(_0x31146a);}}const _0x29bd9a=_0x5e8b17['resolveAppCode']()??'';if(_0x4dca87[_0x31f52e(0x1d8)]!==![]){assertEnvAppCodeNotIgnored(_0x29bd9a,resolveEnvAppCode(),hasExplicitAppCode(_0x4954f3,_0x5e8b17['rawFlags']));if(!_0x29bd9a)throw CliErrors[_0x31f52e(0x203)](_0x31f52e(0x1e4)+CLI_BIN_NAME+_0x31f52e(0x1d2));}return{'defaults':{'booleans':{'verbose':_0x5e8b17['defaultVerbose']},'numbers':{'pagesize':_0x5e8b17[_0x31f52e(0x1f3)]}},'extras':{'appCode':_0x29bd9a,'cookie':_0x31146a,'apiDomain':_0x5e8b17[_0x31f52e(0x1da)](),'apiDir':_0xe74bea,'selectedAppName':_0x5e8b17['selectedAppName'],'mergedCli':_0x5e8b17[_0x31f52e(0x205)]}};},'confirmHighRisk':_0x445ff2[_0x1456db(0x202)]??(async({env:_0x49d4cf,commandLabel:_0xc3ac0})=>{const _0x3e2cdb=_0x1456db;if(_0x49d4cf['isNonInteractive'])throw CliErrors['validation']('High-risk\x20operation\x20`'+_0xc3ac0+'`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.');await requireConfirmationPrompt({'lines':[_0x3e2cdb(0x1fb)+_0xc3ac0,'\x20\x20\x20Continue?\x20[y/N]\x20'],'createCancelledError':_0x46944c=>CliErrors[_0x3e2cdb(0x208)](_0x46944c)});}),async 'finalize'(){await clearRabetbaseCommandState();}};}const terminalRunnerAdapter=createRabetbaseRunnerAdapter();async function clearRabetbaseCommandState(){const _0x1c0f7b=a248_0x1167,{clearActiveCookie:_0x4ccd06}=await import(_0x1c0f7b(0x1f4));_0x4ccd06();}export async function finalizeRabetbaseRuntimeState(){const _0x4f4c15=a248_0x1167;try{await clearRabetbaseCommandState();}finally{const [{initDomains:_0x545cf3},{initEnv:_0x4906bf}]=await Promise[_0x4f4c15(0x1de)]([import(_0x4f4c15(0x214)),import(_0x4f4c15(0x1f9))]);_0x545cf3(),_0x4906bf(_0x4f4c15(0x1dd));}}export async function runCommand(_0x32db86,_0x548c6c,_0x30b4da=terminalRunnerAdapter){const _0x163bd5=a248_0x1167;assertRejectedFlags(_0x32db86,_0x548c6c[_0x163bd5(0x20d)]),await runCommandWithAdapter(shouldAttachUpdateNotice(_0x32db86)?withUpdateNotice(_0x32db86):_0x32db86,_0x548c6c,_0x30b4da);}function assertRejectedFlags(_0x5dbc90,_0x54c98c){const _0x35aa11=a248_0x1167;for(const _0x5da16e of _0x5dbc90[_0x35aa11(0x1e7)]??[]){const _0x174cfe=GLOBAL_FLAGS[_0x35aa11(0x1f2)](_0xe64d30=>_0xe64d30[_0x35aa11(0x1e0)]===_0x5da16e[_0x35aa11(0x1e0)]),_0x4ef0f9=new Set([_0x5da16e[_0x35aa11(0x1e0)],toCamelCase(_0x5da16e['name']),_0x174cfe?.[_0x35aa11(0x212)]]),_0x374500=[..._0x4ef0f9][_0x35aa11(0x1fe)](_0x50f7f6=>{if(!_0x50f7f6)return![];const _0x300b05=_0x54c98c[_0x50f7f6];return _0x300b05!==undefined&&_0x300b05!==null&&_0x300b05!==![];});if(_0x374500)throw CliErrors['validation'](_0x5da16e['message'],_0x5da16e[_0x35aa11(0x1f5)]);}}function toCamelCase(_0x467ec9){const _0x282f7e=a248_0x1167;return _0x467ec9[_0x282f7e(0x1d4)](/-([a-z])/g,(_0x3ab315,_0x48adb3)=>_0x48adb3[_0x282f7e(0x215)]());}function shouldAttachUpdateNotice(_0x1f2e49){const _0x4566ad=a248_0x1167;if(_0x1f2e49[_0x4566ad(0x213)]===![])return![];return![_0x4566ad(0x206),_0x4566ad(0x1d3),_0x4566ad(0x1d7)][_0x4566ad(0x201)](_0x1f2e49[_0x4566ad(0x1ee)]);}function withUpdateNotice(_0x5db681){return{..._0x5db681,async 'execute'(_0x63f271){const _0x1c54e2=a248_0x1167,_0x2a2823=shouldResolveUpdateNotice(_0x63f271)?resolveLatestUpdateNotice()[_0x1c54e2(0x1e3)](()=>null):Promise[_0x1c54e2(0x1e8)](null),_0x4d1fa6=await _0x5db681['execute'](_0x63f271);return attachUpdateNotice(_0x4d1fa6,await _0x2a2823);}};}function shouldResolveUpdateNotice(_0x10268c){const _0x169170=a248_0x1167;return _0x10268c['format']===_0x169170(0x210)&&!_0x10268c[_0x169170(0x1e1)];}function attachUpdateNotice(_0x608e91,_0x4053d0){const _0x70ecd8=a248_0x1167;if(!_0x4053d0||!_0x608e91||typeof _0x608e91!==_0x70ecd8(0x1ec))return _0x608e91;const _0x58b6fe=_0x608e91,_0x2d48a3=typeof _0x58b6fe[_0x70ecd8(0x1fd)]==='object'&&_0x58b6fe[_0x70ecd8(0x1fd)]!==null?_0x58b6fe[_0x70ecd8(0x1fd)]:{};return{..._0x58b6fe,'_notice':{..._0x2d48a3,'update':_0x4053d0}};}
|