@lovrabet/rabetbase-cli 2.4.6 → 2.4.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-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-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/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/search.d.ts +2 -0
- package/lib/commands/kb/search.js +1 -0
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/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.d.ts +16 -0
- 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/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 +4 -4
- package/skills/rabetbase/references/rabetbase-kb.md +13 -3
- package/skills/rabetbase.manifest.json +3 -3
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4afadb,_0x3ef1f7){const _0x585312=a230_0x51ae,_0x1f39a1=_0x4afadb();while(!![]){try{const _0x269ea2=-parseInt(_0x585312(0x185))/0x1+parseInt(_0x585312(0x188))/0x2+parseInt(_0x585312(0x182))/0x3*(parseInt(_0x585312(0x190))/0x4)+parseInt(_0x585312(0x192))/0x5*(-parseInt(_0x585312(0x18b))/0x6)+parseInt(_0x585312(0x186))/0x7+parseInt(_0x585312(0x18d))/0x8*(parseInt(_0x585312(0x18e))/0x9)+-parseInt(_0x585312(0x18c))/0xa;if(_0x269ea2===_0x3ef1f7)break;else _0x1f39a1['push'](_0x1f39a1['shift']());}catch(_0x322684){_0x1f39a1['push'](_0x1f39a1['shift']());}}}(a230_0x2b9b,0xcb466));function a230_0x51ae(_0x342f8a,_0x338a6f){_0x342f8a=_0x342f8a-0x182;const _0x2b9bad=a230_0x2b9b();let _0x51ae43=_0x2b9bad[_0x342f8a];return _0x51ae43;}import a230_0x5c4ad4 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x1d28a9){const _0xc5024b=a230_0x51ae;return JSON[_0xc5024b(0x18a)](JSON[_0xc5024b(0x187)](_0x1d28a9),null,0x2)+'\x0a';}function a230_0x2b9b(){const _0x1572b8=['parse','1049286oFaUTu','hex','stringify','30WVoDgH','18923360ptWxyu','3456536GOaawg','9ZVZzAo','createHash','43804GJBtWa','digest','388780ZLxKLg','411sIotvs','md5','utf8','992161AUXOXT','11542258WKdVII'];a230_0x2b9b=function(){return _0x1572b8;};return a230_0x2b9b();}export function computePageContentHash(_0x523c70){const _0x1f8237=a230_0x51ae;return a230_0x5c4ad4[_0x1f8237(0x18f)](_0x1f8237(0x183))['update'](_0x523c70)[_0x1f8237(0x191)](_0x1f8237(0x189));}export function computeSerializedSchemaHash(_0x1618fb){return computePageContentHash(serializePageSchemaForFile(_0x1618fb));}export async function computePageFileHash(_0x55c8ee){const _0x36eee6=a230_0x51ae,_0x1b23cd=await readFile(_0x55c8ee,_0x36eee6(0x184));return computePageContentHash(_0x1b23cd);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x546762,_0x2022c9){const _0x45aa20=a231_0x5d1f,_0x28700c=_0x546762();while(!![]){try{const _0x4aa18f=parseInt(_0x45aa20(0x1b1))/0x1*(parseInt(_0x45aa20(0x1bf))/0x2)+-parseInt(_0x45aa20(0x1b0))/0x3*(-parseInt(_0x45aa20(0x1ae))/0x4)+parseInt(_0x45aa20(0x1be))/0x5*(parseInt(_0x45aa20(0x1bb))/0x6)+-parseInt(_0x45aa20(0x1c0))/0x7*(parseInt(_0x45aa20(0x1b2))/0x8)+parseInt(_0x45aa20(0x1ac))/0x9*(parseInt(_0x45aa20(0x1b6))/0xa)+-parseInt(_0x45aa20(0x1b4))/0xb*(-parseInt(_0x45aa20(0x1ad))/0xc)+-parseInt(_0x45aa20(0x1b8))/0xd;if(_0x4aa18f===_0x2022c9)break;else _0x28700c['push'](_0x28700c['shift']());}catch(_0x420442){_0x28700c['push'](_0x28700c['shift']());}}}(a231_0x1766,0x434de));import{mkdir,readFile,writeFile}from'node:fs/promises';function a231_0x1766(){const _0x282fad=['apps','459503UJTVKs','stringify','1881670PVJKsr','object','12083916GhvbIE','utf8','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','1465242SUAKKN','lastSync','pages','5ijPIfV','2sRSJUh','105kOmzAy','18NPImAG','12CDFtXR','1016956zsmqyq','parse','3ZwCEUV','435432lpBqae','78280xxIVGE'];a231_0x1766=function(){return _0x282fad;};return a231_0x1766();}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x4b5438,_0x1e2e5d){const _0x3b1636=a231_0x5d1f,_0x3aa0cf={'apps':_0x4b5438[_0x3b1636(0x1b3)]&&typeof _0x4b5438[_0x3b1636(0x1b3)]===_0x3b1636(0x1b7)?_0x4b5438[_0x3b1636(0x1b3)]:{}};let _0xc531a3=_0x3aa0cf[_0x3b1636(0x1b3)][_0x1e2e5d];if(!_0xc531a3)return _0xc531a3={'lastSync':'','pages':{}},_0x3aa0cf[_0x3b1636(0x1b3)][_0x1e2e5d]=_0xc531a3,{'lockData':_0x3aa0cf,'appLock':_0xc531a3};return!_0xc531a3['lastSync']&&(_0xc531a3[_0x3b1636(0x1bc)]=''),(!_0xc531a3[_0x3b1636(0x1bd)]||typeof _0xc531a3[_0x3b1636(0x1bd)]!==_0x3b1636(0x1b7))&&(_0xc531a3[_0x3b1636(0x1bd)]={}),{'lockData':_0x3aa0cf,'appLock':_0xc531a3};}export async function readPageLockFile(_0x203904){const _0x5b22ac=a231_0x5d1f;try{const _0x29b7dc=await readFile(_0x203904,_0x5b22ac(0x1b9)),_0x5c29ee=JSON[_0x5b22ac(0x1af)](_0x29b7dc);return{'apps':_0x5c29ee[_0x5b22ac(0x1b3)]&&typeof _0x5c29ee[_0x5b22ac(0x1b3)]==='object'?_0x5c29ee[_0x5b22ac(0x1b3)]:{}};}catch(_0x2d22fa){if(_0x2d22fa['code']==='ENOENT')return null;throw new Error(_0x5b22ac(0x1ba)+String(_0x2d22fa));}}function a231_0x5d1f(_0x5a23ad,_0x71a8){_0x5a23ad=_0x5a23ad-0x1ac;const _0x1766ad=a231_0x1766();let _0x5d1fbd=_0x1766ad[_0x5a23ad];return _0x5d1fbd;}export async function writePageLockFile(_0x5b676c,_0x20e9c7){const _0x4dd79f=a231_0x5d1f;await mkdir(dirname(_0x5b676c),{'recursive':!![]}),await writeFile(_0x5b676c,JSON[_0x4dd79f(0x1b5)](_0x20e9c7,null,0x2),_0x4dd79f(0x1b9));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2db3ed,_0x2a0501){const _0x4f4d6e=a232_0x5817,_0x5eae6a=_0x2db3ed();while(!![]){try{const _0x780c88=parseInt(_0x4f4d6e(0xe6))/0x1+parseInt(_0x4f4d6e(0xbb))/0x2*(parseInt(_0x4f4d6e(0xd9))/0x3)+-parseInt(_0x4f4d6e(0xd2))/0x4+parseInt(_0x4f4d6e(0xc7))/0x5+parseInt(_0x4f4d6e(0xd5))/0x6+parseInt(_0x4f4d6e(0x101))/0x7*(-parseInt(_0x4f4d6e(0xc1))/0x8)+parseInt(_0x4f4d6e(0xf1))/0x9*(parseInt(_0x4f4d6e(0xfd))/0xa);if(_0x780c88===_0x2a0501)break;else _0x5eae6a['push'](_0x5eae6a['shift']());}catch(_0x1d9bc1){_0x5eae6a['push'](_0x5eae6a['shift']());}}}(a232_0x2244,0x3ada8));function a232_0x2244(){const _0x3c6076=['JOIN_INDEX_NOT_USABLE','metadataAvailable','1281675RznmFU','includes','full','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','slice','map','unsupportedReason','position','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','inner','__sq__','1850004wGTJej','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','add','877650wCDIpZ','replaceAll','min','join','15CnBgTz','exec','matchAll','columns','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','\x5c$&','(?:^|[^\x5cw$])','tableName','sort','indexes','INNER','match','length','393371EBZYZW','test','replace','filter','toUpperCase','trim','push','unavailable','index','INDEX_METADATA_UNAVAILABLE','endsWith','9uWfxWw','some','JOIN_PREDICATE_UNSUPPORTED','table','reduce','warning','matchedPrefix','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','max','covered','JOIN_INDEX_MISSING','left','1993850bNCiTT','natural','split','containsUnresolvedInclude','3361827gjozgy','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','toLowerCase','search','from','75384RlOVUF','indexOf','right','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','has','\x5cs*\x5c.\x5cs*[\x5cw$]+','8LIJxeC','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','alias','unknown'];a232_0x2244=function(){return _0x3c6076;};return a232_0x2244();}import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x2f3f83,_0x9965c){const _0x43caca=a232_0x5817,_0x4b433d=[],_0x531069=normalizeSqlForStaticAnalysis(_0x2f3f83),_0x5b8b87=(_0x531069['error']?[]:extractJoinFacts(_0x531069['sql']))['map'](_0x2bb1d7=>{const _0x2ac161=a232_0x5817;if(_0x2bb1d7['unsupportedPredicate']||_0x2bb1d7[_0x2ac161(0xdc)]['length']===0x0)return _0x4b433d[_0x2ac161(0xec)]({'code':_0x2ac161(0xf3),'table':_0x2bb1d7[_0x2ac161(0xf4)],'alias':_0x2bb1d7[_0x2ac161(0xc3)],'columns':_0x2bb1d7[_0x2ac161(0xdc)],'reason':_0x2bb1d7[_0x2ac161(0xcd)]??_0x2ac161(0xdd)}),{'table':_0x2bb1d7['table'],'alias':_0x2bb1d7[_0x2ac161(0xc3)],'columns':_0x2bb1d7['columns'],'status':_0x2ac161(0xed)};const _0x15f159=resolveTableMetadata(_0x9965c,_0x2bb1d7[_0x2ac161(0xf4)]),_0x4d13f5=(_0x15f159?.[_0x2ac161(0xe2)]??[])[_0x2ac161(0xcc)](_0x168c29=>({'index':_0x168c29,'matchedPrefix':findEqualityPrefix(_0x168c29['columns'],_0x2bb1d7[_0x2ac161(0xdc)])}))[_0x2ac161(0xe9)](_0x2b84f4=>_0x2b84f4[_0x2ac161(0xf7)][_0x2ac161(0xe5)]>0x0),_0xafd557=_0x4d13f5[_0x2ac161(0xf5)]((_0x7a7b6e,_0x3035ae)=>!_0x7a7b6e||_0x3035ae[_0x2ac161(0xf7)]['length']>_0x7a7b6e[_0x2ac161(0xf7)][_0x2ac161(0xe5)]?_0x3035ae:_0x7a7b6e,_0x4d13f5[0x0]);if(_0xafd557)return{'table':_0x2bb1d7[_0x2ac161(0xf4)],'alias':_0x2bb1d7[_0x2ac161(0xc3)],'columns':_0x2bb1d7[_0x2ac161(0xdc)],'status':_0x2ac161(0xfa),'matchedIndex':{..._0xafd557[_0x2ac161(0xee)],'matchedPrefix':_0xafd557[_0x2ac161(0xf7)]}};const _0xb1cc35=_0x15f159?.[_0x2ac161(0xe2)][_0x2ac161(0xe9)](_0x4278ae=>_0x4278ae[_0x2ac161(0xdc)][_0x2ac161(0xf2)](_0x580c0a=>_0x2bb1d7[_0x2ac161(0xdc)][_0x2ac161(0xf2)](_0x3ed2a1=>columnNamesMatch(_0x580c0a,_0x3ed2a1))))??[];if(_0xb1cc35[_0x2ac161(0xe5)]>0x0)return _0x4b433d[_0x2ac161(0xec)]({'code':_0x2ac161(0xc5),'table':_0x2bb1d7[_0x2ac161(0xf4)],'alias':_0x2bb1d7[_0x2ac161(0xc3)],'columns':_0x2bb1d7[_0x2ac161(0xdc)],'reason':_0x2ac161(0x102)}),{'table':_0x2bb1d7[_0x2ac161(0xf4)],'alias':_0x2bb1d7[_0x2ac161(0xc3)],'columns':_0x2bb1d7[_0x2ac161(0xdc)],'status':_0x2ac161(0xf6),'candidateIndexes':_0xb1cc35};if(_0x15f159&&_0x15f159[_0x2ac161(0xc6)]!==![]&&_0x15f159['indexes'][_0x2ac161(0xe5)]>0x0&&_0x2bb1d7[_0x2ac161(0xdc)][_0x2ac161(0xe5)]>0x0)return _0x4b433d['push']({'code':_0x2ac161(0xfb),'table':_0x2bb1d7[_0x2ac161(0xf4)],'alias':_0x2bb1d7['alias'],'columns':_0x2bb1d7[_0x2ac161(0xdc)],'reason':_0x2ac161(0xbe)}),{'table':_0x2bb1d7[_0x2ac161(0xf4)],'alias':_0x2bb1d7[_0x2ac161(0xc3)],'columns':_0x2bb1d7[_0x2ac161(0xdc)],'status':_0x2ac161(0xf6)};return _0x4b433d[_0x2ac161(0xec)]({'code':_0x2ac161(0xef),'table':_0x2bb1d7[_0x2ac161(0xf4)],'alias':_0x2bb1d7[_0x2ac161(0xc3)],'columns':_0x2bb1d7[_0x2ac161(0xdc)],'reason':_0x15f159?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':_0x2ac161(0xc2)}),{'table':_0x2bb1d7[_0x2ac161(0xf4)],'alias':_0x2bb1d7[_0x2ac161(0xc3)],'columns':_0x2bb1d7[_0x2ac161(0xdc)],'status':_0x2ac161(0xed)};});return{'checked':_0x5b8b87[_0x43caca(0xe5)]>0x0,'joins':_0x5b8b87,'warnings':_0x4b433d};}function extractJoinFacts(_0x250e4b){const _0x1dcf60=a232_0x5817,_0x470cea=maskNestedQueries(stripSqlNoise(_0x250e4b)),_0x2761ae=maskQuotedIdentifiers(_0x470cea),_0x5f3db3=[],_0x5b24f0=new Set(),_0x1a74c8=/\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 _0x2eed91 of _0x470cea[_0x1dcf60(0xdb)](_0x1a74c8)){const _0x4073e5=_0x2eed91[_0x1dcf60(0xee)]??0x0,_0x1fe8f0=_0x2eed91[0x0][_0x1dcf60(0x104)](/\bJOIN\b/i),_0x5ccb48=_0x4073e5+Math[_0x1dcf60(0xf9)](0x0,_0x1fe8f0);if(!/^JOIN\b/i['test'](_0x2761ae['slice'](_0x5ccb48)))continue;_0x5b24f0[_0x1dcf60(0xd4)](_0x5ccb48);const _0x7fa764=normalizeIdentifier(_0x2eed91[0x1]||_0x1dcf60(0xe3)),_0x5d8e92=normalizeIdentifier(_0x2eed91[0x2]??''),_0x46c973=normalizeIdentifier(_0x2eed91[0x3]||_0x5d8e92[_0x1dcf60(0xff)]('.')['at'](-0x1)||_0x5d8e92),_0x18858c=[],_0x25ba56=_0x5d8e92==='__sq__';let _0x71f3b8=_0x7fa764===_0x1dcf60(0xbd)||_0x7fa764===_0x1dcf60(0xc9)||_0x25ba56,_0x1749fe=_0x71f3b8?_0x25ba56?_0x1dcf60(0xca):_0x7fa764[_0x1dcf60(0xea)]()+_0x1dcf60(0xd3):undefined;const _0xf36d6c=stripOuterParentheses(_0x2eed91[0x4]??''),_0x36f345=_0xf36d6c[_0x1dcf60(0xc8)](MYBATIS_DYNAMIC_START_MARKER)||_0xf36d6c['includes'](MYBATIS_DYNAMIC_END_MARKER),_0x28974b=_0xf36d6c['includes'](MYBATIS_INCLUDE_MARKER);_0x36f345&&(_0x71f3b8=!![],_0x1749fe??='MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.');_0x28974b&&(_0x71f3b8=!![],_0x1749fe??=_0x1dcf60(0xcf));const _0x316231=_0xf36d6c[_0x1dcf60(0xd6)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x1dcf60(0xd6)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x316231,'OR')&&(_0x71f3b8=!![],_0x1749fe??=_0x1dcf60(0xf8));for(const _0x41083c of splitTopLevelAnd(_0x316231)){const _0x38df1b=stripOuterParentheses(_0x41083c);if(hasTopLevelKeyword(_0x38df1b,'OR')){_0x71f3b8=!![],_0x1749fe??=_0x1dcf60(0xf8);continue;}const _0x1fbbde=splitEquality(_0x38df1b);if(!_0x1fbbde){containsColumnReference(_0x41083c,_0x46c973)&&(_0x71f3b8=!![]);continue;}const _0x34844c=parseDirectColumnReference(_0x1fbbde[0x0],_0x46c973),_0x5f4873=parseDirectColumnReference(_0x1fbbde[0x1],_0x46c973),_0x57b0cd=containsColumnReference(_0x1fbbde[0x0],_0x46c973),_0x1e8435=containsColumnReference(_0x1fbbde[0x1],_0x46c973),_0x3028e3=_0x34844c&&!_0x1e8435?_0x34844c:_0x5f4873&&!_0x57b0cd?_0x5f4873:null;if(_0x3028e3&&!_0x18858c[_0x1dcf60(0xc8)](_0x3028e3))_0x18858c[_0x1dcf60(0xec)](_0x3028e3);else!_0x3028e3&&containsColumnReference(_0x41083c,_0x46c973)&&(_0x71f3b8=!![]);}_0x5f3db3['push']({'table':_0x5d8e92,'alias':_0x46c973,'columns':_0x18858c,'unsupportedPredicate':_0x71f3b8,'unsupportedReason':_0x1749fe,'containsUnresolvedInclude':_0x28974b,'position':_0x5ccb48});}for(const _0x2c68c3 of _0x2761ae['matchAll'](/\bJOIN\b/gi)){const _0x380df2=_0x2c68c3[_0x1dcf60(0xee)]??0x0;if(_0x5b24f0[_0x1dcf60(0xbf)](_0x380df2))continue;const _0x241d85=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x1dcf60(0xda)](_0x470cea['slice'](_0x380df2+_0x2c68c3[0x0][_0x1dcf60(0xe5)])),_0x1b3cb8=normalizeIdentifier(_0x241d85?.[0x1]||'unknown'),_0x420fca=normalizeIdentifier(_0x241d85?.[0x2]||''),_0x57cddf=isSqlClauseKeyword(_0x420fca)?_0x1b3cb8['split']('.')['at'](-0x1)||_0x1b3cb8:_0x420fca||_0x1b3cb8[_0x1dcf60(0xff)]('.')['at'](-0x1)||_0x1b3cb8;_0x5f3db3[_0x1dcf60(0xec)]({'table':_0x1b3cb8,'alias':_0x57cddf,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x380df2});}const _0xa30783=_0x2761ae[_0x1dcf60(0xbc)](MYBATIS_INCLUDE_MARKER);return _0xa30783>=0x0&&!_0x5f3db3[_0x1dcf60(0xf2)](_0x3c33d9=>_0x3c33d9[_0x1dcf60(0x100)])&&_0x5f3db3[_0x1dcf60(0xec)]({'table':_0x1dcf60(0xc4),'alias':_0x1dcf60(0xc4),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','containsUnresolvedInclude':!![],'position':_0xa30783}),_0x5f3db3[_0x1dcf60(0xe1)]((_0x53899a,_0x3812c0)=>_0x53899a[_0x1dcf60(0xce)]-_0x3812c0['position']);}function stripSqlNoise(_0x3eadc7){const _0x5d4b2b=a232_0x5817,_0x3678a9=Array['from'](_0x3eadc7),_0x49e4a8=(_0x4eaaff,_0x408226)=>{for(let _0xb056c7=_0x4eaaff;_0xb056c7<_0x408226;_0xb056c7+=0x1){_0x3678a9[_0xb056c7]!=='\x0a'&&_0x3678a9[_0xb056c7]!=='\x0d'&&(_0x3678a9[_0xb056c7]='\x20');}};for(let _0xa01dae=0x0;_0xa01dae<_0x3678a9[_0x5d4b2b(0xe5)];_0xa01dae+=0x1){const _0x3e089b=_0x3678a9[_0xa01dae],_0x46ada7=_0x3678a9[_0xa01dae+0x1];if(_0x3e089b==='\x27'||_0x3e089b==='\x22'||_0x3e089b==='`'){const _0x3a2474=_0x3e089b,_0x5abf5b=_0xa01dae;_0xa01dae+=0x1;while(_0xa01dae<_0x3678a9[_0x5d4b2b(0xe5)]){if(_0x3678a9[_0xa01dae]==='\x5c'&&_0xa01dae+0x1<_0x3678a9[_0x5d4b2b(0xe5)]){_0xa01dae+=0x2;continue;}if(_0x3678a9[_0xa01dae]!==_0x3a2474){_0xa01dae+=0x1;continue;}if(_0x3678a9[_0xa01dae+0x1]===_0x3a2474){_0xa01dae+=0x2;continue;}break;}if(_0x3a2474==='\x27')_0x49e4a8(_0x5abf5b,Math['min'](_0xa01dae+0x1,_0x3678a9[_0x5d4b2b(0xe5)]));continue;}if(_0x3e089b==='-'&&_0x46ada7==='-'){const _0x5c5f70=_0xa01dae;while(_0xa01dae<_0x3678a9[_0x5d4b2b(0xe5)]&&_0x3678a9[_0xa01dae]!=='\x0a')_0xa01dae+=0x1;_0x49e4a8(_0x5c5f70,_0xa01dae);continue;}if(_0x3e089b==='/'&&_0x46ada7==='*'){const _0x2870b8=_0xa01dae;_0xa01dae+=0x2;while(_0xa01dae<_0x3678a9[_0x5d4b2b(0xe5)]&&!(_0x3678a9[_0xa01dae]==='*'&&_0x3678a9[_0xa01dae+0x1]==='/')){_0xa01dae+=0x1;}_0xa01dae=Math[_0x5d4b2b(0xd7)](_0xa01dae+0x1,_0x3678a9['length']-0x1),_0x49e4a8(_0x2870b8,_0xa01dae+0x1);continue;}if(_0x3e089b==='#'&&_0x46ada7!=='{'){const _0x1fe54d=_0xa01dae;while(_0xa01dae<_0x3678a9[_0x5d4b2b(0xe5)]&&_0x3678a9[_0xa01dae]!=='\x0a')_0xa01dae+=0x1;_0x49e4a8(_0x1fe54d,_0xa01dae);continue;}if((_0x3e089b==='#'||_0x3e089b==='$')&&_0x46ada7==='{'){const _0x423b05=_0xa01dae;_0xa01dae+=0x2;while(_0xa01dae<_0x3678a9[_0x5d4b2b(0xe5)]&&_0x3678a9[_0xa01dae]!=='}')_0xa01dae+=0x1;_0x49e4a8(_0x423b05,Math[_0x5d4b2b(0xd7)](_0xa01dae+0x1,_0x3678a9[_0x5d4b2b(0xe5)]));}}return _0x3678a9[_0x5d4b2b(0xd8)]('');}function maskQuotedIdentifiers(_0x12c517){const _0x51ef69=a232_0x5817,_0x3a71d7=Array[_0x51ef69(0xba)](_0x12c517);for(let _0x3d8e75=0x0;_0x3d8e75<_0x3a71d7['length'];_0x3d8e75+=0x1){const _0x5b3909=_0x3a71d7[_0x3d8e75];if(_0x5b3909!=='\x22'&&_0x5b3909!=='`')continue;_0x3d8e75+=0x1;while(_0x3d8e75<_0x3a71d7[_0x51ef69(0xe5)]){if(_0x3a71d7[_0x3d8e75]===_0x5b3909){if(_0x3a71d7[_0x3d8e75+0x1]===_0x5b3909){_0x3a71d7[_0x3d8e75]='\x20',_0x3a71d7[_0x3d8e75+0x1]='\x20',_0x3d8e75+=0x2;continue;}break;}_0x3a71d7[_0x3d8e75]='\x20',_0x3d8e75+=0x1;}}return _0x3a71d7['join']('');}function maskNestedQueries(_0x100571){const _0x206794=a232_0x5817,_0x189f2d=Array['from'](_0x100571);for(let _0x18e11a=0x0;_0x18e11a<_0x189f2d[_0x206794(0xe5)];_0x18e11a+=0x1){if(_0x189f2d[_0x18e11a]!=='(')continue;const _0x1a6e0e=_0x100571['slice'](_0x18e11a+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x206794(0xe7)](_0x1a6e0e))continue;let _0x28070e=0x1,_0xc7c096=_0x18e11a+0x1;for(;_0xc7c096<_0x189f2d[_0x206794(0xe5)]&&_0x28070e>0x0;_0xc7c096+=0x1){if(_0x189f2d[_0xc7c096]==='(')_0x28070e+=0x1;if(_0x189f2d[_0xc7c096]===')')_0x28070e-=0x1;}if(_0x28070e!==0x0)continue;for(let _0x2b9435=_0x18e11a;_0x2b9435<_0xc7c096;_0x2b9435+=0x1){_0x189f2d[_0x2b9435]='\x20';}const _0x405afc=_0x206794(0xd1);for(let _0x53b028=0x0;_0x53b028<_0x405afc[_0x206794(0xe5)]&&_0x18e11a+_0x53b028<_0xc7c096;_0x53b028+=0x1){_0x189f2d[_0x18e11a+_0x53b028]=_0x405afc[_0x53b028];}_0x18e11a=_0xc7c096-0x1;}return _0x189f2d['join']('');}function splitTopLevelAnd(_0x5d5c52){const _0x36ddd6=a232_0x5817,_0xf3e564=[];let _0x4bdd96=0x0,_0xa5b9b4=0x0;for(let _0x1e8fb0=0x0;_0x1e8fb0<_0x5d5c52[_0x36ddd6(0xe5)];_0x1e8fb0+=0x1){const _0x202ce4=_0x5d5c52[_0x1e8fb0];if(_0x202ce4==='(')_0x4bdd96+=0x1;if(_0x202ce4===')')_0x4bdd96=Math[_0x36ddd6(0xf9)](0x0,_0x4bdd96-0x1);_0x4bdd96===0x0&&_0x5d5c52[_0x36ddd6(0xcb)](_0x1e8fb0)[_0x36ddd6(0xe4)](/^AND\b/i)&&(_0x1e8fb0===0x0||/\s/['test'](_0x5d5c52[_0x1e8fb0-0x1]??''))&&(_0xf3e564[_0x36ddd6(0xec)](_0x5d5c52['slice'](_0xa5b9b4,_0x1e8fb0)[_0x36ddd6(0xeb)]()),_0x1e8fb0+=0x2,_0xa5b9b4=_0x1e8fb0+0x1);}const _0x3c6fe9=_0x5d5c52[_0x36ddd6(0xcb)](_0xa5b9b4)[_0x36ddd6(0xeb)]();if(_0x3c6fe9)_0xf3e564[_0x36ddd6(0xec)](_0x3c6fe9);return _0xf3e564;}function hasTopLevelKeyword(_0x18f7ab,_0x584e31){const _0x25053f=a232_0x5817;let _0x11643c=0x0;for(let _0xb42374=0x0;_0xb42374<_0x18f7ab[_0x25053f(0xe5)];_0xb42374+=0x1){const _0x32122e=_0x18f7ab[_0xb42374];if(_0x32122e==='(')_0x11643c+=0x1;if(_0x32122e===')')_0x11643c=Math['max'](0x0,_0x11643c-0x1);if(_0x11643c!==0x0)continue;const _0x4b68b9=_0x18f7ab[_0x25053f(0xcb)](_0xb42374,_0xb42374+_0x584e31[_0x25053f(0xe5)]),_0x4fcf3a=_0x18f7ab[_0xb42374-0x1]??'\x20',_0x2b1861=_0x18f7ab[_0xb42374+_0x584e31['length']]??'\x20';if(_0x4b68b9['toUpperCase']()===_0x584e31['toUpperCase']()&&!/[\w$]/[_0x25053f(0xe7)](_0x4fcf3a)&&!/[\w$]/[_0x25053f(0xe7)](_0x2b1861))return!![];}return![];}function a232_0x5817(_0x3b9370,_0x5e9a2c){_0x3b9370=_0x3b9370-0xba;const _0x2244d8=a232_0x2244();let _0x5817bd=_0x2244d8[_0x3b9370];return _0x5817bd;}function splitEquality(_0x542ee5){const _0xba2745=a232_0x5817,_0x2cadde=stripOuterParentheses(_0x542ee5);let _0x25ac16=0x0,_0x5d6277;for(let _0x8dc69e=0x0;_0x8dc69e<_0x2cadde[_0xba2745(0xe5)];_0x8dc69e+=0x1){const _0x51abdb=_0x2cadde[_0x8dc69e];if(_0x51abdb==='(')_0x25ac16+=0x1;if(_0x51abdb===')')_0x25ac16=Math['max'](0x0,_0x25ac16-0x1);const _0x7731f7=_0x2cadde[_0x8dc69e-0x1]??'',_0x2b8b58=_0x2cadde[_0x8dc69e+0x1]??'';if(_0x51abdb==='='&&_0x25ac16===0x0&&!/[!<>=:]/[_0xba2745(0xe7)](_0x7731f7)&&_0x2b8b58!=='='){if(_0x5d6277!==undefined)return null;_0x5d6277=_0x8dc69e;}}return _0x5d6277===undefined?null:[_0x2cadde['slice'](0x0,_0x5d6277)[_0xba2745(0xeb)](),_0x2cadde[_0xba2745(0xcb)](_0x5d6277+0x1)[_0xba2745(0xeb)]()];}function parseDirectColumnReference(_0xd975a3,_0x549554){const _0x4b68d7=a232_0x5817,_0x2d5fab=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x4b68d7(0xda)](stripOuterParentheses(_0xd975a3));if(!_0x2d5fab)return null;if(normalizeIdentifier(_0x2d5fab[0x1]??'')!==normalizeIdentifier(_0x549554))return null;return normalizeIdentifier(_0x2d5fab[0x2]??'');}function containsColumnReference(_0x297a83,_0x516751){const _0x36d55e=a232_0x5817,_0x216993=_0x297a83[_0x36d55e(0xe8)](/[`"]/g,''),_0x4b20bb=_0x516751['replace'](/[.*+?^${}()|[\]\\]/g,_0x36d55e(0xde));return new RegExp(_0x36d55e(0xdf)+_0x4b20bb+_0x36d55e(0xc0),'i')[_0x36d55e(0xe7)](_0x216993);}function findEqualityPrefix(_0x11fda1,_0x52cd00){const _0x2b85bb=a232_0x5817,_0x176029=new Set(_0x52cd00[_0x2b85bb(0xcc)](normalizeIdentifier)),_0x46752f=[];for(const _0x1e85f6 of _0x11fda1){if(!_0x176029[_0x2b85bb(0xbf)](normalizeIdentifier(_0x1e85f6)))break;_0x46752f['push'](_0x1e85f6);}return _0x46752f;}function resolveTableMetadata(_0x13dba0,_0x1f243b){const _0x35e111=a232_0x5817,_0x5636a5=normalizeIdentifier(_0x1f243b),_0x5a0970=_0x13dba0[_0x35e111(0xe9)](_0x1029ce=>normalizeIdentifier(_0x1029ce[_0x35e111(0xe0)])===_0x5636a5);if(_0x5a0970[_0x35e111(0xe5)]===0x1)return _0x5a0970[0x0];const _0x4b4880=_0x5636a5['includes']('.'),_0x438301=_0x5636a5[_0x35e111(0xff)]('.')['at'](-0x1),_0x6b7b72=_0x13dba0[_0x35e111(0xe9)](_0x1a1934=>{const _0x3b0760=_0x35e111,_0x496dd5=normalizeIdentifier(_0x1a1934[_0x3b0760(0xe0)]);if(_0x4b4880&&_0x496dd5[_0x3b0760(0xc8)]('.'))return![];return _0x496dd5[_0x3b0760(0xff)]('.')['at'](-0x1)===_0x438301;});return _0x6b7b72[_0x35e111(0xe5)]===0x1?_0x6b7b72[0x0]:undefined;}function columnNamesMatch(_0xae4e9b,_0x2e018c){return normalizeIdentifier(_0xae4e9b)===normalizeIdentifier(_0x2e018c);}function normalizeIdentifier(_0x21ad0c){const _0x5d60ae=a232_0x5817;return _0x21ad0c[_0x5d60ae(0xe8)](/[`"]/g,'')['trim']()[_0x5d60ae(0x103)]();}function isSqlClauseKeyword(_0x3d67bc){const _0x57c2d7=a232_0x5817;return new Set(['on','using','where',_0x57c2d7(0xd8),_0x57c2d7(0xd0),_0x57c2d7(0xfc),_0x57c2d7(0xbd),'full','cross',_0x57c2d7(0xfe)])[_0x57c2d7(0xbf)](_0x3d67bc);}function stripOuterParentheses(_0x48ff45){const _0x123925=a232_0x5817;let _0xf31bfd=_0x48ff45[_0x123925(0xeb)]();while(_0xf31bfd['startsWith']('(')&&_0xf31bfd[_0x123925(0xf0)](')')){let _0xe3bf0d=0x0,_0x24960c=!![];for(let _0xd12789=0x0;_0xd12789<_0xf31bfd['length'];_0xd12789+=0x1){if(_0xf31bfd[_0xd12789]==='(')_0xe3bf0d+=0x1;if(_0xf31bfd[_0xd12789]===')')_0xe3bf0d-=0x1;if(_0xe3bf0d===0x0&&_0xd12789<_0xf31bfd['length']-0x1){_0x24960c=![];break;}}if(!_0x24960c||_0xe3bf0d!==0x0)break;_0xf31bfd=_0xf31bfd[_0x123925(0xcb)](0x1,-0x1)[_0x123925(0xeb)]();}return _0xf31bfd;}
|
|
1
|
+
(function(_0x521e9c,_0x41e30b){const _0x32340f=a233_0x479c,_0x50751d=_0x521e9c();while(!![]){try{const _0x489e80=-parseInt(_0x32340f(0x132))/0x1+-parseInt(_0x32340f(0x134))/0x2+parseInt(_0x32340f(0x101))/0x3+-parseInt(_0x32340f(0x133))/0x4*(parseInt(_0x32340f(0x149))/0x5)+parseInt(_0x32340f(0x102))/0x6*(-parseInt(_0x32340f(0x140))/0x7)+parseInt(_0x32340f(0x12b))/0x8*(-parseInt(_0x32340f(0x143))/0x9)+parseInt(_0x32340f(0x127))/0xa*(parseInt(_0x32340f(0x109))/0xb);if(_0x489e80===_0x41e30b)break;else _0x50751d['push'](_0x50751d['shift']());}catch(_0x24bc76){_0x50751d['push'](_0x50751d['shift']());}}}(a233_0x8658,0x2dcd8));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x551dcd,_0x3d5953){const _0x50bc13=a233_0x479c,_0x78d4e1=[],_0x3a986b=normalizeSqlForStaticAnalysis(_0x551dcd),_0x586e33=(_0x3a986b[_0x50bc13(0x114)]?[]:extractJoinFacts(_0x3a986b[_0x50bc13(0x139)]))[_0x50bc13(0x12f)](_0x273c5a=>{const _0x43441d=_0x50bc13;if(_0x273c5a[_0x43441d(0x12e)]||_0x273c5a['columns'][_0x43441d(0x131)]===0x0)return _0x78d4e1[_0x43441d(0x130)]({'code':_0x43441d(0x13c),'table':_0x273c5a[_0x43441d(0x142)],'alias':_0x273c5a['alias'],'columns':_0x273c5a['columns'],'reason':_0x273c5a[_0x43441d(0x103)]??_0x43441d(0x12d)}),{'table':_0x273c5a[_0x43441d(0x142)],'alias':_0x273c5a[_0x43441d(0x11a)],'columns':_0x273c5a['columns'],'status':_0x43441d(0x119)};const _0x2d1c29=resolveTableMetadata(_0x3d5953,_0x273c5a[_0x43441d(0x142)]),_0x4d2943=(_0x2d1c29?.[_0x43441d(0x11b)]??[])['map'](_0xcebdcd=>({'index':_0xcebdcd,'matchedPrefix':findEqualityPrefix(_0xcebdcd[_0x43441d(0x136)],_0x273c5a['columns'])}))[_0x43441d(0x145)](_0x7110eb=>_0x7110eb[_0x43441d(0x144)][_0x43441d(0x131)]>0x0),_0x1acac2=_0x4d2943[_0x43441d(0x13e)]((_0x5bff3a,_0x2d7214)=>!_0x5bff3a||_0x2d7214[_0x43441d(0x144)][_0x43441d(0x131)]>_0x5bff3a[_0x43441d(0x144)][_0x43441d(0x131)]?_0x2d7214:_0x5bff3a,_0x4d2943[0x0]);if(_0x1acac2)return{'table':_0x273c5a[_0x43441d(0x142)],'alias':_0x273c5a['alias'],'columns':_0x273c5a[_0x43441d(0x136)],'status':_0x43441d(0x123),'matchedIndex':{..._0x1acac2[_0x43441d(0x122)],'matchedPrefix':_0x1acac2[_0x43441d(0x144)]}};const _0x537646=_0x2d1c29?.[_0x43441d(0x11b)][_0x43441d(0x145)](_0x287e16=>_0x287e16[_0x43441d(0x136)][_0x43441d(0x10b)](_0x2fc2f2=>_0x273c5a[_0x43441d(0x136)]['some'](_0x1f8a51=>columnNamesMatch(_0x2fc2f2,_0x1f8a51))))??[];if(_0x537646[_0x43441d(0x131)]>0x0)return _0x78d4e1[_0x43441d(0x130)]({'code':_0x43441d(0x118),'table':_0x273c5a['table'],'alias':_0x273c5a[_0x43441d(0x11a)],'columns':_0x273c5a[_0x43441d(0x136)],'reason':_0x43441d(0x11c)}),{'table':_0x273c5a[_0x43441d(0x142)],'alias':_0x273c5a['alias'],'columns':_0x273c5a['columns'],'status':_0x43441d(0x135),'candidateIndexes':_0x537646};if(_0x2d1c29&&_0x2d1c29[_0x43441d(0x121)]!==![]&&_0x2d1c29['indexes'][_0x43441d(0x131)]>0x0&&_0x273c5a[_0x43441d(0x136)][_0x43441d(0x131)]>0x0)return _0x78d4e1[_0x43441d(0x130)]({'code':_0x43441d(0x125),'table':_0x273c5a[_0x43441d(0x142)],'alias':_0x273c5a[_0x43441d(0x11a)],'columns':_0x273c5a[_0x43441d(0x136)],'reason':_0x43441d(0x104)}),{'table':_0x273c5a[_0x43441d(0x142)],'alias':_0x273c5a[_0x43441d(0x11a)],'columns':_0x273c5a[_0x43441d(0x136)],'status':'warning'};return _0x78d4e1[_0x43441d(0x130)]({'code':_0x43441d(0x146),'table':_0x273c5a['table'],'alias':_0x273c5a[_0x43441d(0x11a)],'columns':_0x273c5a[_0x43441d(0x136)],'reason':_0x2d1c29?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x273c5a[_0x43441d(0x142)],'alias':_0x273c5a[_0x43441d(0x11a)],'columns':_0x273c5a[_0x43441d(0x136)],'status':_0x43441d(0x119)};});return{'checked':_0x586e33['length']>0x0,'joins':_0x586e33,'warnings':_0x78d4e1};}function extractJoinFacts(_0x57e7f4){const _0x171a53=a233_0x479c,_0x5b3942=maskNestedQueries(stripSqlNoise(_0x57e7f4)),_0x447b35=maskQuotedIdentifiers(_0x5b3942),_0xb4af3b=[],_0x5de238=new Set(),_0x1a9c2b=/\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 _0x33129b of _0x5b3942[_0x171a53(0x11f)](_0x1a9c2b)){const _0x370c1a=_0x33129b[_0x171a53(0x122)]??0x0,_0x57260c=_0x33129b[0x0][_0x171a53(0x138)](/\bJOIN\b/i),_0x45e9c0=_0x370c1a+Math[_0x171a53(0x129)](0x0,_0x57260c);if(!/^JOIN\b/i[_0x171a53(0x113)](_0x447b35['slice'](_0x45e9c0)))continue;_0x5de238['add'](_0x45e9c0);const _0x253e0d=normalizeIdentifier(_0x33129b[0x1]||'INNER'),_0x541466=normalizeIdentifier(_0x33129b[0x2]??''),_0x49dc48=normalizeIdentifier(_0x33129b[0x3]||_0x541466[_0x171a53(0x141)]('.')['at'](-0x1)||_0x541466),_0x47e965=[],_0x2a810e=_0x541466===_0x171a53(0x13f);let _0x41bfc0=_0x253e0d===_0x171a53(0x10e)||_0x253e0d==='full'||_0x2a810e,_0x345e66=_0x41bfc0?_0x2a810e?_0x171a53(0x12a):_0x253e0d[_0x171a53(0x10c)]()+'\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.':undefined;const _0xc0d7ac=stripOuterParentheses(_0x33129b[0x4]??''),_0x2f134a=_0xc0d7ac[_0x171a53(0x13d)](MYBATIS_DYNAMIC_START_MARKER)||_0xc0d7ac[_0x171a53(0x13d)](MYBATIS_DYNAMIC_END_MARKER),_0x2f0d1a=_0xc0d7ac[_0x171a53(0x13d)](MYBATIS_INCLUDE_MARKER);_0x2f134a&&(_0x41bfc0=!![],_0x345e66??='MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.');_0x2f0d1a&&(_0x41bfc0=!![],_0x345e66??=_0x171a53(0x10d));const _0x989389=_0xc0d7ac[_0x171a53(0x128)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x171a53(0x128)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x171a53(0x128)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x989389,'OR')&&(_0x41bfc0=!![],_0x345e66??=_0x171a53(0x105));for(const _0x4600c0 of splitTopLevelAnd(_0x989389)){const _0xf953b9=stripOuterParentheses(_0x4600c0);if(hasTopLevelKeyword(_0xf953b9,'OR')){_0x41bfc0=!![],_0x345e66??=_0x171a53(0x105);continue;}const _0x468688=splitEquality(_0xf953b9);if(!_0x468688){containsColumnReference(_0x4600c0,_0x49dc48)&&(_0x41bfc0=!![]);continue;}const _0x40750c=parseDirectColumnReference(_0x468688[0x0],_0x49dc48),_0x271a49=parseDirectColumnReference(_0x468688[0x1],_0x49dc48),_0x49f7fe=containsColumnReference(_0x468688[0x0],_0x49dc48),_0x1ecfbb=containsColumnReference(_0x468688[0x1],_0x49dc48),_0x18fd04=_0x40750c&&!_0x1ecfbb?_0x40750c:_0x271a49&&!_0x49f7fe?_0x271a49:null;if(_0x18fd04&&!_0x47e965[_0x171a53(0x13d)](_0x18fd04))_0x47e965[_0x171a53(0x130)](_0x18fd04);else!_0x18fd04&&containsColumnReference(_0x4600c0,_0x49dc48)&&(_0x41bfc0=!![]);}_0xb4af3b[_0x171a53(0x130)]({'table':_0x541466,'alias':_0x49dc48,'columns':_0x47e965,'unsupportedPredicate':_0x41bfc0,'unsupportedReason':_0x345e66,'containsUnresolvedInclude':_0x2f0d1a,'position':_0x45e9c0});}for(const _0x4998c1 of _0x447b35['matchAll'](/\bJOIN\b/gi)){const _0x236300=_0x4998c1[_0x171a53(0x122)]??0x0;if(_0x5de238['has'](_0x236300))continue;const _0x4246f8=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x171a53(0x107)](_0x5b3942[_0x171a53(0x111)](_0x236300+_0x4998c1[0x0][_0x171a53(0x131)])),_0x4bc9b2=normalizeIdentifier(_0x4246f8?.[0x1]||_0x171a53(0x108)),_0x1dcb9c=normalizeIdentifier(_0x4246f8?.[0x2]||''),_0x159f23=isSqlClauseKeyword(_0x1dcb9c)?_0x4bc9b2['split']('.')['at'](-0x1)||_0x4bc9b2:_0x1dcb9c||_0x4bc9b2[_0x171a53(0x141)]('.')['at'](-0x1)||_0x4bc9b2;_0xb4af3b[_0x171a53(0x130)]({'table':_0x4bc9b2,'alias':_0x159f23,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x171a53(0x117),'position':_0x236300});}const _0xd79131=_0x447b35[_0x171a53(0x13a)](MYBATIS_INCLUDE_MARKER);return _0xd79131>=0x0&&!_0xb4af3b[_0x171a53(0x10b)](_0x4772e4=>_0x4772e4[_0x171a53(0x10a)])&&_0xb4af3b[_0x171a53(0x130)]({'table':'unknown','alias':_0x171a53(0x108),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','containsUnresolvedInclude':!![],'position':_0xd79131}),_0xb4af3b[_0x171a53(0x120)]((_0x39777c,_0x45bcff)=>_0x39777c[_0x171a53(0x148)]-_0x45bcff[_0x171a53(0x148)]);}function stripSqlNoise(_0x2d45db){const _0x51bd6d=a233_0x479c,_0x3834c5=Array[_0x51bd6d(0x126)](_0x2d45db),_0x5606ba=(_0x3e249b,_0x5cfb17)=>{for(let _0x587cbc=_0x3e249b;_0x587cbc<_0x5cfb17;_0x587cbc+=0x1){_0x3834c5[_0x587cbc]!=='\x0a'&&_0x3834c5[_0x587cbc]!=='\x0d'&&(_0x3834c5[_0x587cbc]='\x20');}};for(let _0xca092b=0x0;_0xca092b<_0x3834c5[_0x51bd6d(0x131)];_0xca092b+=0x1){const _0x141aeb=_0x3834c5[_0xca092b],_0x1a8ec6=_0x3834c5[_0xca092b+0x1];if(_0x141aeb==='\x27'||_0x141aeb==='\x22'||_0x141aeb==='`'){const _0x44935a=_0x141aeb,_0x4a5a65=_0xca092b;_0xca092b+=0x1;while(_0xca092b<_0x3834c5[_0x51bd6d(0x131)]){if(_0x3834c5[_0xca092b]==='\x5c'&&_0xca092b+0x1<_0x3834c5['length']){_0xca092b+=0x2;continue;}if(_0x3834c5[_0xca092b]!==_0x44935a){_0xca092b+=0x1;continue;}if(_0x3834c5[_0xca092b+0x1]===_0x44935a){_0xca092b+=0x2;continue;}break;}if(_0x44935a==='\x27')_0x5606ba(_0x4a5a65,Math['min'](_0xca092b+0x1,_0x3834c5[_0x51bd6d(0x131)]));continue;}if(_0x141aeb==='-'&&_0x1a8ec6==='-'){const _0x26cdc2=_0xca092b;while(_0xca092b<_0x3834c5[_0x51bd6d(0x131)]&&_0x3834c5[_0xca092b]!=='\x0a')_0xca092b+=0x1;_0x5606ba(_0x26cdc2,_0xca092b);continue;}if(_0x141aeb==='/'&&_0x1a8ec6==='*'){const _0x5d8cff=_0xca092b;_0xca092b+=0x2;while(_0xca092b<_0x3834c5[_0x51bd6d(0x131)]&&!(_0x3834c5[_0xca092b]==='*'&&_0x3834c5[_0xca092b+0x1]==='/')){_0xca092b+=0x1;}_0xca092b=Math[_0x51bd6d(0x116)](_0xca092b+0x1,_0x3834c5[_0x51bd6d(0x131)]-0x1),_0x5606ba(_0x5d8cff,_0xca092b+0x1);continue;}if(_0x141aeb==='#'&&_0x1a8ec6!=='{'){const _0x32023f=_0xca092b;while(_0xca092b<_0x3834c5['length']&&_0x3834c5[_0xca092b]!=='\x0a')_0xca092b+=0x1;_0x5606ba(_0x32023f,_0xca092b);continue;}if((_0x141aeb==='#'||_0x141aeb==='$')&&_0x1a8ec6==='{'){const _0x121c7d=_0xca092b;_0xca092b+=0x2;while(_0xca092b<_0x3834c5[_0x51bd6d(0x131)]&&_0x3834c5[_0xca092b]!=='}')_0xca092b+=0x1;_0x5606ba(_0x121c7d,Math['min'](_0xca092b+0x1,_0x3834c5[_0x51bd6d(0x131)]));}}return _0x3834c5[_0x51bd6d(0x147)]('');}function a233_0x8658(){const _0x3753a1=['position','20110zyilvT','left','where','590388NjtyNh','228oDtfGy','unsupportedReason','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','has','exec','unknown','1187219RpktTm','containsUnresolvedInclude','some','toUpperCase','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','right','endsWith','\x5c$&','slice','(?:^|[^\x5cw$])','test','error','tableName','min','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','JOIN_INDEX_NOT_USABLE','unavailable','alias','indexes','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','using','full','matchAll','sort','metadataAvailable','index','covered','inner','JOIN_INDEX_MISSING','from','90avTXpW','replaceAll','max','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','8YrxSRG','trim','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','unsupportedPredicate','map','push','length','368337ugiBsT','104vqLDeJ','645734ZmyiAP','warning','columns','replace','search','sql','indexOf','cross','JOIN_PREDICATE_UNSUPPORTED','includes','reduce','__sq__','28301ZCQCZb','split','table','280251AkIVuq','matchedPrefix','filter','INDEX_METADATA_UNAVAILABLE','join'];a233_0x8658=function(){return _0x3753a1;};return a233_0x8658();}function maskQuotedIdentifiers(_0x243bba){const _0x1a2a11=a233_0x479c,_0x2e1eba=Array[_0x1a2a11(0x126)](_0x243bba);for(let _0x55e2ab=0x0;_0x55e2ab<_0x2e1eba[_0x1a2a11(0x131)];_0x55e2ab+=0x1){const _0x5b0f48=_0x2e1eba[_0x55e2ab];if(_0x5b0f48!=='\x22'&&_0x5b0f48!=='`')continue;_0x55e2ab+=0x1;while(_0x55e2ab<_0x2e1eba['length']){if(_0x2e1eba[_0x55e2ab]===_0x5b0f48){if(_0x2e1eba[_0x55e2ab+0x1]===_0x5b0f48){_0x2e1eba[_0x55e2ab]='\x20',_0x2e1eba[_0x55e2ab+0x1]='\x20',_0x55e2ab+=0x2;continue;}break;}_0x2e1eba[_0x55e2ab]='\x20',_0x55e2ab+=0x1;}}return _0x2e1eba['join']('');}function a233_0x479c(_0x216ed6,_0x3b0b75){_0x216ed6=_0x216ed6-0x100;const _0x8658d6=a233_0x8658();let _0x479ccc=_0x8658d6[_0x216ed6];return _0x479ccc;}function maskNestedQueries(_0x2371e9){const _0x1e31e8=a233_0x479c,_0x59def2=Array['from'](_0x2371e9);for(let _0x3100cb=0x0;_0x3100cb<_0x59def2['length'];_0x3100cb+=0x1){if(_0x59def2[_0x3100cb]!=='(')continue;const _0x654bfb=_0x2371e9[_0x1e31e8(0x111)](_0x3100cb+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x1e31e8(0x113)](_0x654bfb))continue;let _0x3db306=0x1,_0x398bda=_0x3100cb+0x1;for(;_0x398bda<_0x59def2[_0x1e31e8(0x131)]&&_0x3db306>0x0;_0x398bda+=0x1){if(_0x59def2[_0x398bda]==='(')_0x3db306+=0x1;if(_0x59def2[_0x398bda]===')')_0x3db306-=0x1;}if(_0x3db306!==0x0)continue;for(let _0x1635e1=_0x3100cb;_0x1635e1<_0x398bda;_0x1635e1+=0x1){_0x59def2[_0x1635e1]='\x20';}const _0xf6634f=_0x1e31e8(0x13f);for(let _0x584211=0x0;_0x584211<_0xf6634f[_0x1e31e8(0x131)]&&_0x3100cb+_0x584211<_0x398bda;_0x584211+=0x1){_0x59def2[_0x3100cb+_0x584211]=_0xf6634f[_0x584211];}_0x3100cb=_0x398bda-0x1;}return _0x59def2[_0x1e31e8(0x147)]('');}function splitTopLevelAnd(_0x5406da){const _0x312ce0=a233_0x479c,_0x4ce180=[];let _0x3a8248=0x0,_0x523791=0x0;for(let _0x42d248=0x0;_0x42d248<_0x5406da['length'];_0x42d248+=0x1){const _0x4399bc=_0x5406da[_0x42d248];if(_0x4399bc==='(')_0x3a8248+=0x1;if(_0x4399bc===')')_0x3a8248=Math[_0x312ce0(0x129)](0x0,_0x3a8248-0x1);_0x3a8248===0x0&&_0x5406da[_0x312ce0(0x111)](_0x42d248)['match'](/^AND\b/i)&&(_0x42d248===0x0||/\s/[_0x312ce0(0x113)](_0x5406da[_0x42d248-0x1]??''))&&(_0x4ce180['push'](_0x5406da[_0x312ce0(0x111)](_0x523791,_0x42d248)[_0x312ce0(0x12c)]()),_0x42d248+=0x2,_0x523791=_0x42d248+0x1);}const _0x59dfe3=_0x5406da[_0x312ce0(0x111)](_0x523791)[_0x312ce0(0x12c)]();if(_0x59dfe3)_0x4ce180['push'](_0x59dfe3);return _0x4ce180;}function hasTopLevelKeyword(_0x3a64f6,_0x168ce3){const _0x5389b5=a233_0x479c;let _0x49987b=0x0;for(let _0x1f49f0=0x0;_0x1f49f0<_0x3a64f6[_0x5389b5(0x131)];_0x1f49f0+=0x1){const _0x55b7e8=_0x3a64f6[_0x1f49f0];if(_0x55b7e8==='(')_0x49987b+=0x1;if(_0x55b7e8===')')_0x49987b=Math[_0x5389b5(0x129)](0x0,_0x49987b-0x1);if(_0x49987b!==0x0)continue;const _0x449698=_0x3a64f6[_0x5389b5(0x111)](_0x1f49f0,_0x1f49f0+_0x168ce3[_0x5389b5(0x131)]),_0x2762de=_0x3a64f6[_0x1f49f0-0x1]??'\x20',_0xe9ab4d=_0x3a64f6[_0x1f49f0+_0x168ce3[_0x5389b5(0x131)]]??'\x20';if(_0x449698[_0x5389b5(0x10c)]()===_0x168ce3[_0x5389b5(0x10c)]()&&!/[\w$]/[_0x5389b5(0x113)](_0x2762de)&&!/[\w$]/['test'](_0xe9ab4d))return!![];}return![];}function splitEquality(_0x3b9396){const _0x44defe=a233_0x479c,_0x40a347=stripOuterParentheses(_0x3b9396);let _0x3fcd17=0x0,_0x187a03;for(let _0x6fed9f=0x0;_0x6fed9f<_0x40a347[_0x44defe(0x131)];_0x6fed9f+=0x1){const _0x38cd3b=_0x40a347[_0x6fed9f];if(_0x38cd3b==='(')_0x3fcd17+=0x1;if(_0x38cd3b===')')_0x3fcd17=Math[_0x44defe(0x129)](0x0,_0x3fcd17-0x1);const _0x2ccd6a=_0x40a347[_0x6fed9f-0x1]??'',_0xfd3655=_0x40a347[_0x6fed9f+0x1]??'';if(_0x38cd3b==='='&&_0x3fcd17===0x0&&!/[!<>=:]/[_0x44defe(0x113)](_0x2ccd6a)&&_0xfd3655!=='='){if(_0x187a03!==undefined)return null;_0x187a03=_0x6fed9f;}}return _0x187a03===undefined?null:[_0x40a347[_0x44defe(0x111)](0x0,_0x187a03)['trim'](),_0x40a347[_0x44defe(0x111)](_0x187a03+0x1)[_0x44defe(0x12c)]()];}function parseDirectColumnReference(_0xf72def,_0x5e80ae){const _0x3c6677=a233_0x479c,_0x199462=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x3c6677(0x107)](stripOuterParentheses(_0xf72def));if(!_0x199462)return null;if(normalizeIdentifier(_0x199462[0x1]??'')!==normalizeIdentifier(_0x5e80ae))return null;return normalizeIdentifier(_0x199462[0x2]??'');}function containsColumnReference(_0x37e362,_0x28da62){const _0x35349c=a233_0x479c,_0x2845ec=_0x37e362[_0x35349c(0x137)](/[`"]/g,''),_0x3d70b5=_0x28da62[_0x35349c(0x137)](/[.*+?^${}()|[\]\\]/g,_0x35349c(0x110));return new RegExp(_0x35349c(0x112)+_0x3d70b5+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x35349c(0x113)](_0x2845ec);}function findEqualityPrefix(_0x123330,_0x4ba805){const _0x58b74b=a233_0x479c,_0x4da521=new Set(_0x4ba805[_0x58b74b(0x12f)](normalizeIdentifier)),_0x1934d5=[];for(const _0x1a4800 of _0x123330){if(!_0x4da521[_0x58b74b(0x106)](normalizeIdentifier(_0x1a4800)))break;_0x1934d5[_0x58b74b(0x130)](_0x1a4800);}return _0x1934d5;}function resolveTableMetadata(_0x441a31,_0xea8756){const _0x59a36b=a233_0x479c,_0x2122f7=normalizeIdentifier(_0xea8756),_0x14e3e2=_0x441a31[_0x59a36b(0x145)](_0x5dfaef=>normalizeIdentifier(_0x5dfaef[_0x59a36b(0x115)])===_0x2122f7);if(_0x14e3e2[_0x59a36b(0x131)]===0x1)return _0x14e3e2[0x0];const _0x1ca2ed=_0x2122f7[_0x59a36b(0x13d)]('.'),_0xf7e96e=_0x2122f7['split']('.')['at'](-0x1),_0x6e061=_0x441a31[_0x59a36b(0x145)](_0x182409=>{const _0x2802a8=_0x59a36b,_0x157b72=normalizeIdentifier(_0x182409[_0x2802a8(0x115)]);if(_0x1ca2ed&&_0x157b72[_0x2802a8(0x13d)]('.'))return![];return _0x157b72[_0x2802a8(0x141)]('.')['at'](-0x1)===_0xf7e96e;});return _0x6e061[_0x59a36b(0x131)]===0x1?_0x6e061[0x0]:undefined;}function columnNamesMatch(_0x7e29c1,_0x456b15){return normalizeIdentifier(_0x7e29c1)===normalizeIdentifier(_0x456b15);}function normalizeIdentifier(_0x57d0b2){const _0xbeb542=a233_0x479c;return _0x57d0b2[_0xbeb542(0x137)](/[`"]/g,'')['trim']()['toLowerCase']();}function isSqlClauseKeyword(_0x54ddbf){const _0x325cab=a233_0x479c;return new Set(['on',_0x325cab(0x11d),_0x325cab(0x100),_0x325cab(0x147),_0x325cab(0x124),_0x325cab(0x14a),_0x325cab(0x10e),_0x325cab(0x11e),_0x325cab(0x13b),'natural'])['has'](_0x54ddbf);}function stripOuterParentheses(_0x5dcf21){const _0x278120=a233_0x479c;let _0x3fccd3=_0x5dcf21[_0x278120(0x12c)]();while(_0x3fccd3['startsWith']('(')&&_0x3fccd3[_0x278120(0x10f)](')')){let _0x5c6772=0x0,_0x43baf8=!![];for(let _0x53d789=0x0;_0x53d789<_0x3fccd3['length'];_0x53d789+=0x1){if(_0x3fccd3[_0x53d789]==='(')_0x5c6772+=0x1;if(_0x3fccd3[_0x53d789]===')')_0x5c6772-=0x1;if(_0x5c6772===0x0&&_0x53d789<_0x3fccd3[_0x278120(0x131)]-0x1){_0x43baf8=![];break;}}if(!_0x43baf8||_0x5c6772!==0x0)break;_0x3fccd3=_0x3fccd3[_0x278120(0x111)](0x1,-0x1)[_0x278120(0x12c)]();}return _0x3fccd3;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a234_0x177e98=a234_0x4d73;(function(_0x12577f,_0x603e82){const _0x44fac6=a234_0x4d73,_0x1d1943=_0x12577f();while(!![]){try{const _0x79f0b9=parseInt(_0x44fac6(0xda))/0x1*(parseInt(_0x44fac6(0xd0))/0x2)+parseInt(_0x44fac6(0xdb))/0x3+parseInt(_0x44fac6(0xd7))/0x4*(-parseInt(_0x44fac6(0xcd))/0x5)+parseInt(_0x44fac6(0xd9))/0x6*(parseInt(_0x44fac6(0xd4))/0x7)+-parseInt(_0x44fac6(0xd2))/0x8+-parseInt(_0x44fac6(0xcf))/0x9*(-parseInt(_0x44fac6(0xd6))/0xa)+parseInt(_0x44fac6(0xd5))/0xb*(-parseInt(_0x44fac6(0xce))/0xc);if(_0x79f0b9===_0x603e82)break;else _0x1d1943['push'](_0x1d1943['shift']());}catch(_0x29b470){_0x1d1943['push'](_0x1d1943['shift']());}}}(a234_0x5089,0x2b2c5));function a234_0x5089(){const _0x49aa3c=['656433irJSlS','12286PZAzOx','sql-trash','1295168xUKltg','sql.lock.json','35EObDgI','143HZbLkj','30sNcUzn','159356lQyLmB','.rabetbase','254406USCEPP','47xTQigt','934575fQoXeb','/sql','10GFirWE','565524xtQfro'];a234_0x5089=function(){return _0x49aa3c;};return a234_0x5089();}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a234_0x177e98(0xd8),LOCK_FILE_NAME=a234_0x177e98(0xd3),TRASH_DIR_NAME=a234_0x177e98(0xd1);function a234_0x4d73(_0x1ee3c5,_0x26f006){_0x1ee3c5=_0x1ee3c5-0xcd;const _0x508946=a234_0x5089();let _0x4d7391=_0x508946[_0x1ee3c5];return _0x4d7391;}export function loadSqlProjectConfig(_0x292670,_0x567b59){const _0x287e68=a234_0x177e98,_0x14a6ea=resolve(_0x567b59??findProjectRootDirectory()),_0x1cb756=DOT_DIR+_0x287e68(0xdc),_0x146ebd=_0x1cb756+'/'+_0x292670;return{'projectRoot':_0x14a6ea,'appCode':_0x292670,'sqlWorkspaceRoot':_0x1cb756,'sqlRoot':_0x146ebd,'sqlRootDir':resolve(_0x14a6ea,DOT_DIR,'sql',_0x292670),'lockFilePath':resolve(_0x14a6ea,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x14a6ea,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x11bf63,_0x55a60f){const _0x4792ba=a235_0x5e77,_0x299def=_0x11bf63();while(!![]){try{const _0x3c659a=parseInt(_0x4792ba(0xd0))/0x1+-parseInt(_0x4792ba(0xd3))/0x2+-parseInt(_0x4792ba(0xbc))/0x3*(-parseInt(_0x4792ba(0xc7))/0x4)+parseInt(_0x4792ba(0xbd))/0x5+-parseInt(_0x4792ba(0xc4))/0x6+parseInt(_0x4792ba(0xcd))/0x7*(-parseInt(_0x4792ba(0xd5))/0x8)+-parseInt(_0x4792ba(0xb8))/0x9*(parseInt(_0x4792ba(0xbf))/0xa);if(_0x3c659a===_0x55a60f)break;else _0x299def['push'](_0x299def['shift']());}catch(_0xc858c6){_0x299def['push'](_0x299def['shift']());}}}(a235_0x24d5,0x2dca0));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x51ef28){const _0x1df82a=a235_0x5e77;if(_0x51ef28==='.sql')return _0x1df82a(0xbe);if(_0x51ef28===_0x1df82a(0xb9))return _0x1df82a(0xcf);return undefined;}function a235_0x24d5(){const _0x1179d1=['1029396nsBJVv','path','name','4nuQZGu','sqlName','sqlRootDir','isDirectory','dbId','code','791CUsQcF','length','mybatisXml','121620YlIVzC','slice','sqlCode','524220vQxFfw','mode','6792kDnnYr','isFile','468ArydQR','.xml','split','indexOf','961941gHuZBR','1500590zQlSsP','sql','4850AHnksO','replace','dbName','push','test'];a235_0x24d5=function(){return _0x1179d1;};return a235_0x24d5();}async function scanSqlFilesRecursively(_0x23cd3a,_0x3ab10e){const _0x1ea7eb=a235_0x5e77,_0x3075e4=[];try{const _0x2a9b06=await readdir(_0x23cd3a,{'withFileTypes':!![]});for(const _0x5ab284 of _0x2a9b06){const _0x242c8f=join(_0x23cd3a,_0x5ab284['name']);if(_0x5ab284[_0x1ea7eb(0xca)]()){_0x3075e4[_0x1ea7eb(0xc2)](...await scanSqlFilesRecursively(_0x242c8f,_0x3ab10e));continue;}if(!_0x5ab284[_0x1ea7eb(0xd6)]())continue;const _0xfe6e58=extname(_0x5ab284[_0x1ea7eb(0xc6)])['toLowerCase'](),_0x33bc10=extensionToMode(_0xfe6e58);if(!_0x33bc10)continue;const _0x232177=relative(_0x3ab10e,_0x242c8f)[_0x1ea7eb(0xc0)](/\\/g,'/'),_0x44df10=_0x232177[_0x1ea7eb(0xba)]('/')['filter'](Boolean),_0x26f079=parseSqlPath(_0x44df10,_0x5ab284[_0x1ea7eb(0xc6)],_0xfe6e58);if(!_0x26f079)continue;_0x3075e4['push']({'sqlCode':_0x26f079[_0x1ea7eb(0xd2)],'sqlName':_0x26f079[_0x1ea7eb(0xc8)],'dbDirectory':_0x44df10[0x0],'filePath':_0x242c8f,'relativePath':_0x232177,'lockKey':_0x26f079[_0x1ea7eb(0xd2)],'mode':_0x33bc10});}}catch(_0x226fd2){if(_0x226fd2[_0x1ea7eb(0xcc)]!=='ENOENT')throw _0x226fd2;}return _0x3075e4;}export async function scanLocalSqlQueries(_0x150da4){const _0x17f660=a235_0x5e77;return scanSqlFilesRecursively(_0x150da4['sqlRootDir'],_0x150da4[_0x17f660(0xc9)]);}function a235_0x5e77(_0x5ea062,_0x285a70){_0x5ea062=_0x5ea062-0xb8;const _0x24d529=a235_0x24d5();let _0x5e77c0=_0x24d529[_0x5ea062];return _0x5e77c0;}export function resolveLocalSqlFilePath(_0x359bd6,_0x15b238,_0x1719ef){const _0x1894e9=a235_0x5e77,_0x545d1c=_0x1719ef?.[_0x1894e9(0xc5)]||(_0x1719ef?.[_0x1894e9(0xc8)]||_0x1719ef?.[_0x1894e9(0xc1)]?buildSqlRelativePath(_0x15b238,_0x1719ef?.[_0x1894e9(0xc8)],_0x1719ef?.[_0x1894e9(0xc1)],_0x1719ef?.[_0x1894e9(0xd4)]||_0x1894e9(0xbe),_0x1719ef?.[_0x1894e9(0xcb)]):buildDefaultSqlFileName(_0x15b238,_0x1719ef?.[_0x1894e9(0xd4)]||_0x1894e9(0xbe)));return join(_0x359bd6[_0x1894e9(0xc9)],_0x545d1c);}export async function directoryExists(_0x3b809a){try{const _0x5cd45b=await stat(_0x3b809a);return _0x5cd45b['isDirectory']();}catch{return![];}}function parseSqlPath(_0x37c4e9,_0x329ec1,_0x507dea){const _0x252e2d=a235_0x5e77,_0x2c5699=_0x329ec1[_0x252e2d(0xd1)](0x0,-_0x507dea[_0x252e2d(0xce)]);if(_0x37c4e9[_0x252e2d(0xce)]<0x2)return null;const _0x326fab=_0x2c5699[_0x252e2d(0xbb)]('_');if(_0x326fab<=0x0||_0x326fab>=_0x2c5699[_0x252e2d(0xce)]-0x1)return null;const _0x216639=_0x2c5699[_0x252e2d(0xd1)](0x0,_0x326fab);if(!isLikelySqlCode(_0x216639))return null;return{'sqlCode':_0x216639,'sqlName':_0x2c5699[_0x252e2d(0xd1)](_0x326fab+0x1)};}function isLikelySqlCode(_0x2fbc13){const _0x46d6f0=a235_0x5e77;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x46d6f0(0xc3)](_0x2fbc13);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a236_0x1b7a(){const _0x57ebba=['2714574rrumzs','md5','hex','digest','createHash','984188jRFvrb','336312dsEVZD','1651181RUKThW','2bTmcCk','147149hYMCNp','utf8','2118660Vwlwhv','3063335pIIMRg'];a236_0x1b7a=function(){return _0x57ebba;};return a236_0x1b7a();}(function(_0x235295,_0x3724dd){const _0x5e0662=a236_0xf9a3,_0x531324=_0x235295();while(!![]){try{const _0x2d3db6=parseInt(_0x5e0662(0x134))/0x1+parseInt(_0x5e0662(0x133))/0x2*(parseInt(_0x5e0662(0x138))/0x3)+parseInt(_0x5e0662(0x130))/0x4+-parseInt(_0x5e0662(0x137))/0x5+-parseInt(_0x5e0662(0x136))/0x6+parseInt(_0x5e0662(0x132))/0x7+-parseInt(_0x5e0662(0x131))/0x8;if(_0x2d3db6===_0x3724dd)break;else _0x531324['push'](_0x531324['shift']());}catch(_0x4af908){_0x531324['push'](_0x531324['shift']());}}}(a236_0x1b7a,0x80729));import{readFile}from'node:fs/promises';function a236_0xf9a3(_0x34beb2,_0x319b56){_0x34beb2=_0x34beb2-0x130;const _0x1b7a05=a236_0x1b7a();let _0xf9a348=_0x1b7a05[_0x34beb2];return _0xf9a348;}import a236_0x23ec5d from'node:crypto';export function computeSqlContentHash(_0x4952de){const _0x570983=a236_0xf9a3;return a236_0x23ec5d[_0x570983(0x13c)](_0x570983(0x139))['update'](_0x4952de)[_0x570983(0x13b)](_0x570983(0x13a));}export async function computeSqlFileHash(_0x5e337a){const _0x4cdc18=a236_0xf9a3,_0x155591=await readFile(_0x5e337a,_0x4cdc18(0x135));return computeSqlContentHash(_0x155591);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x174d1c,_0x230618){const _0x200aac=a237_0x3e53,_0x2a7a51=_0x174d1c();while(!![]){try{const _0x162dd4=parseInt(_0x200aac(0x1c6))/0x1*(parseInt(_0x200aac(0x1c0))/0x2)+-parseInt(_0x200aac(0x1c5))/0x3+-parseInt(_0x200aac(0x1b6))/0x4+-parseInt(_0x200aac(0x1bd))/0x5*(parseInt(_0x200aac(0x1b2))/0x6)+parseInt(_0x200aac(0x1bf))/0x7+-parseInt(_0x200aac(0x1c8))/0x8*(-parseInt(_0x200aac(0x1be))/0x9)+parseInt(_0x200aac(0x1b9))/0xa*(-parseInt(_0x200aac(0x1c1))/0xb);if(_0x162dd4===_0x230618)break;else _0x2a7a51['push'](_0x2a7a51['shift']());}catch(_0x1cf110){_0x2a7a51['push'](_0x2a7a51['shift']());}}}(a237_0x49ee,0xabaf8));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a237_0x3e53(_0x223269,_0x2504a8){_0x223269=_0x223269-0x1b2;const _0x49eebe=a237_0x49ee();let _0x3e537a=_0x49eebe[_0x223269];return _0x3e537a;}export function createEmptySqlLock(){return{'apps':{}};}function a237_0x49ee(){const _0x407026=['stringify','code','sqls','20ekMxas','9yqixeI','6384987nSbXZe','623224PXlLYR','3179zhuYdt','ENOENT','lastSync','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','2523342OTvjNf','2lYvZKw','utf8','8200496YrUxvs','11472YhBKDe','apps',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','\x22\x20vs\x20lock\x20\x22','3948iXBOTl','\x22.\x20','sqlRoot','34860RPslNS'];a237_0x49ee=function(){return _0x407026;};return a237_0x49ee();}export function ensureSqlLockScope(_0x5bbbf7,_0x13d629,_0x1d711d,_0x53fcf9){const _0x3fdf69=a237_0x3e53,_0x4c21a8=_0x5bbbf7??createEmptySqlLock();let _0x340538=_0x4c21a8['apps'][_0x13d629];if(!_0x340538)return _0x340538={'sqlRoot':_0x1d711d,'lastSync':'','sqls':{}},_0x4c21a8[_0x3fdf69(0x1b3)][_0x13d629]=_0x340538,{'lockData':_0x4c21a8,'appLock':_0x340538};if(!_0x340538[_0x3fdf69(0x1b8)])_0x340538['sqlRoot']=_0x1d711d;else{if(_0x340538[_0x3fdf69(0x1b8)]!==_0x1d711d)throw new Error(_0x53fcf9+_0x3fdf69(0x1b4)+_0x1d711d+_0x3fdf69(0x1b5)+_0x340538[_0x3fdf69(0x1b8)]+_0x3fdf69(0x1b7)+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x340538[_0x3fdf69(0x1bc)]&&(_0x340538[_0x3fdf69(0x1bc)]={}),!_0x340538[_0x3fdf69(0x1c3)]&&(_0x340538[_0x3fdf69(0x1c3)]=''),{'lockData':_0x4c21a8,'appLock':_0x340538};}export async function readSqlLockFile(_0x4259de){const _0x4c2a60=a237_0x3e53;try{const _0xdfad4a=await readFile(_0x4259de,_0x4c2a60(0x1c7));return JSON['parse'](_0xdfad4a);}catch(_0x2236e2){if(_0x2236e2[_0x4c2a60(0x1bb)]===_0x4c2a60(0x1c2))return null;throw new Error(_0x4c2a60(0x1c4)+String(_0x2236e2));}}export async function writeSqlLockFile(_0x49ec3f,_0x9cfc04){const _0x4afb95=a237_0x3e53;await mkdir(dirname(_0x49ec3f),{'recursive':!![]}),await writeFile(_0x49ec3f,JSON[_0x4afb95(0x1ba)](_0x9cfc04,null,0x2),_0x4afb95(0x1c7));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3c2840,_0x3aaf53){const _0x4c5019=a239_0x3af8,_0x72b03e=_0x3c2840();while(!![]){try{const _0x41c48f=-parseInt(_0x4c5019(0x76))/0x1+-parseInt(_0x4c5019(0x6d))/0x2+parseInt(_0x4c5019(0x6e))/0x3*(-parseInt(_0x4c5019(0x67))/0x4)+parseInt(_0x4c5019(0x74))/0x5*(parseInt(_0x4c5019(0x71))/0x6)+-parseInt(_0x4c5019(0x69))/0x7*(parseInt(_0x4c5019(0x72))/0x8)+parseInt(_0x4c5019(0x77))/0x9*(parseInt(_0x4c5019(0x6f))/0xa)+parseInt(_0x4c5019(0x66))/0xb;if(_0x41c48f===_0x3aaf53)break;else _0x72b03e['push'](_0x72b03e['shift']());}catch(_0x211951){_0x72b03e['push'](_0x72b03e['shift']());}}}(a239_0x1550,0x8efb9));function a239_0x3af8(_0x38c43b,_0x193ecb){_0x38c43b=_0x38c43b-0x65;const _0x155014=a239_0x1550();let _0x3af818=_0x155014[_0x38c43b];return _0x3af818;}function a239_0x1550(){const _0x5f8b60=['6cQezdy','1304ObxIGv','sql','899195NDVgsm','mybatisXml','926671bnfvkl','1890cWqinA','.xml','42860708UbUTmN','1048584iRjYzp','test','41335zebFSR','replace','unknown-sql','.sql','2112840EaqdWO','12jbeHIO','23980RPYcTa','unknown-db'];a239_0x1550=function(){return _0x5f8b60;};return a239_0x1550();}export function detectSqlMode(_0x1753a8){const _0x588d1c=a239_0x3af8,_0xe0f5f3=_0x1753a8['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x588d1c(0x68)](_0xe0f5f3))return _0x588d1c(0x75);return _0x588d1c(0x73);}export function getSqlFileExtension(_0x167213){const _0x6c133d=a239_0x3af8;return _0x167213===_0x6c133d(0x75)?_0x6c133d(0x65):_0x6c133d(0x6c);}export function buildDefaultSqlFileName(_0x23a017,_0x40d204){return''+_0x23a017+getSqlFileExtension(_0x40d204);}export function sanitizeSqlPathSegment(_0x2d831a,_0xc78e4e){const _0x5a72a1=a239_0x3af8,_0x2a613e=String(_0x2d831a??'')['trim'](),_0x1db983=_0x2a613e[_0x5a72a1(0x6a)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x5a72a1(0x6a)](/\s+/g,'-')[_0x5a72a1(0x6a)](/-+/g,'-')['replace'](/^\.+/,'')['replace'](/\.+$/,'')[_0x5a72a1(0x6a)](/^-+/,'')['replace'](/-+$/,'');return _0x1db983||_0xc78e4e;}export function buildDbDirectoryName(_0x238a02,_0x1bae98){const _0x2b9b72=a239_0x3af8;return sanitizeSqlPathSegment(_0x238a02,_0x1bae98!=null?'db-'+_0x1bae98:_0x2b9b72(0x70));}export function buildSqlRelativePath(_0x597c66,_0x25f7f1,_0x1de8b5,_0x2b1765,_0x2dbe64){const _0x430c00=a239_0x3af8,_0x49d3db=buildDbDirectoryName(_0x1de8b5,_0x2dbe64),_0x7b9daa=sanitizeSqlPathSegment(_0x597c66,_0x430c00(0x6b)),_0x3375c4=sanitizeSqlPathSegment(_0x25f7f1,_0x7b9daa);return _0x49d3db+'/'+_0x7b9daa+'_'+_0x3375c4+getSqlFileExtension(_0x2b1765);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a239_0x3de30a=a239_0x5bae;(function(_0x3cc4a1,_0xc3b74){const _0x48fd5f=a239_0x5bae,_0x54041f=_0x3cc4a1();while(!![]){try{const _0x5ecd72=-parseInt(_0x48fd5f(0x10f))/0x1*(parseInt(_0x48fd5f(0x126))/0x2)+parseInt(_0x48fd5f(0xdf))/0x3+-parseInt(_0x48fd5f(0xed))/0x4+parseInt(_0x48fd5f(0xf6))/0x5*(-parseInt(_0x48fd5f(0x107))/0x6)+-parseInt(_0x48fd5f(0x11f))/0x7*(-parseInt(_0x48fd5f(0xfd))/0x8)+-parseInt(_0x48fd5f(0x122))/0x9*(-parseInt(_0x48fd5f(0xfb))/0xa)+-parseInt(_0x48fd5f(0xcc))/0xb*(-parseInt(_0x48fd5f(0xef))/0xc);if(_0x5ecd72===_0xc3b74)break;else _0x54041f['push'](_0x54041f['shift']());}catch(_0x40fc20){_0x54041f['push'](_0x54041f['shift']());}}}(a239_0x50bb,0x5cd0d));const MYBATIS_OUTER_TAGS=new Map([[a239_0x3de30a(0xca),a239_0x3de30a(0x102)],['insert','INSERT'],['update',a239_0x3de30a(0x121)],['delete',a239_0x3de30a(0x109)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a239_0x3de30a(0xdd),a239_0x3de30a(0xce),'choose',a239_0x3de30a(0xf3),a239_0x3de30a(0xdc),a239_0x3de30a(0x111),a239_0x3de30a(0x124),'bind','include',a239_0x3de30a(0xde)]),MYBATIS_BRANCH_TAGS=new Set(['if',a239_0x3de30a(0xce),a239_0x3de30a(0xf4),'when',a239_0x3de30a(0xdc)]);export const MYBATIS_DYNAMIC_START_MARKER=a239_0x3de30a(0x115);export const MYBATIS_DYNAMIC_END_MARKER=a239_0x3de30a(0x10e);export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT=a239_0x3de30a(0xf2),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a239_0x3de30a(0x11c)+[...MYBATIS_OUTER_TAGS[a239_0x3de30a(0xf1)]()][a239_0x3de30a(0x11a)]('|')+a239_0x3de30a(0xf5),'i');export function normalizeSqlForStaticAnalysis(_0x5aa39d){const _0x260116=a239_0x3de30a,_0x1308ad=typeof _0x5aa39d===_0x260116(0x11b)?_0x5aa39d:'';if(!startsWithMybatisStatementWrapper(_0x1308ad))return{'sql':_0x1308ad,'mode':'sql'};let _0x296e32=0x0,_0x133aca='',_0x5ee471,_0x60530e=![],_0x1a8a5d=![];const _0xeb89d3=[];while(_0x296e32<_0x1308ad[_0x260116(0xd5)]){if(_0x1308ad[_0x260116(0xe4)](_0x260116(0x10c),_0x296e32)){const _0x448139=_0x1308ad[_0x260116(0xf7)]('-->',_0x296e32+0x4);if(_0x448139<0x0)return invalidMybatisSource('Unterminated\x20XML\x20comment.');_0x133aca+='\x20',_0x296e32=_0x448139+0x3;continue;}if(_0x1308ad['startsWith']('<,_0x296e32+0x9);if(_0x19cc09<0x0)return invalidMybatisSource(_0x260116(0xee));_0x133aca+=_0x1308ad[_0x260116(0x117)](_0x296e32+0x9,_0x19cc09),_0x296e32=_0x19cc09+0x3;continue;}if(_0x1308ad[_0x260116(0xe4)]('<?',_0x296e32)){if(_0x60530e)return invalidMybatisSource(_0x260116(0xd0));const _0xe69882=_0x1308ad['indexOf']('?>',_0x296e32+0x2);if(_0xe69882<0x0)return invalidMybatisSource(_0x260116(0xcf));_0x133aca+='\x20',_0x296e32=_0xe69882+0x2;continue;}if(_0x1308ad[_0x296e32]!=='<'){const _0x349ebb=_0x1308ad[_0x260116(0xf7)]('<',_0x296e32),_0x263875=_0x349ebb<0x0?_0x1308ad[_0x260116(0xd5)]:_0x349ebb,_0x232331=_0x1308ad['slice'](_0x296e32,_0x263875);if((!_0x60530e||_0x1a8a5d)&&_0x232331[_0x260116(0x111)]())return invalidMybatisSource(_0x260116(0x116));if(_0x60530e&&!_0x1a8a5d){const _0x1968bb=decodeXmlEntities(_0x232331);if(_0x1968bb===null)return invalidMybatisSource(_0x260116(0x108));_0x133aca+=_0x1968bb;}else _0x133aca+='\x20';_0x296e32=_0x263875;continue;}const _0x3fbc0f=findXmlTagEnd(_0x1308ad,_0x296e32);if(_0x3fbc0f<0x0)return invalidMybatisSource(_0x260116(0xd8));const _0x85af15=_0x1308ad[_0x260116(0x117)](_0x296e32,_0x3fbc0f+0x1),_0x23675d=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x260116(0x105)](_0x85af15);if(!_0x23675d)return invalidMybatisSource(_0x260116(0x119));const _0x8d94c8=_0x23675d[0x1]==='/',_0x329788=_0x23675d[0x2]??'',_0x539902=_0x329788[_0x260116(0xf9)](),_0x1df99a=_0x23675d[0x3]??'',_0x2e1c92=_0x23675d[0x4]==='/',_0x2af30b=MYBATIS_OUTER_TAGS[_0x260116(0xd9)](_0x539902);if(!_0x2af30b&&!MYBATIS_DYNAMIC_TAGS['has'](_0x539902))return invalidMybatisSource(_0x260116(0xcb)+_0x539902+'>.');if(!_0x2af30b&&_0x329788!==_0x539902)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<'+_0x329788+'>.');if(_0x8d94c8){if(_0x1df99a[_0x260116(0x111)]()||_0x2e1c92)return invalidMybatisSource(_0x260116(0xfe)+_0x329788+'>.');const _0x3ea75a=_0xeb89d3['at'](-0x1);if(!_0x3ea75a||(_0x3ea75a[_0x260116(0xd3)]?_0x3ea75a[_0x260116(0xec)]!==_0x539902:_0x3ea75a['rawName']!==_0x329788))return invalidMybatisSource(_0x260116(0xd2)+_0x329788+'>.');_0xeb89d3['pop']();if(_0x3ea75a[_0x260116(0xd3)])_0x1a8a5d=!![];_0x133aca+=MYBATIS_BRANCH_TAGS['has'](_0x539902)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x1df99a))return invalidMybatisSource(_0x260116(0xc9)+_0x329788+'>.');if(_0x539902==='property'&&(!_0x2e1c92||_0xeb89d3['at'](-0x1)?.['tagName']!==_0x260116(0xe0)))return invalidMybatisSource(_0x260116(0x11d));if(_0x2af30b){if(_0x60530e||_0xeb89d3[_0x260116(0xd5)]>0x0)return invalidMybatisSource('Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.');_0x60530e=!![],_0x1a8a5d=_0x2e1c92,_0x5ee471=_0x2af30b;}else{if(!_0x60530e||_0x1a8a5d)return invalidMybatisSource(_0x260116(0xff)+_0x329788+'>.');}_0x133aca+=_0x539902==='where'?'\x20WHERE\x20':_0x539902===_0x260116(0x124)?_0x260116(0x125):_0x539902===_0x260116(0xe0)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x260116(0xf0)](_0x539902)&&!_0x2e1c92?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x2e1c92&&_0xeb89d3[_0x260116(0x101)]({'rawName':_0x329788,'tagName':_0x539902,'outer':!!_0x2af30b});}_0x296e32=_0x3fbc0f+0x1;}if(_0xeb89d3['length']>0x0)return invalidMybatisSource(_0x260116(0xcd)+_0xeb89d3['at'](-0x1)?.[_0x260116(0x123)]+'>.');if(!_0x60530e||!_0x1a8a5d)return invalidMybatisSource(_0x260116(0xfc));return{'sql':_0x133aca[_0x260116(0x111)](),'mode':_0x260116(0x106),..._0x5ee471?{'statementType':_0x5ee471}:{}};}function hasWellFormedXmlAttributes(_0xe8ffbb){const _0x374d73=a239_0x3de30a;let _0xbfec69=0x0;const _0x31cd43=new Set();while(_0xbfec69<_0xe8ffbb[_0x374d73(0xd5)]){while(_0xbfec69<_0xe8ffbb['length']&&/\s/[_0x374d73(0xeb)](_0xe8ffbb[_0xbfec69]??''))_0xbfec69+=0x1;if(_0xbfec69>=_0xe8ffbb[_0x374d73(0xd5)])return!![];const _0x25d174=/^[A-Za-z_:][\w:.-]*/[_0x374d73(0x105)](_0xe8ffbb[_0x374d73(0x117)](_0xbfec69)),_0x368f20=_0x25d174?.[0x0];if(!_0x368f20||_0x31cd43[_0x374d73(0xf0)](_0x368f20))return![];_0x31cd43['add'](_0x368f20),_0xbfec69+=_0x368f20[_0x374d73(0xd5)];while(_0xbfec69<_0xe8ffbb[_0x374d73(0xd5)]&&/\s/[_0x374d73(0xeb)](_0xe8ffbb[_0xbfec69]??''))_0xbfec69+=0x1;if(_0xe8ffbb[_0xbfec69]!=='=')return![];_0xbfec69+=0x1;while(_0xbfec69<_0xe8ffbb[_0x374d73(0xd5)]&&/\s/['test'](_0xe8ffbb[_0xbfec69]??''))_0xbfec69+=0x1;const _0x45c462=_0xe8ffbb[_0xbfec69];if(_0x45c462!=='\x22'&&_0x45c462!=='\x27')return![];_0xbfec69+=0x1;const _0x50a4de=_0xe8ffbb[_0x374d73(0xf7)](_0x45c462,_0xbfec69);if(_0x50a4de<0x0)return![];if(decodeXmlEntities(_0xe8ffbb[_0x374d73(0x117)](_0xbfec69,_0x50a4de))===null)return![];_0xbfec69=_0x50a4de+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x2cb5c8){const _0x2e1a86=a239_0x3de30a;let _0x39f365=0x0;const _0x336af2=()=>{const _0x5d1062=a239_0x5bae;while(_0x39f365<_0x2cb5c8[_0x5d1062(0xd5)]&&/\s/[_0x5d1062(0xeb)](_0x2cb5c8[_0x39f365]??''))_0x39f365+=0x1;};_0x336af2();while(_0x39f365<_0x2cb5c8[_0x2e1a86(0xd5)]){if(_0x2cb5c8['startsWith']('<!--',_0x39f365)){const _0x397d6e=_0x2cb5c8[_0x2e1a86(0xf7)]('-->',_0x39f365+0x4);if(_0x397d6e<0x0)return!![];_0x39f365=_0x397d6e+0x3,_0x336af2();continue;}if(_0x2cb5c8[_0x2e1a86(0xe4)]('<?',_0x39f365)){const _0x140c42=_0x2cb5c8[_0x2e1a86(0xf7)]('?>',_0x39f365+0x2);if(_0x140c42<0x0)return!![];_0x39f365=_0x140c42+0x2,_0x336af2();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x2e1a86(0xeb)](_0x2cb5c8[_0x2e1a86(0x117)](_0x39f365));}function a239_0x5bae(_0x3675af,_0x269fa4){_0x3675af=_0x3675af-0xc9;const _0x50bb68=a239_0x50bb();let _0x5baecb=_0x50bb68[_0x3675af];return _0x5baecb;}function invalidMybatisSource(_0x318f10){const _0x3e9632=a239_0x3de30a;return{'sql':'','mode':_0x3e9632(0x106),'error':_0x318f10};}function findXmlTagEnd(_0x4a8c89,_0x5b875f){const _0x5a3b4d=a239_0x3de30a;let _0x253f75;for(let _0x3cdedc=_0x5b875f+0x1;_0x3cdedc<_0x4a8c89[_0x5a3b4d(0xd5)];_0x3cdedc+=0x1){const _0x306a44=_0x4a8c89[_0x3cdedc];if(_0x253f75){if(_0x306a44===_0x253f75)_0x253f75=undefined;continue;}if(_0x306a44==='\x22'||_0x306a44==='\x27'){_0x253f75=_0x306a44;continue;}if(_0x306a44==='>')return _0x3cdedc;}return-0x1;}function decodeXmlEntities(_0x4e1b7c){const _0x1877d0=a239_0x3de30a;let _0x1c56a2=![];const _0x3cb236=_0x4e1b7c[_0x1877d0(0x118)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x1f19f0=>{const _0x43d898=_0x1877d0;if(_0x1f19f0==='<')return'<';if(_0x1f19f0==='>')return'>';if(_0x1f19f0===_0x43d898(0xe6))return'\x22';if(_0x1f19f0===''')return'\x27';if(_0x1f19f0==='&')return'&';const _0x5ae264=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x43d898(0x105)](_0x1f19f0);if(_0x5ae264){const _0x4fcf0d=_0x5ae264[0x1],_0x49d5c3=_0x5ae264[0x2],_0x258467=Number[_0x43d898(0xd1)](_0x4fcf0d??_0x49d5c3??'',_0x4fcf0d?0x10:0xa);if(isValidXmlCharacter(_0x258467))return String[_0x43d898(0xe9)](_0x258467);}return _0x1c56a2=!![],'';});return _0x1c56a2?null:_0x3cb236;}function isValidXmlCharacter(_0x1a5a75){return _0x1a5a75===0x9||_0x1a5a75===0xa||_0x1a5a75===0xd||_0x1a5a75>=0x20&&_0x1a5a75<=0xd7ff||_0x1a5a75>=0xe000&&_0x1a5a75<=0xfffd||_0x1a5a75>=0x10000&&_0x1a5a75<=0x10ffff;}export function detectSqlType(_0x15e0a8){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x15e0a8));}function detectNormalizedSqlType(_0x4948e5){const _0x37f1a0=a239_0x3de30a;if(_0x4948e5[_0x37f1a0(0xe3)])return{'type':_0x37f1a0(0x11e),'isSelectOnly':![],'isDangerous':![],'reason':_0x4948e5[_0x37f1a0(0xe3)]};if(!_0x4948e5['sql'][_0x37f1a0(0x111)]())return{'type':_0x37f1a0(0x11e),'isSelectOnly':![],'isDangerous':![],'reason':_0x37f1a0(0xfa)};const _0x59dd8e=stripStaticAnalysisMarkers(_0x4948e5[_0x37f1a0(0x114)])[_0x37f1a0(0x118)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x37f1a0(0x118)](/@[^(\s]+(\([^)]*\))?/g,'')['replace'](/\/\*[\s\S]*?\*\//g,'')[_0x37f1a0(0x111)](),_0x25e8e8=_0x59dd8e[_0x37f1a0(0x10a)]('\x0a');let _0x35d9b9='';for(const _0x543b8a of _0x25e8e8){const _0x140dac=_0x543b8a[_0x37f1a0(0x111)]();if(!_0x140dac||_0x140dac[_0x37f1a0(0xe4)]('--')||_0x140dac['startsWith']('/*'))continue;_0x35d9b9=_0x140dac;break;}const _0x2e482e=_0x35d9b9[_0x37f1a0(0xe7)](),_0x31c901=_0x4948e5[_0x37f1a0(0xdb)],_0x1befca=maskSqlTextForBlockedKeywordScan(_0x59dd8e),_0xff548e=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x37f1a0(0xeb)](_0x1befca);if(_0x31c901==='SELECT'||!_0x31c901&&(_0x2e482e[_0x37f1a0(0xe4)](_0x37f1a0(0x102))||_0x2e482e[_0x37f1a0(0xe4)](_0x37f1a0(0xf8)))){const _0x2050ee=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i['test'](_0x59dd8e);return{'type':_0x37f1a0(0x102),'isSelectOnly':!_0x2050ee,'isDangerous':_0x2050ee,'reason':_0x2050ee?_0x37f1a0(0x110):undefined};}if(_0x31c901===_0x37f1a0(0x103)||!_0x31c901&&_0x2e482e[_0x37f1a0(0xe4)](_0x37f1a0(0x103)))return{'type':_0x37f1a0(0x103),'isSelectOnly':![],'isDangerous':_0xff548e,'reason':_0xff548e?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x31c901===_0x37f1a0(0x121)||!_0x31c901&&_0x2e482e[_0x37f1a0(0xe4)](_0x37f1a0(0x121)))return{'type':_0x37f1a0(0x121),'isSelectOnly':![],'isDangerous':_0xff548e,'reason':_0xff548e?_0x37f1a0(0xd6):undefined};if(_0x31c901==='DELETE'||!_0x31c901&&_0x2e482e[_0x37f1a0(0xe4)](_0x37f1a0(0x109)))return{'type':_0x37f1a0(0x109),'isSelectOnly':![],'isDangerous':!![],'reason':_0x37f1a0(0x112)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i['test'](_0x2e482e))return{'type':_0x37f1a0(0x113),'isSelectOnly':![],'isDangerous':!![],'reason':'DDL\x20statements\x20are\x20blocked\x20from\x20auto-save'};return{'type':_0x37f1a0(0x11e),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x1e2a05){const _0x30eea9=a239_0x3de30a;return _0x1e2a05['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x30eea9(0x120)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x30eea9(0x120)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x466588){const _0x1463c6=a239_0x3de30a;return _0x466588[_0x1463c6(0x118)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x1463c6(0x118)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x1463c6(0x118)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x1463c6(0x118)](/--.*$/gm,'\x20')[_0x1463c6(0x118)](/#.*$/gm,'\x20')[_0x1463c6(0x118)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0xd60405){const _0x41c72b=a239_0x3de30a,_0xfc6143=_0xd60405[_0x41c72b(0x118)](/#\{[^}]*\}/g,'?')[_0x41c72b(0x118)](/\$\{[^}]*\}/g,'?')['replace'](/'[^']*'/g,'\x27\x27')[_0x41c72b(0x118)](/--.*$/gm,'')[_0x41c72b(0x118)](/\/\*[\s\S]*?\*\//g,''),_0x1e6e13=[],_0x46b77b=_0xfc6143[_0x41c72b(0xda)](/FROM\s+([^\s,)(]+)/i);addTable(_0x1e6e13,_0x46b77b?.[0x1]);for(const _0x1b68b9 of _0xfc6143['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x1e6e13,_0x1b68b9[0x1]);}const _0x2ec568=_0xfc6143[_0x41c72b(0xda)](/INTO\s+([^\s(]+)/i);addTable(_0x1e6e13,_0x2ec568?.[0x1]);const _0x533629=_0xfc6143[_0x41c72b(0xda)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x1e6e13,_0x533629?.[0x1]),_0x1e6e13;}function addTable(_0x4fd7cf,_0x3137e3){const _0x44aeb6=a239_0x3de30a,_0x14f2ab=_0x3137e3?.['replace'](/[`"]/g,'');_0x14f2ab&&_0x14f2ab!==UNRESOLVED_SQL_FRAGMENT&&!_0x4fd7cf['includes'](_0x14f2ab)&&_0x4fd7cf[_0x44aeb6(0x101)](_0x14f2ab);}function extractParameters(_0xf229cb){const _0x24628b=a239_0x3de30a,_0x193120=new Set();for(const _0x64ad56 of _0xf229cb['matchAll'](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x64ad56[0x1])_0x193120[_0x24628b(0xd4)](_0x64ad56[0x1]);}return Array[_0x24628b(0xe5)](_0x193120);}function a239_0x50bb(){const _0x428bdd=['10cMIKDJ','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','8hQaYdB','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','type','push','SELECT','INSERT','unknown\x20table(s)','exec','mybatisXml','810948qijzjU','Invalid\x20XML\x20entity\x20reference.','DELETE','split','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','<!--','isDangerous','__RABETBASE_MYBATIS_DYNAMIC_END__','29REIrdL','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','trim','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','DDL','sql','__RABETBASE_MYBATIS_DYNAMIC_START__','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','slice','replace','Invalid\x20MyBatis\x20XML\x20tag.','join','string','^<\x5cs*(?:','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','UNKNOWN','3380377HcWrhY','replaceAll','UPDATE','863613bPtRTo','rawName','set','\x20SET\x20','18130IZPYiC','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','select','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','64438fhbCWh','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','foreach','Unterminated\x20XML\x20declaration.','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','parseInt','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','outer','add','length','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','\x20query\x20targeting\x20','Unterminated\x20MyBatis\x20XML\x20tag.','get','match','statementType','otherwise','where','property','57906RaSPez','include','reason',']]>','error','startsWith','from','"','toUpperCase','\x20with\x20parameters:\x20','fromCodePoint','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','test','tagName','914968NAFnli','Unterminated\x20CDATA\x20section.','1668zDftdb','has','keys','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','when','choose',')\x5cb','20bxliQC','indexOf','WITH','toLowerCase','SQL\x20content\x20is\x20empty'];a239_0x50bb=function(){return _0x428bdd;};return a239_0x50bb();}export function validateSql(_0xdf4947){const _0x3797a2=a239_0x3de30a,_0xbcab2c=normalizeSqlForStaticAnalysis(_0xdf4947),_0x1c8e5a=detectNormalizedSqlType(_0xbcab2c),_0x5071e0=stripStaticAnalysisMarkers(_0xbcab2c[_0x3797a2(0x114)]),_0x446e6d=_0xbcab2c['error']?[]:extractTables(_0x5071e0),_0x2d891f=_0xbcab2c[_0x3797a2(0xe3)]?[]:extractParameters(_0x5071e0);if(_0x1c8e5a[_0x3797a2(0x10d)])return{'valid':![],'sqlType':_0x1c8e5a,'tables':_0x446e6d,'parameters':_0x2d891f,'message':_0x1c8e5a[_0x3797a2(0xe1)]||_0x1c8e5a[_0x3797a2(0x100)]+'\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.'};if(_0x1c8e5a[_0x3797a2(0x100)]===_0x3797a2(0x11e))return{'valid':![],'sqlType':_0x1c8e5a,'tables':_0x446e6d,'parameters':_0x2d891f,'message':_0xbcab2c[_0x3797a2(0xe3)]?'Unable\x20to\x20detect\x20SQL\x20type.\x20'+_0xbcab2c[_0x3797a2(0xe3)]:_0x3797a2(0xea)};return{'valid':!![],'sqlType':_0x1c8e5a,'tables':_0x446e6d,'parameters':_0x2d891f,'message':_0x1c8e5a['type']+_0x3797a2(0xd7)+(_0x446e6d[_0x3797a2(0xd5)]?_0x446e6d[_0x3797a2(0x11a)](',\x20'):_0x3797a2(0x104))+(_0x2d891f['length']?_0x3797a2(0xe8)+_0x2d891f[_0x3797a2(0x11a)](',\x20'):'')};}
|
|
1
|
+
const a240_0x365b4b=a240_0x508e;function a240_0x1644(){const _0x2b34fb=['Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','SQL\x20content\x20is\x20empty','INSERT','DELETE','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','\x20with\x20parameters:\x20','include','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','where','match','1760464XGhllN','join','Invalid\x20MyBatis\x20XML\x20tag.','UPDATE','error','outer','toLowerCase','length','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','Invalid\x20XML\x20entity\x20reference.','from','slice','SELECT','trim','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','^<\x5cs*(?:','set','"','test','has','replace',''','replaceAll','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','\x20query\x20targeting\x20','unknown\x20table(s)','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','tagName','otherwise','push','Unterminated\x20XML\x20comment.','property','matchAll','2229897IdwppD','11483899aubDdW','rawName',')\x5cb','startsWith','reason','6762246dEOVgT','select','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','includes','WITH','split','choose','pop','sql','<![CDATA[','parseInt','fromCodePoint','Unterminated\x20MyBatis\x20XML\x20tag.','exec',']]>','type','-->','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','bind','UNKNOWN','3169630LgPyOU','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','when','<','statementType','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','indexOf','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','delete','Unable\x20to\x20detect\x20SQL\x20type.\x20','1393852wBaIVQ','772281kiZCCS','string','__RABETBASE_MYBATIS_DYNAMIC_START__','add','keys','<!--','isDangerous'];a240_0x1644=function(){return _0x2b34fb;};return a240_0x1644();}(function(_0x32ff68,_0x3bc611){const _0x2dd454=a240_0x508e,_0x4ca39b=_0x32ff68();while(!![]){try{const _0x267ddc=-parseInt(_0x2dd454(0x1bb))/0x1+-parseInt(_0x2dd454(0x1cc))/0x2+parseInt(_0x2dd454(0x195))/0x3+parseInt(_0x2dd454(0x1ba))/0x4+parseInt(_0x2dd454(0x1af))/0x5+-parseInt(_0x2dd454(0x19b))/0x6+parseInt(_0x2dd454(0x196))/0x7;if(_0x267ddc===_0x3bc611)break;else _0x4ca39b['push'](_0x4ca39b['shift']());}catch(_0x478f42){_0x4ca39b['push'](_0x4ca39b['shift']());}}}(a240_0x1644,0x8f3c3));const MYBATIS_OUTER_TAGS=new Map([[a240_0x365b4b(0x19c),'SELECT'],['insert',a240_0x365b4b(0x1c4)],['update',a240_0x365b4b(0x1cf)],[a240_0x365b4b(0x1b8),a240_0x365b4b(0x1c5)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a240_0x365b4b(0x1ca),'foreach',a240_0x365b4b(0x1a1),a240_0x365b4b(0x1b1),'otherwise',a240_0x365b4b(0x1da),a240_0x365b4b(0x184),a240_0x365b4b(0x1ad),a240_0x365b4b(0x1c8),a240_0x365b4b(0x193)]),MYBATIS_BRANCH_TAGS=new Set(['if','foreach',a240_0x365b4b(0x1a1),a240_0x365b4b(0x1b1),a240_0x365b4b(0x190)]);export const MYBATIS_DYNAMIC_START_MARKER=a240_0x365b4b(0x1bd);export const MYBATIS_DYNAMIC_END_MARKER='__RABETBASE_MYBATIS_DYNAMIC_END__';export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT='__RABETBASE_UNRESOLVED_SQL_FRAGMENT__',MYBATIS_OUTER_TAG_PATTERN=new RegExp(a240_0x365b4b(0x183)+[...MYBATIS_OUTER_TAGS[a240_0x365b4b(0x1bf)]()]['join']('|')+a240_0x365b4b(0x198),'i');export function normalizeSqlForStaticAnalysis(_0x4718a4){const _0x4ff39a=a240_0x365b4b,_0x5cf917=typeof _0x4718a4===_0x4ff39a(0x1bc)?_0x4718a4:'';if(!startsWithMybatisStatementWrapper(_0x5cf917))return{'sql':_0x5cf917,'mode':_0x4ff39a(0x1a3)};let _0x5f7ae1=0x0,_0x118ccc='',_0xd746a1,_0x2873d7=![],_0x122ea2=![];const _0x5c14f7=[];while(_0x5f7ae1<_0x5cf917[_0x4ff39a(0x1d3)]){if(_0x5cf917[_0x4ff39a(0x199)](_0x4ff39a(0x1c0),_0x5f7ae1)){const _0x4cfd8b=_0x5cf917['indexOf'](_0x4ff39a(0x1ab),_0x5f7ae1+0x4);if(_0x4cfd8b<0x0)return invalidMybatisSource(_0x4ff39a(0x192));_0x118ccc+='\x20',_0x5f7ae1=_0x4cfd8b+0x3;continue;}if(_0x5cf917['startsWith'](_0x4ff39a(0x1a4),_0x5f7ae1)){if(!_0x2873d7||_0x122ea2)return invalidMybatisSource(_0x4ff39a(0x1b0));const _0x4f4c52=_0x5cf917[_0x4ff39a(0x1b5)](_0x4ff39a(0x1a9),_0x5f7ae1+0x9);if(_0x4f4c52<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x118ccc+=_0x5cf917['slice'](_0x5f7ae1+0x9,_0x4f4c52),_0x5f7ae1=_0x4f4c52+0x3;continue;}if(_0x5cf917[_0x4ff39a(0x199)]('<?',_0x5f7ae1)){if(_0x2873d7)return invalidMybatisSource(_0x4ff39a(0x1b4));const _0x36988c=_0x5cf917[_0x4ff39a(0x1b5)]('?>',_0x5f7ae1+0x2);if(_0x36988c<0x0)return invalidMybatisSource('Unterminated\x20XML\x20declaration.');_0x118ccc+='\x20',_0x5f7ae1=_0x36988c+0x2;continue;}if(_0x5cf917[_0x5f7ae1]!=='<'){const _0x5b2a7e=_0x5cf917[_0x4ff39a(0x1b5)]('<',_0x5f7ae1),_0x5ae2c8=_0x5b2a7e<0x0?_0x5cf917['length']:_0x5b2a7e,_0x68a6de=_0x5cf917[_0x4ff39a(0x1d8)](_0x5f7ae1,_0x5ae2c8);if((!_0x2873d7||_0x122ea2)&&_0x68a6de['trim']())return invalidMybatisSource(_0x4ff39a(0x1b7));if(_0x2873d7&&!_0x122ea2){const _0x5d3da7=decodeXmlEntities(_0x68a6de);if(_0x5d3da7===null)return invalidMybatisSource(_0x4ff39a(0x1d6));_0x118ccc+=_0x5d3da7;}else _0x118ccc+='\x20';_0x5f7ae1=_0x5ae2c8;continue;}const _0x2f1181=findXmlTagEnd(_0x5cf917,_0x5f7ae1);if(_0x2f1181<0x0)return invalidMybatisSource(_0x4ff39a(0x1a7));const _0x4f8014=_0x5cf917['slice'](_0x5f7ae1,_0x2f1181+0x1),_0x39134c=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x4ff39a(0x1a8)](_0x4f8014);if(!_0x39134c)return invalidMybatisSource(_0x4ff39a(0x1ce));const _0x2adff6=_0x39134c[0x1]==='/',_0x585c11=_0x39134c[0x2]??'',_0x112ea5=_0x585c11[_0x4ff39a(0x1d2)](),_0xa52901=_0x39134c[0x3]??'',_0x59ffd6=_0x39134c[0x4]==='/',_0x3362f8=MYBATIS_OUTER_TAGS['get'](_0x112ea5);if(!_0x3362f8&&!MYBATIS_DYNAMIC_TAGS['has'](_0x112ea5))return invalidMybatisSource(_0x4ff39a(0x1ac)+_0x112ea5+'>.');if(!_0x3362f8&&_0x585c11!==_0x112ea5)return invalidMybatisSource(_0x4ff39a(0x1dc)+_0x585c11+'>.');if(_0x2adff6){if(_0xa52901[_0x4ff39a(0x1da)]()||_0x59ffd6)return invalidMybatisSource(_0x4ff39a(0x1d4)+_0x585c11+'>.');const _0x20035e=_0x5c14f7['at'](-0x1);if(!_0x20035e||(_0x20035e[_0x4ff39a(0x1d1)]?_0x20035e['tagName']!==_0x112ea5:_0x20035e[_0x4ff39a(0x197)]!==_0x585c11))return invalidMybatisSource('Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x585c11+'>.');_0x5c14f7[_0x4ff39a(0x1a2)]();if(_0x20035e[_0x4ff39a(0x1d1)])_0x122ea2=!![];_0x118ccc+=MYBATIS_BRANCH_TAGS[_0x4ff39a(0x187)](_0x112ea5)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0xa52901))return invalidMybatisSource('Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<'+_0x585c11+'>.');if(_0x112ea5===_0x4ff39a(0x193)&&(!_0x59ffd6||_0x5c14f7['at'](-0x1)?.[_0x4ff39a(0x18f)]!==_0x4ff39a(0x1c8)))return invalidMybatisSource(_0x4ff39a(0x19d));if(_0x3362f8){if(_0x2873d7||_0x5c14f7[_0x4ff39a(0x1d3)]>0x0)return invalidMybatisSource(_0x4ff39a(0x1c2));_0x2873d7=!![],_0x122ea2=_0x59ffd6,_0xd746a1=_0x3362f8;}else{if(!_0x2873d7||_0x122ea2)return invalidMybatisSource(_0x4ff39a(0x1d5)+_0x585c11+'>.');}_0x118ccc+=_0x112ea5==='where'?'\x20WHERE\x20':_0x112ea5===_0x4ff39a(0x184)?'\x20SET\x20':_0x112ea5===_0x4ff39a(0x1c8)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x4ff39a(0x187)](_0x112ea5)&&!_0x59ffd6?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x59ffd6&&_0x5c14f7['push']({'rawName':_0x585c11,'tagName':_0x112ea5,'outer':!!_0x3362f8});}_0x5f7ae1=_0x2f1181+0x1;}if(_0x5c14f7[_0x4ff39a(0x1d3)]>0x0)return invalidMybatisSource(_0x4ff39a(0x1db)+_0x5c14f7['at'](-0x1)?.[_0x4ff39a(0x197)]+'>.');if(!_0x2873d7||!_0x122ea2)return invalidMybatisSource('MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.');return{'sql':_0x118ccc['trim'](),'mode':'mybatisXml',..._0xd746a1?{'statementType':_0xd746a1}:{}};}function hasWellFormedXmlAttributes(_0x6f2761){const _0x431cc3=a240_0x365b4b;let _0x26f5d4=0x0;const _0x45d66f=new Set();while(_0x26f5d4<_0x6f2761[_0x431cc3(0x1d3)]){while(_0x26f5d4<_0x6f2761[_0x431cc3(0x1d3)]&&/\s/['test'](_0x6f2761[_0x26f5d4]??''))_0x26f5d4+=0x1;if(_0x26f5d4>=_0x6f2761['length'])return!![];const _0x4d52c1=/^[A-Za-z_:][\w:.-]*/[_0x431cc3(0x1a8)](_0x6f2761['slice'](_0x26f5d4)),_0x25b0fe=_0x4d52c1?.[0x0];if(!_0x25b0fe||_0x45d66f[_0x431cc3(0x187)](_0x25b0fe))return![];_0x45d66f['add'](_0x25b0fe),_0x26f5d4+=_0x25b0fe['length'];while(_0x26f5d4<_0x6f2761[_0x431cc3(0x1d3)]&&/\s/[_0x431cc3(0x186)](_0x6f2761[_0x26f5d4]??''))_0x26f5d4+=0x1;if(_0x6f2761[_0x26f5d4]!=='=')return![];_0x26f5d4+=0x1;while(_0x26f5d4<_0x6f2761[_0x431cc3(0x1d3)]&&/\s/['test'](_0x6f2761[_0x26f5d4]??''))_0x26f5d4+=0x1;const _0x392477=_0x6f2761[_0x26f5d4];if(_0x392477!=='\x22'&&_0x392477!=='\x27')return![];_0x26f5d4+=0x1;const _0x28b13d=_0x6f2761['indexOf'](_0x392477,_0x26f5d4);if(_0x28b13d<0x0)return![];if(decodeXmlEntities(_0x6f2761['slice'](_0x26f5d4,_0x28b13d))===null)return![];_0x26f5d4=_0x28b13d+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x35b596){const _0x402b5e=a240_0x365b4b;let _0x2b1837=0x0;const _0x531aa8=()=>{const _0xf5c620=a240_0x508e;while(_0x2b1837<_0x35b596[_0xf5c620(0x1d3)]&&/\s/[_0xf5c620(0x186)](_0x35b596[_0x2b1837]??''))_0x2b1837+=0x1;};_0x531aa8();while(_0x2b1837<_0x35b596[_0x402b5e(0x1d3)]){if(_0x35b596[_0x402b5e(0x199)](_0x402b5e(0x1c0),_0x2b1837)){const _0x267666=_0x35b596[_0x402b5e(0x1b5)](_0x402b5e(0x1ab),_0x2b1837+0x4);if(_0x267666<0x0)return!![];_0x2b1837=_0x267666+0x3,_0x531aa8();continue;}if(_0x35b596[_0x402b5e(0x199)]('<?',_0x2b1837)){const _0x39aa62=_0x35b596['indexOf']('?>',_0x2b1837+0x2);if(_0x39aa62<0x0)return!![];_0x2b1837=_0x39aa62+0x2,_0x531aa8();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x402b5e(0x186)](_0x35b596[_0x402b5e(0x1d8)](_0x2b1837));}function invalidMybatisSource(_0x3a38ab){return{'sql':'','mode':'mybatisXml','error':_0x3a38ab};}function findXmlTagEnd(_0x41ce29,_0x486a58){const _0x5eeb02=a240_0x365b4b;let _0x5efe40;for(let _0x19ccc3=_0x486a58+0x1;_0x19ccc3<_0x41ce29[_0x5eeb02(0x1d3)];_0x19ccc3+=0x1){const _0x16126c=_0x41ce29[_0x19ccc3];if(_0x5efe40){if(_0x16126c===_0x5efe40)_0x5efe40=undefined;continue;}if(_0x16126c==='\x22'||_0x16126c==='\x27'){_0x5efe40=_0x16126c;continue;}if(_0x16126c==='>')return _0x19ccc3;}return-0x1;}function decodeXmlEntities(_0x74cde){let _0xfeb2f1=![];const _0x2c2c60=_0x74cde['replace'](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x5168f6=>{const _0x3aa7a1=a240_0x508e;if(_0x5168f6===_0x3aa7a1(0x1b2))return'<';if(_0x5168f6==='>')return'>';if(_0x5168f6===_0x3aa7a1(0x185))return'\x22';if(_0x5168f6===_0x3aa7a1(0x189))return'\x27';if(_0x5168f6==='&')return'&';const _0x4318cc=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x3aa7a1(0x1a8)](_0x5168f6);if(_0x4318cc){const _0x104964=_0x4318cc[0x1],_0x5158b3=_0x4318cc[0x2],_0x407286=Number[_0x3aa7a1(0x1a5)](_0x104964??_0x5158b3??'',_0x104964?0x10:0xa);if(isValidXmlCharacter(_0x407286))return String[_0x3aa7a1(0x1a6)](_0x407286);}return _0xfeb2f1=!![],'';});return _0xfeb2f1?null:_0x2c2c60;}function isValidXmlCharacter(_0x979c61){return _0x979c61===0x9||_0x979c61===0xa||_0x979c61===0xd||_0x979c61>=0x20&&_0x979c61<=0xd7ff||_0x979c61>=0xe000&&_0x979c61<=0xfffd||_0x979c61>=0x10000&&_0x979c61<=0x10ffff;}function a240_0x508e(_0x36e960,_0x44e6a0){_0x36e960=_0x36e960-0x183;const _0x1644ae=a240_0x1644();let _0x508e90=_0x1644ae[_0x36e960];return _0x508e90;}export function detectSqlType(_0x372572){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x372572));}function detectNormalizedSqlType(_0xe02c3b){const _0x202f8b=a240_0x365b4b;if(_0xe02c3b[_0x202f8b(0x1d0)])return{'type':_0x202f8b(0x1ae),'isSelectOnly':![],'isDangerous':![],'reason':_0xe02c3b[_0x202f8b(0x1d0)]};if(!_0xe02c3b[_0x202f8b(0x1a3)][_0x202f8b(0x1da)]())return{'type':_0x202f8b(0x1ae),'isSelectOnly':![],'isDangerous':![],'reason':_0x202f8b(0x1c3)};const _0xcb3db3=stripStaticAnalysisMarkers(_0xe02c3b[_0x202f8b(0x1a3)])['replace'](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x202f8b(0x188)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x202f8b(0x188)](/\/\*[\s\S]*?\*\//g,'')[_0x202f8b(0x1da)](),_0x4b1ebb=_0xcb3db3[_0x202f8b(0x1a0)]('\x0a');let _0x5aeae4='';for(const _0xbae638 of _0x4b1ebb){const _0x3b7d9c=_0xbae638[_0x202f8b(0x1da)]();if(!_0x3b7d9c||_0x3b7d9c[_0x202f8b(0x199)]('--')||_0x3b7d9c[_0x202f8b(0x199)]('/*'))continue;_0x5aeae4=_0x3b7d9c;break;}const _0x4713a8=_0x5aeae4['toUpperCase'](),_0x116bbd=_0xe02c3b[_0x202f8b(0x1b3)],_0x5c9691=maskSqlTextForBlockedKeywordScan(_0xcb3db3),_0x2e7ae2=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x202f8b(0x186)](_0x5c9691);if(_0x116bbd===_0x202f8b(0x1d9)||!_0x116bbd&&(_0x4713a8[_0x202f8b(0x199)](_0x202f8b(0x1d9))||_0x4713a8[_0x202f8b(0x199)](_0x202f8b(0x19f)))){const _0x32ce65=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x202f8b(0x186)](_0xcb3db3);return{'type':'SELECT','isSelectOnly':!_0x32ce65,'isDangerous':_0x32ce65,'reason':_0x32ce65?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x116bbd===_0x202f8b(0x1c4)||!_0x116bbd&&_0x4713a8[_0x202f8b(0x199)]('INSERT'))return{'type':_0x202f8b(0x1c4),'isSelectOnly':![],'isDangerous':_0x2e7ae2,'reason':_0x2e7ae2?_0x202f8b(0x1b6):undefined};if(_0x116bbd===_0x202f8b(0x1cf)||!_0x116bbd&&_0x4713a8['startsWith']('UPDATE'))return{'type':_0x202f8b(0x1cf),'isSelectOnly':![],'isDangerous':_0x2e7ae2,'reason':_0x2e7ae2?_0x202f8b(0x1b6):undefined};if(_0x116bbd===_0x202f8b(0x1c5)||!_0x116bbd&&_0x4713a8['startsWith'](_0x202f8b(0x1c5)))return{'type':_0x202f8b(0x1c5),'isSelectOnly':![],'isDangerous':!![],'reason':_0x202f8b(0x18b)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x202f8b(0x186)](_0x4713a8))return{'type':'DDL','isSelectOnly':![],'isDangerous':!![],'reason':_0x202f8b(0x1c6)};return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x3d7f3d){const _0x545ba4=a240_0x365b4b;return _0x3d7f3d[_0x545ba4(0x18a)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x3132ad){const _0x5bdc6a=a240_0x365b4b;return _0x3132ad[_0x5bdc6a(0x188)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x5bdc6a(0x188)](/"(?:""|\\.|[^"])*"/g,'\x20')['replace'](/`(?:``|\\.|[^`])*`/g,'\x20')['replace'](/--.*$/gm,'\x20')[_0x5bdc6a(0x188)](/#.*$/gm,'\x20')[_0x5bdc6a(0x188)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x28b119){const _0x5171b8=a240_0x365b4b,_0x155426=_0x28b119[_0x5171b8(0x188)](/#\{[^}]*\}/g,'?')[_0x5171b8(0x188)](/\$\{[^}]*\}/g,'?')[_0x5171b8(0x188)](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')[_0x5171b8(0x188)](/\/\*[\s\S]*?\*\//g,''),_0x1cf452=[],_0x436cef=_0x155426[_0x5171b8(0x1cb)](/FROM\s+([^\s,)(]+)/i);addTable(_0x1cf452,_0x436cef?.[0x1]);for(const _0xfb2208 of _0x155426[_0x5171b8(0x194)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x1cf452,_0xfb2208[0x1]);}const _0x44f407=_0x155426[_0x5171b8(0x1cb)](/INTO\s+([^\s(]+)/i);addTable(_0x1cf452,_0x44f407?.[0x1]);const _0x1d6661=_0x155426[_0x5171b8(0x1cb)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x1cf452,_0x1d6661?.[0x1]),_0x1cf452;}function addTable(_0x5b8e9e,_0xcbb81b){const _0x2c8a08=a240_0x365b4b,_0x48045d=_0xcbb81b?.[_0x2c8a08(0x188)](/[`"]/g,'');_0x48045d&&_0x48045d!==UNRESOLVED_SQL_FRAGMENT&&!_0x5b8e9e[_0x2c8a08(0x19e)](_0x48045d)&&_0x5b8e9e[_0x2c8a08(0x191)](_0x48045d);}function extractParameters(_0x1df204){const _0xd8919c=a240_0x365b4b,_0x56dc1e=new Set();for(const _0x250b83 of _0x1df204[_0xd8919c(0x194)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x250b83[0x1])_0x56dc1e[_0xd8919c(0x1be)](_0x250b83[0x1]);}return Array[_0xd8919c(0x1d7)](_0x56dc1e);}export function validateSql(_0x568fd0){const _0x3787a7=a240_0x365b4b,_0x3fe8ae=normalizeSqlForStaticAnalysis(_0x568fd0),_0x568e01=detectNormalizedSqlType(_0x3fe8ae),_0x43db8a=stripStaticAnalysisMarkers(_0x3fe8ae[_0x3787a7(0x1a3)]),_0x3435bf=_0x3fe8ae[_0x3787a7(0x1d0)]?[]:extractTables(_0x43db8a),_0x5d76f2=_0x3fe8ae[_0x3787a7(0x1d0)]?[]:extractParameters(_0x43db8a);if(_0x568e01[_0x3787a7(0x1c1)])return{'valid':![],'sqlType':_0x568e01,'tables':_0x3435bf,'parameters':_0x5d76f2,'message':_0x568e01[_0x3787a7(0x19a)]||_0x568e01[_0x3787a7(0x1aa)]+_0x3787a7(0x1c9)};if(_0x568e01['type']==='UNKNOWN')return{'valid':![],'sqlType':_0x568e01,'tables':_0x3435bf,'parameters':_0x5d76f2,'message':_0x3fe8ae[_0x3787a7(0x1d0)]?_0x3787a7(0x1b9)+_0x3fe8ae[_0x3787a7(0x1d0)]:_0x3787a7(0x18e)};return{'valid':!![],'sqlType':_0x568e01,'tables':_0x3435bf,'parameters':_0x5d76f2,'message':_0x568e01[_0x3787a7(0x1aa)]+_0x3787a7(0x18c)+(_0x3435bf[_0x3787a7(0x1d3)]?_0x3435bf['join'](',\x20'):_0x3787a7(0x18d))+(_0x5d76f2['length']?_0x3787a7(0x1c7)+_0x5d76f2[_0x3787a7(0x1cd)](',\x20'):'')};}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a241_0x3f54(){const _0x35c312=['join','\x0a\x20\x20\x20\x20\x20\x20\x20','2449332WvyiuH','Set\x20appcode\x20via\x20`','7vrerWC','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','Run\x20`','2726286YKPJev','2944590VZGbNF','1179220rAKynz','Tip:\x20`','14530MUpOiY','20lSaQjh','\x20auth`\x20to\x20login\x20first.','590032yJTFhf','177YtANwM','\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.','750211VMhhzd','12yZWToO'];a241_0x3f54=function(){return _0x35c312;};return a241_0x3f54();}function a241_0x2ac1(_0x45a169,_0x49bd49){_0x45a169=_0x45a169-0xc6;const _0x3f549b=a241_0x3f54();let _0x2ac18d=_0x3f549b[_0x45a169];return _0x2ac18d;}const a241_0x42fc0e=a241_0x2ac1;(function(_0x2bc2c6,_0x44d148){const _0x1c2c34=a241_0x2ac1,_0x3c895c=_0x2bc2c6();while(!![]){try{const _0x31eb5a=parseInt(_0x1c2c34(0xd4))/0x1+parseInt(_0x1c2c34(0xce))/0x2*(-parseInt(_0x1c2c34(0xd2))/0x3)+-parseInt(_0x1c2c34(0xd5))/0x4*(-parseInt(_0x1c2c34(0xcc))/0x5)+parseInt(_0x1c2c34(0xca))/0x6*(-parseInt(_0x1c2c34(0xc7))/0x7)+parseInt(_0x1c2c34(0xd1))/0x8+parseInt(_0x1c2c34(0xd8))/0x9+parseInt(_0x1c2c34(0xcf))/0xa*(-parseInt(_0x1c2c34(0xcb))/0xb);if(_0x31eb5a===_0x44d148)break;else _0x3c895c['push'](_0x3c895c['shift']());}catch(_0xebe435){_0x3c895c['push'](_0x3c895c['shift']());}}}(a241_0x3f54,0x5e0e1));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':a241_0x42fc0e(0xc9)+CLI_BIN_NAME+a241_0x42fc0e(0xd0),'configMissingHint':[a241_0x42fc0e(0xc6)+CLI_BIN_NAME+a241_0x42fc0e(0xc8),a241_0x42fc0e(0xcd)+CLI_BIN_NAME+a241_0x42fc0e(0xd3)][a241_0x42fc0e(0xd6)](a241_0x42fc0e(0xd7)),'notInProjectHint':'Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.'});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x91d6b,_0x914e0a){const _0x2abf19=a242_0x40b8,_0x415c94=_0x91d6b();while(!![]){try{const _0x3a92df=parseInt(_0x2abf19(0xc1))/0x1*(-parseInt(_0x2abf19(0xba))/0x2)+parseInt(_0x2abf19(0xbf))/0x3+-parseInt(_0x2abf19(0xbc))/0x4+-parseInt(_0x2abf19(0xb6))/0x5*(parseInt(_0x2abf19(0xb5))/0x6)+-parseInt(_0x2abf19(0xbe))/0x7*(parseInt(_0x2abf19(0xbd))/0x8)+-parseInt(_0x2abf19(0xc0))/0x9*(-parseInt(_0x2abf19(0xbb))/0xa)+-parseInt(_0x2abf19(0xc2))/0xb*(-parseInt(_0x2abf19(0xb7))/0xc);if(_0x3a92df===_0x914e0a)break;else _0x415c94['push'](_0x415c94['shift']());}catch(_0x2b431f){_0x415c94['push'](_0x415c94['shift']());}}}(a242_0x4d33,0xea0c0));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';function a242_0x4d33(){const _0x42bbe2=['yes','map','2ZCWtLQ','10mDHkLd','419400tmrLMM','32wzxAZn','3149013pbaORY','5744880OLdSkP','12147246aUqnhg','162512TMGhIc','7073gJaWhL','11100dXCwOR','2645nhSKvD','13800DaoDqm'];a242_0x4d33=function(){return _0x42bbe2;};return a242_0x4d33();}function a242_0x40b8(_0x58a016,_0xb2d59c){_0x58a016=_0x58a016-0xb5;const _0x4d337a=a242_0x4d33();let _0x40b8b4=_0x4d337a[_0x58a016];return _0x40b8b4;}import{buildAllFlags as a242_0x4263c9}from'@lovrabet/cli-framework';import{EXPLICIT_YES_FLAG_DESCRIPTION,requiresExplicitYes}from'../framework/explicit-yes.js';export function buildAllFlags(_0x2ca83f){const _0x55b28c=a242_0x40b8,_0xd96a85=a242_0x4263c9(_0x2ca83f,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});if(!requiresExplicitYes(_0x2ca83f))return _0xd96a85;return _0xd96a85[_0x55b28c(0xb9)](_0x35ef3e=>_0x35ef3e['name']===_0x55b28c(0xb8)?{..._0x35ef3e,'description':EXPLICIT_YES_FLAG_DESCRIPTION}:_0x35ef3e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x71697,_0x96c7dd){var _0x3be2fb=a243_0x7161,_0x321430=_0x71697();while(!![]){try{var _0x5a02cc=parseInt(_0x3be2fb(0x10a))/0x1+-parseInt(_0x3be2fb(0x104))/0x2+parseInt(_0x3be2fb(0x106))/0x3*(-parseInt(_0x3be2fb(0x105))/0x4)+-parseInt(_0x3be2fb(0x102))/0x5*(-parseInt(_0x3be2fb(0x10b))/0x6)+parseInt(_0x3be2fb(0x100))/0x7+-parseInt(_0x3be2fb(0x108))/0x8*(parseInt(_0x3be2fb(0xff))/0x9)+parseInt(_0x3be2fb(0x107))/0xa;if(_0x5a02cc===_0x96c7dd)break;else _0x321430['push'](_0x321430['shift']());}catch(_0x2425ff){_0x321430['push'](_0x321430['shift']());}}}(a243_0x2be0,0x84e49));function a243_0x7161(_0x14e590,_0x20f76d){_0x14e590=_0x14e590-0xfd;var _0x2be0f5=a243_0x2be0();var _0x7161c7=_0x2be0f5[_0x14e590];return _0x7161c7;}import{resolveOutputConfig}from'@lovrabet/cli-framework';export function usesStructuredErrorOutput(_0x315899){var _0xdf90fa=a243_0x7161;return _0x315899?.[_0xdf90fa(0xfe)]===!![];}export function resolveErrorOutputFormat(_0x28be2c){var _0x53d211=a243_0x7161;if(!_0x28be2c['def'])return _0x28be2c['defaultFormat']??'compress';return resolveOutputConfig({'flags':_0x28be2c[_0x53d211(0x109)]??{},'def':_0x28be2c[_0x53d211(0x103)],'configDefault':_0x28be2c[_0x53d211(0x101)]})[_0x53d211(0xfd)];}function a243_0x2be0(){var _0x1f5d83=['1094737ZfrmUL','defaultFormat','1745HZSCnH','def','1608030wvbFHA','1576168WRILZx','6CsEepF','12201480IyEVfl','130136WIdCKf','flags','702507IeqNkV','11334ZohImN','format','structuredErrors','333sxarTH'];a243_0x2be0=function(){return _0x1f5d83;};return a243_0x2be0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a244_0x263f(){const _0x3490=['kb\x20delete','menu\x20delete','209mBLcMj','8098OddiSt','1331000wYgXbX','154773uAwYGi','has','service','360624bVhALK','964112JOLRih','51028QZrQQi','Required\x20for\x20execution\x20after\x20reviewing\x20the\x20--dry-run\x20plan','434PzbNaI','12666GLcNqA','180YdAKCO','22tfKneW','69truMsS'];a244_0x263f=function(){return _0x3490;};return a244_0x263f();}const a244_0x45aa52=a244_0x5cc9;function a244_0x5cc9(_0x37232b,_0x5a06a2){_0x37232b=_0x37232b-0xc1;const _0x263f9d=a244_0x263f();let _0x5cc9cb=_0x263f9d[_0x37232b];return _0x5cc9cb;}(function(_0x540968,_0x1da7d8){const _0x14aa0=a244_0x5cc9,_0x2eaaf9=_0x540968();while(!![]){try{const _0x3045b3=-parseInt(_0x14aa0(0xcb))/0x1*(parseInt(_0x14aa0(0xd0))/0x2)+-parseInt(_0x14aa0(0xcc))/0x3*(parseInt(_0x14aa0(0xc6))/0x4)+parseInt(_0x14aa0(0xd1))/0x5+-parseInt(_0x14aa0(0xc9))/0x6*(-parseInt(_0x14aa0(0xc8))/0x7)+-parseInt(_0x14aa0(0xc5))/0x8+-parseInt(_0x14aa0(0xc1))/0x9*(parseInt(_0x14aa0(0xca))/0xa)+parseInt(_0x14aa0(0xcf))/0xb*(parseInt(_0x14aa0(0xc4))/0xc);if(_0x3045b3===_0x1da7d8)break;else _0x2eaaf9['push'](_0x2eaaf9['shift']());}catch(_0x348dd0){_0x2eaaf9['push'](_0x2eaaf9['shift']());}}}(a244_0x263f,0x25f81));const EXPLICIT_YES_COMMANDS=new Set([a244_0x45aa52(0xce),a244_0x45aa52(0xcd),'notification\x20config-update','notification\x20config-delete']);export const EXPLICIT_YES_FLAG_DESCRIPTION=a244_0x45aa52(0xc7);export function requiresExplicitYes(_0x3fea7e){const _0x250864=a244_0x45aa52;return EXPLICIT_YES_COMMANDS[_0x250864(0xc2)](_0x3fea7e[_0x250864(0xc3)]+'\x20'+_0x3fea7e['command']);}
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a245_0x134c3c=a245_0x31c8;(function(_0x3ac9aa,_0x3e75c4){const _0x2b9ad9=a245_0x31c8,_0x4e1d5d=_0x3ac9aa();while(!![]){try{const _0x43efb0=parseInt(_0x2b9ad9(0x1d2))/0x1*(parseInt(_0x2b9ad9(0x1d1))/0x2)+parseInt(_0x2b9ad9(0x1c7))/0x3*(-parseInt(_0x2b9ad9(0x1d3))/0x4)+parseInt(_0x2b9ad9(0x1ce))/0x5*(-parseInt(_0x2b9ad9(0x1ca))/0x6)+-parseInt(_0x2b9ad9(0x1cd))/0x7+-parseInt(_0x2b9ad9(0x1cf))/0x8*(-parseInt(_0x2b9ad9(0x1c9))/0x9)+-parseInt(_0x2b9ad9(0x1c8))/0xa*(-parseInt(_0x2b9ad9(0x1cb))/0xb)+parseInt(_0x2b9ad9(0x1cc))/0xc;if(_0x43efb0===_0x3e75c4)break;else _0x4e1d5d['push'](_0x4e1d5d['shift']());}catch(_0x4ec0fa){_0x4e1d5d['push'](_0x4e1d5d['shift']());}}}(a245_0x2353,0xaaf04));import{createFlagHelpers}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a245_0x2353(){const _0x106f40=['322225OnNBnd','86888ivWGCy','parseFlags','324kpAwLm','3694LTrSeK','8qpzqJu','1415691xAghTC','4075910sZhjLU','873BfuFhr','114hctPxz','11kRYhvH','17219676nNhFmw','4382672nSSCRi'];a245_0x2353=function(){return _0x106f40;};return a245_0x2353();}function a245_0x31c8(_0x5d5616,_0x211e2b){_0x5d5616=_0x5d5616-0x1c7;const _0x23538f=a245_0x2353();let _0x31c82c=_0x23538f[_0x5d5616];return _0x31c82c;}const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers[a245_0x134c3c(0x1d0)];export const validateFlags=helpers['validateFlags'];
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a246_0x2ab923=a246_0x2836;function a246_0x2836(_0x5503a6,_0xc868bf){_0x5503a6=_0x5503a6-0x1bb;const _0xdbfbc0=a246_0xdbfb();let _0x2836a2=_0xdbfbc0[_0x5503a6];return _0x2836a2;}(function(_0x28f266,_0x2ae8fd){const _0x61a142=a246_0x2836,_0x253292=_0x28f266();while(!![]){try{const _0x188f18=parseInt(_0x61a142(0x1bd))/0x1*(-parseInt(_0x61a142(0x1bf))/0x2)+-parseInt(_0x61a142(0x1c4))/0x3+-parseInt(_0x61a142(0x1c5))/0x4*(parseInt(_0x61a142(0x1ca))/0x5)+parseInt(_0x61a142(0x1c9))/0x6+-parseInt(_0x61a142(0x1cb))/0x7*(-parseInt(_0x61a142(0x1bc))/0x8)+-parseInt(_0x61a142(0x1c7))/0x9+-parseInt(_0x61a142(0x1c3))/0xa*(-parseInt(_0x61a142(0x1be))/0xb);if(_0x188f18===_0x2ae8fd)break;else _0x253292['push'](_0x253292['shift']());}catch(_0x17e8c3){_0x253292['push'](_0x253292['shift']());}}}(a246_0xdbfb,0xe44b9));import{createHelpGenerators}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';function a246_0xdbfb(){const _0x2d781d=['198935exLGEz','43006QLGfIn','Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.','\x20[args]\x20[flags]','generateServiceHelp','2500vzFYPJ','5225604CHZrxO','4cGMQkF','Requires\x20explicit\x20--yes\x20for\x20execution;\x20use\x20--dry-run\x20to\x20preview.','7613496izeQwT','\x20workspace\x20init`\x20or\x20--appcode).','557580VipeLX','7514630QLPNju','11762324VppsGp','generateFullHelp','8cFpoyL','59uXlQte'];a246_0xdbfb=function(){return _0x2d781d;};return a246_0xdbfb();}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':_0x289b1b=>serviceGroups['get'](_0x289b1b),'buildAllFlags':buildAllFlags,'appPrerequisiteText':'Requires\x20appcode\x20(set\x20via\x20`'+CLI_BIN_NAME+a246_0x2ab923(0x1c8),'serviceUsageSuffix':a246_0x2ab923(0x1c1)});export function generateCommandHelp(_0x204d07){const _0x23944d=a246_0x2ab923,_0xd6b836=generators['generateCommandHelp'](_0x204d07);if(!requiresExplicitYes(_0x204d07))return _0xd6b836;return _0xd6b836['replace'](_0x23944d(0x1c0),_0x23944d(0x1c6));}export const generateServiceHelp=generators[a246_0x2ab923(0x1c2)];export const generateFullHelp=generators[a246_0x2ab923(0x1bb)];
|
package/lib/framework/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a247_0x479a(){var _0x340c7e=['7lVByDp','63985850eYhGre','26xAZatc','112500Jaurby','165LyUGMx','9277158hjxpsU','4728210burAXX','32792PwCEpt','8682088gplWjA','7474878fytcrh'];a247_0x479a=function(){return _0x340c7e;};return a247_0x479a();}function a247_0xc00a(_0x3553f5,_0x98f6ab){_0x3553f5=_0x3553f5-0xaf;var _0x479afb=a247_0x479a();var _0xc00a7c=_0x479afb[_0x3553f5];return _0xc00a7c;}(function(_0x57047a,_0x15b8e1){var _0x89bd42=a247_0xc00a,_0x4fa614=_0x57047a();while(!![]){try{var _0x18288c=parseInt(_0x89bd42(0xb4))/0x1*(parseInt(_0x89bd42(0xaf))/0x2)+parseInt(_0x89bd42(0xb6))/0x3*(-parseInt(_0x89bd42(0xb5))/0x4)+-parseInt(_0x89bd42(0xb8))/0x5+-parseInt(_0x89bd42(0xb7))/0x6+parseInt(_0x89bd42(0xb2))/0x7*(-parseInt(_0x89bd42(0xb0))/0x8)+-parseInt(_0x89bd42(0xb1))/0x9+parseInt(_0x89bd42(0xb3))/0xa;if(_0x18288c===_0x15b8e1)break;else _0x4fa614['push'](_0x4fa614['shift']());}catch(_0x5e1f86){_0x4fa614['push'](_0x4fa614['shift']());}}}(a247_0x479a,0xd47e0));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';export{extractList,extractPaging}from'../framework/response.js';export{riskLevelOrder}from'../framework/types.js';
|
package/lib/framework/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4327bc,_0x47e693){const _0x1bdb99=a248_0x3ad5,_0x499988=_0x4327bc();while(!![]){try{const _0x97bc57=-parseInt(_0x1bdb99(0x13b))/0x1*(parseInt(_0x1bdb99(0x145))/0x2)+-parseInt(_0x1bdb99(0x147))/0x3*(-parseInt(_0x1bdb99(0x140))/0x4)+-parseInt(_0x1bdb99(0x132))/0x5+-parseInt(_0x1bdb99(0x14b))/0x6+-parseInt(_0x1bdb99(0x135))/0x7*(parseInt(_0x1bdb99(0x149))/0x8)+parseInt(_0x1bdb99(0x14a))/0x9*(parseInt(_0x1bdb99(0x14c))/0xa)+-parseInt(_0x1bdb99(0x142))/0xb*(-parseInt(_0x1bdb99(0x13a))/0xc);if(_0x97bc57===_0x47e693)break;else _0x499988['push'](_0x499988['shift']());}catch(_0xdd8c23){_0x499988['push'](_0x499988['shift']());}}}(a248_0x31f8,0x39f33));import{createFormatOutput,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliError,CliErrors}from'../errors.js';import{applyJqFilter}from'../utils/apply-jq-filter.js';function a248_0x3ad5(_0xe605b1,_0x5cfc10){_0xe605b1=_0xe605b1-0x12f;const _0x31f84d=a248_0x31f8();let _0x3ad563=_0x31f84d[_0xe605b1];return _0x3ad563;}const baseFormatOutput=createFormatOutput({'cliErrors':CliErrors,'jqBinaryResolverOptions':{'bundledJqPaths':resolveBundledJqPaths()}});export function formatOutput(_0x52005e,_0x27359c){const _0x7deffa=a248_0x3ad5,_0x378ac4=_0x52005e[_0x7deffa(0x131)],{_notice:_0x10814d,..._0x5d03d6}=_0x52005e;void _0x10814d,baseFormatOutput(_0x5d03d6,_0x27359c),_0x27359c[_0x7deffa(0x13e)]===_0x7deffa(0x138)&&printPrettyNotice(_0x378ac4);}export function formatCliError(_0x30f539,_0x19dd94){const _0x15fc5b=a248_0x3ad5;if(_0x19dd94['format']===_0x15fc5b(0x138))return![];const _0x153c9d=_0x30f539[_0x15fc5b(0x130)],_0x49dc4e={'ok':![],'command':_0x19dd94[_0x15fc5b(0x144)],'risk':_0x19dd94['risk'],'data':_0x153c9d??null,'error':{'code':_0x30f539[_0x15fc5b(0x133)],'message':_0x30f539[_0x15fc5b(0x12f)],..._0x30f539[_0x15fc5b(0x146)]?{'hint':_0x30f539['hint']}:{}}},_0x16772d=_0x19dd94[_0x15fc5b(0x13e)]==='json'?JSON[_0x15fc5b(0x148)](_0x49dc4e,null,0x2):JSON['stringify'](_0x49dc4e);let _0x4e6cff=_0x16772d;if(_0x19dd94[_0x15fc5b(0x137)]?.[_0x15fc5b(0x139)]())try{_0x4e6cff=applyJqFilter(_0x16772d,_0x19dd94[_0x15fc5b(0x137)]);}catch(_0x53069c){const _0xa50065=_0x53069c instanceof CliError?_0x53069c:CliErrors[_0x15fc5b(0x143)]('jq:\x20'+(_0x53069c instanceof Error?_0x53069c['message']:String(_0x53069c))),_0xbc6498={..._0x49dc4e,'error':{'code':_0xa50065['code'],'message':_0xa50065['message'],..._0xa50065[_0x15fc5b(0x146)]?{'hint':_0xa50065[_0x15fc5b(0x146)]}:{},'cause':_0x49dc4e[_0x15fc5b(0x136)]}};_0x4e6cff=_0x19dd94['format']==='json'?JSON['stringify'](_0xbc6498,null,0x2):JSON['stringify'](_0xbc6498);}return process[_0x15fc5b(0x13d)][_0x15fc5b(0x13c)](_0x4e6cff[_0x15fc5b(0x134)]('\x0a')?_0x4e6cff:_0x4e6cff+'\x0a'),!![];}function a248_0x31f8(){const _0x85dea9=['1078ywmpey','validation','command','4wFrTTq','hint','129iMUler','stringify','10480vBSUbQ','5103uNUzQi','2735436JgsTBy','930VcrCDr','message','data','_notice','636965EpKzmW','code','endsWith','1393nXwVYX','error','jqFilter','pretty','trim','119052orRLNv','29847ZmHDEr','write','stdout','format','url','10796VjYSmY','update'];a248_0x31f8=function(){return _0x85dea9;};return a248_0x31f8();}function printPrettyNotice(_0x3b706b){const _0xe104fa=a248_0x3ad5;if(!_0x3b706b?.[_0xe104fa(0x141)])return;console[_0xe104fa(0x136)](_0x3b706b[_0xe104fa(0x141)][_0xe104fa(0x12f)]+'\x20('+_0x3b706b['update'][_0xe104fa(0x13f)]+')');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3b16b8,_0x2f5faf){var _0x4b55f1=a249_0x2356,_0x5b6d8b=_0x3b16b8();while(!![]){try{var _0x20f616=-parseInt(_0x4b55f1(0x1fa))/0x1+-parseInt(_0x4b55f1(0x1f5))/0x2+parseInt(_0x4b55f1(0x1f6))/0x3*(-parseInt(_0x4b55f1(0x1f3))/0x4)+-parseInt(_0x4b55f1(0x1f4))/0x5+parseInt(_0x4b55f1(0x1fb))/0x6*(parseInt(_0x4b55f1(0x1f7))/0x7)+-parseInt(_0x4b55f1(0x1f9))/0x8+parseInt(_0x4b55f1(0x1f8))/0x9;if(_0x20f616===_0x2f5faf)break;else _0x5b6d8b['push'](_0x5b6d8b['shift']());}catch(_0x4533f4){_0x5b6d8b['push'](_0x5b6d8b['shift']());}}}(a249_0x38cf,0xdefaa));export{extractList,extractPaging}from'@lovrabet/cli-framework';function a249_0x2356(_0x5eeb92,_0x174133){_0x5eeb92=_0x5eeb92-0x1f3;var _0x38cf41=a249_0x38cf();var _0x235613=_0x38cf41[_0x5eeb92];return _0x235613;}function a249_0x38cf(){var _0x317d61=['2337752CBgxtf','42327fjzJUt','491239ctByhM','40840695HjrWdt','1485040YlqZxq','648953pIqBln','30ivMumI','340BegjNa','3863470hrIeOA'];a249_0x38cf=function(){return _0x317d61;};return a249_0x38cf();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x587f11,_0x26517c){const _0x526c96=a250_0x27dc,_0x5c1d7a=_0x587f11();while(!![]){try{const _0x40bf1b=parseInt(_0x526c96(0x7d))/0x1*(parseInt(_0x526c96(0x76))/0x2)+parseInt(_0x526c96(0x84))/0x3+-parseInt(_0x526c96(0x83))/0x4*(parseInt(_0x526c96(0x6f))/0x5)+parseInt(_0x526c96(0x78))/0x6*(parseInt(_0x526c96(0x7c))/0x7)+parseInt(_0x526c96(0x80))/0x8*(-parseInt(_0x526c96(0x70))/0x9)+parseInt(_0x526c96(0x75))/0xa+-parseInt(_0x526c96(0x82))/0xb;if(_0x40bf1b===_0x26517c)break;else _0x5c1d7a['push'](_0x5c1d7a['shift']());}catch(_0x3423b0){_0x5c1d7a['push'](_0x5c1d7a['shift']());}}}(a250_0x4585,0x399b9));import{CliErrors}from'../errors.js';import{resolveAlias,listAliases}from'../core/alias-resolver.js';import{CLI_BIN_NAME}from'../constant/cli.js';function a250_0x4585(){const _0x5b38ed=['27212CUcLaE','959154XvplbY','validation','85yBDKGQ','1043334MNWTxY','\x20api\x20pull`\x20first.','flags','\x22.\x20','alias','801250rlHusj','226150iQwNgx','.\x20Run\x20`','4008vpnpHf','name','`\x20requires\x20either\x20--code\x20or\x20--alias.','code','2674TIzjfA','3UzNSOg','join','length','8IHqBGI','some','5793766ZYnVbU'];a250_0x4585=function(){return _0x5b38ed;};return a250_0x4585();}function a250_0x27dc(_0x4cea3d,_0x3b5f79){_0x4cea3d=_0x4cea3d-0x6e;const _0x4585e1=a250_0x4585();let _0x27dc8e=_0x4585e1[_0x4cea3d];return _0x27dc8e;}export function resolveAliasToCode(_0x299c85,_0x31a53a,_0x3d0d0a,_0x110466){const _0x19ef2f=a250_0x27dc,_0x51fc3a=_0x299c85[_0x19ef2f(0x72)][_0x19ef2f(0x81)](_0x280369=>_0x280369[_0x19ef2f(0x79)]===_0x19ef2f(0x7b)&&_0x280369['type']==='string'),_0xd63ae=_0x299c85[_0x19ef2f(0x72)]['some'](_0x275afb=>_0x275afb[_0x19ef2f(0x79)]===_0x19ef2f(0x74)&&_0x275afb['type']==='string');if(!_0x51fc3a||!_0xd63ae)return;const _0x4f6797=_0x31a53a[_0x19ef2f(0x7b)]?String(_0x31a53a[_0x19ef2f(0x7b)]):'',_0x2122bb=_0x31a53a[_0x19ef2f(0x74)]?String(_0x31a53a[_0x19ef2f(0x74)]):'';if(!_0x4f6797&&!_0x2122bb)throw CliErrors[_0x19ef2f(0x6e)]('`'+_0x110466+_0x19ef2f(0x7a));if(_0x2122bb&&!_0x4f6797){const _0x2e4c86=resolveAlias(_0x3d0d0a,_0x2122bb);if(!_0x2e4c86){const _0x1a6be2=listAliases(_0x3d0d0a)['map'](_0x1a0bde=>_0x1a0bde[_0x19ef2f(0x74)]),_0x335f23=_0x1a6be2[_0x19ef2f(0x7f)]?'Available\x20aliases:\x20'+_0x1a6be2[_0x19ef2f(0x7e)](',\x20'):'No\x20api.ts\x20found\x20in\x20'+_0x3d0d0a+_0x19ef2f(0x77)+CLI_BIN_NAME+_0x19ef2f(0x71);throw CliErrors[_0x19ef2f(0x6e)]('Unknown\x20alias\x20\x22'+_0x2122bb+_0x19ef2f(0x73)+_0x335f23);}_0x31a53a[_0x19ef2f(0x7b)]=_0x2e4c86;}}
|