@lovrabet/rabetbase-cli 2.4.1-beta.1 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/references/rabetbase-page-react-detail.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(_0x226b8a,_0x575ba2){const _0x57294b=a230_0xe357,_0x4674e9=_0x226b8a();while(!![]){try{const _0x216d91=parseInt(_0x57294b(0x1aa))/0x1*(-parseInt(_0x57294b(0x1a7))/0x2)+parseInt(_0x57294b(0x19b))/0x3*(parseInt(_0x57294b(0x189))/0x4)+-parseInt(_0x57294b(0x1c1))/0x5*(parseInt(_0x57294b(0x1b5))/0x6)+-parseInt(_0x57294b(0x193))/0x7*(parseInt(_0x57294b(0x199))/0x8)+-parseInt(_0x57294b(0x1b9))/0x9+-parseInt(_0x57294b(0x1a4))/0xa+-parseInt(_0x57294b(0x1bd))/0xb*(-parseInt(_0x57294b(0x1a9))/0xc);if(_0x216d91===_0x575ba2)break;else _0x4674e9['push'](_0x4674e9['shift']());}catch(_0x3fc3a4){_0x4674e9['push'](_0x4674e9['shift']());}}}(a230_0x515f,0xf0abf));function a230_0x515f(){const _0x5c8fac=['split','where','slice','152RjUwSe','matchAll','219qAePiy','covered','join','toUpperCase','sql','toLowerCase','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','JOIN_INDEX_NOT_USABLE','match','14858340rzAzDO','metadataAvailable','position','7068cQswSW','index','5077032LdRYgW','227ElQJhV','natural','unknown','unavailable','columns','map','containsUnresolvedInclude','sort','some','includes','reduce','162dEsWXW','unsupportedReason','replace','test','13098393ibNtVs','add','INNER','right','143fdPmKn','replaceAll','inner','indexes','300470VhWjmE','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','__sq__','endsWith','\x5c$&','min','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','warning','trim','table','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','unsupportedPredicate','max','filter','cross','exec','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','matchedPrefix','91196AKQLdw','from','alias','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','push','INDEX_METADATA_UNAVAILABLE','tableName','JOIN_INDEX_MISSING','length','has','299411AszImq','full','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.'];a230_0x515f=function(){return _0x5c8fac;};return a230_0x515f();}function a230_0xe357(_0x504e70,_0x45a50a){_0x504e70=_0x504e70-0x178;const _0x515fae=a230_0x515f();let _0xe35701=_0x515fae[_0x504e70];return _0xe35701;}import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x58b8b3,_0x58a921){const _0x18d6f2=a230_0xe357,_0x1b51f2=[],_0x4bff6c=normalizeSqlForStaticAnalysis(_0x58b8b3),_0x3198f8=(_0x4bff6c['error']?[]:extractJoinFacts(_0x4bff6c[_0x18d6f2(0x19f)]))[_0x18d6f2(0x1af)](_0x349ff2=>{const _0x4d89c9=_0x18d6f2;if(_0x349ff2[_0x4d89c9(0x182)]||_0x349ff2[_0x4d89c9(0x1ae)][_0x4d89c9(0x191)]===0x0)return _0x1b51f2[_0x4d89c9(0x18d)]({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'reason':_0x349ff2[_0x4d89c9(0x1b6)]??'Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.'}),{'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2['alias'],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'status':_0x4d89c9(0x1ad)};const _0x5bc181=resolveTableMetadata(_0x58a921,_0x349ff2[_0x4d89c9(0x17f)]),_0x98a7c8=(_0x5bc181?.['indexes']??[])['map'](_0x34fc54=>({'index':_0x34fc54,'matchedPrefix':findEqualityPrefix(_0x34fc54[_0x4d89c9(0x1ae)],_0x349ff2[_0x4d89c9(0x1ae)])}))[_0x4d89c9(0x184)](_0x2029e9=>_0x2029e9[_0x4d89c9(0x188)]['length']>0x0),_0x37b63f=_0x98a7c8[_0x4d89c9(0x1b4)]((_0x410e85,_0x3ff86a)=>!_0x410e85||_0x3ff86a['matchedPrefix'][_0x4d89c9(0x191)]>_0x410e85['matchedPrefix']['length']?_0x3ff86a:_0x410e85,_0x98a7c8[0x0]);if(_0x37b63f)return{'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'status':_0x4d89c9(0x19c),'matchedIndex':{..._0x37b63f[_0x4d89c9(0x1a8)],'matchedPrefix':_0x37b63f[_0x4d89c9(0x188)]}};const _0x50218c=_0x5bc181?.[_0x4d89c9(0x1c0)]['filter'](_0x3e34f1=>_0x3e34f1[_0x4d89c9(0x1ae)][_0x4d89c9(0x1b2)](_0x252365=>_0x349ff2['columns'][_0x4d89c9(0x1b2)](_0x481d70=>columnNamesMatch(_0x252365,_0x481d70))))??[];if(_0x50218c[_0x4d89c9(0x191)]>0x0)return _0x1b51f2[_0x4d89c9(0x18d)]({'code':_0x4d89c9(0x1a2),'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'reason':_0x4d89c9(0x17c)}),{'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2['alias'],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'status':_0x4d89c9(0x17d),'candidateIndexes':_0x50218c};if(_0x5bc181&&_0x5bc181[_0x4d89c9(0x1a5)]!==![]&&_0x5bc181[_0x4d89c9(0x1c0)][_0x4d89c9(0x191)]>0x0&&_0x349ff2[_0x4d89c9(0x1ae)][_0x4d89c9(0x191)]>0x0)return _0x1b51f2[_0x4d89c9(0x18d)]({'code':_0x4d89c9(0x190),'table':_0x349ff2['table'],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2['columns'],'reason':_0x4d89c9(0x1a1)}),{'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'status':'warning'};return _0x1b51f2[_0x4d89c9(0x18d)]({'code':_0x4d89c9(0x18e),'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'reason':_0x5bc181?_0x4d89c9(0x1c2):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'status':'unavailable'};});return{'checked':_0x3198f8[_0x18d6f2(0x191)]>0x0,'joins':_0x3198f8,'warnings':_0x1b51f2};}function extractJoinFacts(_0x4f316f){const _0x1eea6c=a230_0xe357,_0x514032=maskNestedQueries(stripSqlNoise(_0x4f316f)),_0x4ee043=maskQuotedIdentifiers(_0x514032),_0xe4bcb1=[],_0x1a4b9e=new Set(),_0x55800b=/\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 _0x3b4868 of _0x514032[_0x1eea6c(0x19a)](_0x55800b)){const _0x57bb82=_0x3b4868[_0x1eea6c(0x1a8)]??0x0,_0x3a38b4=_0x3b4868[0x0]['search'](/\bJOIN\b/i),_0x5472aa=_0x57bb82+Math[_0x1eea6c(0x183)](0x0,_0x3a38b4);if(!/^JOIN\b/i['test'](_0x4ee043['slice'](_0x5472aa)))continue;_0x1a4b9e[_0x1eea6c(0x1ba)](_0x5472aa);const _0x46da82=normalizeIdentifier(_0x3b4868[0x1]||_0x1eea6c(0x1bb)),_0x478d57=normalizeIdentifier(_0x3b4868[0x2]??''),_0x835d40=normalizeIdentifier(_0x3b4868[0x3]||_0x478d57[_0x1eea6c(0x196)]('.')['at'](-0x1)||_0x478d57),_0x21832a=[],_0x155e13=_0x478d57==='__sq__';let _0x5512a2=_0x46da82==='right'||_0x46da82===_0x1eea6c(0x194)||_0x155e13,_0x3ccbd7=_0x5512a2?_0x155e13?'Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.':_0x46da82['toUpperCase']()+_0x1eea6c(0x180):undefined;const _0x19c4e2=stripOuterParentheses(_0x3b4868[0x4]??''),_0x1ceda7=_0x19c4e2[_0x1eea6c(0x1b3)](MYBATIS_DYNAMIC_START_MARKER)||_0x19c4e2['includes'](MYBATIS_DYNAMIC_END_MARKER),_0x159b87=_0x19c4e2[_0x1eea6c(0x1b3)](MYBATIS_INCLUDE_MARKER);_0x1ceda7&&(_0x5512a2=!![],_0x3ccbd7??=_0x1eea6c(0x181));_0x159b87&&(_0x5512a2=!![],_0x3ccbd7??=_0x1eea6c(0x18c));const _0xfce330=_0x19c4e2[_0x1eea6c(0x1be)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x1eea6c(0x1be)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0xfce330,'OR')&&(_0x5512a2=!![],_0x3ccbd7??=_0x1eea6c(0x195));for(const _0x32a33e of splitTopLevelAnd(_0xfce330)){const _0x2b81a4=stripOuterParentheses(_0x32a33e);if(hasTopLevelKeyword(_0x2b81a4,'OR')){_0x5512a2=!![],_0x3ccbd7??=_0x1eea6c(0x195);continue;}const _0x475ceb=splitEquality(_0x2b81a4);if(!_0x475ceb){containsColumnReference(_0x32a33e,_0x835d40)&&(_0x5512a2=!![]);continue;}const _0x5ee2d9=parseDirectColumnReference(_0x475ceb[0x0],_0x835d40),_0x262ca2=parseDirectColumnReference(_0x475ceb[0x1],_0x835d40),_0x2808ad=containsColumnReference(_0x475ceb[0x0],_0x835d40),_0x3d0638=containsColumnReference(_0x475ceb[0x1],_0x835d40),_0x2bbfab=_0x5ee2d9&&!_0x3d0638?_0x5ee2d9:_0x262ca2&&!_0x2808ad?_0x262ca2:null;if(_0x2bbfab&&!_0x21832a[_0x1eea6c(0x1b3)](_0x2bbfab))_0x21832a[_0x1eea6c(0x18d)](_0x2bbfab);else!_0x2bbfab&&containsColumnReference(_0x32a33e,_0x835d40)&&(_0x5512a2=!![]);}_0xe4bcb1['push']({'table':_0x478d57,'alias':_0x835d40,'columns':_0x21832a,'unsupportedPredicate':_0x5512a2,'unsupportedReason':_0x3ccbd7,'containsUnresolvedInclude':_0x159b87,'position':_0x5472aa});}for(const _0x142523 of _0x4ee043[_0x1eea6c(0x19a)](/\bJOIN\b/gi)){const _0x1a9672=_0x142523[_0x1eea6c(0x1a8)]??0x0;if(_0x1a4b9e[_0x1eea6c(0x192)](_0x1a9672))continue;const _0x4fceea=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x1eea6c(0x186)](_0x514032['slice'](_0x1a9672+_0x142523[0x0][_0x1eea6c(0x191)])),_0x10bdfe=normalizeIdentifier(_0x4fceea?.[0x1]||_0x1eea6c(0x1ac)),_0x263b93=normalizeIdentifier(_0x4fceea?.[0x2]||''),_0x36bf8f=isSqlClauseKeyword(_0x263b93)?_0x10bdfe[_0x1eea6c(0x196)]('.')['at'](-0x1)||_0x10bdfe:_0x263b93||_0x10bdfe[_0x1eea6c(0x196)]('.')['at'](-0x1)||_0x10bdfe;_0xe4bcb1['push']({'table':_0x10bdfe,'alias':_0x36bf8f,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x1a9672});}const _0x4867a0=_0x4ee043['indexOf'](MYBATIS_INCLUDE_MARKER);return _0x4867a0>=0x0&&!_0xe4bcb1['some'](_0x4aa2ca=>_0x4aa2ca[_0x1eea6c(0x1b0)])&&_0xe4bcb1[_0x1eea6c(0x18d)]({'table':_0x1eea6c(0x1ac),'alias':_0x1eea6c(0x1ac),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1eea6c(0x187),'containsUnresolvedInclude':!![],'position':_0x4867a0}),_0xe4bcb1[_0x1eea6c(0x1b1)]((_0x4f4992,_0x2faf47)=>_0x4f4992[_0x1eea6c(0x1a6)]-_0x2faf47[_0x1eea6c(0x1a6)]);}function stripSqlNoise(_0x11a700){const _0x116af9=a230_0xe357,_0xfc3b4d=Array[_0x116af9(0x18a)](_0x11a700),_0x1cfb96=(_0x1d4cb8,_0x1e9923)=>{for(let _0x4af386=_0x1d4cb8;_0x4af386<_0x1e9923;_0x4af386+=0x1){_0xfc3b4d[_0x4af386]!=='\x0a'&&_0xfc3b4d[_0x4af386]!=='\x0d'&&(_0xfc3b4d[_0x4af386]='\x20');}};for(let _0x4be2ca=0x0;_0x4be2ca<_0xfc3b4d[_0x116af9(0x191)];_0x4be2ca+=0x1){const _0x4e4841=_0xfc3b4d[_0x4be2ca],_0x204f6c=_0xfc3b4d[_0x4be2ca+0x1];if(_0x4e4841==='\x27'||_0x4e4841==='\x22'||_0x4e4841==='`'){const _0x1641ac=_0x4e4841,_0x72b674=_0x4be2ca;_0x4be2ca+=0x1;while(_0x4be2ca<_0xfc3b4d[_0x116af9(0x191)]){if(_0xfc3b4d[_0x4be2ca]==='\x5c'&&_0x4be2ca+0x1<_0xfc3b4d['length']){_0x4be2ca+=0x2;continue;}if(_0xfc3b4d[_0x4be2ca]!==_0x1641ac){_0x4be2ca+=0x1;continue;}if(_0xfc3b4d[_0x4be2ca+0x1]===_0x1641ac){_0x4be2ca+=0x2;continue;}break;}if(_0x1641ac==='\x27')_0x1cfb96(_0x72b674,Math[_0x116af9(0x17b)](_0x4be2ca+0x1,_0xfc3b4d[_0x116af9(0x191)]));continue;}if(_0x4e4841==='-'&&_0x204f6c==='-'){const _0x796a3b=_0x4be2ca;while(_0x4be2ca<_0xfc3b4d['length']&&_0xfc3b4d[_0x4be2ca]!=='\x0a')_0x4be2ca+=0x1;_0x1cfb96(_0x796a3b,_0x4be2ca);continue;}if(_0x4e4841==='/'&&_0x204f6c==='*'){const _0xa8dc12=_0x4be2ca;_0x4be2ca+=0x2;while(_0x4be2ca<_0xfc3b4d[_0x116af9(0x191)]&&!(_0xfc3b4d[_0x4be2ca]==='*'&&_0xfc3b4d[_0x4be2ca+0x1]==='/')){_0x4be2ca+=0x1;}_0x4be2ca=Math[_0x116af9(0x17b)](_0x4be2ca+0x1,_0xfc3b4d[_0x116af9(0x191)]-0x1),_0x1cfb96(_0xa8dc12,_0x4be2ca+0x1);continue;}if(_0x4e4841==='#'&&_0x204f6c!=='{'){const _0x16e731=_0x4be2ca;while(_0x4be2ca<_0xfc3b4d[_0x116af9(0x191)]&&_0xfc3b4d[_0x4be2ca]!=='\x0a')_0x4be2ca+=0x1;_0x1cfb96(_0x16e731,_0x4be2ca);continue;}if((_0x4e4841==='#'||_0x4e4841==='$')&&_0x204f6c==='{'){const _0xf8bac7=_0x4be2ca;_0x4be2ca+=0x2;while(_0x4be2ca<_0xfc3b4d[_0x116af9(0x191)]&&_0xfc3b4d[_0x4be2ca]!=='}')_0x4be2ca+=0x1;_0x1cfb96(_0xf8bac7,Math[_0x116af9(0x17b)](_0x4be2ca+0x1,_0xfc3b4d['length']));}}return _0xfc3b4d[_0x116af9(0x19d)]('');}function maskQuotedIdentifiers(_0x8a945c){const _0x2eb65a=a230_0xe357,_0x216470=Array[_0x2eb65a(0x18a)](_0x8a945c);for(let _0x3e546f=0x0;_0x3e546f<_0x216470[_0x2eb65a(0x191)];_0x3e546f+=0x1){const _0x28d31e=_0x216470[_0x3e546f];if(_0x28d31e!=='\x22'&&_0x28d31e!=='`')continue;_0x3e546f+=0x1;while(_0x3e546f<_0x216470[_0x2eb65a(0x191)]){if(_0x216470[_0x3e546f]===_0x28d31e){if(_0x216470[_0x3e546f+0x1]===_0x28d31e){_0x216470[_0x3e546f]='\x20',_0x216470[_0x3e546f+0x1]='\x20',_0x3e546f+=0x2;continue;}break;}_0x216470[_0x3e546f]='\x20',_0x3e546f+=0x1;}}return _0x216470[_0x2eb65a(0x19d)]('');}function maskNestedQueries(_0x4a0a37){const _0x3a64e2=a230_0xe357,_0x1f4dba=Array['from'](_0x4a0a37);for(let _0x1334ba=0x0;_0x1334ba<_0x1f4dba[_0x3a64e2(0x191)];_0x1334ba+=0x1){if(_0x1f4dba[_0x1334ba]!=='(')continue;const _0x219b24=_0x4a0a37[_0x3a64e2(0x198)](_0x1334ba+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x3a64e2(0x1b8)](_0x219b24))continue;let _0x35e321=0x1,_0x554708=_0x1334ba+0x1;for(;_0x554708<_0x1f4dba[_0x3a64e2(0x191)]&&_0x35e321>0x0;_0x554708+=0x1){if(_0x1f4dba[_0x554708]==='(')_0x35e321+=0x1;if(_0x1f4dba[_0x554708]===')')_0x35e321-=0x1;}if(_0x35e321!==0x0)continue;for(let _0x4f39a8=_0x1334ba;_0x4f39a8<_0x554708;_0x4f39a8+=0x1){_0x1f4dba[_0x4f39a8]='\x20';}const _0x17f8b5=_0x3a64e2(0x178);for(let _0x117803=0x0;_0x117803<_0x17f8b5[_0x3a64e2(0x191)]&&_0x1334ba+_0x117803<_0x554708;_0x117803+=0x1){_0x1f4dba[_0x1334ba+_0x117803]=_0x17f8b5[_0x117803];}_0x1334ba=_0x554708-0x1;}return _0x1f4dba[_0x3a64e2(0x19d)]('');}function splitTopLevelAnd(_0x2850bc){const _0x55191c=a230_0xe357,_0x454ac6=[];let _0x516b64=0x0,_0x539a6f=0x0;for(let _0x5ba9a5=0x0;_0x5ba9a5<_0x2850bc[_0x55191c(0x191)];_0x5ba9a5+=0x1){const _0x3ce731=_0x2850bc[_0x5ba9a5];if(_0x3ce731==='(')_0x516b64+=0x1;if(_0x3ce731===')')_0x516b64=Math[_0x55191c(0x183)](0x0,_0x516b64-0x1);_0x516b64===0x0&&_0x2850bc[_0x55191c(0x198)](_0x5ba9a5)[_0x55191c(0x1a3)](/^AND\b/i)&&(_0x5ba9a5===0x0||/\s/[_0x55191c(0x1b8)](_0x2850bc[_0x5ba9a5-0x1]??''))&&(_0x454ac6[_0x55191c(0x18d)](_0x2850bc[_0x55191c(0x198)](_0x539a6f,_0x5ba9a5)['trim']()),_0x5ba9a5+=0x2,_0x539a6f=_0x5ba9a5+0x1);}const _0xa0c69a=_0x2850bc[_0x55191c(0x198)](_0x539a6f)[_0x55191c(0x17e)]();if(_0xa0c69a)_0x454ac6['push'](_0xa0c69a);return _0x454ac6;}function hasTopLevelKeyword(_0x566a52,_0x5b339e){const _0x3778f8=a230_0xe357;let _0x2774d5=0x0;for(let _0x20a8f7=0x0;_0x20a8f7<_0x566a52[_0x3778f8(0x191)];_0x20a8f7+=0x1){const _0x52b114=_0x566a52[_0x20a8f7];if(_0x52b114==='(')_0x2774d5+=0x1;if(_0x52b114===')')_0x2774d5=Math[_0x3778f8(0x183)](0x0,_0x2774d5-0x1);if(_0x2774d5!==0x0)continue;const _0x4cb50c=_0x566a52[_0x3778f8(0x198)](_0x20a8f7,_0x20a8f7+_0x5b339e['length']),_0x55f3b3=_0x566a52[_0x20a8f7-0x1]??'\x20',_0x4193ff=_0x566a52[_0x20a8f7+_0x5b339e['length']]??'\x20';if(_0x4cb50c[_0x3778f8(0x19e)]()===_0x5b339e[_0x3778f8(0x19e)]()&&!/[\w$]/['test'](_0x55f3b3)&&!/[\w$]/['test'](_0x4193ff))return!![];}return![];}function splitEquality(_0x1a5197){const _0x22f4d4=a230_0xe357,_0x4226d9=stripOuterParentheses(_0x1a5197);let _0x1d641b=0x0,_0x17d889;for(let _0x354f37=0x0;_0x354f37<_0x4226d9[_0x22f4d4(0x191)];_0x354f37+=0x1){const _0x4641cc=_0x4226d9[_0x354f37];if(_0x4641cc==='(')_0x1d641b+=0x1;if(_0x4641cc===')')_0x1d641b=Math[_0x22f4d4(0x183)](0x0,_0x1d641b-0x1);const _0x2e5a88=_0x4226d9[_0x354f37-0x1]??'',_0x2cd8b5=_0x4226d9[_0x354f37+0x1]??'';if(_0x4641cc==='='&&_0x1d641b===0x0&&!/[!<>=:]/[_0x22f4d4(0x1b8)](_0x2e5a88)&&_0x2cd8b5!=='='){if(_0x17d889!==undefined)return null;_0x17d889=_0x354f37;}}return _0x17d889===undefined?null:[_0x4226d9['slice'](0x0,_0x17d889)[_0x22f4d4(0x17e)](),_0x4226d9['slice'](_0x17d889+0x1)[_0x22f4d4(0x17e)]()];}function parseDirectColumnReference(_0x2f402d,_0x2dd1e0){const _0x112391=a230_0xe357,_0x4fe1db=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x112391(0x186)](stripOuterParentheses(_0x2f402d));if(!_0x4fe1db)return null;if(normalizeIdentifier(_0x4fe1db[0x1]??'')!==normalizeIdentifier(_0x2dd1e0))return null;return normalizeIdentifier(_0x4fe1db[0x2]??'');}function containsColumnReference(_0x5c3691,_0x28faae){const _0x156cb5=a230_0xe357,_0x103d2c=_0x5c3691['replace'](/[`"]/g,''),_0x5a8829=_0x28faae[_0x156cb5(0x1b7)](/[.*+?^${}()|[\]\\]/g,_0x156cb5(0x17a));return new RegExp('(?:^|[^\x5cw$])'+_0x5a8829+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')['test'](_0x103d2c);}function findEqualityPrefix(_0x423db2,_0xfa019e){const _0x598a3a=a230_0xe357,_0xeaec40=new Set(_0xfa019e[_0x598a3a(0x1af)](normalizeIdentifier)),_0xd761d8=[];for(const _0x3c0644 of _0x423db2){if(!_0xeaec40[_0x598a3a(0x192)](normalizeIdentifier(_0x3c0644)))break;_0xd761d8[_0x598a3a(0x18d)](_0x3c0644);}return _0xd761d8;}function resolveTableMetadata(_0x5ee4df,_0xf2adc1){const _0x5ee82b=a230_0xe357,_0x286901=normalizeIdentifier(_0xf2adc1),_0x24810a=_0x5ee4df['filter'](_0x474814=>normalizeIdentifier(_0x474814[_0x5ee82b(0x18f)])===_0x286901);if(_0x24810a[_0x5ee82b(0x191)]===0x1)return _0x24810a[0x0];const _0xe621b5=_0x286901['includes']('.'),_0xa41b4=_0x286901[_0x5ee82b(0x196)]('.')['at'](-0x1),_0x3344c4=_0x5ee4df[_0x5ee82b(0x184)](_0x52c1b1=>{const _0x5e1aeb=_0x5ee82b,_0x34553f=normalizeIdentifier(_0x52c1b1[_0x5e1aeb(0x18f)]);if(_0xe621b5&&_0x34553f[_0x5e1aeb(0x1b3)]('.'))return![];return _0x34553f[_0x5e1aeb(0x196)]('.')['at'](-0x1)===_0xa41b4;});return _0x3344c4[_0x5ee82b(0x191)]===0x1?_0x3344c4[0x0]:undefined;}function columnNamesMatch(_0x6e575a,_0x99a4ac){return normalizeIdentifier(_0x6e575a)===normalizeIdentifier(_0x99a4ac);}function normalizeIdentifier(_0x1e96ee){const _0x5268f8=a230_0xe357;return _0x1e96ee[_0x5268f8(0x1b7)](/[`"]/g,'')[_0x5268f8(0x17e)]()[_0x5268f8(0x1a0)]();}function isSqlClauseKeyword(_0x21bddb){const _0x3faaa8=a230_0xe357;return new Set(['on','using',_0x3faaa8(0x197),_0x3faaa8(0x19d),_0x3faaa8(0x1bf),'left',_0x3faaa8(0x1bc),_0x3faaa8(0x194),_0x3faaa8(0x185),_0x3faaa8(0x1ab)])[_0x3faaa8(0x192)](_0x21bddb);}function stripOuterParentheses(_0x39d677){const _0x511b28=a230_0xe357;let _0x2402e6=_0x39d677[_0x511b28(0x17e)]();while(_0x2402e6['startsWith']('(')&&_0x2402e6[_0x511b28(0x179)](')')){let _0x4cb748=0x0,_0x52f6e8=!![];for(let _0x1eeb78=0x0;_0x1eeb78<_0x2402e6[_0x511b28(0x191)];_0x1eeb78+=0x1){if(_0x2402e6[_0x1eeb78]==='(')_0x4cb748+=0x1;if(_0x2402e6[_0x1eeb78]===')')_0x4cb748-=0x1;if(_0x4cb748===0x0&&_0x1eeb78<_0x2402e6[_0x511b28(0x191)]-0x1){_0x52f6e8=![];break;}}if(!_0x52f6e8||_0x4cb748!==0x0)break;_0x2402e6=_0x2402e6[_0x511b28(0x198)](0x1,-0x1)[_0x511b28(0x17e)]();}return _0x2402e6;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a231_0x56069b=a231_0x44df;function a231_0x44df(_0x4e7b9a,_0x7fa410){_0x4e7b9a=_0x4e7b9a-0x18b;const _0x148d0d=a231_0x148d();let _0x44df08=_0x148d0d[_0x4e7b9a];return _0x44df08;}(function(_0x5a5cf8,_0x1be455){const _0x181130=a231_0x44df,_0x2e6c2f=_0x5a5cf8();while(!![]){try{const _0x78ec64=-parseInt(_0x181130(0x18b))/0x1*(parseInt(_0x181130(0x18d))/0x2)+-parseInt(_0x181130(0x197))/0x3*(parseInt(_0x181130(0x191))/0x4)+-parseInt(_0x181130(0x198))/0x5+-parseInt(_0x181130(0x196))/0x6*(parseInt(_0x181130(0x18f))/0x7)+-parseInt(_0x181130(0x18e))/0x8+parseInt(_0x181130(0x192))/0x9+parseInt(_0x181130(0x194))/0xa;if(_0x78ec64===_0x1be455)break;else _0x2e6c2f['push'](_0x2e6c2f['shift']());}catch(_0x1c3bda){_0x2e6c2f['push'](_0x2e6c2f['shift']());}}}(a231_0x148d,0x3bd87));import{resolve}from'node:path';function a231_0x148d(){const _0x48c4e5=['/sql','12372630oCGGur','.rabetbase','24SAWXKL','1236945URsjmS','947105IHswnd','15YsAKXE','sql-trash','40466moZdwU','3228280eTtQZR','133259AeLsXG','sql.lock.json','4QYJEcr','3535002guxict'];a231_0x148d=function(){return _0x48c4e5;};return a231_0x148d();}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a231_0x56069b(0x195),LOCK_FILE_NAME=a231_0x56069b(0x190),TRASH_DIR_NAME=a231_0x56069b(0x18c);export function loadSqlProjectConfig(_0x880fa8,_0x4d4342){const _0x5363e9=a231_0x56069b,_0x198cf4=resolve(_0x4d4342??findProjectRootDirectory()),_0x227bc5=DOT_DIR+_0x5363e9(0x193),_0x5e3c6c=_0x227bc5+'/'+_0x880fa8;return{'projectRoot':_0x198cf4,'appCode':_0x880fa8,'sqlWorkspaceRoot':_0x227bc5,'sqlRoot':_0x5e3c6c,'sqlRootDir':resolve(_0x198cf4,DOT_DIR,'sql',_0x880fa8),'lockFilePath':resolve(_0x198cf4,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x198cf4,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5de514,_0x44ab6b){const _0x55b9dc=a232_0x1eb8,_0x509b8c=_0x5de514();while(!![]){try{const _0x40ff63=-parseInt(_0x55b9dc(0x12e))/0x1+parseInt(_0x55b9dc(0x122))/0x2+parseInt(_0x55b9dc(0x120))/0x3*(-parseInt(_0x55b9dc(0x11c))/0x4)+parseInt(_0x55b9dc(0x126))/0x5+parseInt(_0x55b9dc(0x123))/0x6*(-parseInt(_0x55b9dc(0x11e))/0x7)+parseInt(_0x55b9dc(0x131))/0x8+-parseInt(_0x55b9dc(0x130))/0x9*(-parseInt(_0x55b9dc(0x12c))/0xa);if(_0x40ff63===_0x44ab6b)break;else _0x509b8c['push'](_0x509b8c['shift']());}catch(_0x5a3c88){_0x509b8c['push'](_0x509b8c['shift']());}}}(a232_0x4d2f,0x866d5));function a232_0x4d2f(){const _0x316026=['sqlRootDir','916625jbMfSI','dbId','9814005nMDvtS','1033632WObnJV','length','mode','push','.sql','sqlName','path','.xml','name','4KaXWzi','sqlCode','21259IRbzlA','sql','1798803ZUNvVE','ENOENT','846248gbadCd','318ItUdwu','toLowerCase','dbName','2925135KjDGMU','isDirectory','replace','isFile','test','slice','10XkPPOd'];a232_0x4d2f=function(){return _0x316026;};return a232_0x4d2f();}import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x31d399){const _0x26bf3b=a232_0x1eb8;if(_0x31d399===_0x26bf3b(0x135))return _0x26bf3b(0x11f);if(_0x31d399===_0x26bf3b(0x11a))return'mybatisXml';return undefined;}async function scanSqlFilesRecursively(_0x6acb66,_0x5d6551){const _0xe383a0=a232_0x1eb8,_0x22c2e3=[];try{const _0x542e66=await readdir(_0x6acb66,{'withFileTypes':!![]});for(const _0x3a13f7 of _0x542e66){const _0x513618=join(_0x6acb66,_0x3a13f7[_0xe383a0(0x11b)]);if(_0x3a13f7['isDirectory']()){_0x22c2e3['push'](...await scanSqlFilesRecursively(_0x513618,_0x5d6551));continue;}if(!_0x3a13f7[_0xe383a0(0x129)]())continue;const _0x5a852f=extname(_0x3a13f7[_0xe383a0(0x11b)])[_0xe383a0(0x124)](),_0x4145ef=extensionToMode(_0x5a852f);if(!_0x4145ef)continue;const _0x225efc=relative(_0x5d6551,_0x513618)[_0xe383a0(0x128)](/\\/g,'/'),_0x10c12d=_0x225efc['split']('/')['filter'](Boolean),_0xfb4492=parseSqlPath(_0x10c12d,_0x3a13f7[_0xe383a0(0x11b)],_0x5a852f);if(!_0xfb4492)continue;_0x22c2e3[_0xe383a0(0x134)]({'sqlCode':_0xfb4492[_0xe383a0(0x11d)],'sqlName':_0xfb4492[_0xe383a0(0x118)],'dbDirectory':_0x10c12d[0x0],'filePath':_0x513618,'relativePath':_0x225efc,'lockKey':_0xfb4492[_0xe383a0(0x11d)],'mode':_0x4145ef});}}catch(_0x4d12fb){if(_0x4d12fb['code']!==_0xe383a0(0x121))throw _0x4d12fb;}return _0x22c2e3;}export async function scanLocalSqlQueries(_0x8ee281){const _0xaef9a7=a232_0x1eb8;return scanSqlFilesRecursively(_0x8ee281[_0xaef9a7(0x12d)],_0x8ee281[_0xaef9a7(0x12d)]);}export function resolveLocalSqlFilePath(_0x499769,_0x4df8fc,_0x4a5959){const _0xea9c65=a232_0x1eb8,_0x2fb316=_0x4a5959?.[_0xea9c65(0x119)]||(_0x4a5959?.[_0xea9c65(0x118)]||_0x4a5959?.[_0xea9c65(0x125)]?buildSqlRelativePath(_0x4df8fc,_0x4a5959?.[_0xea9c65(0x118)],_0x4a5959?.['dbName'],_0x4a5959?.[_0xea9c65(0x133)]||_0xea9c65(0x11f),_0x4a5959?.[_0xea9c65(0x12f)]):buildDefaultSqlFileName(_0x4df8fc,_0x4a5959?.[_0xea9c65(0x133)]||'sql'));return join(_0x499769['sqlRootDir'],_0x2fb316);}export async function directoryExists(_0x3b3c3f){const _0x38145e=a232_0x1eb8;try{const _0x21e633=await stat(_0x3b3c3f);return _0x21e633[_0x38145e(0x127)]();}catch{return![];}}function parseSqlPath(_0x2efc0b,_0x3b6531,_0x336ee6){const _0x2bf162=a232_0x1eb8,_0x4ebaef=_0x3b6531['slice'](0x0,-_0x336ee6[_0x2bf162(0x132)]);if(_0x2efc0b['length']<0x2)return null;const _0x3bb0ad=_0x4ebaef['indexOf']('_');if(_0x3bb0ad<=0x0||_0x3bb0ad>=_0x4ebaef[_0x2bf162(0x132)]-0x1)return null;const _0x535506=_0x4ebaef[_0x2bf162(0x12b)](0x0,_0x3bb0ad);if(!isLikelySqlCode(_0x535506))return null;return{'sqlCode':_0x535506,'sqlName':_0x4ebaef[_0x2bf162(0x12b)](_0x3bb0ad+0x1)};}function a232_0x1eb8(_0x2d19a8,_0x1e5fc5){_0x2d19a8=_0x2d19a8-0x118;const _0x4d2f6b=a232_0x4d2f();let _0x1eb82b=_0x4d2f6b[_0x2d19a8];return _0x1eb82b;}function isLikelySqlCode(_0x3b4fb0){const _0x156fa8=a232_0x1eb8;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x156fa8(0x12a)](_0x3b4fb0);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a233_0x4adc(_0x36e992,_0x20298a){_0x36e992=_0x36e992-0x1a0;const _0x3d5e36=a233_0x3d5e();let _0x4adcf7=_0x3d5e36[_0x36e992];return _0x4adcf7;}function a233_0x3d5e(){const _0x7c083e=['3434296adZDLa','2028861cFiGdi','805ImHtJF','19360vyDYUu','1386zqQsKs','update','createHash','31644YagRtx','hex','21715419JQFEtp','136704xZFszQ','20HVwjiu','51685MOKylk','312hveZdw','utf8','md5'];a233_0x3d5e=function(){return _0x7c083e;};return a233_0x3d5e();}(function(_0x36e602,_0x409a0b){const _0x192e71=a233_0x4adc,_0x54a140=_0x36e602();while(!![]){try{const _0x1a63fd=parseInt(_0x192e71(0x1a6))/0x1*(parseInt(_0x192e71(0x1a7))/0x2)+parseInt(_0x192e71(0x1ad))/0x3+parseInt(_0x192e71(0x1a9))/0x4*(parseInt(_0x192e71(0x1a8))/0x5)+-parseInt(_0x192e71(0x1a3))/0x6*(-parseInt(_0x192e71(0x1ae))/0x7)+-parseInt(_0x192e71(0x1ac))/0x8+parseInt(_0x192e71(0x1a0))/0x9*(-parseInt(_0x192e71(0x1af))/0xa)+-parseInt(_0x192e71(0x1a5))/0xb;if(_0x1a63fd===_0x409a0b)break;else _0x54a140['push'](_0x54a140['shift']());}catch(_0x2e0df8){_0x54a140['push'](_0x54a140['shift']());}}}(a233_0x3d5e,0xb8383));import{readFile}from'node:fs/promises';import a233_0x278411 from'node:crypto';export function computeSqlContentHash(_0x547d90){const _0x50d399=a233_0x4adc;return a233_0x278411[_0x50d399(0x1a2)](_0x50d399(0x1ab))[_0x50d399(0x1a1)](_0x547d90)['digest'](_0x50d399(0x1a4));}export async function computeSqlFileHash(_0x50873e){const _0x4d1ea2=a233_0x4adc,_0x3073f5=await readFile(_0x50873e,_0x4d1ea2(0x1aa));return computeSqlContentHash(_0x3073f5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a234_0x45d4(){const _0x22a193=['177415OUVVVp','2145609tIOjzK','ENOENT','1843370jJkpic','354734PgjoKT','42PcyAdS','17072puFPdt','sqls','parse','701242dfJscM','\x22.\x20','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','96TzSKrD','\x22\x20vs\x20lock\x20\x22','code','apps',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','971184qVgpQr','sqlRoot','lastSync','stringify'];a234_0x45d4=function(){return _0x22a193;};return a234_0x45d4();}(function(_0x1c7b72,_0x5e32ed){const _0x492019=a234_0x3283,_0x351f7f=_0x1c7b72();while(!![]){try{const _0x5271e5=-parseInt(_0x492019(0x1c9))/0x1+parseInt(_0x492019(0x1b9))/0x2+-parseInt(_0x492019(0x1bc))/0x3*(parseInt(_0x492019(0x1b6))/0x4)+parseInt(_0x492019(0x1c8))/0x5+-parseInt(_0x492019(0x1ca))/0x6*(-parseInt(_0x492019(0x1c5))/0x7)+parseInt(_0x492019(0x1c1))/0x8+-parseInt(_0x492019(0x1c6))/0x9;if(_0x5271e5===_0x5e32ed)break;else _0x351f7f['push'](_0x351f7f['shift']());}catch(_0x5625e5){_0x351f7f['push'](_0x351f7f['shift']());}}}(a234_0x45d4,0x4668d));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}function a234_0x3283(_0xfda32a,_0x52ec74){_0xfda32a=_0xfda32a-0x1b6;const _0x45d40d=a234_0x45d4();let _0x328311=_0x45d40d[_0xfda32a];return _0x328311;}export function ensureSqlLockScope(_0x5ddd3b,_0x630839,_0x3241b4,_0x1aac2b){const _0x34f247=a234_0x3283,_0x131e1e=_0x5ddd3b??createEmptySqlLock();let _0x44a578=_0x131e1e[_0x34f247(0x1bf)][_0x630839];if(!_0x44a578)return _0x44a578={'sqlRoot':_0x3241b4,'lastSync':'','sqls':{}},_0x131e1e[_0x34f247(0x1bf)][_0x630839]=_0x44a578,{'lockData':_0x131e1e,'appLock':_0x44a578};if(!_0x44a578[_0x34f247(0x1c2)])_0x44a578[_0x34f247(0x1c2)]=_0x3241b4;else{if(_0x44a578[_0x34f247(0x1c2)]!==_0x3241b4)throw new Error(_0x1aac2b+_0x34f247(0x1c0)+_0x3241b4+_0x34f247(0x1bd)+_0x44a578[_0x34f247(0x1c2)]+_0x34f247(0x1ba)+_0x34f247(0x1bb));}return!_0x44a578[_0x34f247(0x1b7)]&&(_0x44a578[_0x34f247(0x1b7)]={}),!_0x44a578[_0x34f247(0x1c3)]&&(_0x44a578['lastSync']=''),{'lockData':_0x131e1e,'appLock':_0x44a578};}export async function readSqlLockFile(_0x9990bd){const _0x4b7a47=a234_0x3283;try{const _0x492152=await readFile(_0x9990bd,'utf8');return JSON[_0x4b7a47(0x1b8)](_0x492152);}catch(_0x10f0b7){if(_0x10f0b7[_0x4b7a47(0x1be)]===_0x4b7a47(0x1c7))return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x10f0b7));}}export async function writeSqlLockFile(_0x295453,_0x2fbb7b){const _0x3f348c=a234_0x3283;await mkdir(dirname(_0x295453),{'recursive':!![]}),await writeFile(_0x295453,JSON[_0x3f348c(0x1c4)](_0x2fbb7b,null,0x2),'utf8');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3301bc,_0x4c5f0a){const _0x1b2b5e=a236_0x102e,_0x5b1e97=_0x3301bc();while(!![]){try{const _0x48bac5=-parseInt(_0x1b2b5e(0x115))/0x1*(parseInt(_0x1b2b5e(0x10d))/0x2)+parseInt(_0x1b2b5e(0x110))/0x3+parseInt(_0x1b2b5e(0x10e))/0x4+-parseInt(_0x1b2b5e(0x106))/0x5*(-parseInt(_0x1b2b5e(0x105))/0x6)+parseInt(_0x1b2b5e(0x10a))/0x7+-parseInt(_0x1b2b5e(0x113))/0x8*(parseInt(_0x1b2b5e(0x10c))/0x9)+-parseInt(_0x1b2b5e(0x10b))/0xa;if(_0x48bac5===_0x4c5f0a)break;else _0x5b1e97['push'](_0x5b1e97['shift']());}catch(_0x125910){_0x5b1e97['push'](_0x5b1e97['shift']());}}}(a236_0x1f4f,0xdfc7d));export function detectSqlMode(_0x4d1ffc){const _0x2e6dc1=a236_0x102e,_0x456268=_0x4d1ffc[_0x2e6dc1(0x114)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x456268))return _0x2e6dc1(0x112);return _0x2e6dc1(0x111);}function a236_0x1f4f(){const _0x58d1a8=['trimStart','61KnQVxP','unknown-db','43062MOAUid','35OLVKYA','trim','replace','unknown-sql','12502007VwztiQ','24184330GOlCHx','90aPvtJR','41598KLtlzr','6264388rOIxhN','.xml','4632060lxYXJW','sql','mybatisXml','274064qUHwJx'];a236_0x1f4f=function(){return _0x58d1a8;};return a236_0x1f4f();}export function getSqlFileExtension(_0x417319){const _0x453eca=a236_0x102e;return _0x417319===_0x453eca(0x112)?_0x453eca(0x10f):'.sql';}export function buildDefaultSqlFileName(_0x4ec5a9,_0x42edcd){return''+_0x4ec5a9+getSqlFileExtension(_0x42edcd);}export function sanitizeSqlPathSegment(_0x1db528,_0x8542a1){const _0x25cfc6=a236_0x102e,_0x598258=String(_0x1db528??'')[_0x25cfc6(0x107)](),_0x56c3da=_0x598258['replace'](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x25cfc6(0x108)](/\s+/g,'-')[_0x25cfc6(0x108)](/-+/g,'-')[_0x25cfc6(0x108)](/^\.+/,'')[_0x25cfc6(0x108)](/\.+$/,'')['replace'](/^-+/,'')[_0x25cfc6(0x108)](/-+$/,'');return _0x56c3da||_0x8542a1;}export function buildDbDirectoryName(_0x151c17,_0x145081){const _0x5ace33=a236_0x102e;return sanitizeSqlPathSegment(_0x151c17,_0x145081!=null?'db-'+_0x145081:_0x5ace33(0x116));}function a236_0x102e(_0x31b83f,_0x593a3c){_0x31b83f=_0x31b83f-0x105;const _0x1f4f89=a236_0x1f4f();let _0x102e48=_0x1f4f89[_0x31b83f];return _0x102e48;}export function buildSqlRelativePath(_0x873a11,_0x2aa916,_0x5e0dff,_0x5f443d,_0x4ccd22){const _0x59a25a=a236_0x102e,_0x2eaf44=buildDbDirectoryName(_0x5e0dff,_0x4ccd22),_0x342c81=sanitizeSqlPathSegment(_0x873a11,_0x59a25a(0x109)),_0x43069c=sanitizeSqlPathSegment(_0x2aa916,_0x342c81);return _0x2eaf44+'/'+_0x342c81+'_'+_0x43069c+getSqlFileExtension(_0x5f443d);}
|
|
@@ -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
|
+
function a237_0x3127(){const _0x30e087=['outer','tagName','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','length','property','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','join',''','include','startsWith','\x20query\x20targeting\x20','mybatisXml','choose','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','rawName','INSERT','\x20WHERE\x20','fromCodePoint','3794628gUzpsV','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','type','slice','statementType','match','13904865wjWvcL','<','WITH','add','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','^<\x5cs*(?:','toLowerCase','SELECT','9665NGQium','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','parseInt','replace','bind',')\x5cb','UNKNOWN','from','UPDATE','SQL\x20content\x20is\x20empty','__RABETBASE_MYBATIS_DYNAMIC_END__','set','includes','Unable\x20to\x20detect\x20SQL\x20type.\x20','matchAll','insert','Invalid\x20MyBatis\x20XML\x20tag.','Unterminated\x20MyBatis\x20XML\x20tag.','10284280LzCXxX','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','4818ABzWvn','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','test','indexOf','<!--','97454BuWKeg','push','foreach','"','error','exec','DELETE','2648436gxEBbX','DDL','when','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','split','otherwise','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','sql','unknown\x20table(s)','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','reason','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','Unterminated\x20XML\x20comment.','-->','trim','354504BXkMWW','get','pop','string','704BoSIfZ','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','\x20SET\x20','replaceAll','>','__RABETBASE_MYBATIS_DYNAMIC_START__','keys','8TLAUji','has','Unterminated\x20CDATA\x20section.','\x20with\x20parameters:\x20'];a237_0x3127=function(){return _0x30e087;};return a237_0x3127();}const a237_0x41c7e3=a237_0x320f;(function(_0x53a3db,_0x194e6e){const _0x385932=a237_0x320f,_0x4e7ab8=_0x53a3db();while(!![]){try{const _0x29b063=parseInt(_0x385932(0xde))/0x1*(-parseInt(_0x385932(0xea))/0x2)+parseInt(_0x385932(0xcf))/0x3+-parseInt(_0x385932(0x100))/0x4+-parseInt(_0x385932(0xae))/0x5*(-parseInt(_0x385932(0xc3))/0x6)+-parseInt(_0x385932(0xc8))/0x7*(-parseInt(_0x385932(0xe2))/0x8)+-parseInt(_0x385932(0xa6))/0x9+parseInt(_0x385932(0xc0))/0xa;if(_0x29b063===_0x194e6e)break;else _0x4e7ab8['push'](_0x4e7ab8['shift']());}catch(_0x53ad04){_0x4e7ab8['push'](_0x4e7ab8['shift']());}}}(a237_0x3127,0xbdad5));const MYBATIS_OUTER_TAGS=new Map([['select',a237_0x41c7e3(0xad)],[a237_0x41c7e3(0xbd),a237_0x41c7e3(0xfd)],['update',a237_0x41c7e3(0xb6)],['delete','DELETE']]),MYBATIS_DYNAMIC_TAGS=new Set(['if','where',a237_0x41c7e3(0xca),a237_0x41c7e3(0xfa),a237_0x41c7e3(0xd1),a237_0x41c7e3(0xd4),'trim',a237_0x41c7e3(0xb9),a237_0x41c7e3(0xb2),a237_0x41c7e3(0xf6),a237_0x41c7e3(0xf2)]),MYBATIS_BRANCH_TAGS=new Set(['if',a237_0x41c7e3(0xca),a237_0x41c7e3(0xfa),a237_0x41c7e3(0xd1),a237_0x41c7e3(0xd4)]);export const MYBATIS_DYNAMIC_START_MARKER=a237_0x41c7e3(0xe8);export const MYBATIS_DYNAMIC_END_MARKER=a237_0x41c7e3(0xb8);export const MYBATIS_INCLUDE_MARKER=a237_0x41c7e3(0xf3);const UNRESOLVED_SQL_FRAGMENT=a237_0x41c7e3(0xaf),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a237_0x41c7e3(0xab)+[...MYBATIS_OUTER_TAGS[a237_0x41c7e3(0xe9)]()][a237_0x41c7e3(0xf4)]('|')+a237_0x41c7e3(0xb3),'i');export function normalizeSqlForStaticAnalysis(_0x4b1cbb){const _0x20e2c0=a237_0x41c7e3,_0x869938=typeof _0x4b1cbb===_0x20e2c0(0xe1)?_0x4b1cbb:'';if(!startsWithMybatisStatementWrapper(_0x869938))return{'sql':_0x869938,'mode':_0x20e2c0(0xd6)};let _0x5cd9f8=0x0,_0xb9137b='',_0x2447a1,_0x2f891b=![],_0x3d23b0=![];const _0x4fa39c=[];while(_0x5cd9f8<_0x869938['length']){if(_0x869938[_0x20e2c0(0xf7)](_0x20e2c0(0xc7),_0x5cd9f8)){const _0x1a37c1=_0x869938['indexOf'](_0x20e2c0(0xdc),_0x5cd9f8+0x4);if(_0x1a37c1<0x0)return invalidMybatisSource(_0x20e2c0(0xdb));_0xb9137b+='\x20',_0x5cd9f8=_0x1a37c1+0x3;continue;}if(_0x869938[_0x20e2c0(0xf7)]('<;if(_0x1befc0<0x0)return invalidMybatisSource(_0x20e2c0(0xec));_0xb9137b+=_0x869938[_0x20e2c0(0x103)](_0x5cd9f8+0x9,_0x1befc0),_0x5cd9f8=_0x1befc0+0x3;continue;}if(_0x869938[_0x20e2c0(0xf7)]('<?',_0x5cd9f8)){if(_0x2f891b)return invalidMybatisSource(_0x20e2c0(0xf0));const _0x376ead=_0x869938[_0x20e2c0(0xc6)]('?>',_0x5cd9f8+0x2);if(_0x376ead<0x0)return invalidMybatisSource('Unterminated\x20XML\x20declaration.');_0xb9137b+='\x20',_0x5cd9f8=_0x376ead+0x2;continue;}if(_0x869938[_0x5cd9f8]!=='<'){const _0x3bbf7b=_0x869938[_0x20e2c0(0xc6)]('<',_0x5cd9f8),_0x2d8bfc=_0x3bbf7b<0x0?_0x869938[_0x20e2c0(0xf1)]:_0x3bbf7b,_0x2becb9=_0x869938['slice'](_0x5cd9f8,_0x2d8bfc);if((!_0x2f891b||_0x3d23b0)&&_0x2becb9[_0x20e2c0(0xdd)]())return invalidMybatisSource(_0x20e2c0(0xd8));if(_0x2f891b&&!_0x3d23b0){const _0x5856b8=decodeXmlEntities(_0x2becb9);if(_0x5856b8===null)return invalidMybatisSource('Invalid\x20XML\x20entity\x20reference.');_0xb9137b+=_0x5856b8;}else _0xb9137b+='\x20';_0x5cd9f8=_0x2d8bfc;continue;}const _0x2fae81=findXmlTagEnd(_0x869938,_0x5cd9f8);if(_0x2fae81<0x0)return invalidMybatisSource(_0x20e2c0(0xbf));const _0x90b68e=_0x869938[_0x20e2c0(0x103)](_0x5cd9f8,_0x2fae81+0x1),_0x2f1777=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x20e2c0(0xcd)](_0x90b68e);if(!_0x2f1777)return invalidMybatisSource(_0x20e2c0(0xbe));const _0x3bfe89=_0x2f1777[0x1]==='/',_0x521abd=_0x2f1777[0x2]??'',_0xe4264b=_0x521abd[_0x20e2c0(0xac)](),_0x28c5e1=_0x2f1777[0x3]??'',_0x457770=_0x2f1777[0x4]==='/',_0x57a40d=MYBATIS_OUTER_TAGS[_0x20e2c0(0xdf)](_0xe4264b);if(!_0x57a40d&&!MYBATIS_DYNAMIC_TAGS['has'](_0xe4264b))return invalidMybatisSource('Unsupported\x20MyBatis\x20XML\x20tag:\x20<'+_0xe4264b+'>.');if(!_0x57a40d&&_0x521abd!==_0xe4264b)return invalidMybatisSource(_0x20e2c0(0xc4)+_0x521abd+'>.');if(_0x3bfe89){if(_0x28c5e1[_0x20e2c0(0xdd)]()||_0x457770)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x521abd+'>.');const _0x229bea=_0x4fa39c['at'](-0x1);if(!_0x229bea||(_0x229bea['outer']?_0x229bea[_0x20e2c0(0xef)]!==_0xe4264b:_0x229bea[_0x20e2c0(0xfc)]!==_0x521abd))return invalidMybatisSource('Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x521abd+'>.');_0x4fa39c[_0x20e2c0(0xe0)]();if(_0x229bea[_0x20e2c0(0xee)])_0x3d23b0=!![];_0xb9137b+=MYBATIS_BRANCH_TAGS[_0x20e2c0(0xeb)](_0xe4264b)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x28c5e1))return invalidMybatisSource('Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<'+_0x521abd+'>.');if(_0xe4264b===_0x20e2c0(0xf2)&&(!_0x457770||_0x4fa39c['at'](-0x1)?.['tagName']!==_0x20e2c0(0xf6)))return invalidMybatisSource(_0x20e2c0(0xe4));if(_0x57a40d){if(_0x2f891b||_0x4fa39c[_0x20e2c0(0xf1)]>0x0)return invalidMybatisSource('Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.');_0x2f891b=!![],_0x3d23b0=_0x457770,_0x2447a1=_0x57a40d;}else{if(!_0x2f891b||_0x3d23b0)return invalidMybatisSource(_0x20e2c0(0xfb)+_0x521abd+'>.');}_0xb9137b+=_0xe4264b==='where'?_0x20e2c0(0xfe):_0xe4264b==='set'?_0x20e2c0(0xe5):_0xe4264b===_0x20e2c0(0xf6)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x20e2c0(0xeb)](_0xe4264b)&&!_0x457770?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x457770&&_0x4fa39c[_0x20e2c0(0xc9)]({'rawName':_0x521abd,'tagName':_0xe4264b,'outer':!!_0x57a40d});}_0x5cd9f8=_0x2fae81+0x1;}if(_0x4fa39c[_0x20e2c0(0xf1)]>0x0)return invalidMybatisSource(_0x20e2c0(0xd5)+_0x4fa39c['at'](-0x1)?.['rawName']+'>.');if(!_0x2f891b||!_0x3d23b0)return invalidMybatisSource(_0x20e2c0(0x101));return{'sql':_0xb9137b[_0x20e2c0(0xdd)](),'mode':_0x20e2c0(0xf9),..._0x2447a1?{'statementType':_0x2447a1}:{}};}function hasWellFormedXmlAttributes(_0x4ea958){const _0x56f95f=a237_0x41c7e3;let _0x3a206b=0x0;const _0x14151f=new Set();while(_0x3a206b<_0x4ea958[_0x56f95f(0xf1)]){while(_0x3a206b<_0x4ea958[_0x56f95f(0xf1)]&&/\s/['test'](_0x4ea958[_0x3a206b]??''))_0x3a206b+=0x1;if(_0x3a206b>=_0x4ea958[_0x56f95f(0xf1)])return!![];const _0x2ab7d8=/^[A-Za-z_:][\w:.-]*/[_0x56f95f(0xcd)](_0x4ea958[_0x56f95f(0x103)](_0x3a206b)),_0x172b63=_0x2ab7d8?.[0x0];if(!_0x172b63||_0x14151f[_0x56f95f(0xeb)](_0x172b63))return![];_0x14151f[_0x56f95f(0xa9)](_0x172b63),_0x3a206b+=_0x172b63[_0x56f95f(0xf1)];while(_0x3a206b<_0x4ea958[_0x56f95f(0xf1)]&&/\s/[_0x56f95f(0xc5)](_0x4ea958[_0x3a206b]??''))_0x3a206b+=0x1;if(_0x4ea958[_0x3a206b]!=='=')return![];_0x3a206b+=0x1;while(_0x3a206b<_0x4ea958[_0x56f95f(0xf1)]&&/\s/[_0x56f95f(0xc5)](_0x4ea958[_0x3a206b]??''))_0x3a206b+=0x1;const _0x4bc903=_0x4ea958[_0x3a206b];if(_0x4bc903!=='\x22'&&_0x4bc903!=='\x27')return![];_0x3a206b+=0x1;const _0x4a3961=_0x4ea958['indexOf'](_0x4bc903,_0x3a206b);if(_0x4a3961<0x0)return![];if(decodeXmlEntities(_0x4ea958['slice'](_0x3a206b,_0x4a3961))===null)return![];_0x3a206b=_0x4a3961+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x1df8d5){const _0xe7b1cf=a237_0x41c7e3;let _0x231827=0x0;const _0x54d4e0=()=>{const _0x1ec83a=a237_0x320f;while(_0x231827<_0x1df8d5[_0x1ec83a(0xf1)]&&/\s/[_0x1ec83a(0xc5)](_0x1df8d5[_0x231827]??''))_0x231827+=0x1;};_0x54d4e0();while(_0x231827<_0x1df8d5[_0xe7b1cf(0xf1)]){if(_0x1df8d5['startsWith'](_0xe7b1cf(0xc7),_0x231827)){const _0x44a09b=_0x1df8d5[_0xe7b1cf(0xc6)](_0xe7b1cf(0xdc),_0x231827+0x4);if(_0x44a09b<0x0)return!![];_0x231827=_0x44a09b+0x3,_0x54d4e0();continue;}if(_0x1df8d5[_0xe7b1cf(0xf7)]('<?',_0x231827)){const _0x36602f=_0x1df8d5[_0xe7b1cf(0xc6)]('?>',_0x231827+0x2);if(_0x36602f<0x0)return!![];_0x231827=_0x36602f+0x2,_0x54d4e0();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN['test'](_0x1df8d5[_0xe7b1cf(0x103)](_0x231827));}function invalidMybatisSource(_0x4063a9){const _0x372144=a237_0x41c7e3;return{'sql':'','mode':_0x372144(0xf9),'error':_0x4063a9};}function findXmlTagEnd(_0x1e77e5,_0x269429){const _0x29cb08=a237_0x41c7e3;let _0x5e21c7;for(let _0x1a375b=_0x269429+0x1;_0x1a375b<_0x1e77e5[_0x29cb08(0xf1)];_0x1a375b+=0x1){const _0x167a20=_0x1e77e5[_0x1a375b];if(_0x5e21c7){if(_0x167a20===_0x5e21c7)_0x5e21c7=undefined;continue;}if(_0x167a20==='\x22'||_0x167a20==='\x27'){_0x5e21c7=_0x167a20;continue;}if(_0x167a20==='>')return _0x1a375b;}return-0x1;}function decodeXmlEntities(_0x5d5902){const _0x3d6434=a237_0x41c7e3;let _0x479987=![];const _0x32975f=_0x5d5902[_0x3d6434(0xb1)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0xa72bc6=>{const _0x3e2d96=_0x3d6434;if(_0xa72bc6===_0x3e2d96(0xa7))return'<';if(_0xa72bc6===_0x3e2d96(0xe7))return'>';if(_0xa72bc6===_0x3e2d96(0xcb))return'\x22';if(_0xa72bc6===_0x3e2d96(0xf5))return'\x27';if(_0xa72bc6==='&')return'&';const _0x515319=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x3e2d96(0xcd)](_0xa72bc6);if(_0x515319){const _0xdc5e8e=_0x515319[0x1],_0x3e8147=_0x515319[0x2],_0x57f21a=Number[_0x3e2d96(0xb0)](_0xdc5e8e??_0x3e8147??'',_0xdc5e8e?0x10:0xa);if(isValidXmlCharacter(_0x57f21a))return String[_0x3e2d96(0xff)](_0x57f21a);}return _0x479987=!![],'';});return _0x479987?null:_0x32975f;}function isValidXmlCharacter(_0x9dd215){return _0x9dd215===0x9||_0x9dd215===0xa||_0x9dd215===0xd||_0x9dd215>=0x20&&_0x9dd215<=0xd7ff||_0x9dd215>=0xe000&&_0x9dd215<=0xfffd||_0x9dd215>=0x10000&&_0x9dd215<=0x10ffff;}export function detectSqlType(_0x967483){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x967483));}function a237_0x320f(_0x30e044,_0x4fc0ac){_0x30e044=_0x30e044-0xa4;const _0x31279f=a237_0x3127();let _0x320fe5=_0x31279f[_0x30e044];return _0x320fe5;}function detectNormalizedSqlType(_0x5d2bd8){const _0x5e50ba=a237_0x41c7e3;if(_0x5d2bd8[_0x5e50ba(0xcc)])return{'type':_0x5e50ba(0xb4),'isSelectOnly':![],'isDangerous':![],'reason':_0x5d2bd8[_0x5e50ba(0xcc)]};if(!_0x5d2bd8['sql'][_0x5e50ba(0xdd)]())return{'type':_0x5e50ba(0xb4),'isSelectOnly':![],'isDangerous':![],'reason':_0x5e50ba(0xb7)};const _0x232999=stripStaticAnalysisMarkers(_0x5d2bd8[_0x5e50ba(0xd6)])[_0x5e50ba(0xb1)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x5e50ba(0xb1)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x5e50ba(0xb1)](/\/\*[\s\S]*?\*\//g,'')['trim'](),_0x42f0c4=_0x232999[_0x5e50ba(0xd3)]('\x0a');let _0x526274='';for(const _0x2f0c31 of _0x42f0c4){const _0x29c24b=_0x2f0c31[_0x5e50ba(0xdd)]();if(!_0x29c24b||_0x29c24b[_0x5e50ba(0xf7)]('--')||_0x29c24b[_0x5e50ba(0xf7)]('/*'))continue;_0x526274=_0x29c24b;break;}const _0x51a231=_0x526274['toUpperCase'](),_0x4090c0=_0x5d2bd8[_0x5e50ba(0xa4)],_0x90b8d5=maskSqlTextForBlockedKeywordScan(_0x232999),_0x501ee9=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x5e50ba(0xc5)](_0x90b8d5);if(_0x4090c0===_0x5e50ba(0xad)||!_0x4090c0&&(_0x51a231['startsWith'](_0x5e50ba(0xad))||_0x51a231[_0x5e50ba(0xf7)](_0x5e50ba(0xa8)))){const _0x12ba71=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i['test'](_0x232999);return{'type':'SELECT','isSelectOnly':!_0x12ba71,'isDangerous':_0x12ba71,'reason':_0x12ba71?_0x5e50ba(0xaa):undefined};}if(_0x4090c0==='INSERT'||!_0x4090c0&&_0x51a231[_0x5e50ba(0xf7)]('INSERT'))return{'type':_0x5e50ba(0xfd),'isSelectOnly':![],'isDangerous':_0x501ee9,'reason':_0x501ee9?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x4090c0===_0x5e50ba(0xb6)||!_0x4090c0&&_0x51a231[_0x5e50ba(0xf7)](_0x5e50ba(0xb6)))return{'type':_0x5e50ba(0xb6),'isSelectOnly':![],'isDangerous':_0x501ee9,'reason':_0x501ee9?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x4090c0===_0x5e50ba(0xce)||!_0x4090c0&&_0x51a231[_0x5e50ba(0xf7)](_0x5e50ba(0xce)))return{'type':_0x5e50ba(0xce),'isSelectOnly':![],'isDangerous':!![],'reason':_0x5e50ba(0xc2)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x5e50ba(0xc5)](_0x51a231))return{'type':_0x5e50ba(0xd0),'isSelectOnly':![],'isDangerous':!![],'reason':_0x5e50ba(0xda)};return{'type':_0x5e50ba(0xb4),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x425fae){const _0x43acc1=a237_0x41c7e3;return _0x425fae[_0x43acc1(0xe6)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x43acc1(0xe6)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x43acc1(0xe6)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x2607fa){const _0x57fb26=a237_0x41c7e3;return _0x2607fa[_0x57fb26(0xb1)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x57fb26(0xb1)](/"(?:""|\\.|[^"])*"/g,'\x20')['replace'](/`(?:``|\\.|[^`])*`/g,'\x20')['replace'](/--.*$/gm,'\x20')[_0x57fb26(0xb1)](/#.*$/gm,'\x20')[_0x57fb26(0xb1)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x4a794d){const _0x69c024=a237_0x41c7e3,_0x52c1f8=_0x4a794d[_0x69c024(0xb1)](/#\{[^}]*\}/g,'?')[_0x69c024(0xb1)](/\$\{[^}]*\}/g,'?')[_0x69c024(0xb1)](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')[_0x69c024(0xb1)](/\/\*[\s\S]*?\*\//g,''),_0x40f8b8=[],_0x473b0f=_0x52c1f8[_0x69c024(0xa5)](/FROM\s+([^\s,)(]+)/i);addTable(_0x40f8b8,_0x473b0f?.[0x1]);for(const _0x4583f2 of _0x52c1f8[_0x69c024(0xbc)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x40f8b8,_0x4583f2[0x1]);}const _0x8538=_0x52c1f8[_0x69c024(0xa5)](/INTO\s+([^\s(]+)/i);addTable(_0x40f8b8,_0x8538?.[0x1]);const _0x2277e8=_0x52c1f8[_0x69c024(0xa5)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x40f8b8,_0x2277e8?.[0x1]),_0x40f8b8;}function addTable(_0x13d4f8,_0x4d7a99){const _0x2f27d7=a237_0x41c7e3,_0x3bb37c=_0x4d7a99?.[_0x2f27d7(0xb1)](/[`"]/g,'');_0x3bb37c&&_0x3bb37c!==UNRESOLVED_SQL_FRAGMENT&&!_0x13d4f8[_0x2f27d7(0xba)](_0x3bb37c)&&_0x13d4f8[_0x2f27d7(0xc9)](_0x3bb37c);}function extractParameters(_0xf8531b){const _0x5e5a66=a237_0x41c7e3,_0x194223=new Set();for(const _0x343968 of _0xf8531b[_0x5e5a66(0xbc)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x343968[0x1])_0x194223['add'](_0x343968[0x1]);}return Array[_0x5e5a66(0xb5)](_0x194223);}export function validateSql(_0x572605){const _0x4b2084=a237_0x41c7e3,_0x474665=normalizeSqlForStaticAnalysis(_0x572605),_0x1dee39=detectNormalizedSqlType(_0x474665),_0x50550f=stripStaticAnalysisMarkers(_0x474665[_0x4b2084(0xd6)]),_0x5513a9=_0x474665['error']?[]:extractTables(_0x50550f),_0x50bf8f=_0x474665[_0x4b2084(0xcc)]?[]:extractParameters(_0x50550f);if(_0x1dee39['isDangerous'])return{'valid':![],'sqlType':_0x1dee39,'tables':_0x5513a9,'parameters':_0x50bf8f,'message':_0x1dee39[_0x4b2084(0xd9)]||_0x1dee39[_0x4b2084(0x102)]+_0x4b2084(0xe3)};if(_0x1dee39['type']===_0x4b2084(0xb4))return{'valid':![],'sqlType':_0x1dee39,'tables':_0x5513a9,'parameters':_0x50bf8f,'message':_0x474665['error']?_0x4b2084(0xbb)+_0x474665[_0x4b2084(0xcc)]:_0x4b2084(0xc1)};return{'valid':!![],'sqlType':_0x1dee39,'tables':_0x5513a9,'parameters':_0x50bf8f,'message':_0x1dee39['type']+_0x4b2084(0xf8)+(_0x5513a9[_0x4b2084(0xf1)]?_0x5513a9[_0x4b2084(0xf4)](',\x20'):_0x4b2084(0xd7))+(_0x50bf8f[_0x4b2084(0xf1)]?_0x4b2084(0xed)+_0x50bf8f[_0x4b2084(0xf4)](',\x20'):'')};}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a238_0x34b164=a238_0x557d;(function(_0x555806,_0x424c78){const _0x4c024a=a238_0x557d,_0x263afb=_0x555806();while(!![]){try{const _0xb4d8ad=parseInt(_0x4c024a(0x124))/0x1+-parseInt(_0x4c024a(0x122))/0x2+-parseInt(_0x4c024a(0x129))/0x3+parseInt(_0x4c024a(0x128))/0x4+parseInt(_0x4c024a(0x12c))/0x5+-parseInt(_0x4c024a(0x123))/0x6+-parseInt(_0x4c024a(0x12b))/0x7*(-parseInt(_0x4c024a(0x121))/0x8);if(_0xb4d8ad===_0x424c78)break;else _0x263afb['push'](_0x263afb['shift']());}catch(_0x5231d8){_0x263afb['push'](_0x263afb['shift']());}}}(a238_0x3953,0x95aa3));function a238_0x3953(){const _0x19d47e=['Run\x20`','\x0a\x20\x20\x20\x20\x20\x20\x20','3295404WRzdcN','1146795rnkCJf','\x20auth`\x20to\x20login\x20first.','7LtTFdX','595525vhzJkF','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','8677584QilDbt','1550482bBHuFK','5010648nUgyWy','577987FExKsW','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.'];a238_0x3953=function(){return _0x19d47e;};return a238_0x3953();}function a238_0x557d(_0x48b1fb,_0x3e0756){_0x48b1fb=_0x48b1fb-0x120;const _0x39539b=a238_0x3953();let _0x557ddb=_0x39539b[_0x48b1fb];return _0x557ddb;}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_0x34b164(0x126)+CLI_BIN_NAME+a238_0x34b164(0x12a),'configMissingHint':['Set\x20appcode\x20via\x20`'+CLI_BIN_NAME+a238_0x34b164(0x125),'Tip:\x20`'+CLI_BIN_NAME+'\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.']['join'](a238_0x34b164(0x127)),'notInProjectHint':a238_0x34b164(0x120)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4ff8a0,_0x34195d){const _0x2de303=a239_0x2f92,_0x16dead=_0x4ff8a0();while(!![]){try{const _0x338639=-parseInt(_0x2de303(0x1ae))/0x1*(parseInt(_0x2de303(0x1ad))/0x2)+parseInt(_0x2de303(0x1ab))/0x3*(parseInt(_0x2de303(0x1a9))/0x4)+-parseInt(_0x2de303(0x1b1))/0x5+parseInt(_0x2de303(0x1aa))/0x6+parseInt(_0x2de303(0x1af))/0x7+-parseInt(_0x2de303(0x1b0))/0x8+-parseInt(_0x2de303(0x1a8))/0x9;if(_0x338639===_0x34195d)break;else _0x16dead['push'](_0x16dead['shift']());}catch(_0x24ac5b){_0x16dead['push'](_0x16dead['shift']());}}}(a239_0x4887,0xdbfa1));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a239_0x2cb033}from'@lovrabet/cli-framework';function a239_0x2f92(_0x43e0e5,_0x421313){_0x43e0e5=_0x43e0e5-0x1a8;const _0x4887ce=a239_0x4887();let _0x2f92fa=_0x4887ce[_0x43e0e5];return _0x2f92fa;}function a239_0x4887(){const _0x514ef2=['2354964bjYyKZ','1454778tHlphw','name','44534YqjpTL','19aaPtOe','10801259PvLCmM','2449520KbQwTc','4279670Cfoupq','8136783oQyiiN','12gxNMmB'];a239_0x4887=function(){return _0x514ef2;};return a239_0x4887();}import{EXPLICIT_YES_FLAG_DESCRIPTION,requiresExplicitYes}from'../framework/explicit-yes.js';export function buildAllFlags(_0x5d44ed){const _0x2f763a=a239_0x2f92,_0x57a13d=a239_0x2cb033(_0x5d44ed,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});if(!requiresExplicitYes(_0x5d44ed))return _0x57a13d;return _0x57a13d['map'](_0x57adc8=>_0x57adc8[_0x2f763a(0x1ac)]==='yes'?{..._0x57adc8,'description':EXPLICIT_YES_FLAG_DESCRIPTION}:_0x57adc8);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a240_0x1b81(){var _0x48ce86=['2iIuTow','5364096dptXwT','defaultFormat','structuredErrors','13073796qZoEjC','def','2024133gaFoJQ','6876600vMbdQJ','3317910Grifyd','format','4349616DOmXYQ','flags','1236868hSnKrA','7VGzyhm'];a240_0x1b81=function(){return _0x48ce86;};return a240_0x1b81();}function a240_0x34d1(_0x316750,_0x2f5c13){_0x316750=_0x316750-0x90;var _0x1b8188=a240_0x1b81();var _0x34d12a=_0x1b8188[_0x316750];return _0x34d12a;}(function(_0x1deaea,_0x592140){var _0x59e83b=a240_0x34d1,_0x6e70c6=_0x1deaea();while(!![]){try{var _0x364042=-parseInt(_0x59e83b(0x98))/0x1+parseInt(_0x59e83b(0x9a))/0x2*(parseInt(_0x59e83b(0x92))/0x3)+parseInt(_0x59e83b(0x9b))/0x4+parseInt(_0x59e83b(0x93))/0x5+-parseInt(_0x59e83b(0x94))/0x6*(-parseInt(_0x59e83b(0x99))/0x7)+-parseInt(_0x59e83b(0x96))/0x8+-parseInt(_0x59e83b(0x90))/0x9;if(_0x364042===_0x592140)break;else _0x6e70c6['push'](_0x6e70c6['shift']());}catch(_0x1212c3){_0x6e70c6['push'](_0x6e70c6['shift']());}}}(a240_0x1b81,0xad8aa));import{resolveOutputConfig}from'@lovrabet/cli-framework';export function usesStructuredErrorOutput(_0x140cd4){var _0x1b5b8a=a240_0x34d1;return _0x140cd4?.[_0x1b5b8a(0x9d)]===!![];}export function resolveErrorOutputFormat(_0x13e26f){var _0x1df436=a240_0x34d1;if(!_0x13e26f[_0x1df436(0x91)])return _0x13e26f['defaultFormat']??'compress';return resolveOutputConfig({'flags':_0x13e26f[_0x1df436(0x97)]??{},'def':_0x13e26f[_0x1df436(0x91)],'configDefault':_0x13e26f[_0x1df436(0x9c)]})[_0x1df436(0x95)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a241_0x1624(_0x583ba9,_0x40a1d6){_0x583ba9=_0x583ba9-0x97;const _0x556572=a241_0x5565();let _0x16245c=_0x556572[_0x583ba9];return _0x16245c;}const a241_0x11271f=a241_0x1624;(function(_0x1e4340,_0x3b8f35){const _0x33a5f0=a241_0x1624,_0x44801f=_0x1e4340();while(!![]){try{const _0x46cd6f=parseInt(_0x33a5f0(0x9a))/0x1*(parseInt(_0x33a5f0(0xa6))/0x2)+-parseInt(_0x33a5f0(0x9d))/0x3+parseInt(_0x33a5f0(0xa5))/0x4*(-parseInt(_0x33a5f0(0x97))/0x5)+-parseInt(_0x33a5f0(0xa0))/0x6+-parseInt(_0x33a5f0(0xa2))/0x7+-parseInt(_0x33a5f0(0xa1))/0x8*(-parseInt(_0x33a5f0(0x9c))/0x9)+parseInt(_0x33a5f0(0xa4))/0xa;if(_0x46cd6f===_0x3b8f35)break;else _0x44801f['push'](_0x44801f['shift']());}catch(_0x2fa26b){_0x44801f['push'](_0x44801f['shift']());}}}(a241_0x5565,0xd562d));const EXPLICIT_YES_COMMANDS=new Set(['menu\x20external-link-update','menu\x20delete','menu\x20regroup-start',a241_0x11271f(0x9f),a241_0x11271f(0x98),'kb\x20delete']);export const EXPLICIT_YES_FLAG_DESCRIPTION=a241_0x11271f(0x99);function a241_0x5565(){const _0x1b1b1f=['8520960xgwKqQ','1176340TdWkJy','3430814rhxrLi','10KJgeJY','kb\x20update','Required\x20for\x20execution\x20after\x20reviewing\x20the\x20--dry-run\x20plan','1PnvUNk','service','3003021apCKDf','637026tvdSPl','command','kb\x20create','9124326SYXeIE','24KvmuTS','2612736GAPzUX','has'];a241_0x5565=function(){return _0x1b1b1f;};return a241_0x5565();}export function requiresExplicitYes(_0x539aea){const _0x4b3641=a241_0x11271f;return EXPLICIT_YES_COMMANDS[_0x4b3641(0xa3)](_0x539aea[_0x4b3641(0x9b)]+'\x20'+_0x539aea[_0x4b3641(0x9e)]);}
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a242_0x2d9bba=a242_0x527d;(function(_0x381b59,_0x26fbe5){const _0x72b174=a242_0x527d,_0x4e9a59=_0x381b59();while(!![]){try{const _0x3c106b=-parseInt(_0x72b174(0x170))/0x1+-parseInt(_0x72b174(0x172))/0x2*(-parseInt(_0x72b174(0x176))/0x3)+parseInt(_0x72b174(0x16c))/0x4+parseInt(_0x72b174(0x16d))/0x5*(parseInt(_0x72b174(0x173))/0x6)+-parseInt(_0x72b174(0x175))/0x7*(parseInt(_0x72b174(0x177))/0x8)+parseInt(_0x72b174(0x16e))/0x9*(parseInt(_0x72b174(0x174))/0xa)+-parseInt(_0x72b174(0x171))/0xb;if(_0x3c106b===_0x26fbe5)break;else _0x4e9a59['push'](_0x4e9a59['shift']());}catch(_0x5d93ae){_0x4e9a59['push'](_0x4e9a59['shift']());}}}(a242_0x40df,0x2a1bd));import{createFlagHelpers}from'@lovrabet/cli-framework';function a242_0x40df(){const _0x3fc6e1=['195928dYJKrf','3966TgUHSk','567150dNjBbD','147UShXnO','6XwuEQr','74792zUDEkw','1118228szYEMn','1645UFbMYN','18VAXRGe','validateFlags','271696zKVMQu','1824702apkMak'];a242_0x40df=function(){return _0x3fc6e1;};return a242_0x40df();}function a242_0x527d(_0x939608,_0x537aeb){_0x939608=_0x939608-0x16c;const _0x40df4c=a242_0x40df();let _0x527d97=_0x40df4c[_0x939608];return _0x527d97;}import{CliErrors}from'../errors.js';const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers['parseFlags'];export const validateFlags=helpers[a242_0x2d9bba(0x16f)];
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a243_0xacd7(_0x426adc,_0x1ff873){_0x426adc=_0x426adc-0x6a;const _0x527328=a243_0x5273();let _0xacd774=_0x527328[_0x426adc];return _0xacd774;}const a243_0x36af2b=a243_0xacd7;(function(_0x398985,_0xf15024){const _0x404118=a243_0xacd7,_0xbd4825=_0x398985();while(!![]){try{const _0x53c448=parseInt(_0x404118(0x6d))/0x1*(parseInt(_0x404118(0x70))/0x2)+-parseInt(_0x404118(0x75))/0x3+parseInt(_0x404118(0x7b))/0x4*(parseInt(_0x404118(0x71))/0x5)+parseInt(_0x404118(0x6c))/0x6*(parseInt(_0x404118(0x73))/0x7)+parseInt(_0x404118(0x7c))/0x8+-parseInt(_0x404118(0x72))/0x9*(parseInt(_0x404118(0x78))/0xa)+-parseInt(_0x404118(0x7a))/0xb;if(_0x53c448===_0xf15024)break;else _0xbd4825['push'](_0xbd4825['shift']());}catch(_0xe8adb4){_0xbd4825['push'](_0xbd4825['shift']());}}}(a243_0x5273,0x1daa0));import{createHelpGenerators}from'@lovrabet/cli-framework';function a243_0x5273(){const _0x21fde1=['\x20[args]\x20[flags]','generateCommandHelp','2qndtYM','60vGdYFL','105939RtwpFU','7EDlcOc','replace','475581zKieIr','generateFullHelp','Requires\x20explicit\x20--yes\x20for\x20execution;\x20use\x20--dry-run\x20to\x20preview.','20HlCzZn','Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.','3004155rDxUkS','28620AtyLZW','1712568OvHmhA','\x20workspace\x20init`\x20or\x20--appcode).','Requires\x20appcode\x20(set\x20via\x20`','1153926DMfAkX','84426LLcBLO'];a243_0x5273=function(){return _0x21fde1;};return a243_0x5273();}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':_0x8a1ea6=>serviceGroups['get'](_0x8a1ea6),'buildAllFlags':buildAllFlags,'appPrerequisiteText':a243_0x36af2b(0x6b)+CLI_BIN_NAME+a243_0x36af2b(0x6a),'serviceUsageSuffix':a243_0x36af2b(0x6e)});export function generateCommandHelp(_0x428b50){const _0x3540aa=a243_0x36af2b,_0x484cd5=generators[_0x3540aa(0x6f)](_0x428b50);if(!requiresExplicitYes(_0x428b50))return _0x484cd5;return _0x484cd5[_0x3540aa(0x74)](_0x3540aa(0x79),_0x3540aa(0x77));}export const generateServiceHelp=generators['generateServiceHelp'];export const generateFullHelp=generators[a243_0x36af2b(0x76)];
|
package/lib/framework/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x48bed6,_0x41f437){var _0x2b9586=a244_0x538c,_0x5ab84e=_0x48bed6();while(!![]){try{var _0x19cc44=-parseInt(_0x2b9586(0x1dc))/0x1*(parseInt(_0x2b9586(0x1dd))/0x2)+-parseInt(_0x2b9586(0x1df))/0x3*(-parseInt(_0x2b9586(0x1de))/0x4)+-parseInt(_0x2b9586(0x1d9))/0x5*(-parseInt(_0x2b9586(0x1e0))/0x6)+parseInt(_0x2b9586(0x1d6))/0x7+-parseInt(_0x2b9586(0x1da))/0x8+parseInt(_0x2b9586(0x1d7))/0x9*(-parseInt(_0x2b9586(0x1db))/0xa)+-parseInt(_0x2b9586(0x1e1))/0xb*(-parseInt(_0x2b9586(0x1d8))/0xc);if(_0x19cc44===_0x41f437)break;else _0x5ab84e['push'](_0x5ab84e['shift']());}catch(_0x11d9c1){_0x5ab84e['push'](_0x5ab84e['shift']());}}}(a244_0x59b5,0x550b2));function a244_0x59b5(){var _0x283552=['494240jDAqIg','14921yOheDh','22SPbCLq','4yoBLHr','229761RseAap','2141214NlgAeR','1199uWrQgX','4629569RdVuXy','9yzpxgH','12084zMtOxq','5iUbgNN','5141544UpzeQI'];a244_0x59b5=function(){return _0x283552;};return a244_0x59b5();}export{runCommand}from'../framework/runner.js';export{parseFlags,validateFlags}from'../framework/flags.js';export{formatOutput}from'../framework/output.js';export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'../framework/help.js';function a244_0x538c(_0x17f3fa,_0x26d8d4){_0x17f3fa=_0x17f3fa-0x1d6;var _0x59b55f=a244_0x59b5();var _0x538c3a=_0x59b55f[_0x17f3fa];return _0x538c3a;}export{extractList,extractPaging}from'../framework/response.js';export{riskLevelOrder}from'../framework/types.js';
|
package/lib/framework/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3a98e6,_0xac6358){const _0x1fcf95=a245_0x4fff,_0x32871d=_0x3a98e6();while(!![]){try{const _0x3b2023=-parseInt(_0x1fcf95(0xb5))/0x1+-parseInt(_0x1fcf95(0xb7))/0x2+-parseInt(_0x1fcf95(0xb2))/0x3*(parseInt(_0x1fcf95(0xb3))/0x4)+parseInt(_0x1fcf95(0xbe))/0x5+parseInt(_0x1fcf95(0xb9))/0x6+parseInt(_0x1fcf95(0xab))/0x7*(parseInt(_0x1fcf95(0xaf))/0x8)+-parseInt(_0x1fcf95(0xb6))/0x9*(-parseInt(_0x1fcf95(0xc1))/0xa);if(_0x3b2023===_0xac6358)break;else _0x32871d['push'](_0x32871d['shift']());}catch(_0x316522){_0x32871d['push'](_0x32871d['shift']());}}}(a245_0xc2c7,0xb61cc));import{createFormatOutput,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliError,CliErrors}from'../errors.js';function a245_0x4fff(_0x8f0b1,_0x55ba72){_0x8f0b1=_0x8f0b1-0xa9;const _0xc2c75f=a245_0xc2c7();let _0x4fffcb=_0xc2c75f[_0x8f0b1];return _0x4fffcb;}import{applyJqFilter}from'../utils/apply-jq-filter.js';function a245_0xc2c7(){const _0x1be552=['trim','4867355UbOQCJ','message','json','6014040ZxUuGj','format','validation','7THEVri','update','stringify','endsWith','2570136qlrIuW','command','write','289599yqKaXy','8mHrKbG','error','1402677jKuBmy','18LrJYAd','2520578WSDxuX','jqFilter','6626508TLxtTL','hint','_notice','code'];a245_0xc2c7=function(){return _0x1be552;};return a245_0xc2c7();}const baseFormatOutput=createFormatOutput({'cliErrors':CliErrors,'jqBinaryResolverOptions':{'bundledJqPaths':resolveBundledJqPaths()}});export function formatOutput(_0x5386b2,_0x286ef1){const _0x366098=a245_0x4fff,_0x43951e=_0x5386b2[_0x366098(0xbb)],{_notice:_0x330ad1,..._0x140730}=_0x5386b2;void _0x330ad1,baseFormatOutput(_0x140730,_0x286ef1),_0x286ef1[_0x366098(0xa9)]==='pretty'&&printPrettyNotice(_0x43951e);}export function formatCliError(_0x181011,_0x509be){const _0x3cc5e2=a245_0x4fff;if(_0x509be['format']==='pretty')return![];const _0x37f1be=_0x181011['data'],_0x5eb36c={'ok':![],'command':_0x509be[_0x3cc5e2(0xb0)],'risk':_0x509be['risk'],'data':_0x37f1be??null,'error':{'code':_0x181011[_0x3cc5e2(0xbc)],'message':_0x181011['message'],..._0x181011[_0x3cc5e2(0xba)]?{'hint':_0x181011[_0x3cc5e2(0xba)]}:{}}},_0x505d05=_0x509be[_0x3cc5e2(0xa9)]===_0x3cc5e2(0xc0)?JSON[_0x3cc5e2(0xad)](_0x5eb36c,null,0x2):JSON[_0x3cc5e2(0xad)](_0x5eb36c);let _0x472c1c=_0x505d05;if(_0x509be[_0x3cc5e2(0xb8)]?.[_0x3cc5e2(0xbd)]())try{_0x472c1c=applyJqFilter(_0x505d05,_0x509be[_0x3cc5e2(0xb8)]);}catch(_0xc4288a){const _0x372d24=_0xc4288a instanceof CliError?_0xc4288a:CliErrors[_0x3cc5e2(0xaa)]('jq:\x20'+(_0xc4288a instanceof Error?_0xc4288a[_0x3cc5e2(0xbf)]:String(_0xc4288a))),_0x318e64={..._0x5eb36c,'error':{'code':_0x372d24[_0x3cc5e2(0xbc)],'message':_0x372d24[_0x3cc5e2(0xbf)],..._0x372d24[_0x3cc5e2(0xba)]?{'hint':_0x372d24['hint']}:{},'cause':_0x5eb36c[_0x3cc5e2(0xb4)]}};_0x472c1c=_0x509be[_0x3cc5e2(0xa9)]===_0x3cc5e2(0xc0)?JSON[_0x3cc5e2(0xad)](_0x318e64,null,0x2):JSON[_0x3cc5e2(0xad)](_0x318e64);}return process['stdout'][_0x3cc5e2(0xb1)](_0x472c1c[_0x3cc5e2(0xae)]('\x0a')?_0x472c1c:_0x472c1c+'\x0a'),!![];}function printPrettyNotice(_0x2acf7d){const _0x4e1f8e=a245_0x4fff;if(!_0x2acf7d?.[_0x4e1f8e(0xac)])return;console['error'](_0x2acf7d['update']['message']+'\x20('+_0x2acf7d['update']['url']+')');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a246_0x243f(_0x26e640,_0x2fc929){_0x26e640=_0x26e640-0x163;var _0x46f1f5=a246_0x46f1();var _0x243f5d=_0x46f1f5[_0x26e640];return _0x243f5d;}(function(_0x81c395,_0x7b641e){var _0x2dfc83=a246_0x243f,_0x276605=_0x81c395();while(!![]){try{var _0x244b43=parseInt(_0x2dfc83(0x164))/0x1+parseInt(_0x2dfc83(0x166))/0x2+parseInt(_0x2dfc83(0x163))/0x3*(-parseInt(_0x2dfc83(0x16c))/0x4)+-parseInt(_0x2dfc83(0x167))/0x5*(-parseInt(_0x2dfc83(0x16b))/0x6)+parseInt(_0x2dfc83(0x16a))/0x7+parseInt(_0x2dfc83(0x168))/0x8+-parseInt(_0x2dfc83(0x165))/0x9*(parseInt(_0x2dfc83(0x169))/0xa);if(_0x244b43===_0x7b641e)break;else _0x276605['push'](_0x276605['shift']());}catch(_0x518932){_0x276605['push'](_0x276605['shift']());}}}(a246_0x46f1,0x9474a));export{extractList,extractPaging}from'@lovrabet/cli-framework';function a246_0x46f1(){var _0x458dfa=['685720oegkGx','368605CPjleE','9502416qZuvSl','310eOAwjx','653632BSGepq','42AZosHo','6796DIiczU','357EZZwrK','518948BZxyWg','536742AQxqjS'];a246_0x46f1=function(){return _0x458dfa;};return a246_0x46f1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x276aa0,_0xa12c){const _0x183543=a247_0x30d7,_0x585326=_0x276aa0();while(!![]){try{const _0xb78639=parseInt(_0x183543(0x17f))/0x1+-parseInt(_0x183543(0x17a))/0x2*(parseInt(_0x183543(0x18c))/0x3)+-parseInt(_0x183543(0x189))/0x4+parseInt(_0x183543(0x17d))/0x5*(-parseInt(_0x183543(0x184))/0x6)+-parseInt(_0x183543(0x179))/0x7*(parseInt(_0x183543(0x177))/0x8)+-parseInt(_0x183543(0x183))/0x9*(parseInt(_0x183543(0x182))/0xa)+parseInt(_0x183543(0x176))/0xb;if(_0xb78639===_0xa12c)break;else _0x585326['push'](_0x585326['shift']());}catch(_0x345b78){_0x585326['push'](_0x585326['shift']());}}}(a247_0x1fd7,0x77620));function a247_0x1fd7(){const _0x4d6220=['.\x20Run\x20`','validation','367480ToUIBi','string','459855qNIFGm','some','length','323090QmJIqO','9qcTsmH','24rvPNEn','flags','code','\x20api\x20pull`\x20first.','type','3830028BkxvFA','alias','map','3zXehxr','`\x20requires\x20either\x20--code\x20or\x20--alias.','No\x20api.ts\x20found\x20in\x20','Available\x20aliases:\x20','18678990nnvPNa','90568KcFPVT','name','154aeUJpo','272182tBpKsH'];a247_0x1fd7=function(){return _0x4d6220;};return a247_0x1fd7();}function a247_0x30d7(_0x4010a5,_0x383691){_0x4010a5=_0x4010a5-0x175;const _0x1fd703=a247_0x1fd7();let _0x30d75d=_0x1fd703[_0x4010a5];return _0x30d75d;}import{CliErrors}from'../errors.js';import{resolveAlias,listAliases}from'../core/alias-resolver.js';import{CLI_BIN_NAME}from'../constant/cli.js';export function resolveAliasToCode(_0x18e25a,_0x5c5014,_0x3a9caf,_0x150f79){const _0x1c97c9=a247_0x30d7,_0x218dbb=_0x18e25a['flags'][_0x1c97c9(0x180)](_0x4a3a2e=>_0x4a3a2e[_0x1c97c9(0x178)]===_0x1c97c9(0x186)&&_0x4a3a2e[_0x1c97c9(0x188)]===_0x1c97c9(0x17e)),_0x487006=_0x18e25a[_0x1c97c9(0x185)][_0x1c97c9(0x180)](_0x44c1d7=>_0x44c1d7[_0x1c97c9(0x178)]===_0x1c97c9(0x18a)&&_0x44c1d7['type']===_0x1c97c9(0x17e));if(!_0x218dbb||!_0x487006)return;const _0x54de3c=_0x5c5014[_0x1c97c9(0x186)]?String(_0x5c5014['code']):'',_0x299031=_0x5c5014[_0x1c97c9(0x18a)]?String(_0x5c5014[_0x1c97c9(0x18a)]):'';if(!_0x54de3c&&!_0x299031)throw CliErrors[_0x1c97c9(0x17c)]('`'+_0x150f79+_0x1c97c9(0x18d));if(_0x299031&&!_0x54de3c){const _0xd5fa02=resolveAlias(_0x3a9caf,_0x299031);if(!_0xd5fa02){const _0x5f0a11=listAliases(_0x3a9caf)[_0x1c97c9(0x18b)](_0x427524=>_0x427524[_0x1c97c9(0x18a)]),_0x1465c9=_0x5f0a11[_0x1c97c9(0x181)]?_0x1c97c9(0x175)+_0x5f0a11['join'](',\x20'):_0x1c97c9(0x18e)+_0x3a9caf+_0x1c97c9(0x17b)+CLI_BIN_NAME+_0x1c97c9(0x187);throw CliErrors[_0x1c97c9(0x17c)]('Unknown\x20alias\x20\x22'+_0x299031+'\x22.\x20'+_0x1465c9);}_0x5c5014[_0x1c97c9(0x186)]=_0xd5fa02;}}
|
package/lib/framework/runner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f46cc,_0x6f455b){const _0x36bc1c=a248_0x275e,_0x4e32d5=_0x2f46cc();while(!![]){try{const _0x5da42b=-parseInt(_0x36bc1c(0x1e2))/0x1+-parseInt(_0x36bc1c(0x1e8))/0x2*(-parseInt(_0x36bc1c(0x1ba))/0x3)+parseInt(_0x36bc1c(0x1c9))/0x4+-parseInt(_0x36bc1c(0x1e1))/0x5+-parseInt(_0x36bc1c(0x1bc))/0x6*(parseInt(_0x36bc1c(0x1dc))/0x7)+parseInt(_0x36bc1c(0x1f7))/0x8+parseInt(_0x36bc1c(0x1fb))/0x9*(parseInt(_0x36bc1c(0x1c3))/0xa);if(_0x5da42b===_0x6f455b)break;else _0x4e32d5['push'](_0x4e32d5['shift']());}catch(_0x222655){_0x4e32d5['push'](_0x4e32d5['shift']());}}}(a248_0x1af5,0x5a3e4));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_0x13192c}from'../utils/is-non-interactive.js';import{resolveAliasToCode}from'../framework/runner-alias.js';import{resolveLatestUpdateNotice}from'../utils/update-notice.js';function stringFlag(_0x19a0d5){const _0x20fb0e=a248_0x275e;return typeof _0x19a0d5==='string'&&_0x19a0d5[_0x20fb0e(0x1c1)]()?_0x19a0d5[_0x20fb0e(0x1c1)]():undefined;}function resolveEnvAppCode(){const _0x71a9fc=a248_0x275e,_0x15a93d=stringFlag(process.env.RABETBASE_APPCODE);if(_0x15a93d)return{'name':_0x71a9fc(0x1de),'value':_0x15a93d};const _0x4677ea=stringFlag(process.env.LOVRABET_APPCODE);if(_0x4677ea)return{'name':_0x71a9fc(0x1c8),'value':_0x4677ea};return undefined;}function hasExplicitAppCode(_0x18b667,_0x407630){const _0xbb74c7=a248_0x275e;return!!(stringFlag(_0x18b667[_0xbb74c7(0x1c6)])||stringFlag(_0x407630[_0xbb74c7(0x1c6)]));}function assertEnvAppCodeNotIgnored(_0x276eae,_0x46b405,_0x4502e0){const _0x5c8014=a248_0x275e;if(!_0x46b405||_0x4502e0||_0x276eae===_0x46b405[_0x5c8014(0x1d7)])return;const _0x219b8a=_0x276eae?_0x5c8014(0x1f1)+_0x276eae+'\x22.':_0x5c8014(0x1cd);throw CliErrors['validation'](_0x46b405[_0x5c8014(0x1d1)]+'='+_0x46b405['value']+_0x5c8014(0x1cb)+_0x219b8a+'\x20'+('To\x20use\x20this\x20environment\x20variable,\x20pass\x20--appcode\x20\x22$'+_0x46b405[_0x5c8014(0x1d1)]+'\x22.'));}export function createPipelineEnv(_0x51cd5a,_0x2a9e08,_0x23f4ea=[]){const _0x5d3958=a248_0x275e;return{'rawFlags':_0x2a9e08,'args':_0x23f4ea,'resolveAppCode':()=>_0x51cd5a['appCode'],'resolveCookie':()=>_0x51cd5a[_0x5d3958(0x1ef)]||getCookie(),'resolveApiDomain':()=>getApiDomain(),'isNonInteractive':a248_0x13192c(_0x2a9e08),'defaultFormat':_0x51cd5a[_0x5d3958(0x1cf)],'defaultPageSize':_0x51cd5a[_0x5d3958(0x1ee)],'defaultVerbose':_0x51cd5a[_0x5d3958(0x1c5)],'apiDir':_0x51cd5a['apiDir'],'riskLevel':_0x51cd5a[_0x5d3958(0x1df)],'selectedAppName':_0x51cd5a[_0x5d3958(0x1be)],'mergedCli':{'defaultApp':_0x51cd5a[_0x5d3958(0x1b6)],'currentApp':_0x51cd5a[_0x5d3958(0x1e3)],'appCode':_0x51cd5a[_0x5d3958(0x1b8)],'apps':_0x51cd5a[_0x5d3958(0x1fc)]}};}function a248_0x1af5(){const _0x16e94e=['\x20\x20\x20Continue?\x20[y/N]\x20','resolveApiDomain','resolveCookie','2FGVNBl','High-risk\x20operation\x20`','configMissing','production','map','authRequired','pageSize','cookie','service','Current\x20resolved\x20appcode\x20is\x20\x22','pretty','command','resolve','`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.','execute','2096272zjVZZg','none','selectedAppName','update','63RFtmYn','apps','defaultApp','hint','appCode','includes','2084601rBWGvV','filter','390XHnlZO','requiresAppCode','explicitAppName','resolveAppCode','_notice','trim','⚠\x20\x20High-risk\x20operation:\x20','1230310tXjuAo','validation','verbose','appcode','toUpperCase','LOVRABET_APPCODE','1492888zbpcYK','cancelled','\x20is\x20not\x20used\x20as\x20appcode\x20automatically.\x20','nonInteractive','No\x20appcode\x20is\x20resolved\x20from\x20--appcode,\x20project\x20config,\x20or\x20global\x20config.','Set\x20appcode\x20via\x20`','format','formatOutput','name','find','../core/api-client.js','defaultVerbose','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','object','value','rawFlags','confirmHighRisk','doctor','apiDir','55167UVrFbz','replace','RABETBASE_APPCODE','riskLevel','mergedCli','3106865GlJkQQ','688066OnmmhO','currentApp','has'];a248_0x1af5=function(){return _0x16e94e;};return a248_0x1af5();}export function createRabetbaseRunnerAdapter(_0x168503={}){const _0x1914d3=a248_0x275e;return{'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS[_0x1914d3(0x1bb)](_0xe73bb7=>PIPELINE_FLAG_NAMES[_0x1914d3(0x1e4)](_0xe73bb7[_0x1914d3(0x1d1)]))[_0x1914d3(0x1ec)](({name:_0x4b0f5b,type:_0x43c807,description:_0x532ca7})=>({'name':_0x4b0f5b,'type':_0x43c807,'description':_0x532ca7})),'formatOutput':_0x168503[_0x1914d3(0x1d0)]??formatOutput,'getCommandLabel'(_0x32cab9){const _0xd1c5b8=_0x1914d3;return CLI_BIN_NAME+'\x20'+_0x32cab9[_0xd1c5b8(0x1f0)]+'\x20'+_0x32cab9[_0xd1c5b8(0x1f3)];},'riskPolicy':{'skipWhenDryRun':!![],'createError'(_0x5b9ab9){const _0x2a2c96=_0x1914d3;return CliErrors[_0x2a2c96(0x1c4)](_0x5b9ab9);}},async 'prepare'(_0x4e7516,_0xa87e1f,_0x1d9011,_0x324586){const _0x936a8f=_0x1914d3,_0x2ac0e6=_0xa87e1f[_0x936a8f(0x1db)]||DEFAULT_API_DIR;resolveAliasToCode(_0x4e7516,_0x1d9011,_0x2ac0e6,_0x324586);const _0x7740fa=resolveCommandAuthMode(_0x4e7516);let _0x486287='';if(_0x7740fa!==_0x936a8f(0x1f8)){_0x486287=_0xa87e1f[_0x936a8f(0x1e7)]()||'';if(!_0x486287){if(_0x7740fa==='required')throw CliErrors[_0x936a8f(0x1ed)]();}else{const {setActiveCookie:_0x5e2321}=await import(_0x936a8f(0x1d3));_0x5e2321(_0x486287);}}const _0x33d58e=_0xa87e1f[_0x936a8f(0x1bf)]()??'';if(_0x4e7516[_0x936a8f(0x1bd)]!==![]){assertEnvAppCodeNotIgnored(_0x33d58e,resolveEnvAppCode(),hasExplicitAppCode(_0x1d9011,_0xa87e1f[_0x936a8f(0x1d8)]));if(!_0x33d58e)throw CliErrors[_0x936a8f(0x1ea)](_0x936a8f(0x1ce)+CLI_BIN_NAME+_0x936a8f(0x1d5));}return{'defaults':{'booleans':{'verbose':_0xa87e1f[_0x936a8f(0x1d4)]},'numbers':{'pagesize':_0xa87e1f['defaultPageSize']}},'extras':{'appCode':_0x33d58e,'cookie':_0x486287,'apiDomain':_0xa87e1f[_0x936a8f(0x1e6)](),'apiDir':_0x2ac0e6,'selectedAppName':_0xa87e1f[_0x936a8f(0x1f9)],'mergedCli':_0xa87e1f[_0x936a8f(0x1e0)]}};},'confirmHighRisk':_0x168503[_0x1914d3(0x1d9)]??(async({env:_0x20322e,commandLabel:_0x15cd8e})=>{const _0x22b438=_0x1914d3;if(_0x20322e['isNonInteractive'])throw CliErrors[_0x22b438(0x1c4)](_0x22b438(0x1e9)+_0x15cd8e+_0x22b438(0x1f5));await requireConfirmationPrompt({'lines':[_0x22b438(0x1c2)+_0x15cd8e,_0x22b438(0x1e5)],'createCancelledError':_0x4d2cfc=>CliErrors[_0x22b438(0x1ca)](_0x4d2cfc)});}),async 'finalize'(){await clearRabetbaseCommandState();}};}const terminalRunnerAdapter=createRabetbaseRunnerAdapter();async function clearRabetbaseCommandState(){const {clearActiveCookie:_0x4277e5}=await import('../core/api-client.js');_0x4277e5();}export async function finalizeRabetbaseRuntimeState(){const _0x401bd1=a248_0x275e;try{await clearRabetbaseCommandState();}finally{const [{initDomains:_0x164976},{initEnv:_0x3ae84e}]=await Promise['all']([import('../constant/domain.js'),import('../constant/env.js')]);_0x164976(),_0x3ae84e(_0x401bd1(0x1eb));}}export async function runCommand(_0xdef441,_0xafd0bb,_0x54a531=terminalRunnerAdapter){const _0x1384cc=a248_0x275e;assertRejectedFlags(_0xdef441,_0xafd0bb[_0x1384cc(0x1d8)]),await runCommandWithAdapter(shouldAttachUpdateNotice(_0xdef441)?withUpdateNotice(_0xdef441):_0xdef441,_0xafd0bb,_0x54a531);}function assertRejectedFlags(_0x44c6e8,_0x31016b){const _0x381ea3=a248_0x275e;for(const _0x26b46e of _0x44c6e8['rejectedFlags']??[]){const _0x1f9f82=GLOBAL_FLAGS[_0x381ea3(0x1d2)](_0x5ab890=>_0x5ab890[_0x381ea3(0x1d1)]===_0x26b46e[_0x381ea3(0x1d1)]),_0x5d8aa2=new Set([_0x26b46e[_0x381ea3(0x1d1)],toCamelCase(_0x26b46e['name']),_0x1f9f82?.['meowKey']]),_0x3767f0=[..._0x5d8aa2]['some'](_0x1a7b19=>{if(!_0x1a7b19)return![];const _0x1eafce=_0x31016b[_0x1a7b19];return _0x1eafce!==undefined&&_0x1eafce!==null&&_0x1eafce!==![];});if(_0x3767f0)throw CliErrors[_0x381ea3(0x1c4)](_0x26b46e['message'],_0x26b46e[_0x381ea3(0x1b7)]);}}function toCamelCase(_0x2ae8b8){const _0x117aa9=a248_0x275e;return _0x2ae8b8[_0x117aa9(0x1dd)](/-([a-z])/g,(_0x59c2a9,_0x3dbddd)=>_0x3dbddd[_0x117aa9(0x1c7)]());}function shouldAttachUpdateNotice(_0x184125){const _0x432341=a248_0x275e;if(_0x184125['hasFormat']===![])return![];return![_0x432341(0x1fa),'schema',_0x432341(0x1da)][_0x432341(0x1b9)](_0x184125[_0x432341(0x1f0)]);}function withUpdateNotice(_0x4caca9){return{..._0x4caca9,async 'execute'(_0x149958){const _0x460979=a248_0x275e,_0x4fe4d6=shouldResolveUpdateNotice(_0x149958)?resolveLatestUpdateNotice()['catch'](()=>null):Promise[_0x460979(0x1f4)](null),_0x252df2=await _0x4caca9[_0x460979(0x1f6)](_0x149958);return attachUpdateNotice(_0x252df2,await _0x4fe4d6);}};}function a248_0x275e(_0xe1bcef,_0x58b686){_0xe1bcef=_0xe1bcef-0x1b6;const _0x1af525=a248_0x1af5();let _0x275e2a=_0x1af525[_0xe1bcef];return _0x275e2a;}function shouldResolveUpdateNotice(_0x3d7a01){const _0x313504=a248_0x275e;return _0x3d7a01[_0x313504(0x1cf)]===_0x313504(0x1f2)&&!_0x3d7a01[_0x313504(0x1cc)];}function attachUpdateNotice(_0x310b6a,_0x3c772b){const _0xef5b7b=a248_0x275e;if(!_0x3c772b||!_0x310b6a||typeof _0x310b6a!==_0xef5b7b(0x1d6))return _0x310b6a;const _0x8ad450=_0x310b6a,_0x55380c=typeof _0x8ad450[_0xef5b7b(0x1c0)]===_0xef5b7b(0x1d6)&&_0x8ad450[_0xef5b7b(0x1c0)]!==null?_0x8ad450[_0xef5b7b(0x1c0)]:{};return{..._0x8ad450,'_notice':{..._0x55380c,'update':_0x3c772b}};}
|