@lovrabet/rabetbase-cli 2.5.1-beta.4 → 2.5.1-beta.5
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/README.md +75 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.d.ts +0 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.d.ts +2 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.d.ts +2 -0
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/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.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/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.d.ts +1 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.d.ts +2 -0
- package/lib/commands/project/domain-routing-sync.js +1 -0
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.d.ts +2 -0
- package/lib/commands/rule/get.js +1 -0
- package/lib/commands/rule/index.d.ts +2 -0
- package/lib/commands/rule/index.js +1 -0
- package/lib/commands/rule/list.d.ts +2 -0
- package/lib/commands/rule/list.js +1 -0
- package/lib/commands/rule/set.d.ts +2 -0
- package/lib/commands/rule/set.js +1 -0
- package/lib/commands/rule/shared.d.ts +43 -0
- package/lib/commands/rule/shared.js +1 -0
- 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/deployment-sync.js +1 -1
- package/lib/config/domain-config.d.ts +37 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.d.ts +27 -0
- package/lib/config/project-domain-routing.js +1 -0
- package/lib/config/schema.d.ts +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.d.ts +10 -4
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.d.ts +4 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.d.ts +43 -49
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +2 -0
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +37 -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.d.ts +0 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.d.ts +83 -0
- package/lib/generated/official-routing.js +1 -0
- package/lib/generated/routing-contract.d.ts +9 -0
- package/lib/generated/routing-contract.js +1 -0
- 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/types/index.d.ts +0 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -1
- package/skills/rabetbase/SKILL.md +16 -13
- package/skills/rabetbase/guides/sdk-client-generation.md +10 -8
- package/skills/rabetbase/references/rabetbase-api-pull.md +16 -11
- package/skills/rabetbase/references/rabetbase-config.md +4 -4
- package/skills/rabetbase/references/rabetbase-doctor.md +2 -1
- package/skills/rabetbase/references/rabetbase-init.md +32 -8
- package/skills/rabetbase/references/rabetbase-kb.md +7 -8
- package/skills/rabetbase/references/rabetbase-project-create.md +33 -8
- package/skills/rabetbase/references/rabetbase-project-domain-routing-sync.md +28 -0
- package/skills/rabetbase/references/rabetbase-rule.md +49 -0
- package/skills/rabetbase.manifest.json +5 -3
- package/lib/config/project-routing.d.ts +0 -30
- package/lib/config/project-routing.js +0 -1
- package/lib/core/kb-search-client.d.ts +0 -30
- package/lib/core/kb-search-client.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a244_0x7567(){const _0x484f98=['cwd','49pQSpHr','286424cvTwXF','1225072kfgqVH','page','18aLZGDB','.rabetbase','26620450JYpNFo','5766444bSFFgP','19576tZyZbc','7849415uzZcNb','F_OK','258DKehKv','5694992kLppIN'];a244_0x7567=function(){return _0x484f98;};return a244_0x7567();}const a244_0x4975c4=a244_0x4f54;(function(_0x18334a,_0x5ab45b){const _0x29e3c4=a244_0x4f54,_0x2ec722=_0x18334a();while(!![]){try{const _0x5b217c=parseInt(_0x29e3c4(0x1c2))/0x1+-parseInt(_0x29e3c4(0x1ba))/0x2*(-parseInt(_0x29e3c4(0x1bd))/0x3)+parseInt(_0x29e3c4(0x1be))/0x4+parseInt(_0x29e3c4(0x1bb))/0x5+parseInt(_0x29e3c4(0x1b9))/0x6+-parseInt(_0x29e3c4(0x1c0))/0x7*(-parseInt(_0x29e3c4(0x1c1))/0x8)+-parseInt(_0x29e3c4(0x1b6))/0x9*(parseInt(_0x29e3c4(0x1b8))/0xa);if(_0x5b217c===_0x5ab45b)break;else _0x2ec722['push'](_0x2ec722['shift']());}catch(_0x130d7c){_0x2ec722['push'](_0x2ec722['shift']());}}}(a244_0x7567,0xe776c));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x243d9b,_0x58dfc3=process[a244_0x4975c4(0x1bf)]()){const _0x55b5b0=a244_0x4975c4,_0x2aec96=resolve(_0x58dfc3),_0x55dcc2=join(_0x2aec96,_0x55b5b0(0x1b7),_0x55b5b0(0x1b5));return{'projectRoot':_0x2aec96,'pagesBaseDir':_0x55dcc2,'appPagesDir':join(_0x55dcc2,_0x243d9b),'lockFilePath':join(_0x2aec96,_0x55b5b0(0x1b7),'page.lock.json')};}export function buildPageFileName(_0x2e7ea2,_0x5725c7){return _0x2e7ea2+'-'+String(_0x5725c7)['toUpperCase']()+'.json';}export function resolvePageFilePath(_0x259a64,_0x2d9555,_0x67b5d6){return join(_0x259a64['appPagesDir'],buildPageFileName(_0x2d9555,_0x67b5d6));}export async function ensureParentDirectory(_0x508fdd){await mkdir(dirname(_0x508fdd),{'recursive':!![]});}function a244_0x4f54(_0x157135,_0x3878d0){_0x157135=_0x157135-0x1b5;const _0x75678f=a244_0x7567();let _0x4f54f0=_0x75678f[_0x157135];return _0x4f54f0;}export async function fileExists(_0x465af7){const _0x1c450d=a244_0x4975c4;try{return await access(_0x465af7,constants[_0x1c450d(0x1bc)]),!![];}catch{return![];}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a245_0x17b6(_0x1e25bf,_0x1a254d){_0x1e25bf=_0x1e25bf-0x81;const _0x52df59=a245_0x52df();let _0x17b66b=_0x52df59[_0x1e25bf];return _0x17b66b;}(function(_0x758b65,_0x2318a8){const _0x1d719a=a245_0x17b6,_0x171b76=_0x758b65();while(!![]){try{const _0x1f5784=parseInt(_0x1d719a(0x88))/0x1+-parseInt(_0x1d719a(0x81))/0x2*(parseInt(_0x1d719a(0x85))/0x3)+-parseInt(_0x1d719a(0x8d))/0x4*(parseInt(_0x1d719a(0x8c))/0x5)+parseInt(_0x1d719a(0x8f))/0x6+-parseInt(_0x1d719a(0x82))/0x7+-parseInt(_0x1d719a(0x83))/0x8+parseInt(_0x1d719a(0x8b))/0x9*(parseInt(_0x1d719a(0x8e))/0xa);if(_0x1f5784===_0x2318a8)break;else _0x171b76['push'](_0x171b76['shift']());}catch(_0x3383ec){_0x171b76['push'](_0x171b76['shift']());}}}(a245_0x52df,0x1d250));function a245_0x52df(){const _0x31707a=['861684mOOkre','hex','md5','387902aGXAMA','1439536bEtjRw','507488xgupqC','parse','3OajZkd','stringify','update','14112JWtpEZ','digest','utf8','5424822XUEOZt','5RImTwM','712292LaiYqU','10yNQdKk'];a245_0x52df=function(){return _0x31707a;};return a245_0x52df();}import a245_0x368f47 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x563694){const _0xe2c47a=a245_0x17b6;return JSON[_0xe2c47a(0x86)](JSON[_0xe2c47a(0x84)](_0x563694),null,0x2)+'\x0a';}export function computePageContentHash(_0x1d027a){const _0x3164f6=a245_0x17b6;return a245_0x368f47['createHash'](_0x3164f6(0x91))[_0x3164f6(0x87)](_0x1d027a)[_0x3164f6(0x89)](_0x3164f6(0x90));}export function computeSerializedSchemaHash(_0x49a006){return computePageContentHash(serializePageSchemaForFile(_0x49a006));}export async function computePageFileHash(_0x266db2){const _0x49af95=a245_0x17b6,_0x54256a=await readFile(_0x266db2,_0x49af95(0x8a));return computePageContentHash(_0x54256a);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2ce6b1,_0x29bc13){const _0x530162=a246_0x2cf9,_0x37a685=_0x2ce6b1();while(!![]){try{const _0x2ad0df=-parseInt(_0x530162(0x9f))/0x1+parseInt(_0x530162(0x9a))/0x2*(-parseInt(_0x530162(0x92))/0x3)+-parseInt(_0x530162(0x98))/0x4+parseInt(_0x530162(0x9c))/0x5+-parseInt(_0x530162(0x95))/0x6+-parseInt(_0x530162(0xa3))/0x7*(parseInt(_0x530162(0x99))/0x8)+parseInt(_0x530162(0x9d))/0x9*(parseInt(_0x530162(0x94))/0xa);if(_0x2ad0df===_0x29bc13)break;else _0x37a685['push'](_0x37a685['shift']());}catch(_0x2d15bd){_0x37a685['push'](_0x37a685['shift']());}}}(a246_0xf7d1,0x34681));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x1e7938,_0x1275f5){const _0x48966a=a246_0x2cf9,_0x53d359={'apps':_0x1e7938[_0x48966a(0x93)]&&typeof _0x1e7938['apps']==='object'?_0x1e7938['apps']:{}};let _0x2af62b=_0x53d359[_0x48966a(0x93)][_0x1275f5];if(!_0x2af62b)return _0x2af62b={'lastSync':'','pages':{}},_0x53d359[_0x48966a(0x93)][_0x1275f5]=_0x2af62b,{'lockData':_0x53d359,'appLock':_0x2af62b};return!_0x2af62b['lastSync']&&(_0x2af62b[_0x48966a(0xa0)]=''),(!_0x2af62b[_0x48966a(0xa2)]||typeof _0x2af62b['pages']!=='object')&&(_0x2af62b[_0x48966a(0xa2)]={}),{'lockData':_0x53d359,'appLock':_0x2af62b};}export async function readPageLockFile(_0xb40ec4){const _0xdde52a=a246_0x2cf9;try{const _0x529a20=await readFile(_0xb40ec4,_0xdde52a(0x9b)),_0x2e4be0=JSON['parse'](_0x529a20);return{'apps':_0x2e4be0[_0xdde52a(0x93)]&&typeof _0x2e4be0['apps']===_0xdde52a(0xa1)?_0x2e4be0['apps']:{}};}catch(_0x1928e2){if(_0x1928e2[_0xdde52a(0x9e)]===_0xdde52a(0x96))return null;throw new Error(_0xdde52a(0x97)+String(_0x1928e2));}}function a246_0xf7d1(){const _0x4b60c6=['18580igighv','1335060oMhZOR','ENOENT','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','1657248EQNumv','5080OazBiN','527146SgzaaZ','utf8','1773475eiZiuA','4626qCdlXc','code','130520fsNHVU','lastSync','object','pages','707KNZjPa','3OvKTLh','apps'];a246_0xf7d1=function(){return _0x4b60c6;};return a246_0xf7d1();}function a246_0x2cf9(_0x204469,_0x13cf8a){_0x204469=_0x204469-0x92;const _0xf7d16e=a246_0xf7d1();let _0x2cf908=_0xf7d16e[_0x204469];return _0x2cf908;}export async function writePageLockFile(_0x4e6402,_0x4ae39f){const _0x2b9553=a246_0x2cf9;await mkdir(dirname(_0x4e6402),{'recursive':!![]}),await writeFile(_0x4e6402,JSON['stringify'](_0x4ae39f,null,0x2),_0x2b9553(0x9b));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x948d21,_0x564f85){const _0x1d69fb=a243_0x517e,_0x2f1871=_0x948d21();while(!![]){try{const _0xa99bb9=parseInt(_0x1d69fb(0x1bb))/0x1+parseInt(_0x1d69fb(0x1de))/0x2*(parseInt(_0x1d69fb(0x1c5))/0x3)+-parseInt(_0x1d69fb(0x1f2))/0x4+parseInt(_0x1d69fb(0x1c4))/0x5+-parseInt(_0x1d69fb(0x1f7))/0x6+parseInt(_0x1d69fb(0x1e4))/0x7*(-parseInt(_0x1d69fb(0x1ce))/0x8)+-parseInt(_0x1d69fb(0x1e8))/0x9;if(_0xa99bb9===_0x564f85)break;else _0x2f1871['push'](_0x2f1871['shift']());}catch(_0x2b99a9){_0x2f1871['push'](_0x2f1871['shift']());}}}(a243_0x1906,0x93fb1));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x474766,_0x153c10){const _0x1d40c7=a243_0x517e,_0x4e8a1f=[],_0x878b7b=normalizeSqlForStaticAnalysis(_0x474766),_0x983468=(_0x878b7b[_0x1d40c7(0x1be)]?[]:extractJoinFacts(_0x878b7b[_0x1d40c7(0x1b8)]))[_0x1d40c7(0x1ed)](_0x4025d3=>{const _0x1cb77c=_0x1d40c7;if(_0x4025d3[_0x1cb77c(0x1d9)]||_0x4025d3[_0x1cb77c(0x1fa)][_0x1cb77c(0x1f6)]===0x0)return _0x4e8a1f['push']({'code':_0x1cb77c(0x1cc),'table':_0x4025d3['table'],'alias':_0x4025d3[_0x1cb77c(0x1fb)],'columns':_0x4025d3[_0x1cb77c(0x1fa)],'reason':_0x4025d3[_0x1cb77c(0x1bd)]??_0x1cb77c(0x1c3)}),{'table':_0x4025d3[_0x1cb77c(0x1d2)],'alias':_0x4025d3[_0x1cb77c(0x1fb)],'columns':_0x4025d3[_0x1cb77c(0x1fa)],'status':'unavailable'};const _0x1e5f36=resolveTableMetadata(_0x153c10,_0x4025d3[_0x1cb77c(0x1d2)]),_0x15ff32=(_0x1e5f36?.[_0x1cb77c(0x1f3)]??[])['map'](_0x22c494=>({'index':_0x22c494,'matchedPrefix':findEqualityPrefix(_0x22c494[_0x1cb77c(0x1fa)],_0x4025d3['columns'])}))['filter'](_0x188647=>_0x188647[_0x1cb77c(0x1e7)]['length']>0x0),_0x5b44a9=_0x15ff32['reduce']((_0x278d48,_0x5d9a5e)=>!_0x278d48||_0x5d9a5e[_0x1cb77c(0x1e7)][_0x1cb77c(0x1f6)]>_0x278d48['matchedPrefix'][_0x1cb77c(0x1f6)]?_0x5d9a5e:_0x278d48,_0x15ff32[0x0]);if(_0x5b44a9)return{'table':_0x4025d3['table'],'alias':_0x4025d3[_0x1cb77c(0x1fb)],'columns':_0x4025d3[_0x1cb77c(0x1fa)],'status':'covered','matchedIndex':{..._0x5b44a9['index'],'matchedPrefix':_0x5b44a9[_0x1cb77c(0x1e7)]}};const _0x16c166=_0x1e5f36?.['indexes'][_0x1cb77c(0x1d7)](_0xaf15ea=>_0xaf15ea[_0x1cb77c(0x1fa)][_0x1cb77c(0x1c6)](_0x35071c=>_0x4025d3['columns'][_0x1cb77c(0x1c6)](_0x5e8a77=>columnNamesMatch(_0x35071c,_0x5e8a77))))??[];if(_0x16c166['length']>0x0)return _0x4e8a1f['push']({'code':'JOIN_INDEX_NOT_USABLE','table':_0x4025d3[_0x1cb77c(0x1d2)],'alias':_0x4025d3['alias'],'columns':_0x4025d3[_0x1cb77c(0x1fa)],'reason':_0x1cb77c(0x1f1)}),{'table':_0x4025d3[_0x1cb77c(0x1d2)],'alias':_0x4025d3[_0x1cb77c(0x1fb)],'columns':_0x4025d3[_0x1cb77c(0x1fa)],'status':_0x1cb77c(0x1d0),'candidateIndexes':_0x16c166};if(_0x1e5f36&&_0x1e5f36[_0x1cb77c(0x1f4)]!==![]&&_0x1e5f36[_0x1cb77c(0x1f3)][_0x1cb77c(0x1f6)]>0x0&&_0x4025d3[_0x1cb77c(0x1fa)][_0x1cb77c(0x1f6)]>0x0)return _0x4e8a1f[_0x1cb77c(0x1e5)]({'code':'JOIN_INDEX_MISSING','table':_0x4025d3[_0x1cb77c(0x1d2)],'alias':_0x4025d3[_0x1cb77c(0x1fb)],'columns':_0x4025d3[_0x1cb77c(0x1fa)],'reason':_0x1cb77c(0x1c9)}),{'table':_0x4025d3[_0x1cb77c(0x1d2)],'alias':_0x4025d3[_0x1cb77c(0x1fb)],'columns':_0x4025d3[_0x1cb77c(0x1fa)],'status':_0x1cb77c(0x1d0)};return _0x4e8a1f['push']({'code':_0x1cb77c(0x1df),'table':_0x4025d3[_0x1cb77c(0x1d2)],'alias':_0x4025d3[_0x1cb77c(0x1fb)],'columns':_0x4025d3[_0x1cb77c(0x1fa)],'reason':_0x1e5f36?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':_0x1cb77c(0x1d6)}),{'table':_0x4025d3[_0x1cb77c(0x1d2)],'alias':_0x4025d3[_0x1cb77c(0x1fb)],'columns':_0x4025d3['columns'],'status':_0x1cb77c(0x1ca)};});return{'checked':_0x983468['length']>0x0,'joins':_0x983468,'warnings':_0x4e8a1f};}function extractJoinFacts(_0x5baeba){const _0x374a6b=a243_0x517e,_0x4a3922=maskNestedQueries(stripSqlNoise(_0x5baeba)),_0x1d69f4=maskQuotedIdentifiers(_0x4a3922),_0x5e0718=[],_0x444a24=new Set(),_0x3aa4d3=/\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 _0x24712b of _0x4a3922['matchAll'](_0x3aa4d3)){const _0x337a37=_0x24712b['index']??0x0,_0x3a0c4c=_0x24712b[0x0][_0x374a6b(0x1d8)](/\bJOIN\b/i),_0x468315=_0x337a37+Math[_0x374a6b(0x1c8)](0x0,_0x3a0c4c);if(!/^JOIN\b/i['test'](_0x1d69f4[_0x374a6b(0x1ef)](_0x468315)))continue;_0x444a24[_0x374a6b(0x1d3)](_0x468315);const _0x24fe5e=normalizeIdentifier(_0x24712b[0x1]||'INNER'),_0x527aae=normalizeIdentifier(_0x24712b[0x2]??''),_0x3c8630=normalizeIdentifier(_0x24712b[0x3]||_0x527aae['split']('.')['at'](-0x1)||_0x527aae),_0x1a1837=[],_0x45da6f=_0x527aae===_0x374a6b(0x1db);let _0x498c6a=_0x24fe5e===_0x374a6b(0x1d5)||_0x24fe5e===_0x374a6b(0x1f9)||_0x45da6f,_0x155424=_0x498c6a?_0x45da6f?'Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.':_0x24fe5e[_0x374a6b(0x1fc)]()+_0x374a6b(0x1c0):undefined;const _0x2e1d3c=stripOuterParentheses(_0x24712b[0x4]??''),_0x5165ec=_0x2e1d3c[_0x374a6b(0x1d1)](MYBATIS_DYNAMIC_START_MARKER)||_0x2e1d3c[_0x374a6b(0x1d1)](MYBATIS_DYNAMIC_END_MARKER),_0x36a7ad=_0x2e1d3c['includes'](MYBATIS_INCLUDE_MARKER);_0x5165ec&&(_0x498c6a=!![],_0x155424??='MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.');_0x36a7ad&&(_0x498c6a=!![],_0x155424??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0x31ff0a=_0x2e1d3c[_0x374a6b(0x1ee)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x374a6b(0x1ee)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x31ff0a,'OR')&&(_0x498c6a=!![],_0x155424??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.');for(const _0x5d3b82 of splitTopLevelAnd(_0x31ff0a)){const _0xc86fa0=stripOuterParentheses(_0x5d3b82);if(hasTopLevelKeyword(_0xc86fa0,'OR')){_0x498c6a=!![],_0x155424??=_0x374a6b(0x1ba);continue;}const _0x2a361b=splitEquality(_0xc86fa0);if(!_0x2a361b){containsColumnReference(_0x5d3b82,_0x3c8630)&&(_0x498c6a=!![]);continue;}const _0x57f3ce=parseDirectColumnReference(_0x2a361b[0x0],_0x3c8630),_0x4db87a=parseDirectColumnReference(_0x2a361b[0x1],_0x3c8630),_0x2ba4a1=containsColumnReference(_0x2a361b[0x0],_0x3c8630),_0x541188=containsColumnReference(_0x2a361b[0x1],_0x3c8630),_0x2ce5a6=_0x57f3ce&&!_0x541188?_0x57f3ce:_0x4db87a&&!_0x2ba4a1?_0x4db87a:null;if(_0x2ce5a6&&!_0x1a1837[_0x374a6b(0x1d1)](_0x2ce5a6))_0x1a1837[_0x374a6b(0x1e5)](_0x2ce5a6);else!_0x2ce5a6&&containsColumnReference(_0x5d3b82,_0x3c8630)&&(_0x498c6a=!![]);}_0x5e0718[_0x374a6b(0x1e5)]({'table':_0x527aae,'alias':_0x3c8630,'columns':_0x1a1837,'unsupportedPredicate':_0x498c6a,'unsupportedReason':_0x155424,'containsUnresolvedInclude':_0x36a7ad,'position':_0x468315});}for(const _0x21d0be of _0x1d69f4[_0x374a6b(0x1cb)](/\bJOIN\b/gi)){const _0x163a04=_0x21d0be[_0x374a6b(0x1cf)]??0x0;if(_0x444a24['has'](_0x163a04))continue;const _0x460328=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x374a6b(0x1d4)](_0x4a3922[_0x374a6b(0x1ef)](_0x163a04+_0x21d0be[0x0][_0x374a6b(0x1f6)])),_0x5a5de8=normalizeIdentifier(_0x460328?.[0x1]||'unknown'),_0x551614=normalizeIdentifier(_0x460328?.[0x2]||''),_0x4b116e=isSqlClauseKeyword(_0x551614)?_0x5a5de8[_0x374a6b(0x1c1)]('.')['at'](-0x1)||_0x5a5de8:_0x551614||_0x5a5de8[_0x374a6b(0x1c1)]('.')['at'](-0x1)||_0x5a5de8;_0x5e0718[_0x374a6b(0x1e5)]({'table':_0x5a5de8,'alias':_0x4b116e,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x374a6b(0x1da),'position':_0x163a04});}const _0x392633=_0x1d69f4[_0x374a6b(0x1f5)](MYBATIS_INCLUDE_MARKER);return _0x392633>=0x0&&!_0x5e0718[_0x374a6b(0x1c6)](_0x990e42=>_0x990e42[_0x374a6b(0x1e3)])&&_0x5e0718[_0x374a6b(0x1e5)]({'table':'unknown','alias':_0x374a6b(0x1b9),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','containsUnresolvedInclude':!![],'position':_0x392633}),_0x5e0718[_0x374a6b(0x1e2)]((_0x17ff7e,_0x2dcd1c)=>_0x17ff7e[_0x374a6b(0x1e9)]-_0x2dcd1c[_0x374a6b(0x1e9)]);}function stripSqlNoise(_0x34e5d1){const _0x4d7809=a243_0x517e,_0x35d55f=Array[_0x4d7809(0x1eb)](_0x34e5d1),_0x144666=(_0x4f5eb9,_0x358feb)=>{for(let _0x3c42d9=_0x4f5eb9;_0x3c42d9<_0x358feb;_0x3c42d9+=0x1){_0x35d55f[_0x3c42d9]!=='\x0a'&&_0x35d55f[_0x3c42d9]!=='\x0d'&&(_0x35d55f[_0x3c42d9]='\x20');}};for(let _0x1454bc=0x0;_0x1454bc<_0x35d55f[_0x4d7809(0x1f6)];_0x1454bc+=0x1){const _0x39f605=_0x35d55f[_0x1454bc],_0x5441b9=_0x35d55f[_0x1454bc+0x1];if(_0x39f605==='\x27'||_0x39f605==='\x22'||_0x39f605==='`'){const _0x1a8e66=_0x39f605,_0x4afd15=_0x1454bc;_0x1454bc+=0x1;while(_0x1454bc<_0x35d55f[_0x4d7809(0x1f6)]){if(_0x35d55f[_0x1454bc]==='\x5c'&&_0x1454bc+0x1<_0x35d55f['length']){_0x1454bc+=0x2;continue;}if(_0x35d55f[_0x1454bc]!==_0x1a8e66){_0x1454bc+=0x1;continue;}if(_0x35d55f[_0x1454bc+0x1]===_0x1a8e66){_0x1454bc+=0x2;continue;}break;}if(_0x1a8e66==='\x27')_0x144666(_0x4afd15,Math[_0x4d7809(0x1c2)](_0x1454bc+0x1,_0x35d55f[_0x4d7809(0x1f6)]));continue;}if(_0x39f605==='-'&&_0x5441b9==='-'){const _0x3e37ed=_0x1454bc;while(_0x1454bc<_0x35d55f['length']&&_0x35d55f[_0x1454bc]!=='\x0a')_0x1454bc+=0x1;_0x144666(_0x3e37ed,_0x1454bc);continue;}if(_0x39f605==='/'&&_0x5441b9==='*'){const _0x564cde=_0x1454bc;_0x1454bc+=0x2;while(_0x1454bc<_0x35d55f[_0x4d7809(0x1f6)]&&!(_0x35d55f[_0x1454bc]==='*'&&_0x35d55f[_0x1454bc+0x1]==='/')){_0x1454bc+=0x1;}_0x1454bc=Math[_0x4d7809(0x1c2)](_0x1454bc+0x1,_0x35d55f['length']-0x1),_0x144666(_0x564cde,_0x1454bc+0x1);continue;}if(_0x39f605==='#'&&_0x5441b9!=='{'){const _0x44141b=_0x1454bc;while(_0x1454bc<_0x35d55f['length']&&_0x35d55f[_0x1454bc]!=='\x0a')_0x1454bc+=0x1;_0x144666(_0x44141b,_0x1454bc);continue;}if((_0x39f605==='#'||_0x39f605==='$')&&_0x5441b9==='{'){const _0x420628=_0x1454bc;_0x1454bc+=0x2;while(_0x1454bc<_0x35d55f['length']&&_0x35d55f[_0x1454bc]!=='}')_0x1454bc+=0x1;_0x144666(_0x420628,Math[_0x4d7809(0x1c2)](_0x1454bc+0x1,_0x35d55f[_0x4d7809(0x1f6)]));}}return _0x35d55f['join']('');}function maskQuotedIdentifiers(_0x23f591){const _0x352221=a243_0x517e,_0x40c71b=Array[_0x352221(0x1eb)](_0x23f591);for(let _0x4e976e=0x0;_0x4e976e<_0x40c71b[_0x352221(0x1f6)];_0x4e976e+=0x1){const _0x256bda=_0x40c71b[_0x4e976e];if(_0x256bda!=='\x22'&&_0x256bda!=='`')continue;_0x4e976e+=0x1;while(_0x4e976e<_0x40c71b['length']){if(_0x40c71b[_0x4e976e]===_0x256bda){if(_0x40c71b[_0x4e976e+0x1]===_0x256bda){_0x40c71b[_0x4e976e]='\x20',_0x40c71b[_0x4e976e+0x1]='\x20',_0x4e976e+=0x2;continue;}break;}_0x40c71b[_0x4e976e]='\x20',_0x4e976e+=0x1;}}return _0x40c71b['join']('');}function maskNestedQueries(_0x58c79f){const _0x597484=a243_0x517e,_0x57b1e6=Array[_0x597484(0x1eb)](_0x58c79f);for(let _0x39d990=0x0;_0x39d990<_0x57b1e6[_0x597484(0x1f6)];_0x39d990+=0x1){if(_0x57b1e6[_0x39d990]!=='(')continue;const _0x235ea1=_0x58c79f[_0x597484(0x1ef)](_0x39d990+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x597484(0x1e6)](_0x235ea1))continue;let _0xd7df92=0x1,_0x97420b=_0x39d990+0x1;for(;_0x97420b<_0x57b1e6[_0x597484(0x1f6)]&&_0xd7df92>0x0;_0x97420b+=0x1){if(_0x57b1e6[_0x97420b]==='(')_0xd7df92+=0x1;if(_0x57b1e6[_0x97420b]===')')_0xd7df92-=0x1;}if(_0xd7df92!==0x0)continue;for(let _0x5628d1=_0x39d990;_0x5628d1<_0x97420b;_0x5628d1+=0x1){_0x57b1e6[_0x5628d1]='\x20';}const _0x186af6='__sq__';for(let _0x1d7254=0x0;_0x1d7254<_0x186af6[_0x597484(0x1f6)]&&_0x39d990+_0x1d7254<_0x97420b;_0x1d7254+=0x1){_0x57b1e6[_0x39d990+_0x1d7254]=_0x186af6[_0x1d7254];}_0x39d990=_0x97420b-0x1;}return _0x57b1e6[_0x597484(0x1cd)]('');}function a243_0x517e(_0x27b41b,_0x3f7863){_0x27b41b=_0x27b41b-0x1b8;const _0x190688=a243_0x1906();let _0x517e2e=_0x190688[_0x27b41b];return _0x517e2e;}function splitTopLevelAnd(_0x12a4a2){const _0x5133ae=a243_0x517e,_0x1b140d=[];let _0x27c0bb=0x0,_0x1d2457=0x0;for(let _0x149514=0x0;_0x149514<_0x12a4a2[_0x5133ae(0x1f6)];_0x149514+=0x1){const _0x3fbac3=_0x12a4a2[_0x149514];if(_0x3fbac3==='(')_0x27c0bb+=0x1;if(_0x3fbac3===')')_0x27c0bb=Math[_0x5133ae(0x1c8)](0x0,_0x27c0bb-0x1);_0x27c0bb===0x0&&_0x12a4a2['slice'](_0x149514)[_0x5133ae(0x1dc)](/^AND\b/i)&&(_0x149514===0x0||/\s/[_0x5133ae(0x1e6)](_0x12a4a2[_0x149514-0x1]??''))&&(_0x1b140d['push'](_0x12a4a2[_0x5133ae(0x1ef)](_0x1d2457,_0x149514)[_0x5133ae(0x1f0)]()),_0x149514+=0x2,_0x1d2457=_0x149514+0x1);}const _0x3b2984=_0x12a4a2[_0x5133ae(0x1ef)](_0x1d2457)[_0x5133ae(0x1f0)]();if(_0x3b2984)_0x1b140d[_0x5133ae(0x1e5)](_0x3b2984);return _0x1b140d;}function hasTopLevelKeyword(_0x179e4c,_0x32ea52){const _0x12650c=a243_0x517e;let _0x12a21f=0x0;for(let _0xad852f=0x0;_0xad852f<_0x179e4c[_0x12650c(0x1f6)];_0xad852f+=0x1){const _0x5447e4=_0x179e4c[_0xad852f];if(_0x5447e4==='(')_0x12a21f+=0x1;if(_0x5447e4===')')_0x12a21f=Math['max'](0x0,_0x12a21f-0x1);if(_0x12a21f!==0x0)continue;const _0x19e93f=_0x179e4c[_0x12650c(0x1ef)](_0xad852f,_0xad852f+_0x32ea52['length']),_0x5f5a65=_0x179e4c[_0xad852f-0x1]??'\x20',_0x11311b=_0x179e4c[_0xad852f+_0x32ea52[_0x12650c(0x1f6)]]??'\x20';if(_0x19e93f[_0x12650c(0x1fc)]()===_0x32ea52['toUpperCase']()&&!/[\w$]/['test'](_0x5f5a65)&&!/[\w$]/[_0x12650c(0x1e6)](_0x11311b))return!![];}return![];}function splitEquality(_0x2a60ea){const _0x505412=a243_0x517e,_0xf17a52=stripOuterParentheses(_0x2a60ea);let _0x36f169=0x0,_0x5a15cf;for(let _0x2a962b=0x0;_0x2a962b<_0xf17a52[_0x505412(0x1f6)];_0x2a962b+=0x1){const _0x25b295=_0xf17a52[_0x2a962b];if(_0x25b295==='(')_0x36f169+=0x1;if(_0x25b295===')')_0x36f169=Math[_0x505412(0x1c8)](0x0,_0x36f169-0x1);const _0x2b823a=_0xf17a52[_0x2a962b-0x1]??'',_0x520187=_0xf17a52[_0x2a962b+0x1]??'';if(_0x25b295==='='&&_0x36f169===0x0&&!/[!<>=:]/['test'](_0x2b823a)&&_0x520187!=='='){if(_0x5a15cf!==undefined)return null;_0x5a15cf=_0x2a962b;}}return _0x5a15cf===undefined?null:[_0xf17a52[_0x505412(0x1ef)](0x0,_0x5a15cf)[_0x505412(0x1f0)](),_0xf17a52[_0x505412(0x1ef)](_0x5a15cf+0x1)['trim']()];}function parseDirectColumnReference(_0x4b1e8a,_0x235a7f){const _0x1f3231=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/['exec'](stripOuterParentheses(_0x4b1e8a));if(!_0x1f3231)return null;if(normalizeIdentifier(_0x1f3231[0x1]??'')!==normalizeIdentifier(_0x235a7f))return null;return normalizeIdentifier(_0x1f3231[0x2]??'');}function containsColumnReference(_0x2baa19,_0x56bf72){const _0x3a0080=a243_0x517e,_0x5f54db=_0x2baa19[_0x3a0080(0x1ec)](/[`"]/g,''),_0x227645=_0x56bf72['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp('(?:^|[^\x5cw$])'+_0x227645+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x3a0080(0x1e6)](_0x5f54db);}function findEqualityPrefix(_0x3a14e8,_0x18b2ae){const _0x32ef20=a243_0x517e,_0x5e1ab5=new Set(_0x18b2ae[_0x32ef20(0x1ed)](normalizeIdentifier)),_0x14fa5=[];for(const _0x1a2b1f of _0x3a14e8){if(!_0x5e1ab5[_0x32ef20(0x1dd)](normalizeIdentifier(_0x1a2b1f)))break;_0x14fa5[_0x32ef20(0x1e5)](_0x1a2b1f);}return _0x14fa5;}function resolveTableMetadata(_0x1d915e,_0x9d2850){const _0x2bc2a7=a243_0x517e,_0x4df310=normalizeIdentifier(_0x9d2850),_0x473395=_0x1d915e['filter'](_0x375ddc=>normalizeIdentifier(_0x375ddc[_0x2bc2a7(0x1bf)])===_0x4df310);if(_0x473395[_0x2bc2a7(0x1f6)]===0x1)return _0x473395[0x0];const _0x5a2a29=_0x4df310[_0x2bc2a7(0x1d1)]('.'),_0x231c2c=_0x4df310[_0x2bc2a7(0x1c1)]('.')['at'](-0x1),_0x62a91a=_0x1d915e[_0x2bc2a7(0x1d7)](_0x2ba256=>{const _0x165c23=_0x2bc2a7,_0x4409f3=normalizeIdentifier(_0x2ba256[_0x165c23(0x1bf)]);if(_0x5a2a29&&_0x4409f3['includes']('.'))return![];return _0x4409f3['split']('.')['at'](-0x1)===_0x231c2c;});return _0x62a91a['length']===0x1?_0x62a91a[0x0]:undefined;}function columnNamesMatch(_0x4901f7,_0x19baf7){return normalizeIdentifier(_0x4901f7)===normalizeIdentifier(_0x19baf7);}function normalizeIdentifier(_0x41605c){const _0x27bc68=a243_0x517e;return _0x41605c['replace'](/[`"]/g,'')[_0x27bc68(0x1f0)]()['toLowerCase']();}function isSqlClauseKeyword(_0xaf0b5c){const _0x4034fc=a243_0x517e;return new Set(['on','using','where',_0x4034fc(0x1cd),_0x4034fc(0x1f8),_0x4034fc(0x1e0),_0x4034fc(0x1d5),_0x4034fc(0x1f9),_0x4034fc(0x1bc),_0x4034fc(0x1c7)])['has'](_0xaf0b5c);}function a243_0x1906(){const _0x379a46=['error','tableName','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','split','min','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','5101465jyRCBk','600FgRFRi','some','natural','max','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','unavailable','matchAll','JOIN_PREDICATE_UNSUPPORTED','join','24xgJRol','index','warning','includes','table','add','exec','right','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','filter','search','unsupportedPredicate','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','__sq__','match','has','5594vZzeeR','INDEX_METADATA_UNAVAILABLE','left','endsWith','sort','containsUnresolvedInclude','838054rsXwgz','push','test','matchedPrefix','9445329bLAiTA','position','startsWith','from','replace','map','replaceAll','slice','trim','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','11516DUGYCn','indexes','metadataAvailable','indexOf','length','148938drVkjy','inner','full','columns','alias','toUpperCase','sql','unknown','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','462785ONwYcR','cross','unsupportedReason'];a243_0x1906=function(){return _0x379a46;};return a243_0x1906();}function stripOuterParentheses(_0x17f203){const _0x5d7b67=a243_0x517e;let _0x22c7eb=_0x17f203[_0x5d7b67(0x1f0)]();while(_0x22c7eb[_0x5d7b67(0x1ea)]('(')&&_0x22c7eb[_0x5d7b67(0x1e1)](')')){let _0x52a639=0x0,_0x122501=!![];for(let _0x44e156=0x0;_0x44e156<_0x22c7eb[_0x5d7b67(0x1f6)];_0x44e156+=0x1){if(_0x22c7eb[_0x44e156]==='(')_0x52a639+=0x1;if(_0x22c7eb[_0x44e156]===')')_0x52a639-=0x1;if(_0x52a639===0x0&&_0x44e156<_0x22c7eb['length']-0x1){_0x122501=![];break;}}if(!_0x122501||_0x52a639!==0x0)break;_0x22c7eb=_0x22c7eb[_0x5d7b67(0x1ef)](0x1,-0x1)[_0x5d7b67(0x1f0)]();}return _0x22c7eb;}
|
|
1
|
+
(function(_0x4a9c60,_0x3662aa){const _0x37fda9=a248_0x18e4,_0x289b6f=_0x4a9c60();while(!![]){try{const _0x1fd1c6=parseInt(_0x37fda9(0x1b3))/0x1+parseInt(_0x37fda9(0x1be))/0x2*(-parseInt(_0x37fda9(0x191))/0x3)+parseInt(_0x37fda9(0x180))/0x4+-parseInt(_0x37fda9(0x17c))/0x5*(-parseInt(_0x37fda9(0x1b7))/0x6)+-parseInt(_0x37fda9(0x18e))/0x7+parseInt(_0x37fda9(0x1af))/0x8+parseInt(_0x37fda9(0x190))/0x9*(-parseInt(_0x37fda9(0x198))/0xa);if(_0x1fd1c6===_0x3662aa)break;else _0x289b6f['push'](_0x289b6f['shift']());}catch(_0x58c762){_0x289b6f['push'](_0x289b6f['shift']());}}}(a248_0x436e,0x1cad6));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x13ffc1,_0x2a06bc){const _0x4f998f=a248_0x18e4,_0x58db3a=[],_0xed4bd2=normalizeSqlForStaticAnalysis(_0x13ffc1),_0x4f4060=(_0xed4bd2[_0x4f998f(0x1b4)]?[]:extractJoinFacts(_0xed4bd2[_0x4f998f(0x175)]))[_0x4f998f(0x19d)](_0x4b9df8=>{const _0x368e9b=_0x4f998f;if(_0x4b9df8[_0x368e9b(0x187)]||_0x4b9df8[_0x368e9b(0x1bb)]['length']===0x0)return _0x58db3a[_0x368e9b(0x1a0)]({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0x4b9df8[_0x368e9b(0x19e)],'alias':_0x4b9df8[_0x368e9b(0x1a9)],'columns':_0x4b9df8[_0x368e9b(0x1bb)],'reason':_0x4b9df8['unsupportedReason']??_0x368e9b(0x17a)}),{'table':_0x4b9df8['table'],'alias':_0x4b9df8['alias'],'columns':_0x4b9df8[_0x368e9b(0x1bb)],'status':'unavailable'};const _0x4bf2fa=resolveTableMetadata(_0x2a06bc,_0x4b9df8['table']),_0xc30f21=(_0x4bf2fa?.[_0x368e9b(0x1ad)]??[])[_0x368e9b(0x19d)](_0xb3f104=>({'index':_0xb3f104,'matchedPrefix':findEqualityPrefix(_0xb3f104[_0x368e9b(0x1bb)],_0x4b9df8[_0x368e9b(0x1bb)])}))[_0x368e9b(0x183)](_0x41027d=>_0x41027d[_0x368e9b(0x1b6)][_0x368e9b(0x1b5)]>0x0),_0x5d778d=_0xc30f21[_0x368e9b(0x199)]((_0x30b276,_0x5ae506)=>!_0x30b276||_0x5ae506[_0x368e9b(0x1b6)][_0x368e9b(0x1b5)]>_0x30b276[_0x368e9b(0x1b6)][_0x368e9b(0x1b5)]?_0x5ae506:_0x30b276,_0xc30f21[0x0]);if(_0x5d778d)return{'table':_0x4b9df8[_0x368e9b(0x19e)],'alias':_0x4b9df8[_0x368e9b(0x1a9)],'columns':_0x4b9df8[_0x368e9b(0x1bb)],'status':_0x368e9b(0x193),'matchedIndex':{..._0x5d778d[_0x368e9b(0x1bc)],'matchedPrefix':_0x5d778d[_0x368e9b(0x1b6)]}};const _0x2c3128=_0x4bf2fa?.[_0x368e9b(0x1ad)][_0x368e9b(0x183)](_0x176b91=>_0x176b91[_0x368e9b(0x1bb)]['some'](_0x5de360=>_0x4b9df8[_0x368e9b(0x1bb)][_0x368e9b(0x185)](_0x59ea47=>columnNamesMatch(_0x5de360,_0x59ea47))))??[];if(_0x2c3128[_0x368e9b(0x1b5)]>0x0)return _0x58db3a[_0x368e9b(0x1a0)]({'code':'JOIN_INDEX_NOT_USABLE','table':_0x4b9df8[_0x368e9b(0x19e)],'alias':_0x4b9df8[_0x368e9b(0x1a9)],'columns':_0x4b9df8[_0x368e9b(0x1bb)],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x4b9df8[_0x368e9b(0x19e)],'alias':_0x4b9df8[_0x368e9b(0x1a9)],'columns':_0x4b9df8['columns'],'status':_0x368e9b(0x1a7),'candidateIndexes':_0x2c3128};if(_0x4bf2fa&&_0x4bf2fa['metadataAvailable']!==![]&&_0x4bf2fa[_0x368e9b(0x1ad)][_0x368e9b(0x1b5)]>0x0&&_0x4b9df8[_0x368e9b(0x1bb)]['length']>0x0)return _0x58db3a[_0x368e9b(0x1a0)]({'code':_0x368e9b(0x184),'table':_0x4b9df8[_0x368e9b(0x19e)],'alias':_0x4b9df8['alias'],'columns':_0x4b9df8['columns'],'reason':_0x368e9b(0x186)}),{'table':_0x4b9df8['table'],'alias':_0x4b9df8[_0x368e9b(0x1a9)],'columns':_0x4b9df8['columns'],'status':_0x368e9b(0x1a7)};return _0x58db3a[_0x368e9b(0x1a0)]({'code':_0x368e9b(0x1b2),'table':_0x4b9df8[_0x368e9b(0x19e)],'alias':_0x4b9df8[_0x368e9b(0x1a9)],'columns':_0x4b9df8[_0x368e9b(0x1bb)],'reason':_0x4bf2fa?_0x368e9b(0x177):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x4b9df8['table'],'alias':_0x4b9df8[_0x368e9b(0x1a9)],'columns':_0x4b9df8[_0x368e9b(0x1bb)],'status':'unavailable'};});return{'checked':_0x4f4060['length']>0x0,'joins':_0x4f4060,'warnings':_0x58db3a};}function extractJoinFacts(_0x2a248){const _0x51cedb=a248_0x18e4,_0x64666=maskNestedQueries(stripSqlNoise(_0x2a248)),_0x371ec8=maskQuotedIdentifiers(_0x64666),_0x3e794f=[],_0x39b98c=new Set(),_0x3d95ad=/\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 _0x4ae4a4 of _0x64666[_0x51cedb(0x1b0)](_0x3d95ad)){const _0x45594b=_0x4ae4a4[_0x51cedb(0x1bc)]??0x0,_0x5a48fc=_0x4ae4a4[0x0]['search'](/\bJOIN\b/i),_0x1aab5f=_0x45594b+Math[_0x51cedb(0x1ba)](0x0,_0x5a48fc);if(!/^JOIN\b/i['test'](_0x371ec8[_0x51cedb(0x18a)](_0x1aab5f)))continue;_0x39b98c[_0x51cedb(0x1ab)](_0x1aab5f);const _0x31ac03=normalizeIdentifier(_0x4ae4a4[0x1]||_0x51cedb(0x196)),_0x5bb180=normalizeIdentifier(_0x4ae4a4[0x2]??''),_0x47b8e6=normalizeIdentifier(_0x4ae4a4[0x3]||_0x5bb180[_0x51cedb(0x195)]('.')['at'](-0x1)||_0x5bb180),_0x2dc288=[],_0x19b645=_0x5bb180==='__sq__';let _0x1e3062=_0x31ac03===_0x51cedb(0x1a3)||_0x31ac03===_0x51cedb(0x18d)||_0x19b645,_0x3efed5=_0x1e3062?_0x19b645?_0x51cedb(0x1a5):_0x31ac03[_0x51cedb(0x178)]()+_0x51cedb(0x176):undefined;const _0x192348=stripOuterParentheses(_0x4ae4a4[0x4]??''),_0x224931=_0x192348[_0x51cedb(0x1a6)](MYBATIS_DYNAMIC_START_MARKER)||_0x192348[_0x51cedb(0x1a6)](MYBATIS_DYNAMIC_END_MARKER),_0x36e3b9=_0x192348[_0x51cedb(0x1a6)](MYBATIS_INCLUDE_MARKER);_0x224931&&(_0x1e3062=!![],_0x3efed5??=_0x51cedb(0x188));_0x36e3b9&&(_0x1e3062=!![],_0x3efed5??=_0x51cedb(0x189));const _0x1ec10e=_0x192348['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x51cedb(0x17b)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x1ec10e,'OR')&&(_0x1e3062=!![],_0x3efed5??=_0x51cedb(0x19f));for(const _0x170a5a of splitTopLevelAnd(_0x1ec10e)){const _0x54b819=stripOuterParentheses(_0x170a5a);if(hasTopLevelKeyword(_0x54b819,'OR')){_0x1e3062=!![],_0x3efed5??=_0x51cedb(0x19f);continue;}const _0xbfd441=splitEquality(_0x54b819);if(!_0xbfd441){containsColumnReference(_0x170a5a,_0x47b8e6)&&(_0x1e3062=!![]);continue;}const _0x13c417=parseDirectColumnReference(_0xbfd441[0x0],_0x47b8e6),_0x119970=parseDirectColumnReference(_0xbfd441[0x1],_0x47b8e6),_0x45a508=containsColumnReference(_0xbfd441[0x0],_0x47b8e6),_0x29e500=containsColumnReference(_0xbfd441[0x1],_0x47b8e6),_0x2a8050=_0x13c417&&!_0x29e500?_0x13c417:_0x119970&&!_0x45a508?_0x119970:null;if(_0x2a8050&&!_0x2dc288['includes'](_0x2a8050))_0x2dc288[_0x51cedb(0x1a0)](_0x2a8050);else!_0x2a8050&&containsColumnReference(_0x170a5a,_0x47b8e6)&&(_0x1e3062=!![]);}_0x3e794f[_0x51cedb(0x1a0)]({'table':_0x5bb180,'alias':_0x47b8e6,'columns':_0x2dc288,'unsupportedPredicate':_0x1e3062,'unsupportedReason':_0x3efed5,'containsUnresolvedInclude':_0x36e3b9,'position':_0x1aab5f});}for(const _0x23f662 of _0x371ec8['matchAll'](/\bJOIN\b/gi)){const _0xeb5140=_0x23f662[_0x51cedb(0x1bc)]??0x0;if(_0x39b98c[_0x51cedb(0x182)](_0xeb5140))continue;const _0x5d2b18=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x51cedb(0x181)](_0x64666[_0x51cedb(0x18a)](_0xeb5140+_0x23f662[0x0]['length'])),_0x42d44c=normalizeIdentifier(_0x5d2b18?.[0x1]||_0x51cedb(0x1bd)),_0x5988ff=normalizeIdentifier(_0x5d2b18?.[0x2]||''),_0x232693=isSqlClauseKeyword(_0x5988ff)?_0x42d44c[_0x51cedb(0x195)]('.')['at'](-0x1)||_0x42d44c:_0x5988ff||_0x42d44c[_0x51cedb(0x195)]('.')['at'](-0x1)||_0x42d44c;_0x3e794f[_0x51cedb(0x1a0)]({'table':_0x42d44c,'alias':_0x232693,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x51cedb(0x197),'position':_0xeb5140});}const _0x45b11c=_0x371ec8[_0x51cedb(0x19b)](MYBATIS_INCLUDE_MARKER);return _0x45b11c>=0x0&&!_0x3e794f[_0x51cedb(0x185)](_0x3ec261=>_0x3ec261[_0x51cedb(0x1a8)])&&_0x3e794f['push']({'table':_0x51cedb(0x1bd),'alias':_0x51cedb(0x1bd),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','containsUnresolvedInclude':!![],'position':_0x45b11c}),_0x3e794f[_0x51cedb(0x1b1)]((_0x23ce74,_0x5a021e)=>_0x23ce74[_0x51cedb(0x192)]-_0x5a021e[_0x51cedb(0x192)]);}function stripSqlNoise(_0x15c3e9){const _0x3a2de5=a248_0x18e4,_0x5c5d4c=Array[_0x3a2de5(0x1a1)](_0x15c3e9),_0x233ee3=(_0x4c913b,_0x3ff1a3)=>{for(let _0x16b88e=_0x4c913b;_0x16b88e<_0x3ff1a3;_0x16b88e+=0x1){_0x5c5d4c[_0x16b88e]!=='\x0a'&&_0x5c5d4c[_0x16b88e]!=='\x0d'&&(_0x5c5d4c[_0x16b88e]='\x20');}};for(let _0x33cc6e=0x0;_0x33cc6e<_0x5c5d4c[_0x3a2de5(0x1b5)];_0x33cc6e+=0x1){const _0x165677=_0x5c5d4c[_0x33cc6e],_0x120e87=_0x5c5d4c[_0x33cc6e+0x1];if(_0x165677==='\x27'||_0x165677==='\x22'||_0x165677==='`'){const _0x558342=_0x165677,_0x5121ca=_0x33cc6e;_0x33cc6e+=0x1;while(_0x33cc6e<_0x5c5d4c[_0x3a2de5(0x1b5)]){if(_0x5c5d4c[_0x33cc6e]==='\x5c'&&_0x33cc6e+0x1<_0x5c5d4c[_0x3a2de5(0x1b5)]){_0x33cc6e+=0x2;continue;}if(_0x5c5d4c[_0x33cc6e]!==_0x558342){_0x33cc6e+=0x1;continue;}if(_0x5c5d4c[_0x33cc6e+0x1]===_0x558342){_0x33cc6e+=0x2;continue;}break;}if(_0x558342==='\x27')_0x233ee3(_0x5121ca,Math[_0x3a2de5(0x194)](_0x33cc6e+0x1,_0x5c5d4c[_0x3a2de5(0x1b5)]));continue;}if(_0x165677==='-'&&_0x120e87==='-'){const _0x1bd2c6=_0x33cc6e;while(_0x33cc6e<_0x5c5d4c[_0x3a2de5(0x1b5)]&&_0x5c5d4c[_0x33cc6e]!=='\x0a')_0x33cc6e+=0x1;_0x233ee3(_0x1bd2c6,_0x33cc6e);continue;}if(_0x165677==='/'&&_0x120e87==='*'){const _0x129135=_0x33cc6e;_0x33cc6e+=0x2;while(_0x33cc6e<_0x5c5d4c[_0x3a2de5(0x1b5)]&&!(_0x5c5d4c[_0x33cc6e]==='*'&&_0x5c5d4c[_0x33cc6e+0x1]==='/')){_0x33cc6e+=0x1;}_0x33cc6e=Math[_0x3a2de5(0x194)](_0x33cc6e+0x1,_0x5c5d4c[_0x3a2de5(0x1b5)]-0x1),_0x233ee3(_0x129135,_0x33cc6e+0x1);continue;}if(_0x165677==='#'&&_0x120e87!=='{'){const _0x399194=_0x33cc6e;while(_0x33cc6e<_0x5c5d4c['length']&&_0x5c5d4c[_0x33cc6e]!=='\x0a')_0x33cc6e+=0x1;_0x233ee3(_0x399194,_0x33cc6e);continue;}if((_0x165677==='#'||_0x165677==='$')&&_0x120e87==='{'){const _0x34439f=_0x33cc6e;_0x33cc6e+=0x2;while(_0x33cc6e<_0x5c5d4c[_0x3a2de5(0x1b5)]&&_0x5c5d4c[_0x33cc6e]!=='}')_0x33cc6e+=0x1;_0x233ee3(_0x34439f,Math['min'](_0x33cc6e+0x1,_0x5c5d4c[_0x3a2de5(0x1b5)]));}}return _0x5c5d4c[_0x3a2de5(0x179)]('');}function maskQuotedIdentifiers(_0x52b3f3){const _0x52cc76=a248_0x18e4,_0x591811=Array[_0x52cc76(0x1a1)](_0x52b3f3);for(let _0x254197=0x0;_0x254197<_0x591811[_0x52cc76(0x1b5)];_0x254197+=0x1){const _0x35ce6f=_0x591811[_0x254197];if(_0x35ce6f!=='\x22'&&_0x35ce6f!=='`')continue;_0x254197+=0x1;while(_0x254197<_0x591811['length']){if(_0x591811[_0x254197]===_0x35ce6f){if(_0x591811[_0x254197+0x1]===_0x35ce6f){_0x591811[_0x254197]='\x20',_0x591811[_0x254197+0x1]='\x20',_0x254197+=0x2;continue;}break;}_0x591811[_0x254197]='\x20',_0x254197+=0x1;}}return _0x591811[_0x52cc76(0x179)]('');}function maskNestedQueries(_0x383a01){const _0x182f0a=a248_0x18e4,_0x21232f=Array[_0x182f0a(0x1a1)](_0x383a01);for(let _0x60bf39=0x0;_0x60bf39<_0x21232f[_0x182f0a(0x1b5)];_0x60bf39+=0x1){if(_0x21232f[_0x60bf39]!=='(')continue;const _0x56789b=_0x383a01[_0x182f0a(0x18a)](_0x60bf39+0x1);if(!/^\s*(?:SELECT|WITH)\b/i['test'](_0x56789b))continue;let _0x5a84eb=0x1,_0x46519b=_0x60bf39+0x1;for(;_0x46519b<_0x21232f[_0x182f0a(0x1b5)]&&_0x5a84eb>0x0;_0x46519b+=0x1){if(_0x21232f[_0x46519b]==='(')_0x5a84eb+=0x1;if(_0x21232f[_0x46519b]===')')_0x5a84eb-=0x1;}if(_0x5a84eb!==0x0)continue;for(let _0x3d8946=_0x60bf39;_0x3d8946<_0x46519b;_0x3d8946+=0x1){_0x21232f[_0x3d8946]='\x20';}const _0xd200cf=_0x182f0a(0x1ac);for(let _0x3b701d=0x0;_0x3b701d<_0xd200cf[_0x182f0a(0x1b5)]&&_0x60bf39+_0x3b701d<_0x46519b;_0x3b701d+=0x1){_0x21232f[_0x60bf39+_0x3b701d]=_0xd200cf[_0x3b701d];}_0x60bf39=_0x46519b-0x1;}return _0x21232f['join']('');}function splitTopLevelAnd(_0x2940b3){const _0x5b12b7=a248_0x18e4,_0x32c144=[];let _0x555fdc=0x0,_0x1c3949=0x0;for(let _0x26c737=0x0;_0x26c737<_0x2940b3[_0x5b12b7(0x1b5)];_0x26c737+=0x1){const _0x1969be=_0x2940b3[_0x26c737];if(_0x1969be==='(')_0x555fdc+=0x1;if(_0x1969be===')')_0x555fdc=Math[_0x5b12b7(0x1ba)](0x0,_0x555fdc-0x1);_0x555fdc===0x0&&_0x2940b3[_0x5b12b7(0x18a)](_0x26c737)['match'](/^AND\b/i)&&(_0x26c737===0x0||/\s/[_0x5b12b7(0x17e)](_0x2940b3[_0x26c737-0x1]??''))&&(_0x32c144[_0x5b12b7(0x1a0)](_0x2940b3[_0x5b12b7(0x18a)](_0x1c3949,_0x26c737)[_0x5b12b7(0x17d)]()),_0x26c737+=0x2,_0x1c3949=_0x26c737+0x1);}const _0x22dee4=_0x2940b3[_0x5b12b7(0x18a)](_0x1c3949)['trim']();if(_0x22dee4)_0x32c144['push'](_0x22dee4);return _0x32c144;}function a248_0x18e4(_0x29e141,_0x2c9265){_0x29e141=_0x29e141-0x175;const _0x436e30=a248_0x436e();let _0x18e45f=_0x436e30[_0x29e141];return _0x18e45f;}function hasTopLevelKeyword(_0x18a32d,_0x3e3264){const _0x3b1f2d=a248_0x18e4;let _0x5350a5=0x0;for(let _0x3da165=0x0;_0x3da165<_0x18a32d['length'];_0x3da165+=0x1){const _0x4ae360=_0x18a32d[_0x3da165];if(_0x4ae360==='(')_0x5350a5+=0x1;if(_0x4ae360===')')_0x5350a5=Math['max'](0x0,_0x5350a5-0x1);if(_0x5350a5!==0x0)continue;const _0x2bf0a9=_0x18a32d[_0x3b1f2d(0x18a)](_0x3da165,_0x3da165+_0x3e3264[_0x3b1f2d(0x1b5)]),_0x2cdd91=_0x18a32d[_0x3da165-0x1]??'\x20',_0x343a15=_0x18a32d[_0x3da165+_0x3e3264[_0x3b1f2d(0x1b5)]]??'\x20';if(_0x2bf0a9['toUpperCase']()===_0x3e3264[_0x3b1f2d(0x178)]()&&!/[\w$]/[_0x3b1f2d(0x17e)](_0x2cdd91)&&!/[\w$]/[_0x3b1f2d(0x17e)](_0x343a15))return!![];}return![];}function splitEquality(_0x5e8cfb){const _0x187071=a248_0x18e4,_0x141029=stripOuterParentheses(_0x5e8cfb);let _0x58d676=0x0,_0x669beb;for(let _0xd90466=0x0;_0xd90466<_0x141029[_0x187071(0x1b5)];_0xd90466+=0x1){const _0x8d43e7=_0x141029[_0xd90466];if(_0x8d43e7==='(')_0x58d676+=0x1;if(_0x8d43e7===')')_0x58d676=Math['max'](0x0,_0x58d676-0x1);const _0xf5d4c2=_0x141029[_0xd90466-0x1]??'',_0x5f0b7d=_0x141029[_0xd90466+0x1]??'';if(_0x8d43e7==='='&&_0x58d676===0x0&&!/[!<>=:]/[_0x187071(0x17e)](_0xf5d4c2)&&_0x5f0b7d!=='='){if(_0x669beb!==undefined)return null;_0x669beb=_0xd90466;}}return _0x669beb===undefined?null:[_0x141029[_0x187071(0x18a)](0x0,_0x669beb)[_0x187071(0x17d)](),_0x141029[_0x187071(0x18a)](_0x669beb+0x1)[_0x187071(0x17d)]()];}function a248_0x436e(){const _0x58a6b0=['covered','min','split','INNER','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','353530BodwMW','reduce','toLowerCase','indexOf','cross','map','table','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','push','from','natural','right','where','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','includes','warning','containsUnresolvedInclude','alias','(?:^|[^\x5cw$])','add','__sq__','indexes','\x5cs*\x5c.\x5cs*[\x5cw$]+','1353264koXTtK','matchAll','sort','INDEX_METADATA_UNAVAILABLE','103661NGmXBw','error','length','matchedPrefix','193506ScqbSN','inner','tableName','max','columns','index','unknown','5486CxJwFY','sql','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','toUpperCase','join','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','replaceAll','15PJEfXY','trim','test','using','528332NyBmaP','exec','has','filter','JOIN_INDEX_MISSING','some','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','unsupportedPredicate','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','slice','\x5c$&','replace','full','1048775nrXhuX','left','45XfkKrh','63ogDKPM','position'];a248_0x436e=function(){return _0x58a6b0;};return a248_0x436e();}function parseDirectColumnReference(_0xc25588,_0x3536cc){const _0x1f26ff=a248_0x18e4,_0x255f4b=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x1f26ff(0x181)](stripOuterParentheses(_0xc25588));if(!_0x255f4b)return null;if(normalizeIdentifier(_0x255f4b[0x1]??'')!==normalizeIdentifier(_0x3536cc))return null;return normalizeIdentifier(_0x255f4b[0x2]??'');}function containsColumnReference(_0x29a45c,_0x4ebfa8){const _0x8be37e=a248_0x18e4,_0x403d86=_0x29a45c['replace'](/[`"]/g,''),_0xb700f6=_0x4ebfa8[_0x8be37e(0x18c)](/[.*+?^${}()|[\]\\]/g,_0x8be37e(0x18b));return new RegExp(_0x8be37e(0x1aa)+_0xb700f6+_0x8be37e(0x1ae),'i')['test'](_0x403d86);}function findEqualityPrefix(_0x14a156,_0x150291){const _0x445375=a248_0x18e4,_0x208b23=new Set(_0x150291[_0x445375(0x19d)](normalizeIdentifier)),_0x52139a=[];for(const _0x435862 of _0x14a156){if(!_0x208b23[_0x445375(0x182)](normalizeIdentifier(_0x435862)))break;_0x52139a['push'](_0x435862);}return _0x52139a;}function resolveTableMetadata(_0x34a1e1,_0x48645f){const _0x3e9c9a=a248_0x18e4,_0x1ec03b=normalizeIdentifier(_0x48645f),_0x3c3387=_0x34a1e1[_0x3e9c9a(0x183)](_0x46681b=>normalizeIdentifier(_0x46681b['tableName'])===_0x1ec03b);if(_0x3c3387[_0x3e9c9a(0x1b5)]===0x1)return _0x3c3387[0x0];const _0x5d3244=_0x1ec03b[_0x3e9c9a(0x1a6)]('.'),_0x477606=_0x1ec03b[_0x3e9c9a(0x195)]('.')['at'](-0x1),_0x4dae43=_0x34a1e1[_0x3e9c9a(0x183)](_0x20ef81=>{const _0x4359ec=_0x3e9c9a,_0x81aecf=normalizeIdentifier(_0x20ef81[_0x4359ec(0x1b9)]);if(_0x5d3244&&_0x81aecf[_0x4359ec(0x1a6)]('.'))return![];return _0x81aecf[_0x4359ec(0x195)]('.')['at'](-0x1)===_0x477606;});return _0x4dae43[_0x3e9c9a(0x1b5)]===0x1?_0x4dae43[0x0]:undefined;}function columnNamesMatch(_0x40bb3f,_0x462b3d){return normalizeIdentifier(_0x40bb3f)===normalizeIdentifier(_0x462b3d);}function normalizeIdentifier(_0x509e81){const _0x23add5=a248_0x18e4;return _0x509e81['replace'](/[`"]/g,'')[_0x23add5(0x17d)]()[_0x23add5(0x19a)]();}function isSqlClauseKeyword(_0x5017aa){const _0x52a941=a248_0x18e4;return new Set(['on',_0x52a941(0x17f),_0x52a941(0x1a4),'join',_0x52a941(0x1b8),_0x52a941(0x18f),_0x52a941(0x1a3),_0x52a941(0x18d),_0x52a941(0x19c),_0x52a941(0x1a2)])[_0x52a941(0x182)](_0x5017aa);}function stripOuterParentheses(_0x5c9604){const _0x428250=a248_0x18e4;let _0x144ffc=_0x5c9604['trim']();while(_0x144ffc['startsWith']('(')&&_0x144ffc['endsWith'](')')){let _0x1fae10=0x0,_0x2fde95=!![];for(let _0xacd619=0x0;_0xacd619<_0x144ffc[_0x428250(0x1b5)];_0xacd619+=0x1){if(_0x144ffc[_0xacd619]==='(')_0x1fae10+=0x1;if(_0x144ffc[_0xacd619]===')')_0x1fae10-=0x1;if(_0x1fae10===0x0&&_0xacd619<_0x144ffc[_0x428250(0x1b5)]-0x1){_0x2fde95=![];break;}}if(!_0x2fde95||_0x1fae10!==0x0)break;_0x144ffc=_0x144ffc[_0x428250(0x18a)](0x1,-0x1)[_0x428250(0x17d)]();}return _0x144ffc;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a249_0x467b38=a249_0x4a26;function a249_0x4a26(_0x1b39d3,_0x155798){_0x1b39d3=_0x1b39d3-0x115;const _0x252348=a249_0x2523();let _0x4a2682=_0x252348[_0x1b39d3];return _0x4a2682;}(function(_0x5cc6ed,_0x2c0f77){const _0x5e7b7a=a249_0x4a26,_0x26689a=_0x5cc6ed();while(!![]){try{const _0x39e97d=parseInt(_0x5e7b7a(0x117))/0x1*(-parseInt(_0x5e7b7a(0x120))/0x2)+-parseInt(_0x5e7b7a(0x11b))/0x3*(parseInt(_0x5e7b7a(0x121))/0x4)+-parseInt(_0x5e7b7a(0x11e))/0x5+parseInt(_0x5e7b7a(0x11c))/0x6+-parseInt(_0x5e7b7a(0x11a))/0x7+-parseInt(_0x5e7b7a(0x115))/0x8+parseInt(_0x5e7b7a(0x11f))/0x9;if(_0x39e97d===_0x2c0f77)break;else _0x26689a['push'](_0x26689a['shift']());}catch(_0x1442a9){_0x26689a['push'](_0x26689a['shift']());}}}(a249_0x2523,0x773c5));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a249_0x467b38(0x11d),LOCK_FILE_NAME=a249_0x467b38(0x118),TRASH_DIR_NAME=a249_0x467b38(0x116);export function loadSqlProjectConfig(_0x5204f2,_0x42503d){const _0x2fca33=a249_0x467b38,_0x29e2fd=resolve(_0x42503d??findProjectRootDirectory()),_0x52c546=DOT_DIR+_0x2fca33(0x119),_0x195057=_0x52c546+'/'+_0x5204f2;return{'projectRoot':_0x29e2fd,'appCode':_0x5204f2,'sqlWorkspaceRoot':_0x52c546,'sqlRoot':_0x195057,'sqlRootDir':resolve(_0x29e2fd,DOT_DIR,'sql',_0x5204f2),'lockFilePath':resolve(_0x29e2fd,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x29e2fd,DOT_DIR,TRASH_DIR_NAME)};}function a249_0x2523(){const _0x3f6792=['.rabetbase','3188425WReHvT','22559112vtIQrO','3246TYOLDk','2324vLoNFi','5348904NLaVde','sql-trash','154mBWdnD','sql.lock.json','/sql','5534508IqcHzK','2133SvyUat','4450776xlYBVW'];a249_0x2523=function(){return _0x3f6792;};return a249_0x2523();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x48e86c,_0x347e5d){const _0x158d5b=a250_0x5877,_0x1b681d=_0x48e86c();while(!![]){try{const _0x43625c=parseInt(_0x158d5b(0x184))/0x1*(-parseInt(_0x158d5b(0x169))/0x2)+parseInt(_0x158d5b(0x17b))/0x3*(parseInt(_0x158d5b(0x185))/0x4)+-parseInt(_0x158d5b(0x171))/0x5*(-parseInt(_0x158d5b(0x186))/0x6)+-parseInt(_0x158d5b(0x16b))/0x7*(-parseInt(_0x158d5b(0x174))/0x8)+-parseInt(_0x158d5b(0x178))/0x9*(-parseInt(_0x158d5b(0x176))/0xa)+-parseInt(_0x158d5b(0x172))/0xb+-parseInt(_0x158d5b(0x17d))/0xc;if(_0x43625c===_0x347e5d)break;else _0x1b681d['push'](_0x1b681d['shift']());}catch(_0x19f6ce){_0x1b681d['push'](_0x1b681d['shift']());}}}(a250_0x3ab5,0x2113a));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';function a250_0x5877(_0x3d1633,_0x5b537f){_0x3d1633=_0x3d1633-0x168;const _0x3ab555=a250_0x3ab5();let _0x5877c1=_0x3ab555[_0x3d1633];return _0x5877c1;}import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x4dc634){const _0x3e76fb=a250_0x5877;if(_0x4dc634===_0x3e76fb(0x17e))return _0x3e76fb(0x16c);if(_0x4dc634===_0x3e76fb(0x168))return'mybatisXml';return undefined;}async function scanSqlFilesRecursively(_0x31e946,_0xa5fa8a){const _0xb24f7e=a250_0x5877,_0x2d72e5=[];try{const _0x50146c=await readdir(_0x31e946,{'withFileTypes':!![]});for(const _0x3b423a of _0x50146c){const _0x23b558=join(_0x31e946,_0x3b423a[_0xb24f7e(0x180)]);if(_0x3b423a['isDirectory']()){_0x2d72e5['push'](...await scanSqlFilesRecursively(_0x23b558,_0xa5fa8a));continue;}if(!_0x3b423a['isFile']())continue;const _0x508cfe=extname(_0x3b423a['name'])[_0xb24f7e(0x189)](),_0x472d3c=extensionToMode(_0x508cfe);if(!_0x472d3c)continue;const _0x1d20ba=relative(_0xa5fa8a,_0x23b558)[_0xb24f7e(0x16d)](/\\/g,'/'),_0x3da126=_0x1d20ba[_0xb24f7e(0x17f)]('/')[_0xb24f7e(0x188)](Boolean),_0xd7dafe=parseSqlPath(_0x3da126,_0x3b423a[_0xb24f7e(0x180)],_0x508cfe);if(!_0xd7dafe)continue;_0x2d72e5[_0xb24f7e(0x179)]({'sqlCode':_0xd7dafe[_0xb24f7e(0x16e)],'sqlName':_0xd7dafe[_0xb24f7e(0x17a)],'dbDirectory':_0x3da126[0x0],'filePath':_0x23b558,'relativePath':_0x1d20ba,'lockKey':_0xd7dafe[_0xb24f7e(0x16e)],'mode':_0x472d3c});}}catch(_0x45301f){if(_0x45301f[_0xb24f7e(0x16f)]!==_0xb24f7e(0x181))throw _0x45301f;}return _0x2d72e5;}export async function scanLocalSqlQueries(_0x56f680){const _0x2338a5=a250_0x5877;return scanSqlFilesRecursively(_0x56f680[_0x2338a5(0x173)],_0x56f680[_0x2338a5(0x173)]);}export function resolveLocalSqlFilePath(_0x1bdda8,_0x22b2ea,_0x2c6cf5){const _0x30b1ff=a250_0x5877,_0x2b342a=_0x2c6cf5?.[_0x30b1ff(0x170)]||(_0x2c6cf5?.[_0x30b1ff(0x17a)]||_0x2c6cf5?.[_0x30b1ff(0x183)]?buildSqlRelativePath(_0x22b2ea,_0x2c6cf5?.[_0x30b1ff(0x17a)],_0x2c6cf5?.['dbName'],_0x2c6cf5?.['mode']||_0x30b1ff(0x16c),_0x2c6cf5?.[_0x30b1ff(0x175)]):buildDefaultSqlFileName(_0x22b2ea,_0x2c6cf5?.[_0x30b1ff(0x182)]||_0x30b1ff(0x16c)));return join(_0x1bdda8[_0x30b1ff(0x173)],_0x2b342a);}function a250_0x3ab5(){const _0x1b28cd=['.sql','split','name','ENOENT','mode','dbName','12mgNcdg','4hIEbPp','9060JYXcPw','length','filter','toLowerCase','.xml','9754jjIPQi','slice','4186IgEgYd','sql','replace','sqlCode','code','path','130FZlOEt','2818706NRgruw','sqlRootDir','2648lViJFh','dbId','370UlOqXT','indexOf','57159tBUgUE','push','sqlName','483213IYCvFf','test','2196048TQmRiz'];a250_0x3ab5=function(){return _0x1b28cd;};return a250_0x3ab5();}export async function directoryExists(_0x347447){try{const _0xfabc28=await stat(_0x347447);return _0xfabc28['isDirectory']();}catch{return![];}}function parseSqlPath(_0x420e76,_0x340717,_0x44bff7){const _0x4e3d8e=a250_0x5877,_0x3d44f9=_0x340717['slice'](0x0,-_0x44bff7[_0x4e3d8e(0x187)]);if(_0x420e76[_0x4e3d8e(0x187)]<0x2)return null;const _0x2019a0=_0x3d44f9[_0x4e3d8e(0x177)]('_');if(_0x2019a0<=0x0||_0x2019a0>=_0x3d44f9[_0x4e3d8e(0x187)]-0x1)return null;const _0x489dd8=_0x3d44f9[_0x4e3d8e(0x16a)](0x0,_0x2019a0);if(!isLikelySqlCode(_0x489dd8))return null;return{'sqlCode':_0x489dd8,'sqlName':_0x3d44f9['slice'](_0x2019a0+0x1)};}function isLikelySqlCode(_0x2c72a6){const _0x3d3245=a250_0x5877;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x3d3245(0x17c)](_0x2c72a6);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x427a82,_0xfa218d){const _0x1f747b=a251_0xb1d2,_0x520f9e=_0x427a82();while(!![]){try{const _0x2ded2a=parseInt(_0x1f747b(0xce))/0x1+-parseInt(_0x1f747b(0xca))/0x2+-parseInt(_0x1f747b(0xc9))/0x3+-parseInt(_0x1f747b(0xcd))/0x4*(-parseInt(_0x1f747b(0xc8))/0x5)+-parseInt(_0x1f747b(0xd0))/0x6+-parseInt(_0x1f747b(0xd2))/0x7+parseInt(_0x1f747b(0xcb))/0x8;if(_0x2ded2a===_0xfa218d)break;else _0x520f9e['push'](_0x520f9e['shift']());}catch(_0x50f92b){_0x520f9e['push'](_0x520f9e['shift']());}}}(a251_0x1db8,0x7e37d));function a251_0xb1d2(_0x5dc143,_0xac2fe1){_0x5dc143=_0x5dc143-0xc7;const _0x1db8fd=a251_0x1db8();let _0xb1d2c6=_0x1db8fd[_0x5dc143];return _0xb1d2c6;}import{readFile}from'node:fs/promises';import a251_0x557091 from'node:crypto';export function computeSqlContentHash(_0x393d72){const _0x4aa928=a251_0xb1d2;return a251_0x557091[_0x4aa928(0xc7)]('md5')[_0x4aa928(0xcc)](_0x393d72)['digest'](_0x4aa928(0xcf));}export async function computeSqlFileHash(_0x19503f){const _0x33a7ca=a251_0xb1d2,_0x4c0465=await readFile(_0x19503f,_0x33a7ca(0xd1));return computeSqlContentHash(_0x4c0465);}function a251_0x1db8(){const _0x4383c8=['1447182ZCQwZr','utf8','4360251nhXWrV','createHash','961325nOMcpi','2691051IANyLR','783884RkJset','11122472ehLcMa','update','16UMsnZp','510669VpsDWw','hex'];a251_0x1db8=function(){return _0x4383c8;};return a251_0x1db8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a252_0x318e(){const _0x14d6f3=['3104490FmrxnE','927492XZQArY','apps','23154Yhpgff','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','parse',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','243JyXHQu','ENOENT','36104laEAXG','code','6lYtAxx','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','stringify','lastSync','801ixfSaG','\x22.\x20','1324442ZbByca','utf8','710156MVppvH','\x22\x20vs\x20lock\x20\x22','22qKEzcC','sqlRoot','1540470KygFuW'];a252_0x318e=function(){return _0x14d6f3;};return a252_0x318e();}(function(_0x17372d,_0x4ba62b){const _0x3591ac=a252_0x63ab,_0x540761=_0x17372d();while(!![]){try{const _0x237efe=-parseInt(_0x3591ac(0xc1))/0x1+-parseInt(_0x3591ac(0xc9))/0x2*(-parseInt(_0x3591ac(0xcd))/0x3)+-parseInt(_0x3591ac(0xc7))/0x4+parseInt(_0x3591ac(0xc5))/0x5+-parseInt(_0x3591ac(0xd1))/0x6*(-parseInt(_0x3591ac(0xbf))/0x7)+parseInt(_0x3591ac(0xcf))/0x8*(-parseInt(_0x3591ac(0xd5))/0x9)+-parseInt(_0x3591ac(0xc6))/0xa*(-parseInt(_0x3591ac(0xc3))/0xb);if(_0x237efe===_0x4ba62b)break;else _0x540761['push'](_0x540761['shift']());}catch(_0x34c50f){_0x540761['push'](_0x540761['shift']());}}}(a252_0x318e,0xade39));function a252_0x63ab(_0x4161c6,_0x2609b8){_0x4161c6=_0x4161c6-0xbf;const _0x318eb5=a252_0x318e();let _0x63ab6b=_0x318eb5[_0x4161c6];return _0x63ab6b;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0xa0d35e,_0x5117bf,_0x2cf0d8,_0x131079){const _0x2a2724=a252_0x63ab,_0x4a2301=_0xa0d35e??createEmptySqlLock();let _0x218266=_0x4a2301[_0x2a2724(0xc8)][_0x5117bf];if(!_0x218266)return _0x218266={'sqlRoot':_0x2cf0d8,'lastSync':'','sqls':{}},_0x4a2301[_0x2a2724(0xc8)][_0x5117bf]=_0x218266,{'lockData':_0x4a2301,'appLock':_0x218266};if(!_0x218266['sqlRoot'])_0x218266[_0x2a2724(0xc4)]=_0x2cf0d8;else{if(_0x218266[_0x2a2724(0xc4)]!==_0x2cf0d8)throw new Error(_0x131079+_0x2a2724(0xcc)+_0x2cf0d8+_0x2a2724(0xc2)+_0x218266[_0x2a2724(0xc4)]+_0x2a2724(0xd6)+_0x2a2724(0xca));}return!_0x218266['sqls']&&(_0x218266['sqls']={}),!_0x218266[_0x2a2724(0xd4)]&&(_0x218266[_0x2a2724(0xd4)]=''),{'lockData':_0x4a2301,'appLock':_0x218266};}export async function readSqlLockFile(_0x289cae){const _0xe0d22a=a252_0x63ab;try{const _0x3ed61=await readFile(_0x289cae,_0xe0d22a(0xc0));return JSON[_0xe0d22a(0xcb)](_0x3ed61);}catch(_0x666c96){if(_0x666c96[_0xe0d22a(0xd0)]===_0xe0d22a(0xce))return null;throw new Error(_0xe0d22a(0xd2)+String(_0x666c96));}}export async function writeSqlLockFile(_0x29c436,_0x3cfc55){const _0x2e8e9a=a252_0x63ab;await mkdir(dirname(_0x29c436),{'recursive':!![]}),await writeFile(_0x29c436,JSON[_0x2e8e9a(0xd3)](_0x3cfc55,null,0x2),'utf8');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1b4aa2,_0x37194b){const _0x2f4e5c=a254_0x31c0,_0x29bb80=_0x1b4aa2();while(!![]){try{const _0x3e93ab=-parseInt(_0x2f4e5c(0x97))/0x1+-parseInt(_0x2f4e5c(0x91))/0x2*(-parseInt(_0x2f4e5c(0xa1))/0x3)+parseInt(_0x2f4e5c(0x9e))/0x4+parseInt(_0x2f4e5c(0x94))/0x5*(parseInt(_0x2f4e5c(0xa6))/0x6)+parseInt(_0x2f4e5c(0x9a))/0x7*(-parseInt(_0x2f4e5c(0xa3))/0x8)+-parseInt(_0x2f4e5c(0x93))/0x9*(parseInt(_0x2f4e5c(0x92))/0xa)+-parseInt(_0x2f4e5c(0xa4))/0xb*(-parseInt(_0x2f4e5c(0x95))/0xc);if(_0x3e93ab===_0x37194b)break;else _0x29bb80['push'](_0x29bb80['shift']());}catch(_0x22d1dc){_0x29bb80['push'](_0x29bb80['shift']());}}}(a254_0x3e00,0x7af86));export function detectSqlMode(_0x327c82){const _0x42fe9f=a254_0x31c0,_0x2cd2ad=_0x327c82[_0x42fe9f(0x9b)]();if(/^<(select|insert|update|delete)\b/i[_0x42fe9f(0x9d)](_0x2cd2ad))return _0x42fe9f(0xa7);return _0x42fe9f(0xa0);}function a254_0x3e00(){const _0x13575b=['.xml','7JJyggs','trimStart','trim','test','3650080ZhKnfv','unknown-sql','sql','5667ZBUNec','replace','3856304kWWMYt','8456789YpNMYe','unknown-db','624756IcUiyD','mybatisXml','134HzudNX','1102440wJfZub','63VvysDl','40Dbzash','12uoYcDu','.sql','883458PyBOob','db-'];a254_0x3e00=function(){return _0x13575b;};return a254_0x3e00();}export function getSqlFileExtension(_0x480271){const _0x48819d=a254_0x31c0;return _0x480271==='mybatisXml'?_0x48819d(0x99):_0x48819d(0x96);}export function buildDefaultSqlFileName(_0x373d3e,_0x509db3){return''+_0x373d3e+getSqlFileExtension(_0x509db3);}export function sanitizeSqlPathSegment(_0x2d4644,_0x1235f9){const _0x2424ce=a254_0x31c0,_0x44937c=String(_0x2d4644??'')[_0x2424ce(0x9c)](),_0x528af0=_0x44937c[_0x2424ce(0xa2)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x2424ce(0xa2)](/\s+/g,'-')[_0x2424ce(0xa2)](/-+/g,'-')[_0x2424ce(0xa2)](/^\.+/,'')[_0x2424ce(0xa2)](/\.+$/,'')['replace'](/^-+/,'')[_0x2424ce(0xa2)](/-+$/,'');return _0x528af0||_0x1235f9;}export function buildDbDirectoryName(_0x1e7ea7,_0x15ee93){const _0x1ec961=a254_0x31c0;return sanitizeSqlPathSegment(_0x1e7ea7,_0x15ee93!=null?_0x1ec961(0x98)+_0x15ee93:_0x1ec961(0xa5));}function a254_0x31c0(_0x5684db,_0x48772a){_0x5684db=_0x5684db-0x91;const _0x3e004a=a254_0x3e00();let _0x31c047=_0x3e004a[_0x5684db];return _0x31c047;}export function buildSqlRelativePath(_0x221fa9,_0x77a4d4,_0x54a5f8,_0x3dd18a,_0xd30604){const _0x44a44b=a254_0x31c0,_0x2ff5e0=buildDbDirectoryName(_0x54a5f8,_0xd30604),_0x2da619=sanitizeSqlPathSegment(_0x221fa9,_0x44a44b(0x9f)),_0x5d7a5a=sanitizeSqlPathSegment(_0x77a4d4,_0x2da619);return _0x2ff5e0+'/'+_0x2da619+'_'+_0x5d7a5a+getSqlFileExtension(_0x3dd18a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a250_0x30dc3f=a250_0x55b2;(function(_0x27962d,_0x1fd0c1){const _0x4c813c=a250_0x55b2,_0x37ae5d=_0x27962d();while(!![]){try{const _0x2bbb23=parseInt(_0x4c813c(0x1ff))/0x1*(-parseInt(_0x4c813c(0x1ad))/0x2)+-parseInt(_0x4c813c(0x1d2))/0x3+-parseInt(_0x4c813c(0x1da))/0x4*(-parseInt(_0x4c813c(0x1eb))/0x5)+-parseInt(_0x4c813c(0x1e8))/0x6*(-parseInt(_0x4c813c(0x1f0))/0x7)+-parseInt(_0x4c813c(0x204))/0x8*(-parseInt(_0x4c813c(0x1c6))/0x9)+-parseInt(_0x4c813c(0x1ee))/0xa+parseInt(_0x4c813c(0x1f4))/0xb*(parseInt(_0x4c813c(0x1d1))/0xc);if(_0x2bbb23===_0x1fd0c1)break;else _0x37ae5d['push'](_0x37ae5d['shift']());}catch(_0x4b6048){_0x37ae5d['push'](_0x37ae5d['shift']());}}}(a250_0x1724,0x1e432));const MYBATIS_OUTER_TAGS=new Map([[a250_0x30dc3f(0x1b9),a250_0x30dc3f(0x1ba)],[a250_0x30dc3f(0x205),'INSERT'],['update','UPDATE'],[a250_0x30dc3f(0x1cc),a250_0x30dc3f(0x1f3)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a250_0x30dc3f(0x1c9),a250_0x30dc3f(0x1b7),'choose','when','otherwise',a250_0x30dc3f(0x1c0),'set',a250_0x30dc3f(0x1c2),a250_0x30dc3f(0x1bd),a250_0x30dc3f(0x1ac)]),MYBATIS_BRANCH_TAGS=new Set(['if','foreach',a250_0x30dc3f(0x1fe),a250_0x30dc3f(0x206),a250_0x30dc3f(0x1c4)]);export const MYBATIS_DYNAMIC_START_MARKER=a250_0x30dc3f(0x200);export const MYBATIS_DYNAMIC_END_MARKER=a250_0x30dc3f(0x1b8);export const MYBATIS_INCLUDE_MARKER=a250_0x30dc3f(0x1cb);const UNRESOLVED_SQL_FRAGMENT=a250_0x30dc3f(0x1fb),MYBATIS_OUTER_TAG_PATTERN=new RegExp('^<\x5cs*(?:'+[...MYBATIS_OUTER_TAGS['keys']()][a250_0x30dc3f(0x1d7)]('|')+a250_0x30dc3f(0x1f8),'i');function a250_0x55b2(_0x16e1cc,_0x1d75d8){_0x16e1cc=_0x16e1cc-0x1ac;const _0x1724ec=a250_0x1724();let _0x55b234=_0x1724ec[_0x16e1cc];return _0x55b234;}function a250_0x1724(){const _0x21a659=['error','otherwise','toUpperCase','429291aOuIYB','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','-->','where','DDL','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','delete','SQL\x20content\x20is\x20empty','indexOf','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','exec','12lwIATt','342408dLsPUA','outer','add','has','length','join','slice','\x20SET\x20','29496zUtdIS','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','INSERT','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','sql','match','Unterminated\x20XML\x20declaration.','matchAll','&','<!--','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','Invalid\x20MyBatis\x20XML\x20tag.','replace','141234lBFKUt','Unterminated\x20CDATA\x20section.','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','120koGMAB','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','toLowerCase','398790LwuXBY','UNKNOWN','7FJPJzs','get','\x20WHERE\x20','DELETE','1996478Gbspgm','split','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','parseInt',')\x5cb','UPDATE','\x20with\x20parameters:\x20','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','choose','247141wEadrP','__RABETBASE_MYBATIS_DYNAMIC_START__','>',']]>','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','24PexXQs','insert','when','test','\x20query\x20targeting\x20','unknown\x20table(s)','property','2FYjBFB','fromCodePoint','tagName','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','from','Invalid\x20XML\x20entity\x20reference.','push','replaceAll','type','startsWith','foreach','__RABETBASE_MYBATIS_DYNAMIC_END__','select','SELECT','statementType','rawName','include','Unterminated\x20MyBatis\x20XML\x20tag.','includes','trim','pop','bind'];a250_0x1724=function(){return _0x21a659;};return a250_0x1724();}export function normalizeSqlForStaticAnalysis(_0x4dbb88){const _0x135e94=a250_0x30dc3f,_0x41d2eb=typeof _0x4dbb88==='string'?_0x4dbb88:'';if(!startsWithMybatisStatementWrapper(_0x41d2eb))return{'sql':_0x41d2eb,'mode':'sql'};let _0x2a6fc5=0x0,_0xdcb98d='',_0x14a2de,_0x437194=![],_0x3b9af9=![];const _0x509ecc=[];while(_0x2a6fc5<_0x41d2eb[_0x135e94(0x1d6)]){if(_0x41d2eb[_0x135e94(0x1b6)](_0x135e94(0x1e4),_0x2a6fc5)){const _0x12d472=_0x41d2eb[_0x135e94(0x1ce)](_0x135e94(0x1c8),_0x2a6fc5+0x4);if(_0x12d472<0x0)return invalidMybatisSource('Unterminated\x20XML\x20comment.');_0xdcb98d+='\x20',_0x2a6fc5=_0x12d472+0x3;continue;}if(_0x41d2eb[_0x135e94(0x1b6)]('<,_0x2a6fc5+0x9);if(_0x11a71e<0x0)return invalidMybatisSource(_0x135e94(0x1e9));_0xdcb98d+=_0x41d2eb[_0x135e94(0x1d8)](_0x2a6fc5+0x9,_0x11a71e),_0x2a6fc5=_0x11a71e+0x3;continue;}if(_0x41d2eb['startsWith']('<?',_0x2a6fc5)){if(_0x437194)return invalidMybatisSource(_0x135e94(0x1b0));const _0x24e66f=_0x41d2eb['indexOf']('?>',_0x2a6fc5+0x2);if(_0x24e66f<0x0)return invalidMybatisSource(_0x135e94(0x1e1));_0xdcb98d+='\x20',_0x2a6fc5=_0x24e66f+0x2;continue;}if(_0x41d2eb[_0x2a6fc5]!=='<'){const _0x10496e=_0x41d2eb[_0x135e94(0x1ce)]('<',_0x2a6fc5),_0x9406b9=_0x10496e<0x0?_0x41d2eb[_0x135e94(0x1d6)]:_0x10496e,_0x406e60=_0x41d2eb[_0x135e94(0x1d8)](_0x2a6fc5,_0x9406b9);if((!_0x437194||_0x3b9af9)&&_0x406e60[_0x135e94(0x1c0)]())return invalidMybatisSource(_0x135e94(0x1db));if(_0x437194&&!_0x3b9af9){const _0x34ef5a=decodeXmlEntities(_0x406e60);if(_0x34ef5a===null)return invalidMybatisSource(_0x135e94(0x1b2));_0xdcb98d+=_0x34ef5a;}else _0xdcb98d+='\x20';_0x2a6fc5=_0x9406b9;continue;}const _0x432a35=findXmlTagEnd(_0x41d2eb,_0x2a6fc5);if(_0x432a35<0x0)return invalidMybatisSource(_0x135e94(0x1be));const _0x4feae9=_0x41d2eb[_0x135e94(0x1d8)](_0x2a6fc5,_0x432a35+0x1),_0x173bed=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x135e94(0x1d0)](_0x4feae9);if(!_0x173bed)return invalidMybatisSource(_0x135e94(0x1e6));const _0xb1f7d9=_0x173bed[0x1]==='/',_0x52038a=_0x173bed[0x2]??'',_0x1bb124=_0x52038a[_0x135e94(0x1ed)](),_0x2ebb02=_0x173bed[0x3]??'',_0x322e71=_0x173bed[0x4]==='/',_0x4e2b35=MYBATIS_OUTER_TAGS[_0x135e94(0x1f1)](_0x1bb124);if(!_0x4e2b35&&!MYBATIS_DYNAMIC_TAGS[_0x135e94(0x1d5)](_0x1bb124))return invalidMybatisSource('Unsupported\x20MyBatis\x20XML\x20tag:\x20<'+_0x1bb124+'>.');if(!_0x4e2b35&&_0x52038a!==_0x1bb124)return invalidMybatisSource(_0x135e94(0x1ec)+_0x52038a+'>.');if(_0xb1f7d9){if(_0x2ebb02[_0x135e94(0x1c0)]()||_0x322e71)return invalidMybatisSource(_0x135e94(0x1dd)+_0x52038a+'>.');const _0x5629b7=_0x509ecc['at'](-0x1);if(!_0x5629b7||(_0x5629b7[_0x135e94(0x1d3)]?_0x5629b7[_0x135e94(0x1af)]!==_0x1bb124:_0x5629b7[_0x135e94(0x1bc)]!==_0x52038a))return invalidMybatisSource(_0x135e94(0x1fd)+_0x52038a+'>.');_0x509ecc[_0x135e94(0x1c1)]();if(_0x5629b7[_0x135e94(0x1d3)])_0x3b9af9=!![];_0xdcb98d+=MYBATIS_BRANCH_TAGS['has'](_0x1bb124)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x2ebb02))return invalidMybatisSource('Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<'+_0x52038a+'>.');if(_0x1bb124===_0x135e94(0x1ac)&&(!_0x322e71||_0x509ecc['at'](-0x1)?.[_0x135e94(0x1af)]!==_0x135e94(0x1bd)))return invalidMybatisSource(_0x135e94(0x1c7));if(_0x4e2b35){if(_0x437194||_0x509ecc[_0x135e94(0x1d6)]>0x0)return invalidMybatisSource(_0x135e94(0x1ea));_0x437194=!![],_0x3b9af9=_0x322e71,_0x14a2de=_0x4e2b35;}else{if(!_0x437194||_0x3b9af9)return invalidMybatisSource(_0x135e94(0x1f6)+_0x52038a+'>.');}_0xdcb98d+=_0x1bb124===_0x135e94(0x1c9)?_0x135e94(0x1f2):_0x1bb124==='set'?_0x135e94(0x1d9):_0x1bb124==='include'?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x135e94(0x1d5)](_0x1bb124)&&!_0x322e71?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x322e71&&_0x509ecc[_0x135e94(0x1b3)]({'rawName':_0x52038a,'tagName':_0x1bb124,'outer':!!_0x4e2b35});}_0x2a6fc5=_0x432a35+0x1;}if(_0x509ecc[_0x135e94(0x1d6)]>0x0)return invalidMybatisSource('Unclosed\x20MyBatis\x20XML\x20tag:\x20<'+_0x509ecc['at'](-0x1)?.['rawName']+'>.');if(!_0x437194||!_0x3b9af9)return invalidMybatisSource(_0x135e94(0x1cf));return{'sql':_0xdcb98d['trim'](),'mode':'mybatisXml',..._0x14a2de?{'statementType':_0x14a2de}:{}};}function hasWellFormedXmlAttributes(_0x21ea9c){const _0x41545c=a250_0x30dc3f;let _0x519f4f=0x0;const _0x4777de=new Set();while(_0x519f4f<_0x21ea9c[_0x41545c(0x1d6)]){while(_0x519f4f<_0x21ea9c[_0x41545c(0x1d6)]&&/\s/[_0x41545c(0x207)](_0x21ea9c[_0x519f4f]??''))_0x519f4f+=0x1;if(_0x519f4f>=_0x21ea9c[_0x41545c(0x1d6)])return!![];const _0x424ee2=/^[A-Za-z_:][\w:.-]*/[_0x41545c(0x1d0)](_0x21ea9c['slice'](_0x519f4f)),_0x5e112e=_0x424ee2?.[0x0];if(!_0x5e112e||_0x4777de[_0x41545c(0x1d5)](_0x5e112e))return![];_0x4777de[_0x41545c(0x1d4)](_0x5e112e),_0x519f4f+=_0x5e112e[_0x41545c(0x1d6)];while(_0x519f4f<_0x21ea9c[_0x41545c(0x1d6)]&&/\s/[_0x41545c(0x207)](_0x21ea9c[_0x519f4f]??''))_0x519f4f+=0x1;if(_0x21ea9c[_0x519f4f]!=='=')return![];_0x519f4f+=0x1;while(_0x519f4f<_0x21ea9c[_0x41545c(0x1d6)]&&/\s/[_0x41545c(0x207)](_0x21ea9c[_0x519f4f]??''))_0x519f4f+=0x1;const _0x4670df=_0x21ea9c[_0x519f4f];if(_0x4670df!=='\x22'&&_0x4670df!=='\x27')return![];_0x519f4f+=0x1;const _0x5403a9=_0x21ea9c[_0x41545c(0x1ce)](_0x4670df,_0x519f4f);if(_0x5403a9<0x0)return![];if(decodeXmlEntities(_0x21ea9c['slice'](_0x519f4f,_0x5403a9))===null)return![];_0x519f4f=_0x5403a9+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x27fd4e){const _0x54608d=a250_0x30dc3f;let _0x11c0d9=0x0;const _0xabbfad=()=>{const _0xb23632=a250_0x55b2;while(_0x11c0d9<_0x27fd4e[_0xb23632(0x1d6)]&&/\s/[_0xb23632(0x207)](_0x27fd4e[_0x11c0d9]??''))_0x11c0d9+=0x1;};_0xabbfad();while(_0x11c0d9<_0x27fd4e[_0x54608d(0x1d6)]){if(_0x27fd4e[_0x54608d(0x1b6)]('<!--',_0x11c0d9)){const _0x1b96f8=_0x27fd4e['indexOf'](_0x54608d(0x1c8),_0x11c0d9+0x4);if(_0x1b96f8<0x0)return!![];_0x11c0d9=_0x1b96f8+0x3,_0xabbfad();continue;}if(_0x27fd4e[_0x54608d(0x1b6)]('<?',_0x11c0d9)){const _0x525b14=_0x27fd4e[_0x54608d(0x1ce)]('?>',_0x11c0d9+0x2);if(_0x525b14<0x0)return!![];_0x11c0d9=_0x525b14+0x2,_0xabbfad();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x54608d(0x207)](_0x27fd4e[_0x54608d(0x1d8)](_0x11c0d9));}function invalidMybatisSource(_0x10773a){return{'sql':'','mode':'mybatisXml','error':_0x10773a};}function findXmlTagEnd(_0x59e879,_0x27f6fe){const _0x300ba2=a250_0x30dc3f;let _0x5dde88;for(let _0x1165c2=_0x27f6fe+0x1;_0x1165c2<_0x59e879[_0x300ba2(0x1d6)];_0x1165c2+=0x1){const _0x532381=_0x59e879[_0x1165c2];if(_0x5dde88){if(_0x532381===_0x5dde88)_0x5dde88=undefined;continue;}if(_0x532381==='\x22'||_0x532381==='\x27'){_0x5dde88=_0x532381;continue;}if(_0x532381==='>')return _0x1165c2;}return-0x1;}function decodeXmlEntities(_0x23feaf){const _0x2cd44e=a250_0x30dc3f;let _0x503218=![];const _0x29e700=_0x23feaf[_0x2cd44e(0x1e7)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x723f71=>{const _0xe0b2ba=_0x2cd44e;if(_0x723f71==='<')return'<';if(_0x723f71===_0xe0b2ba(0x201))return'>';if(_0x723f71==='"')return'\x22';if(_0x723f71===''')return'\x27';if(_0x723f71===_0xe0b2ba(0x1e3))return'&';const _0x54d226=/^&#(?:x([0-9a-f]+)|([0-9]+));$/['exec'](_0x723f71);if(_0x54d226){const _0x1f426e=_0x54d226[0x1],_0x5bde0a=_0x54d226[0x2],_0x1031c3=Number[_0xe0b2ba(0x1f7)](_0x1f426e??_0x5bde0a??'',_0x1f426e?0x10:0xa);if(isValidXmlCharacter(_0x1031c3))return String[_0xe0b2ba(0x1ae)](_0x1031c3);}return _0x503218=!![],'';});return _0x503218?null:_0x29e700;}function isValidXmlCharacter(_0x698057){return _0x698057===0x9||_0x698057===0xa||_0x698057===0xd||_0x698057>=0x20&&_0x698057<=0xd7ff||_0x698057>=0xe000&&_0x698057<=0xfffd||_0x698057>=0x10000&&_0x698057<=0x10ffff;}export function detectSqlType(_0x37293c){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x37293c));}function detectNormalizedSqlType(_0x68ece){const _0x6aec81=a250_0x30dc3f;if(_0x68ece['error'])return{'type':_0x6aec81(0x1ef),'isSelectOnly':![],'isDangerous':![],'reason':_0x68ece[_0x6aec81(0x1c3)]};if(!_0x68ece[_0x6aec81(0x1df)][_0x6aec81(0x1c0)]())return{'type':_0x6aec81(0x1ef),'isSelectOnly':![],'isDangerous':![],'reason':_0x6aec81(0x1cd)};const _0x32f62c=stripStaticAnalysisMarkers(_0x68ece[_0x6aec81(0x1df)])['replace'](/#\{[^}]*\}/g,'?')[_0x6aec81(0x1e7)](/\$\{[^}]*\}/g,'?')[_0x6aec81(0x1e7)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x6aec81(0x1e7)](/\/\*[\s\S]*?\*\//g,'')[_0x6aec81(0x1c0)](),_0x5e9678=_0x32f62c[_0x6aec81(0x1f5)]('\x0a');let _0x15bf65='';for(const _0x1f8f5 of _0x5e9678){const _0x27d124=_0x1f8f5[_0x6aec81(0x1c0)]();if(!_0x27d124||_0x27d124[_0x6aec81(0x1b6)]('--')||_0x27d124[_0x6aec81(0x1b6)]('/*'))continue;_0x15bf65=_0x27d124;break;}const _0x2aa192=_0x15bf65[_0x6aec81(0x1c5)](),_0x3dd780=_0x68ece[_0x6aec81(0x1bb)],_0x1a9559=maskSqlTextForBlockedKeywordScan(_0x32f62c),_0x1f39b1=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x6aec81(0x207)](_0x1a9559);if(_0x3dd780==='SELECT'||!_0x3dd780&&(_0x2aa192[_0x6aec81(0x1b6)](_0x6aec81(0x1ba))||_0x2aa192[_0x6aec81(0x1b6)]('WITH'))){const _0x25c9c6=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x6aec81(0x207)](_0x32f62c);return{'type':_0x6aec81(0x1ba),'isSelectOnly':!_0x25c9c6,'isDangerous':_0x25c9c6,'reason':_0x25c9c6?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x3dd780===_0x6aec81(0x1dc)||!_0x3dd780&&_0x2aa192[_0x6aec81(0x1b6)]('INSERT'))return{'type':_0x6aec81(0x1dc),'isSelectOnly':![],'isDangerous':_0x1f39b1,'reason':_0x1f39b1?_0x6aec81(0x1fc):undefined};if(_0x3dd780==='UPDATE'||!_0x3dd780&&_0x2aa192[_0x6aec81(0x1b6)](_0x6aec81(0x1f9)))return{'type':_0x6aec81(0x1f9),'isSelectOnly':![],'isDangerous':_0x1f39b1,'reason':_0x1f39b1?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x3dd780==='DELETE'||!_0x3dd780&&_0x2aa192['startsWith'](_0x6aec81(0x1f3)))return{'type':_0x6aec81(0x1f3),'isSelectOnly':![],'isDangerous':!![],'reason':'DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save'};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x6aec81(0x207)](_0x2aa192))return{'type':_0x6aec81(0x1ca),'isSelectOnly':![],'isDangerous':!![],'reason':_0x6aec81(0x1e5)};return{'type':_0x6aec81(0x1ef),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x32c388){const _0x42e964=a250_0x30dc3f;return _0x32c388[_0x42e964(0x1b4)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x42e964(0x1b4)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x31207c){const _0x55dbfe=a250_0x30dc3f;return _0x31207c['replace'](/'(?:''|\\.|[^'])*'/g,'\x20')['replace'](/"(?:""|\\.|[^"])*"/g,'\x20')['replace'](/`(?:``|\\.|[^`])*`/g,'\x20')['replace'](/--.*$/gm,'\x20')['replace'](/#.*$/gm,'\x20')[_0x55dbfe(0x1e7)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x34de7a){const _0x1a8ace=a250_0x30dc3f,_0x49c25d=_0x34de7a['replace'](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')['replace'](/'[^']*'/g,'\x27\x27')[_0x1a8ace(0x1e7)](/--.*$/gm,'')['replace'](/\/\*[\s\S]*?\*\//g,''),_0x4f6407=[],_0x1ecc6b=_0x49c25d['match'](/FROM\s+([^\s,)(]+)/i);addTable(_0x4f6407,_0x1ecc6b?.[0x1]);for(const _0x534d14 of _0x49c25d[_0x1a8ace(0x1e2)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x4f6407,_0x534d14[0x1]);}const _0x7be630=_0x49c25d[_0x1a8ace(0x1e0)](/INTO\s+([^\s(]+)/i);addTable(_0x4f6407,_0x7be630?.[0x1]);const _0x223282=_0x49c25d[_0x1a8ace(0x1e0)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x4f6407,_0x223282?.[0x1]),_0x4f6407;}function addTable(_0x378fa4,_0x4c110c){const _0x467498=a250_0x30dc3f,_0x23c2d3=_0x4c110c?.[_0x467498(0x1e7)](/[`"]/g,'');_0x23c2d3&&_0x23c2d3!==UNRESOLVED_SQL_FRAGMENT&&!_0x378fa4[_0x467498(0x1bf)](_0x23c2d3)&&_0x378fa4[_0x467498(0x1b3)](_0x23c2d3);}function extractParameters(_0x2445f8){const _0x25cc85=a250_0x30dc3f,_0x21f974=new Set();for(const _0x541986 of _0x2445f8['matchAll'](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x541986[0x1])_0x21f974['add'](_0x541986[0x1]);}return Array[_0x25cc85(0x1b1)](_0x21f974);}export function validateSql(_0x39de5d){const _0x5bcfc4=a250_0x30dc3f,_0x44abe1=normalizeSqlForStaticAnalysis(_0x39de5d),_0x266154=detectNormalizedSqlType(_0x44abe1),_0x32f7d4=stripStaticAnalysisMarkers(_0x44abe1[_0x5bcfc4(0x1df)]),_0x550e8a=_0x44abe1[_0x5bcfc4(0x1c3)]?[]:extractTables(_0x32f7d4),_0x24f4c4=_0x44abe1['error']?[]:extractParameters(_0x32f7d4);if(_0x266154['isDangerous'])return{'valid':![],'sqlType':_0x266154,'tables':_0x550e8a,'parameters':_0x24f4c4,'message':_0x266154['reason']||_0x266154[_0x5bcfc4(0x1b5)]+_0x5bcfc4(0x203)};if(_0x266154[_0x5bcfc4(0x1b5)]===_0x5bcfc4(0x1ef))return{'valid':![],'sqlType':_0x266154,'tables':_0x550e8a,'parameters':_0x24f4c4,'message':_0x44abe1[_0x5bcfc4(0x1c3)]?'Unable\x20to\x20detect\x20SQL\x20type.\x20'+_0x44abe1[_0x5bcfc4(0x1c3)]:'Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.'};return{'valid':!![],'sqlType':_0x266154,'tables':_0x550e8a,'parameters':_0x24f4c4,'message':_0x266154[_0x5bcfc4(0x1b5)]+_0x5bcfc4(0x208)+(_0x550e8a[_0x5bcfc4(0x1d6)]?_0x550e8a[_0x5bcfc4(0x1d7)](',\x20'):_0x5bcfc4(0x209))+(_0x24f4c4[_0x5bcfc4(0x1d6)]?_0x5bcfc4(0x1fa)+_0x24f4c4[_0x5bcfc4(0x1d7)](',\x20'):'')};}
|
|
1
|
+
const a255_0x4f8516=a255_0x1833;(function(_0x11f183,_0x5af0de){const _0x3e7109=a255_0x1833,_0x1bc5f3=_0x11f183();while(!![]){try{const _0x17c5bb=parseInt(_0x3e7109(0x1a3))/0x1+-parseInt(_0x3e7109(0x1a2))/0x2*(-parseInt(_0x3e7109(0x1dc))/0x3)+-parseInt(_0x3e7109(0x1d3))/0x4+parseInt(_0x3e7109(0x1e1))/0x5*(-parseInt(_0x3e7109(0x1c2))/0x6)+parseInt(_0x3e7109(0x1c0))/0x7*(-parseInt(_0x3e7109(0x1ee))/0x8)+-parseInt(_0x3e7109(0x1e2))/0x9*(parseInt(_0x3e7109(0x1c9))/0xa)+parseInt(_0x3e7109(0x1e3))/0xb;if(_0x17c5bb===_0x5af0de)break;else _0x1bc5f3['push'](_0x1bc5f3['shift']());}catch(_0x4d34fc){_0x1bc5f3['push'](_0x1bc5f3['shift']());}}}(a255_0x5130,0x9b230));const MYBATIS_OUTER_TAGS=new Map([[a255_0x4f8516(0x1e0),'SELECT'],[a255_0x4f8516(0x1cc),'INSERT'],[a255_0x4f8516(0x1c1),'UPDATE'],[a255_0x4f8516(0x1d0),a255_0x4f8516(0x19d)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a255_0x4f8516(0x1b5),a255_0x4f8516(0x1b4),a255_0x4f8516(0x19a),a255_0x4f8516(0x1ea),a255_0x4f8516(0x1a8),a255_0x4f8516(0x1de),a255_0x4f8516(0x1d9),a255_0x4f8516(0x1a9),'include','property']),MYBATIS_BRANCH_TAGS=new Set(['if','foreach','choose',a255_0x4f8516(0x1ea),'otherwise']);function a255_0x5130(){const _0x7859a8=[')\x5cb','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','match','\x20query\x20targeting\x20','error','Unable\x20to\x20detect\x20SQL\x20type.\x20','pop','21PYqZpK','update','293442BOXSSD','&','toUpperCase','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','tagName','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','add','797590cqeEBa','rawName','isDangerous','insert','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','test','statementType','delete','\x20SET\x20','SELECT','1519332amyBgx','INSERT','UNKNOWN','split','exec','sql','set','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','slice','105CSXyOv','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','trim','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','select','20cRmvOD','99bnKPtu','22352132YEhpDh','replace','startsWith','^<\x5cs*(?:','string','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','when','WITH','indexOf','type','2434792kTtJpV','join','replaceAll','\x20with\x20parameters:\x20','SQL\x20content\x20is\x20empty','Unterminated\x20XML\x20comment.','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','choose','push','length','DELETE','-->','from','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','<![CDATA[','28918jhuLVB','463220BWVMoL','outer','includes','\x20WHERE\x20','has','otherwise','bind','matchAll','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','__RABETBASE_MYBATIS_DYNAMIC_START__',']]>','__RABETBASE_MYBATIS_DYNAMIC_END__','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','include','<!--','mybatisXml','DDL','foreach','where','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','>','Invalid\x20MyBatis\x20XML\x20tag.'];a255_0x5130=function(){return _0x7859a8;};return a255_0x5130();}export const MYBATIS_DYNAMIC_START_MARKER=a255_0x4f8516(0x1ac);export const MYBATIS_DYNAMIC_END_MARKER=a255_0x4f8516(0x1ae);function a255_0x1833(_0x53cb7e,_0x1f777f){_0x53cb7e=_0x53cb7e-0x196;const _0x513003=a255_0x5130();let _0x183356=_0x513003[_0x53cb7e];return _0x183356;}export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT=a255_0x4f8516(0x1e9),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a255_0x4f8516(0x1e6)+[...MYBATIS_OUTER_TAGS['keys']()][a255_0x4f8516(0x1ef)]('|')+a255_0x4f8516(0x1b9),'i');export function normalizeSqlForStaticAnalysis(_0x1791ec){const _0x1e84ec=a255_0x4f8516,_0x58fc59=typeof _0x1791ec===_0x1e84ec(0x1e7)?_0x1791ec:'';if(!startsWithMybatisStatementWrapper(_0x58fc59))return{'sql':_0x58fc59,'mode':'sql'};let _0x18fb6c=0x0,_0x23c86d='',_0x44ff9c,_0x7c2092=![],_0x63c482=![];const _0x35739a=[];while(_0x18fb6c<_0x58fc59[_0x1e84ec(0x19c)]){if(_0x58fc59[_0x1e84ec(0x1e5)](_0x1e84ec(0x1b1),_0x18fb6c)){const _0x48f3d6=_0x58fc59[_0x1e84ec(0x1ec)](_0x1e84ec(0x19e),_0x18fb6c+0x4);if(_0x48f3d6<0x0)return invalidMybatisSource(_0x1e84ec(0x198));_0x23c86d+='\x20',_0x18fb6c=_0x48f3d6+0x3;continue;}if(_0x58fc59[_0x1e84ec(0x1e5)](_0x1e84ec(0x1a1),_0x18fb6c)){if(!_0x7c2092||_0x63c482)return invalidMybatisSource(_0x1e84ec(0x1c7));const _0x38e332=_0x58fc59['indexOf'](_0x1e84ec(0x1ad),_0x18fb6c+0x9);if(_0x38e332<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x23c86d+=_0x58fc59[_0x1e84ec(0x1db)](_0x18fb6c+0x9,_0x38e332),_0x18fb6c=_0x38e332+0x3;continue;}if(_0x58fc59[_0x1e84ec(0x1e5)]('<?',_0x18fb6c)){if(_0x7c2092)return invalidMybatisSource('XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.');const _0x17f5c2=_0x58fc59[_0x1e84ec(0x1ec)]('?>',_0x18fb6c+0x2);if(_0x17f5c2<0x0)return invalidMybatisSource('Unterminated\x20XML\x20declaration.');_0x23c86d+='\x20',_0x18fb6c=_0x17f5c2+0x2;continue;}if(_0x58fc59[_0x18fb6c]!=='<'){const _0x410c5f=_0x58fc59[_0x1e84ec(0x1ec)]('<',_0x18fb6c),_0x33fc0c=_0x410c5f<0x0?_0x58fc59[_0x1e84ec(0x19c)]:_0x410c5f,_0x32a48c=_0x58fc59['slice'](_0x18fb6c,_0x33fc0c);if((!_0x7c2092||_0x63c482)&&_0x32a48c['trim']())return invalidMybatisSource('SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');if(_0x7c2092&&!_0x63c482){const _0x5a0268=decodeXmlEntities(_0x32a48c);if(_0x5a0268===null)return invalidMybatisSource('Invalid\x20XML\x20entity\x20reference.');_0x23c86d+=_0x5a0268;}else _0x23c86d+='\x20';_0x18fb6c=_0x33fc0c;continue;}const _0x36f842=findXmlTagEnd(_0x58fc59,_0x18fb6c);if(_0x36f842<0x0)return invalidMybatisSource('Unterminated\x20MyBatis\x20XML\x20tag.');const _0x37053f=_0x58fc59[_0x1e84ec(0x1db)](_0x18fb6c,_0x36f842+0x1),_0x129b7e=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/['exec'](_0x37053f);if(!_0x129b7e)return invalidMybatisSource(_0x1e84ec(0x1b8));const _0x44b469=_0x129b7e[0x1]==='/',_0x54de7a=_0x129b7e[0x2]??'',_0x153145=_0x54de7a['toLowerCase'](),_0x40f027=_0x129b7e[0x3]??'',_0x11eca7=_0x129b7e[0x4]==='/',_0x578a1f=MYBATIS_OUTER_TAGS['get'](_0x153145);if(!_0x578a1f&&!MYBATIS_DYNAMIC_TAGS[_0x1e84ec(0x1a7)](_0x153145))return invalidMybatisSource(_0x1e84ec(0x1dd)+_0x153145+'>.');if(!_0x578a1f&&_0x54de7a!==_0x153145)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<'+_0x54de7a+'>.');if(_0x44b469){if(_0x40f027['trim']()||_0x11eca7)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x54de7a+'>.');const _0xd1a9e8=_0x35739a['at'](-0x1);if(!_0xd1a9e8||(_0xd1a9e8[_0x1e84ec(0x1a4)]?_0xd1a9e8[_0x1e84ec(0x1c6)]!==_0x153145:_0xd1a9e8[_0x1e84ec(0x1ca)]!==_0x54de7a))return invalidMybatisSource('Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x54de7a+'>.');_0x35739a[_0x1e84ec(0x1bf)]();if(_0xd1a9e8[_0x1e84ec(0x1a4)])_0x63c482=!![];_0x23c86d+=MYBATIS_BRANCH_TAGS[_0x1e84ec(0x1a7)](_0x153145)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x40f027))return invalidMybatisSource(_0x1e84ec(0x1a0)+_0x54de7a+'>.');if(_0x153145==='property'&&(!_0x11eca7||_0x35739a['at'](-0x1)?.[_0x1e84ec(0x1c6)]!==_0x1e84ec(0x1b0)))return invalidMybatisSource(_0x1e84ec(0x1c5));if(_0x578a1f){if(_0x7c2092||_0x35739a['length']>0x0)return invalidMybatisSource(_0x1e84ec(0x1cd));_0x7c2092=!![],_0x63c482=_0x11eca7,_0x44ff9c=_0x578a1f;}else{if(!_0x7c2092||_0x63c482)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<'+_0x54de7a+'>.');}_0x23c86d+=_0x153145===_0x1e84ec(0x1b5)?_0x1e84ec(0x1a6):_0x153145===_0x1e84ec(0x1d9)?_0x1e84ec(0x1d1):_0x153145==='include'?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x1e84ec(0x1a7)](_0x153145)&&!_0x11eca7?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x11eca7&&_0x35739a[_0x1e84ec(0x19b)]({'rawName':_0x54de7a,'tagName':_0x153145,'outer':!!_0x578a1f});}_0x18fb6c=_0x36f842+0x1;}if(_0x35739a[_0x1e84ec(0x19c)]>0x0)return invalidMybatisSource(_0x1e84ec(0x1b6)+_0x35739a['at'](-0x1)?.[_0x1e84ec(0x1ca)]+'>.');if(!_0x7c2092||!_0x63c482)return invalidMybatisSource(_0x1e84ec(0x1da));return{'sql':_0x23c86d[_0x1e84ec(0x1de)](),'mode':_0x1e84ec(0x1b2),..._0x44ff9c?{'statementType':_0x44ff9c}:{}};}function hasWellFormedXmlAttributes(_0x4c43c9){const _0x2968b8=a255_0x4f8516;let _0x5cc31f=0x0;const _0x195467=new Set();while(_0x5cc31f<_0x4c43c9[_0x2968b8(0x19c)]){while(_0x5cc31f<_0x4c43c9[_0x2968b8(0x19c)]&&/\s/[_0x2968b8(0x1ce)](_0x4c43c9[_0x5cc31f]??''))_0x5cc31f+=0x1;if(_0x5cc31f>=_0x4c43c9[_0x2968b8(0x19c)])return!![];const _0xb40e8a=/^[A-Za-z_:][\w:.-]*/['exec'](_0x4c43c9[_0x2968b8(0x1db)](_0x5cc31f)),_0x1f4701=_0xb40e8a?.[0x0];if(!_0x1f4701||_0x195467[_0x2968b8(0x1a7)](_0x1f4701))return![];_0x195467[_0x2968b8(0x1c8)](_0x1f4701),_0x5cc31f+=_0x1f4701[_0x2968b8(0x19c)];while(_0x5cc31f<_0x4c43c9[_0x2968b8(0x19c)]&&/\s/[_0x2968b8(0x1ce)](_0x4c43c9[_0x5cc31f]??''))_0x5cc31f+=0x1;if(_0x4c43c9[_0x5cc31f]!=='=')return![];_0x5cc31f+=0x1;while(_0x5cc31f<_0x4c43c9[_0x2968b8(0x19c)]&&/\s/[_0x2968b8(0x1ce)](_0x4c43c9[_0x5cc31f]??''))_0x5cc31f+=0x1;const _0x61af80=_0x4c43c9[_0x5cc31f];if(_0x61af80!=='\x22'&&_0x61af80!=='\x27')return![];_0x5cc31f+=0x1;const _0x78317=_0x4c43c9['indexOf'](_0x61af80,_0x5cc31f);if(_0x78317<0x0)return![];if(decodeXmlEntities(_0x4c43c9[_0x2968b8(0x1db)](_0x5cc31f,_0x78317))===null)return![];_0x5cc31f=_0x78317+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x2830bc){const _0xe7ca8e=a255_0x4f8516;let _0x32fa5d=0x0;const _0xf90c21=()=>{const _0x485678=a255_0x1833;while(_0x32fa5d<_0x2830bc['length']&&/\s/[_0x485678(0x1ce)](_0x2830bc[_0x32fa5d]??''))_0x32fa5d+=0x1;};_0xf90c21();while(_0x32fa5d<_0x2830bc['length']){if(_0x2830bc['startsWith'](_0xe7ca8e(0x1b1),_0x32fa5d)){const _0x4b0239=_0x2830bc[_0xe7ca8e(0x1ec)](_0xe7ca8e(0x19e),_0x32fa5d+0x4);if(_0x4b0239<0x0)return!![];_0x32fa5d=_0x4b0239+0x3,_0xf90c21();continue;}if(_0x2830bc[_0xe7ca8e(0x1e5)]('<?',_0x32fa5d)){const _0x12bd2b=_0x2830bc['indexOf']('?>',_0x32fa5d+0x2);if(_0x12bd2b<0x0)return!![];_0x32fa5d=_0x12bd2b+0x2,_0xf90c21();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0xe7ca8e(0x1ce)](_0x2830bc[_0xe7ca8e(0x1db)](_0x32fa5d));}function invalidMybatisSource(_0x26e8f9){const _0x59769f=a255_0x4f8516;return{'sql':'','mode':_0x59769f(0x1b2),'error':_0x26e8f9};}function findXmlTagEnd(_0x367369,_0x5ee8aa){const _0x3ea303=a255_0x4f8516;let _0x2f06eb;for(let _0x1033af=_0x5ee8aa+0x1;_0x1033af<_0x367369[_0x3ea303(0x19c)];_0x1033af+=0x1){const _0xf9e32d=_0x367369[_0x1033af];if(_0x2f06eb){if(_0xf9e32d===_0x2f06eb)_0x2f06eb=undefined;continue;}if(_0xf9e32d==='\x22'||_0xf9e32d==='\x27'){_0x2f06eb=_0xf9e32d;continue;}if(_0xf9e32d==='>')return _0x1033af;}return-0x1;}function decodeXmlEntities(_0x492e2a){const _0x2ee577=a255_0x4f8516;let _0xf0696=![];const _0x2c5384=_0x492e2a[_0x2ee577(0x1e4)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x4c348e=>{const _0x50fc64=_0x2ee577;if(_0x4c348e==='<')return'<';if(_0x4c348e===_0x50fc64(0x1b7))return'>';if(_0x4c348e==='"')return'\x22';if(_0x4c348e===''')return'\x27';if(_0x4c348e===_0x50fc64(0x1c3))return'&';const _0x174ffa=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x50fc64(0x1d7)](_0x4c348e);if(_0x174ffa){const _0xc9ba4a=_0x174ffa[0x1],_0x344860=_0x174ffa[0x2],_0x5156b3=Number['parseInt'](_0xc9ba4a??_0x344860??'',_0xc9ba4a?0x10:0xa);if(isValidXmlCharacter(_0x5156b3))return String['fromCodePoint'](_0x5156b3);}return _0xf0696=!![],'';});return _0xf0696?null:_0x2c5384;}function isValidXmlCharacter(_0x472f5b){return _0x472f5b===0x9||_0x472f5b===0xa||_0x472f5b===0xd||_0x472f5b>=0x20&&_0x472f5b<=0xd7ff||_0x472f5b>=0xe000&&_0x472f5b<=0xfffd||_0x472f5b>=0x10000&&_0x472f5b<=0x10ffff;}export function detectSqlType(_0x3092e7){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x3092e7));}function detectNormalizedSqlType(_0x357196){const _0x134587=a255_0x4f8516;if(_0x357196[_0x134587(0x1bd)])return{'type':_0x134587(0x1d5),'isSelectOnly':![],'isDangerous':![],'reason':_0x357196[_0x134587(0x1bd)]};if(!_0x357196[_0x134587(0x1d8)]['trim']())return{'type':_0x134587(0x1d5),'isSelectOnly':![],'isDangerous':![],'reason':_0x134587(0x197)};const _0x5eff04=stripStaticAnalysisMarkers(_0x357196[_0x134587(0x1d8)])[_0x134587(0x1e4)](/#\{[^}]*\}/g,'?')[_0x134587(0x1e4)](/\$\{[^}]*\}/g,'?')[_0x134587(0x1e4)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x134587(0x1e4)](/\/\*[\s\S]*?\*\//g,'')[_0x134587(0x1de)](),_0x33e083=_0x5eff04[_0x134587(0x1d6)]('\x0a');let _0x6dac1='';for(const _0x35bf76 of _0x33e083){const _0x266214=_0x35bf76[_0x134587(0x1de)]();if(!_0x266214||_0x266214['startsWith']('--')||_0x266214[_0x134587(0x1e5)]('/*'))continue;_0x6dac1=_0x266214;break;}const _0x25dc37=_0x6dac1[_0x134587(0x1c4)](),_0x709c41=_0x357196[_0x134587(0x1cf)],_0x52c6d2=maskSqlTextForBlockedKeywordScan(_0x5eff04),_0x41d524=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x134587(0x1ce)](_0x52c6d2);if(_0x709c41===_0x134587(0x1d2)||!_0x709c41&&(_0x25dc37['startsWith'](_0x134587(0x1d2))||_0x25dc37[_0x134587(0x1e5)](_0x134587(0x1eb)))){const _0xc6d3b9=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x134587(0x1ce)](_0x5eff04);return{'type':_0x134587(0x1d2),'isSelectOnly':!_0xc6d3b9,'isDangerous':_0xc6d3b9,'reason':_0xc6d3b9?_0x134587(0x1e8):undefined};}if(_0x709c41===_0x134587(0x1d4)||!_0x709c41&&_0x25dc37['startsWith'](_0x134587(0x1d4)))return{'type':_0x134587(0x1d4),'isSelectOnly':![],'isDangerous':_0x41d524,'reason':_0x41d524?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x709c41==='UPDATE'||!_0x709c41&&_0x25dc37[_0x134587(0x1e5)]('UPDATE'))return{'type':'UPDATE','isSelectOnly':![],'isDangerous':_0x41d524,'reason':_0x41d524?_0x134587(0x1af):undefined};if(_0x709c41==='DELETE'||!_0x709c41&&_0x25dc37['startsWith']('DELETE'))return{'type':'DELETE','isSelectOnly':![],'isDangerous':!![],'reason':_0x134587(0x1df)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x134587(0x1ce)](_0x25dc37))return{'type':_0x134587(0x1b3),'isSelectOnly':![],'isDangerous':!![],'reason':_0x134587(0x1ab)};return{'type':_0x134587(0x1d5),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x2b8ca1){const _0x84ed27=a255_0x4f8516;return _0x2b8ca1['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x84ed27(0x1f0)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x542846){const _0x45dd24=a255_0x4f8516;return _0x542846[_0x45dd24(0x1e4)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x45dd24(0x1e4)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x45dd24(0x1e4)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x45dd24(0x1e4)](/--.*$/gm,'\x20')['replace'](/#.*$/gm,'\x20')[_0x45dd24(0x1e4)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x385f9c){const _0x48a24e=a255_0x4f8516,_0x57f8e8=_0x385f9c[_0x48a24e(0x1e4)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x48a24e(0x1e4)](/'[^']*'/g,'\x27\x27')[_0x48a24e(0x1e4)](/--.*$/gm,'')['replace'](/\/\*[\s\S]*?\*\//g,''),_0xae671f=[],_0x576488=_0x57f8e8[_0x48a24e(0x1bb)](/FROM\s+([^\s,)(]+)/i);addTable(_0xae671f,_0x576488?.[0x1]);for(const _0x2d98f7 of _0x57f8e8[_0x48a24e(0x1aa)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0xae671f,_0x2d98f7[0x1]);}const _0x4872d8=_0x57f8e8[_0x48a24e(0x1bb)](/INTO\s+([^\s(]+)/i);addTable(_0xae671f,_0x4872d8?.[0x1]);const _0x2a843e=_0x57f8e8[_0x48a24e(0x1bb)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0xae671f,_0x2a843e?.[0x1]),_0xae671f;}function addTable(_0x4abfe2,_0x5729ff){const _0x73188c=a255_0x4f8516,_0x132a4a=_0x5729ff?.[_0x73188c(0x1e4)](/[`"]/g,'');_0x132a4a&&_0x132a4a!==UNRESOLVED_SQL_FRAGMENT&&!_0x4abfe2[_0x73188c(0x1a5)](_0x132a4a)&&_0x4abfe2['push'](_0x132a4a);}function extractParameters(_0xc79a0c){const _0xb83d56=a255_0x4f8516,_0x4c418a=new Set();for(const _0xf086c8 of _0xc79a0c[_0xb83d56(0x1aa)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0xf086c8[0x1])_0x4c418a[_0xb83d56(0x1c8)](_0xf086c8[0x1]);}return Array[_0xb83d56(0x19f)](_0x4c418a);}export function validateSql(_0x4b3c7c){const _0x31d4e4=a255_0x4f8516,_0x1c56f5=normalizeSqlForStaticAnalysis(_0x4b3c7c),_0xc75693=detectNormalizedSqlType(_0x1c56f5),_0x54b15a=stripStaticAnalysisMarkers(_0x1c56f5[_0x31d4e4(0x1d8)]),_0x18abab=_0x1c56f5[_0x31d4e4(0x1bd)]?[]:extractTables(_0x54b15a),_0x3fa1c2=_0x1c56f5[_0x31d4e4(0x1bd)]?[]:extractParameters(_0x54b15a);if(_0xc75693[_0x31d4e4(0x1cb)])return{'valid':![],'sqlType':_0xc75693,'tables':_0x18abab,'parameters':_0x3fa1c2,'message':_0xc75693['reason']||_0xc75693[_0x31d4e4(0x1ed)]+_0x31d4e4(0x199)};if(_0xc75693[_0x31d4e4(0x1ed)]===_0x31d4e4(0x1d5))return{'valid':![],'sqlType':_0xc75693,'tables':_0x18abab,'parameters':_0x3fa1c2,'message':_0x1c56f5[_0x31d4e4(0x1bd)]?_0x31d4e4(0x1be)+_0x1c56f5[_0x31d4e4(0x1bd)]:_0x31d4e4(0x1ba)};return{'valid':!![],'sqlType':_0xc75693,'tables':_0x18abab,'parameters':_0x3fa1c2,'message':_0xc75693[_0x31d4e4(0x1ed)]+_0x31d4e4(0x1bc)+(_0x18abab['length']?_0x18abab['join'](',\x20'):'unknown\x20table(s)')+(_0x3fa1c2['length']?_0x31d4e4(0x196)+_0x3fa1c2[_0x31d4e4(0x1ef)](',\x20'):'')};}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a256_0x5531(_0x39e871,_0xc05719){_0x39e871=_0x39e871-0x19e;const _0x472b74=a256_0x472b();let _0x553106=_0x472b74[_0x39e871];return _0x553106;}const a256_0x5f28c3=a256_0x5531;function a256_0x472b(){const _0xfaacef=['134847OiSjfm','Network\x20error:\x20','375857lguoXe','Operation\x20cancelled.','Check\x20your\x20internet\x20connection\x20and\x20try\x20again.','710dxDEwk','not_in_project','Missing\x20required\x20flag:\x20--','387722ElmOaU','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.\x0a\x20\x20\x20\x20\x20\x20\x20Tip:\x20`','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>\x20--global`\x20registers\x20a\x20reusable\x20global\x20app\x20profile.','auth_required','\x20project\x20directory','7OODSwY','unknown_command','Set\x20appcode\x20via\x20`','4263624yPvRIX','apiError','Not\x20in\x20a\x20','\x20auth`\x20to\x20login\x20first.','Run\x20`','cancelled','Unknown\x20command:\x20','1147980BPKLMs','network_error','1163310narXNL','771210UaxAEz','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','\x20--help`\x20to\x20see\x20available\x20commands.','12YpLifA'];a256_0x472b=function(){return _0xfaacef;};return a256_0x472b();}(function(_0x4b5a96,_0x16acb8){const _0x32e7e3=a256_0x5531,_0x58f8b9=_0x4b5a96();while(!![]){try{const _0x469645=-parseInt(_0x32e7e3(0x1af))/0x1+-parseInt(_0x32e7e3(0x1b5))/0x2+parseInt(_0x32e7e3(0x1a9))/0x3+parseInt(_0x32e7e3(0x1ac))/0x4*(-parseInt(_0x32e7e3(0x1a8))/0x5)+-parseInt(_0x32e7e3(0x1a6))/0x6*(parseInt(_0x32e7e3(0x1ba))/0x7)+parseInt(_0x32e7e3(0x19f))/0x8+-parseInt(_0x32e7e3(0x1ad))/0x9*(-parseInt(_0x32e7e3(0x1b2))/0xa);if(_0x469645===_0x16acb8)break;else _0x58f8b9['push'](_0x58f8b9['shift']());}catch(_0xa85b71){_0x58f8b9['push'](_0x58f8b9['shift']());}}}(a256_0x472b,0x6061e));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';export{CliError};const baseCliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':'Run\x20`'+CLI_BIN_NAME+'\x20auth`\x20to\x20login\x20first.','configMissingHint':a256_0x5f28c3(0x19e)+CLI_BIN_NAME+a256_0x5f28c3(0x1b6)+CLI_BIN_NAME+a256_0x5f28c3(0x1b7),'notInProjectHint':a256_0x5f28c3(0x1aa)});export const CliErrors={'authRequired'(_0x3d1929){const _0x3402bd=a256_0x5f28c3;return new CliError(_0x3402bd(0x1b8),0x1,'Authentication\x20required',_0x3d1929??'Run\x20`'+CLI_BIN_NAME+_0x3402bd(0x1a2));},'configMissing'(_0x3ee06e){const _0x3c7680=a256_0x5f28c3;return new CliError('config_missing',0x1,'Configuration\x20file\x20not\x20found',_0x3ee06e??_0x3c7680(0x19e)+CLI_BIN_NAME+_0x3c7680(0x1b6)+CLI_BIN_NAME+_0x3c7680(0x1b7));},'notInProject'(){const _0x4346f3=a256_0x5f28c3;return new CliError(_0x4346f3(0x1b3),0x1,_0x4346f3(0x1a1)+CLI_BIN_NAME+_0x4346f3(0x1b9),_0x4346f3(0x1aa));},'apiError'(_0x2ab7ca,_0x362f62){const _0x484f5a=a256_0x5f28c3;return baseCliErrors[_0x484f5a(0x1a0)](_0x2ab7ca,_0x362f62);},'networkError'(_0x56e48f){const _0x3ad3b4=a256_0x5f28c3;return new CliError(_0x3ad3b4(0x1a7),0x2,_0x3ad3b4(0x1ae)+_0x56e48f,_0x3ad3b4(0x1b1));},'unknownCommand'(_0x66c180){const _0x9d5dff=a256_0x5f28c3;return new CliError(_0x9d5dff(0x1bb),0x1,_0x9d5dff(0x1a5)+_0x66c180,_0x9d5dff(0x1a3)+CLI_BIN_NAME+_0x9d5dff(0x1ab));},'flagMissing'(_0x3c5f10,_0x18a9cc){const _0x3fe5be=a256_0x5f28c3;return new CliError('flag_missing',0x1,_0x3fe5be(0x1b4)+_0x3c5f10,_0x18a9cc);},'validation'(_0x1832eb,_0x29beaf){return baseCliErrors['validation'](_0x1832eb,_0x29beaf);},'cancelled'(_0x1240fd){const _0x45c529=a256_0x5f28c3;return new CliError(_0x45c529(0x1a4),0x0,_0x1240fd??_0x45c529(0x1b0));}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x33e7c8,_0x116231){const _0x431912=a257_0x405b,_0x444b2d=_0x33e7c8();while(!![]){try{const _0x3bd944=-parseInt(_0x431912(0x70))/0x1+parseInt(_0x431912(0x67))/0x2*(-parseInt(_0x431912(0x6d))/0x3)+parseInt(_0x431912(0x71))/0x4+parseInt(_0x431912(0x66))/0x5*(parseInt(_0x431912(0x68))/0x6)+-parseInt(_0x431912(0x72))/0x7*(-parseInt(_0x431912(0x6a))/0x8)+-parseInt(_0x431912(0x69))/0x9+parseInt(_0x431912(0x6f))/0xa*(-parseInt(_0x431912(0x6e))/0xb);if(_0x3bd944===_0x116231)break;else _0x444b2d['push'](_0x444b2d['shift']());}catch(_0x2eab76){_0x444b2d['push'](_0x444b2d['shift']());}}}(a257_0x23c5,0xde390));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';function a257_0x23c5(){const _0x2661f6=['1160043DlDPma','64097bEdCeD','1830ZEFRut','252656yDZXWV','2304496EpLuqh','5481483nRpWpZ','1725935LOGsBu','6MjBnEa','30neJixm','4310397fIGOvX','16XCHeHC','map','yes'];a257_0x23c5=function(){return _0x2661f6;};return a257_0x23c5();}import{buildAllFlags as a257_0x1a1e15}from'@lovrabet/cli-framework';import{EXPLICIT_YES_FLAG_DESCRIPTION,requiresExplicitYes}from'../framework/explicit-yes.js';function a257_0x405b(_0xfbdcec,_0x5713ac){_0xfbdcec=_0xfbdcec-0x66;const _0x23c5d3=a257_0x23c5();let _0x405b8a=_0x23c5d3[_0xfbdcec];return _0x405b8a;}export function buildAllFlags(_0x2654ab){const _0x52259e=a257_0x405b,_0x49f039=a257_0x1a1e15(_0x2654ab,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});if(!requiresExplicitYes(_0x2654ab))return _0x49f039;return _0x49f039[_0x52259e(0x6b)](_0x4403cd=>_0x4403cd['name']===_0x52259e(0x6c)?{..._0x4403cd,'description':EXPLICIT_YES_FLAG_DESCRIPTION}:_0x4403cd);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a258_0x4c37(_0x53b6b0,_0x5e2219){_0x53b6b0=_0x53b6b0-0xe1;var _0x481ee3=a258_0x481e();var _0x4c37c3=_0x481ee3[_0x53b6b0];return _0x4c37c3;}(function(_0x56fec2,_0x5076bf){var _0x16ef13=a258_0x4c37,_0x2adb60=_0x56fec2();while(!![]){try{var _0x58ab3b=parseInt(_0x16ef13(0xeb))/0x1*(parseInt(_0x16ef13(0xe9))/0x2)+parseInt(_0x16ef13(0xea))/0x3+parseInt(_0x16ef13(0xee))/0x4*(-parseInt(_0x16ef13(0xf1))/0x5)+-parseInt(_0x16ef13(0xec))/0x6*(parseInt(_0x16ef13(0xe7))/0x7)+parseInt(_0x16ef13(0xed))/0x8*(-parseInt(_0x16ef13(0xf0))/0x9)+-parseInt(_0x16ef13(0xe4))/0xa*(parseInt(_0x16ef13(0xe8))/0xb)+parseInt(_0x16ef13(0xe3))/0xc;if(_0x58ab3b===_0x5076bf)break;else _0x2adb60['push'](_0x2adb60['shift']());}catch(_0x2e5554){_0x2adb60['push'](_0x2adb60['shift']());}}}(a258_0x481e,0xd55c6));import{resolveOutputConfig}from'@lovrabet/cli-framework';function a258_0x481e(){var _0x47be99=['3919398vepQtp','40xSGadp','159700sYZTQc','compress','2377044vxaqFp','40SXQxCn','defaultFormat','format','43709148uOqUgG','15964190ovxgvb','flags','def','14HHtrTf','11AETdRT','6RKJULi','3949173DmpHSQ','152657dzzmgF'];a258_0x481e=function(){return _0x47be99;};return a258_0x481e();}export function usesStructuredErrorOutput(_0x5c7202){return _0x5c7202?.['structuredErrors']===!![];}export function resolveErrorOutputFormat(_0x46ef4c){var _0x37bcd8=a258_0x4c37;if(!_0x46ef4c[_0x37bcd8(0xe6)])return _0x46ef4c[_0x37bcd8(0xe1)]??_0x37bcd8(0xef);return resolveOutputConfig({'flags':_0x46ef4c[_0x37bcd8(0xe5)]??{},'def':_0x46ef4c[_0x37bcd8(0xe6)],'configDefault':_0x46ef4c[_0x37bcd8(0xe1)]})[_0x37bcd8(0xe2)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a259_0x1f2207=a259_0x3a84;function a259_0x5d0b(){const _0x992e6e=['1172283btkfHm','2826612yXCoDo','125PJoAgM','1118364reSVfd','305339gRfRtL','has','40PKPcqx','420978BRucce','14558592JovAwb','menu\x20delete','notification\x20config-delete','603436CFrGAg','15Gbzdlx','command','notification\x20config-update'];a259_0x5d0b=function(){return _0x992e6e;};return a259_0x5d0b();}(function(_0x291fa7,_0x3e9158){const _0x525e20=a259_0x3a84,_0x50ebec=_0x291fa7();while(!![]){try{const _0x1bf6c4=-parseInt(_0x525e20(0xa2))/0x1+-parseInt(_0x525e20(0xa1))/0x2+parseInt(_0x525e20(0x9b))/0x3*(parseInt(_0x525e20(0x9a))/0x4)+-parseInt(_0x525e20(0xa0))/0x5*(-parseInt(_0x525e20(0xa5))/0x6)+-parseInt(_0x525e20(0x9e))/0x7+-parseInt(_0x525e20(0xa6))/0x8+-parseInt(_0x525e20(0x9f))/0x9*(-parseInt(_0x525e20(0xa4))/0xa);if(_0x1bf6c4===_0x3e9158)break;else _0x50ebec['push'](_0x50ebec['shift']());}catch(_0x41599c){_0x50ebec['push'](_0x50ebec['shift']());}}}(a259_0x5d0b,0xdedbc));function a259_0x3a84(_0x379f55,_0x166d7a){_0x379f55=_0x379f55-0x9a;const _0x5d0b55=a259_0x5d0b();let _0x3a8431=_0x5d0b55[_0x379f55];return _0x3a8431;}const EXPLICIT_YES_COMMANDS=new Set([a259_0x1f2207(0xa7),'kb\x20delete',a259_0x1f2207(0x9d),a259_0x1f2207(0xa8)]);export const EXPLICIT_YES_FLAG_DESCRIPTION='Required\x20for\x20execution\x20after\x20reviewing\x20the\x20--dry-run\x20plan';export function requiresExplicitYes(_0x4b8e48){const _0x3f15b3=a259_0x1f2207;return EXPLICIT_YES_COMMANDS[_0x3f15b3(0xa3)](_0x4b8e48['service']+'\x20'+_0x4b8e48[_0x3f15b3(0x9c)]);}
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a260_0xead797=a260_0x60a4;(function(_0x41e41,_0x4697f0){const _0x3e4a72=a260_0x60a4,_0x1d125a=_0x41e41();while(!![]){try{const _0x7ce9c4=-parseInt(_0x3e4a72(0x189))/0x1+parseInt(_0x3e4a72(0x191))/0x2*(parseInt(_0x3e4a72(0x18a))/0x3)+parseInt(_0x3e4a72(0x186))/0x4+-parseInt(_0x3e4a72(0x18e))/0x5+parseInt(_0x3e4a72(0x188))/0x6*(-parseInt(_0x3e4a72(0x18f))/0x7)+-parseInt(_0x3e4a72(0x192))/0x8*(parseInt(_0x3e4a72(0x18b))/0x9)+-parseInt(_0x3e4a72(0x18d))/0xa*(-parseInt(_0x3e4a72(0x187))/0xb);if(_0x7ce9c4===_0x4697f0)break;else _0x1d125a['push'](_0x1d125a['shift']());}catch(_0x9686aa){_0x1d125a['push'](_0x1d125a['shift']());}}}(a260_0xb2f8,0xd2f1a));import{createFlagHelpers}from'@lovrabet/cli-framework';function a260_0x60a4(_0x4b2ae3,_0xcc858b){_0x4b2ae3=_0x4b2ae3-0x186;const _0xb2f831=a260_0xb2f8();let _0x60a40b=_0xb2f831[_0x4b2ae3];return _0x60a40b;}import{CliErrors}from'../errors.js';const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers[a260_0xead797(0x190)];function a260_0xb2f8(){const _0x3591f8=['9662StyPFK','4558952dlpXuw','5801708AFXkDq','20647uHZRDs','6zOjtIK','792018rFDCFm','837LbYjhH','27xgzSGE','validateFlags','19070nISfeF','7539490FldEnY','10529162nTlFmJ','parseFlags'];a260_0xb2f8=function(){return _0x3591f8;};return a260_0xb2f8();}export const validateFlags=helpers[a260_0xead797(0x18c)];
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x46800b,_0x5770e2){const _0x40fba9=a261_0x3afd,_0xeecb4d=_0x46800b();while(!![]){try{const _0x193074=-parseInt(_0x40fba9(0x7e))/0x1*(-parseInt(_0x40fba9(0x80))/0x2)+parseInt(_0x40fba9(0x76))/0x3*(parseInt(_0x40fba9(0x73))/0x4)+-parseInt(_0x40fba9(0x7a))/0x5*(parseInt(_0x40fba9(0x71))/0x6)+-parseInt(_0x40fba9(0x72))/0x7*(-parseInt(_0x40fba9(0x7c))/0x8)+parseInt(_0x40fba9(0x74))/0x9+parseInt(_0x40fba9(0x7d))/0xa+-parseInt(_0x40fba9(0x77))/0xb*(parseInt(_0x40fba9(0x79))/0xc);if(_0x193074===_0x5770e2)break;else _0xeecb4d['push'](_0xeecb4d['shift']());}catch(_0x15a23b){_0xeecb4d['push'](_0xeecb4d['shift']());}}}(a261_0x1603,0x88b0d));import{createHelpGenerators}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{requiresExplicitYes}from'../framework/explicit-yes.js';function createGenerators(){const _0x1e26b9=a261_0x3afd;return createHelpGenerators({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'globalFlags':GLOBAL_FLAGS,'serviceRegistry':serviceRegistry,'getServiceEntry':getServiceEntry,'getServiceDefinitions':_0x69bc45=>serviceGroups['get'](_0x69bc45),'buildAllFlags':buildAllFlags,'appPrerequisiteText':'Requires\x20appcode\x20(set\x20via\x20`'+CLI_BIN_NAME+'\x20workspace\x20init`\x20or\x20--appcode).','serviceUsageSuffix':_0x1e26b9(0x78)});}function a261_0x3afd(_0x18ca7d,_0xe08498){_0x18ca7d=_0x18ca7d-0x71;const _0x1603ca=a261_0x1603();let _0x3afd01=_0x1603ca[_0x18ca7d];return _0x3afd01;}export function generateCommandHelp(_0x24bbf7){const _0x169408=a261_0x3afd,_0x24dfaf=createGenerators()[_0x169408(0x7b)](_0x24bbf7);if(!requiresExplicitYes(_0x24bbf7))return _0x24dfaf;return _0x24dfaf['replace'](_0x169408(0x75),'Requires\x20explicit\x20--yes\x20for\x20execution;\x20use\x20--dry-run\x20to\x20preview.');}export function generateServiceHelp(_0x49b685){const _0x21c258=a261_0x3afd;return createGenerators()[_0x21c258(0x7f)](_0x49b685);}function a261_0x1603(){const _0x2d692d=['generateCommandHelp','280KlMOxG','116930adYSWL','1gfPjMY','generateServiceHelp','1711362mNQhxQ','6432306oWpReu','199444oYjaFr','4cxalqA','9712944UeFUdp','Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.','99087QjqIZC','231WQOjCb','\x20[args]\x20[flags]','768516oVTQPq','5UtUZdw'];a261_0x1603=function(){return _0x2d692d;};return a261_0x1603();}export function generateFullHelp(){return createGenerators()['generateFullHelp']();}
|
package/lib/framework/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a262_0x3166(){var _0x4177c9=['963315oztbQQ','1146285nDbtiq','1265QVlgBq','161ELqHBz','6mCSCmU','3639174HwqqQn','7032rdfMqZ','6216488fxDGWM','80XHfRhE','128670uBhNxa','530776NeKQbg'];a262_0x3166=function(){return _0x4177c9;};return a262_0x3166();}function a262_0x1e6b(_0x454778,_0x31a03b){_0x454778=_0x454778-0x1b7;var _0x3166c5=a262_0x3166();var _0x1e6b18=_0x3166c5[_0x454778];return _0x1e6b18;}(function(_0x21b77f,_0x325885){var _0x22791e=a262_0x1e6b,_0x37faa0=_0x21b77f();while(!![]){try{var _0x2630bc=-parseInt(_0x22791e(0x1c1))/0x1+-parseInt(_0x22791e(0x1bb))/0x2*(parseInt(_0x22791e(0x1b7))/0x3)+parseInt(_0x22791e(0x1bd))/0x4*(-parseInt(_0x22791e(0x1b9))/0x5)+-parseInt(_0x22791e(0x1c0))/0x6*(-parseInt(_0x22791e(0x1ba))/0x7)+-parseInt(_0x22791e(0x1be))/0x8+parseInt(_0x22791e(0x1b8))/0x9+parseInt(_0x22791e(0x1bf))/0xa*(parseInt(_0x22791e(0x1bc))/0xb);if(_0x2630bc===_0x325885)break;else _0x37faa0['push'](_0x37faa0['shift']());}catch(_0x25f850){_0x37faa0['push'](_0x37faa0['shift']());}}}(a262_0x3166,0x869b2));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 a263_0x3888(_0x3c1f33,_0x441203){_0x3c1f33=_0x3c1f33-0x1d6;const _0x4d0f03=a263_0x4d0f();let _0x3888b9=_0x4d0f03[_0x3c1f33];return _0x3888b9;}(function(_0x1da74d,_0x20dea7){const _0x46c602=a263_0x3888,_0x22792f=_0x1da74d();while(!![]){try{const _0x6dad63=parseInt(_0x46c602(0x1e2))/0x1+parseInt(_0x46c602(0x1e9))/0x2*(parseInt(_0x46c602(0x1e0))/0x3)+parseInt(_0x46c602(0x1e8))/0x4+-parseInt(_0x46c602(0x1db))/0x5+parseInt(_0x46c602(0x1e6))/0x6*(parseInt(_0x46c602(0x1dc))/0x7)+parseInt(_0x46c602(0x1df))/0x8+-parseInt(_0x46c602(0x1d7))/0x9;if(_0x6dad63===_0x20dea7)break;else _0x22792f['push'](_0x22792f['shift']());}catch(_0x2992dd){_0x22792f['push'](_0x22792f['shift']());}}}(a263_0x4d0f,0x5b0a2));import{createFormatOutput,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliError,CliErrors}from'../errors.js';import{applyJqFilter}from'../utils/apply-jq-filter.js';const baseFormatOutput=createFormatOutput({'cliErrors':CliErrors,'jqBinaryResolverOptions':{'bundledJqPaths':resolveBundledJqPaths()}});function a263_0x4d0f(){const _0x5f2ffb=['322268TixvSN','429316LmNsaM','url','validation','risk','pretty','format','message','jqFilter','hint','trim','10050543ejUNkA','write','command','endsWith','1389785bNpGzz','131145oqywpa','stdout','json','5343736LRoDmE','6fQTvoD','stringify','364912blzFyN','update','_notice','code','72wByenx','error'];a263_0x4d0f=function(){return _0x5f2ffb;};return a263_0x4d0f();}export function formatOutput(_0x378c77,_0x2b4a9c){const _0x2fd834=a263_0x3888,_0x33983f=_0x378c77[_0x2fd834(0x1e4)],{_notice:_0x47d79f,..._0x1c3ead}=_0x378c77;void _0x47d79f,baseFormatOutput(_0x1c3ead,_0x2b4a9c),_0x2b4a9c['format']===_0x2fd834(0x1ed)&&printPrettyNotice(_0x33983f);}export function formatCliError(_0x10ac48,_0x1af71b){const _0x287da7=a263_0x3888;if(_0x1af71b[_0x287da7(0x1ee)]===_0x287da7(0x1ed))return![];const _0x28f489=_0x10ac48['data'],_0x17d87f={'ok':![],'command':_0x1af71b[_0x287da7(0x1d9)],'risk':_0x1af71b[_0x287da7(0x1ec)],'data':_0x28f489??null,'error':{'code':_0x10ac48[_0x287da7(0x1e5)],'message':_0x10ac48['message'],..._0x10ac48[_0x287da7(0x1f1)]?{'hint':_0x10ac48[_0x287da7(0x1f1)]}:{}}},_0x2709af=_0x1af71b[_0x287da7(0x1ee)]===_0x287da7(0x1de)?JSON['stringify'](_0x17d87f,null,0x2):JSON[_0x287da7(0x1e1)](_0x17d87f);let _0xb96922=_0x2709af;if(_0x1af71b['jqFilter']?.[_0x287da7(0x1d6)]())try{_0xb96922=applyJqFilter(_0x2709af,_0x1af71b[_0x287da7(0x1f0)]);}catch(_0x50381b){const _0x2ebef5=_0x50381b instanceof CliError?_0x50381b:CliErrors[_0x287da7(0x1eb)]('jq:\x20'+(_0x50381b instanceof Error?_0x50381b[_0x287da7(0x1ef)]:String(_0x50381b))),_0x51fc51={..._0x17d87f,'error':{'code':_0x2ebef5[_0x287da7(0x1e5)],'message':_0x2ebef5[_0x287da7(0x1ef)],..._0x2ebef5[_0x287da7(0x1f1)]?{'hint':_0x2ebef5[_0x287da7(0x1f1)]}:{},'cause':_0x17d87f[_0x287da7(0x1e7)]}};_0xb96922=_0x1af71b[_0x287da7(0x1ee)]===_0x287da7(0x1de)?JSON['stringify'](_0x51fc51,null,0x2):JSON[_0x287da7(0x1e1)](_0x51fc51);}return process[_0x287da7(0x1dd)][_0x287da7(0x1d8)](_0xb96922[_0x287da7(0x1da)]('\x0a')?_0xb96922:_0xb96922+'\x0a'),!![];}function printPrettyNotice(_0x17b592){const _0x5e0c42=a263_0x3888;if(!_0x17b592?.[_0x5e0c42(0x1e3)])return;console[_0x5e0c42(0x1e7)](_0x17b592[_0x5e0c42(0x1e3)]['message']+'\x20('+_0x17b592[_0x5e0c42(0x1e3)][_0x5e0c42(0x1ea)]+')');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x44e82f,_0x44be22){var _0x4f4486=a264_0x2fc1,_0x5e95bf=_0x44e82f();while(!![]){try{var _0x3ccc85=parseInt(_0x4f4486(0xe0))/0x1*(parseInt(_0x4f4486(0xe8))/0x2)+parseInt(_0x4f4486(0xde))/0x3*(parseInt(_0x4f4486(0xe5))/0x4)+-parseInt(_0x4f4486(0xe3))/0x5*(parseInt(_0x4f4486(0xe1))/0x6)+-parseInt(_0x4f4486(0xe2))/0x7+parseInt(_0x4f4486(0xe6))/0x8*(-parseInt(_0x4f4486(0xe4))/0x9)+-parseInt(_0x4f4486(0xdf))/0xa+parseInt(_0x4f4486(0xe7))/0xb;if(_0x3ccc85===_0x44be22)break;else _0x5e95bf['push'](_0x5e95bf['shift']());}catch(_0x179851){_0x5e95bf['push'](_0x5e95bf['shift']());}}}(a264_0x394e,0x9c6d9));export{extractList,extractPaging}from'@lovrabet/cli-framework';function a264_0x2fc1(_0x2ef567,_0x3bbc2c){_0x2ef567=_0x2ef567-0xde;var _0x394e77=a264_0x394e();var _0x2fc151=_0x394e77[_0x2ef567];return _0x2fc151;}function a264_0x394e(){var _0x305e6b=['3251088PuaIJY','3208tGqTOQ','1646436eamVzE','9788wQANcz','3AUpQTK','741040zaTXEa','237hdKHMK','108LdUkCX','4069100phDjsD','161885xSQuZn','5463zdVzuE'];a264_0x394e=function(){return _0x305e6b;};return a264_0x394e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3dae82,_0x5cc485){const _0x4f36fb=a265_0x5211,_0x56d093=_0x3dae82();while(!![]){try{const _0x6e69b9=-parseInt(_0x4f36fb(0x12b))/0x1+-parseInt(_0x4f36fb(0x12d))/0x2+parseInt(_0x4f36fb(0x128))/0x3*(parseInt(_0x4f36fb(0x13b))/0x4)+-parseInt(_0x4f36fb(0x137))/0x5*(parseInt(_0x4f36fb(0x129))/0x6)+-parseInt(_0x4f36fb(0x130))/0x7*(parseInt(_0x4f36fb(0x12e))/0x8)+-parseInt(_0x4f36fb(0x12a))/0x9*(parseInt(_0x4f36fb(0x13d))/0xa)+-parseInt(_0x4f36fb(0x126))/0xb*(-parseInt(_0x4f36fb(0x133))/0xc);if(_0x6e69b9===_0x5cc485)break;else _0x56d093['push'](_0x56d093['shift']());}catch(_0x20f9a2){_0x56d093['push'](_0x56d093['shift']());}}}(a265_0x5526,0x6e914));import{CliErrors}from'../errors.js';function a265_0x5211(_0x3133df,_0xd8f61b){_0x3133df=_0x3133df-0x125;const _0x5526d5=a265_0x5526();let _0x521174=_0x5526d5[_0x3133df];return _0x521174;}import{resolveAlias,listAliases}from'../core/alias-resolver.js';import{CLI_BIN_NAME}from'../constant/cli.js';function a265_0x5526(){const _0x134364=['432oqPoWe','\x20api\x20pull`\x20first.','62741jRdZIU','map','length','96fLtDKY','validation','name','Available\x20aliases:\x20','3331745ySbVVR','code','No\x20api.ts\x20found\x20in\x20','join','4xvxKbQ','flags','302710MWUtsl','string','\x22.\x20','4006651hEbJsf','some','1758345jfbmmo','6LNddjN','252ZabvvO','321390BjKaNH','alias','1455660XTqrZa'];a265_0x5526=function(){return _0x134364;};return a265_0x5526();}export function resolveAliasToCode(_0x1d36e1,_0x2749e7,_0x414815,_0x519817){const _0xf3770c=a265_0x5211,_0x1b2dc5=_0x1d36e1[_0xf3770c(0x13c)][_0xf3770c(0x127)](_0x189ca1=>_0x189ca1['name']==='code'&&_0x189ca1['type']===_0xf3770c(0x13e)),_0x2394b3=_0x1d36e1['flags'][_0xf3770c(0x127)](_0x395c9c=>_0x395c9c[_0xf3770c(0x135)]===_0xf3770c(0x12c)&&_0x395c9c['type']===_0xf3770c(0x13e));if(!_0x1b2dc5||!_0x2394b3)return;const _0xcfb51e=_0x2749e7[_0xf3770c(0x138)]?String(_0x2749e7[_0xf3770c(0x138)]):'',_0x5c7bcc=_0x2749e7[_0xf3770c(0x12c)]?String(_0x2749e7[_0xf3770c(0x12c)]):'';if(!_0xcfb51e&&!_0x5c7bcc)throw CliErrors[_0xf3770c(0x134)]('`'+_0x519817+'`\x20requires\x20either\x20--code\x20or\x20--alias.');if(_0x5c7bcc&&!_0xcfb51e){const _0x1abf3a=resolveAlias(_0x414815,_0x5c7bcc);if(!_0x1abf3a){const _0x1f4085=listAliases(_0x414815)[_0xf3770c(0x131)](_0x5a3964=>_0x5a3964['alias']),_0x59f2b9=_0x1f4085[_0xf3770c(0x132)]?_0xf3770c(0x136)+_0x1f4085[_0xf3770c(0x13a)](',\x20'):_0xf3770c(0x139)+_0x414815+'.\x20Run\x20`'+CLI_BIN_NAME+_0xf3770c(0x12f);throw CliErrors['validation']('Unknown\x20alias\x20\x22'+_0x5c7bcc+_0xf3770c(0x125)+_0x59f2b9);}_0x2749e7[_0xf3770c(0x138)]=_0x1abf3a;}}
|