@lovrabet/rabetbase-cli 2.5.3-beta.2 → 2.5.3-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.d.ts +22 -0
- package/lib/api/api-group.js +1 -0
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +18 -2
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.d.ts +11 -0
- package/lib/api/legacy-api-file.js +1 -0
- package/lib/api/model-registry-file.d.ts +36 -0
- package/lib/api/model-registry-file.js +1 -0
- package/lib/api/model-registry-scaffold.d.ts +7 -0
- package/lib/api/model-registry-scaffold.js +1 -0
- package/lib/api/model-source.d.ts +6 -0
- package/lib/api/model-source.js +1 -0
- 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/logs.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 +7 -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.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/batch-design.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/cross-relation-create.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-create.js +1 -0
- package/lib/commands/dataset/cross-relation-delete.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-delete.js +1 -0
- package/lib/commands/dataset/cross-relation-list.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-list.js +1 -0
- package/lib/commands/dataset/cross-relation-shared.d.ts +190 -0
- package/lib/commands/dataset/cross-relation-shared.js +1 -0
- package/lib/commands/dataset/cross-relation-update.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-update.js +1 -0
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.d.ts +28 -0
- package/lib/commands/project/api-architecture-upgrade.js +1 -0
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.d.ts +30 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.d.ts +5 -3
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.d.ts +2 -0
- 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 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.d.ts +13 -17
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +6 -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/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.d.ts +41 -0
- package/lib/core/cross-db-relation.js +1 -0
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.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.d.ts +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +0 -10
- 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 +11 -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.d.ts +19 -0
- 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 +6 -1
- package/skills/rabetbase/SKILL.md +16 -10
- package/skills/rabetbase/guides/backend-function.md +5 -1
- package/skills/rabetbase/guides/bff-creation-workflow.md +3 -1
- package/skills/rabetbase/guides/cross-database-bff.md +70 -0
- package/skills/rabetbase/guides/data-api-guidelines.md +35 -33
- package/skills/rabetbase/guides/sdk-client-generation.md +112 -61
- package/skills/rabetbase/guides/sql-creation-workflow.md +2 -0
- package/skills/rabetbase/guides/typescript-sdk.md +9 -0
- package/skills/rabetbase/references/rabetbase-api-pull.md +30 -19
- package/skills/rabetbase/references/rabetbase-app-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-config.md +2 -1
- package/skills/rabetbase/references/rabetbase-dataset-cross-relations.md +64 -0
- package/skills/rabetbase/references/rabetbase-project-create.md +3 -3
- package/skills/rabetbase/references/rabetbase-project-upgrade.md +24 -13
- package/skills/rabetbase.manifest.json +5 -3
- package/templates/README.md +46 -6
- package/templates/generate-api/model-runtime.ts.tpl +101 -0
- package/templates/generate-api/profile-api.ts.tpl +21 -0
- package/templates/generate-api/profile-client.ts.tpl +14 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a282_0x4b2c68=a282_0x284e;(function(_0x2e6b4c,_0x4be8b8){const _0x49efe7=a282_0x284e,_0x14b536=_0x2e6b4c();while(!![]){try{const _0x2ee9ac=parseInt(_0x49efe7(0x1b2))/0x1*(parseInt(_0x49efe7(0x1ba))/0x2)+-parseInt(_0x49efe7(0x1d4))/0x3*(-parseInt(_0x49efe7(0x1ca))/0x4)+-parseInt(_0x49efe7(0x1d6))/0x5+parseInt(_0x49efe7(0x1e0))/0x6*(parseInt(_0x49efe7(0x1b9))/0x7)+parseInt(_0x49efe7(0x1e8))/0x8+parseInt(_0x49efe7(0x1e1))/0x9+parseInt(_0x49efe7(0x1a9))/0xa*(-parseInt(_0x49efe7(0x1ce))/0xb);if(_0x2ee9ac===_0x4be8b8)break;else _0x14b536['push'](_0x14b536['shift']());}catch(_0x31c1f8){_0x14b536['push'](_0x14b536['shift']());}}}(a282_0x458d,0x461c2));function a282_0x284e(_0x3f305b,_0x4414f8){_0x3f305b=_0x3f305b-0x1a7;const _0x458dcd=a282_0x458d();let _0x284e65=_0x458dcd[_0x3f305b];return _0x284e65;}import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';function a282_0x458d(){const _0x47a0c4=['Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20','isArray','ENOENT','rules','allow','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_file_exists','object','created','string','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','parse','3188QTbGJq','policyRoot','appCode','Review\x20the\x20file\x20before\x20retrying.','165341VSTBfd','stringify','decode','instant_api_policy_app_code_mismatch','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','instant_api_policy_file_too_large','2100GqbxoI','code','1014745Fvvbwe','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','utf8','force','instant_api_policy_file_unreadable','byteLength','policyFilePath','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','908322KHZnxH','1272186aSkoxK','.rabetbase/instant-api-policy','size','instant_api_policy_file_unwritable','defaults','EEXIST','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','4379304JLHmLt','instantApi','trim','790RRLoLf','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','Policy\x20defaults.instantApi\x20is\x20required.','instant_api_policy_file_invalid','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','catch','unchanged','length','instant_api_policy_json_invalid','3BlmueB','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','includes','version','instant_api_policy_file_missing','pid','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','14hDJlvM','85418yAvZaT','instant_api_policy_app_code_invalid','overwritten','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.'];a282_0x458d=function(){return _0x47a0c4;};return a282_0x458d();}import{dirname,resolve}from'node:path';import{TextDecoder}from'node:util';import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT=a282_0x4b2c68(0x1e2);export const INSTANT_API_POLICY_FILE_NAME='policy.json';export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x240912,_0xd8dcfb,_0x3e7df5){return new CliError(_0x240912,0x1,_0xd8dcfb,_0x3e7df5);}export function loadInstantApiPolicyLocalConfig(_0x3b6c51,_0x53e461){assertSafeAppCode(_0x3b6c51);const _0x5ca9a4=resolve(_0x53e461??findProjectRootDirectory()),_0x126b7a=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x3b6c51+'/'+INSTANT_API_POLICY_FILE_NAME,_0x278ef3=resolve(_0x5ca9a4,INSTANT_API_POLICY_RELATIVE_ROOT,_0x3b6c51),_0x1486b2=resolve(_0x278ef3,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x5ca9a4,'appCode':_0x3b6c51,'policyRoot':_0x278ef3,'policyFilePath':_0x1486b2,'policyRelativePath':_0x126b7a};}export function createDefaultInstantApiPolicyConfig(_0x343bee,_0x882c39=a282_0x4b2c68(0x1c2)){return assertSafeAppCode(_0x343bee),{'version':'2','appCode':_0x343bee,'defaults':{'instantApi':_0x882c39},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x39c6e8){const _0x25c777=a282_0x4b2c68;let _0x1fca40;try{_0x1fca40=await stat(_0x39c6e8[_0x25c777(0x1de)]);}catch(_0x2429ad){throw instantApiPolicyError(_0x25c777(0x1b6),_0x25c777(0x1d8)+_0x39c6e8[_0x25c777(0x1de)],_0x25c777(0x1d7));}if(!_0x1fca40['isFile']())throw instantApiPolicyError('instant_api_policy_file_invalid',_0x25c777(0x1ad)+_0x39c6e8[_0x25c777(0x1de)]);if(_0x1fca40[_0x25c777(0x1e3)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x25c777(0x1d3),_0x25c777(0x1b3));let _0x483625;try{_0x483625=await readFile(_0x39c6e8['policyFilePath']);}catch{throw instantApiPolicyError(_0x25c777(0x1dc),_0x25c777(0x1d9)+_0x39c6e8[_0x25c777(0x1de)]);}if(_0x483625[_0x25c777(0x1dd)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x25c777(0x1d3),_0x25c777(0x1b3));let _0x242ccc;try{_0x242ccc=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x25c777(0x1d0)](_0x483625);}catch{throw instantApiPolicyError(_0x25c777(0x1ac),'Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x39c6e8['policyFilePath']);}let _0x566a71;try{_0x566a71=JSON[_0x25c777(0x1c9)](_0x242ccc);}catch{throw instantApiPolicyError(_0x25c777(0x1b1),_0x25c777(0x1be)+_0x39c6e8[_0x25c777(0x1de)]);}return assertLocalPolicyContract(_0x566a71,_0x39c6e8[_0x25c777(0x1cc)]);}export async function writeInstantApiPolicyConfigFile(_0x4e3fd9,_0x4bad17,_0x13b0d3={}){const _0x2ed7ca=a282_0x4b2c68,_0x68c259=assertLocalPolicyContract(_0x4bad17,_0x4e3fd9[_0x2ed7ca(0x1cc)]),_0x1f267d=JSON[_0x2ed7ca(0x1cf)](_0x68c259,null,0x2)+'\x0a';if(Buffer[_0x2ed7ca(0x1dd)](_0x1f267d,'utf8')>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x2ed7ca(0x1b3));await mkdir(_0x4e3fd9[_0x2ed7ca(0x1cb)],{'recursive':!![]});let _0x549820;try{_0x549820=await readFile(_0x4e3fd9[_0x2ed7ca(0x1de)],_0x2ed7ca(0x1da));}catch(_0x40c1da){if(!isMissingFile(_0x40c1da))throw instantApiPolicyError(_0x2ed7ca(0x1dc),_0x2ed7ca(0x1c3)+_0x4e3fd9[_0x2ed7ca(0x1de)]);}if(_0x549820===_0x1f267d)return{'action':_0x2ed7ca(0x1af),'filePath':_0x4e3fd9[_0x2ed7ca(0x1de)]};if(_0x549820!==undefined&&!_0x13b0d3['force'])throw instantApiPolicyError(_0x2ed7ca(0x1c4),_0x2ed7ca(0x1aa)+_0x4e3fd9[_0x2ed7ca(0x1de)],'Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.');if(_0x549820===undefined)try{return await writeFile(_0x4e3fd9[_0x2ed7ca(0x1de)],_0x1f267d,{'encoding':_0x2ed7ca(0x1da),'flag':'wx'}),{'action':_0x2ed7ca(0x1c6),'filePath':_0x4e3fd9[_0x2ed7ca(0x1de)]};}catch(_0x34dbac){if(!isAlreadyExists(_0x34dbac))throw instantApiPolicyError(_0x2ed7ca(0x1e4),'Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20'+_0x4e3fd9['policyFilePath']);if(!_0x13b0d3[_0x2ed7ca(0x1db)])throw instantApiPolicyError(_0x2ed7ca(0x1c4),_0x2ed7ca(0x1b8)+_0x4e3fd9['policyFilePath'],_0x2ed7ca(0x1cd));}const _0x5bfb44=resolve(dirname(_0x4e3fd9[_0x2ed7ca(0x1de)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x2ed7ca(0x1b7)]+'.'+randomUUID()+'.tmp');try{await writeFile(_0x5bfb44,_0x1f267d,{'encoding':_0x2ed7ca(0x1da),'flag':'wx'}),await rename(_0x5bfb44,_0x4e3fd9[_0x2ed7ca(0x1de)]);}catch{await unlink(_0x5bfb44)[_0x2ed7ca(0x1ae)](()=>undefined);throw instantApiPolicyError('instant_api_policy_file_unwritable',_0x2ed7ca(0x1df)+_0x4e3fd9[_0x2ed7ca(0x1de)]);}return{'action':_0x2ed7ca(0x1bc),'filePath':_0x4e3fd9[_0x2ed7ca(0x1de)]};}function assertSafeAppCode(_0x3ec73a){const _0x5d211c=a282_0x4b2c68,_0x549069=_0x3ec73a[_0x5d211c(0x1a8)]();if(!_0x549069||_0x549069!==_0x3ec73a||_0x549069[_0x5d211c(0x1b0)]>0x64||_0x549069==='.'||_0x549069==='..'||_0x549069[_0x5d211c(0x1b4)]('/')||_0x549069[_0x5d211c(0x1b4)]('\x5c')||_0x549069[_0x5d211c(0x1b4)]('\x00'))throw instantApiPolicyError(_0x5d211c(0x1bb),_0x5d211c(0x1d2));}function assertLocalPolicyContract(_0x4d6c53,_0x48e5d8){const _0x156fd1=a282_0x4b2c68;if(!isObject(_0x4d6c53))throw instantApiPolicyError('instant_api_policy_json_invalid','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.');if(_0x4d6c53[_0x156fd1(0x1b5)]!=='1'&&_0x4d6c53[_0x156fd1(0x1b5)]!=='2')throw instantApiPolicyError('instant_api_policy_version_invalid',_0x156fd1(0x1bd),'version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.');if(_0x4d6c53[_0x156fd1(0x1cc)]!==_0x48e5d8)throw instantApiPolicyError(_0x156fd1(0x1d1),_0x156fd1(0x1e7)+_0x48e5d8+'.');if(!isObject(_0x4d6c53[_0x156fd1(0x1e5)])||typeof _0x4d6c53['defaults'][_0x156fd1(0x1a7)]!==_0x156fd1(0x1c7))throw instantApiPolicyError('instant_api_policy_defaults_invalid',_0x156fd1(0x1ab));if(_0x4d6c53['rules']!==undefined&&_0x4d6c53[_0x156fd1(0x1c1)]!==null&&!Array[_0x156fd1(0x1bf)](_0x4d6c53[_0x156fd1(0x1c1)]))throw instantApiPolicyError('instant_api_policy_rules_invalid',_0x156fd1(0x1c8));return _0x4d6c53;}function isObject(_0x4c38c8){const _0x2f81dd=a282_0x4b2c68;return _0x4c38c8!==null&&typeof _0x4c38c8==='object'&&!Array[_0x2f81dd(0x1bf)](_0x4c38c8);}function isMissingFile(_0x80db51){const _0x4e50c5=a282_0x4b2c68;return Boolean(_0x80db51&&typeof _0x80db51===_0x4e50c5(0x1c5)&&_0x80db51[_0x4e50c5(0x1d5)]===_0x4e50c5(0x1c0));}function isAlreadyExists(_0x1831f8){const _0x1f6aa8=a282_0x4b2c68;return Boolean(_0x1831f8&&typeof _0x1831f8===_0x1f6aa8(0x1c5)&&_0x1831f8[_0x1f6aa8(0x1d5)]===_0x1f6aa8(0x1e6));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a283_0x19c988=a283_0x5d67;(function(_0x241d14,_0x1cd04e){const _0x59b97e=a283_0x5d67,_0x42ee2c=_0x241d14();while(!![]){try{const _0x517415=parseInt(_0x59b97e(0x1d1))/0x1*(parseInt(_0x59b97e(0x1ca))/0x2)+parseInt(_0x59b97e(0x1e4))/0x3*(parseInt(_0x59b97e(0x1ce))/0x4)+-parseInt(_0x59b97e(0x1d3))/0x5+-parseInt(_0x59b97e(0x1c3))/0x6+parseInt(_0x59b97e(0x1d2))/0x7*(-parseInt(_0x59b97e(0x206))/0x8)+parseInt(_0x59b97e(0x1d4))/0x9*(parseInt(_0x59b97e(0x1c0))/0xa)+-parseInt(_0x59b97e(0x1de))/0xb*(parseInt(_0x59b97e(0x1e7))/0xc);if(_0x517415===_0x1cd04e)break;else _0x42ee2c['push'](_0x42ee2c['shift']());}catch(_0xff71){_0x42ee2c['push'](_0x42ee2c['shift']());}}}(a283_0xacac,0x49c99));function a283_0x5d67(_0x591e5e,_0x312891){_0x591e5e=_0x591e5e-0x1b8;const _0xacac7a=a283_0xacac();let _0x5d678b=_0xacac7a[_0x591e5e];return _0x5d678b;}import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a283_0x19c988(0x1ba),a283_0x19c988(0x1c1),'total','hits',a283_0x19c988(0x1ec),a283_0x19c988(0x1d7)],HIT_KEYS=[a283_0x19c988(0x1be),a283_0x19c988(0x200),a283_0x19c988(0x1c9),a283_0x19c988(0x1f9),'title','text',a283_0x19c988(0x1bb),a283_0x19c988(0x205),a283_0x19c988(0x1da),'finalScore','scoreKind'];export async function searchDevelopmentKnowledge(_0x2583f9){const _0x2dacb0=a283_0x19c988,_0x2bb1df=_0x2583f9[_0x2dacb0(0x1d6)][_0x2dacb0(0x204)](),_0x1f260a=_0x2583f9[_0x2dacb0(0x1e1)][_0x2dacb0(0x204)]();if(!_0x2bb1df)throw CliErrors[_0x2dacb0(0x1bc)](_0x2dacb0(0x1ef));if(!_0x2583f9[_0x2dacb0(0x1c6)][_0x2dacb0(0x204)]())throw CliErrors[_0x2dacb0(0x1d8)]();if(!_0x1f260a)throw CliErrors[_0x2dacb0(0x1bc)](_0x2dacb0(0x202));validateTopK(_0x2583f9[_0x2dacb0(0x1fd)]);const _0x327ee1=getKbDomain()+_0x2dacb0(0x1c5);let _0x6241fe;try{_0x6241fe=await fetch(_0x327ee1,{'method':_0x2dacb0(0x1e2),'headers':{'Content-Type':'application/json','Cookie':_0x2583f9[_0x2dacb0(0x1c6)],'X-Invoke-Source':_0x2dacb0(0x1fa)},'body':JSON[_0x2dacb0(0x201)]({'appCode':_0x2bb1df,'query':_0x1f260a,..._0x2583f9[_0x2dacb0(0x1fd)]!==undefined?{'topK':_0x2583f9['topK']}:{}}),'signal':_0x2583f9[_0x2dacb0(0x1e8)]});}catch(_0x55ad0f){if(_0x55ad0f instanceof CliError)throw _0x55ad0f;if(_0x55ad0f instanceof Error&&_0x55ad0f[_0x2dacb0(0x1c2)]===_0x2dacb0(0x1ea))throw _0x55ad0f;throw CliErrors[_0x2dacb0(0x1f7)](_0x2dacb0(0x1f1));}if(!hasNoStore(_0x6241fe[_0x2dacb0(0x1ed)]))throw CliErrors[_0x2dacb0(0x207)]('SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.');if(_0x6241fe[_0x2dacb0(0x203)]===0x191)throw CliErrors[_0x2dacb0(0x1d8)]();if(!_0x6241fe['ok'])throw CliErrors[_0x2dacb0(0x207)](_0x2dacb0(0x1c8)+_0x6241fe[_0x2dacb0(0x203)]+').');if(!(_0x6241fe['headers'][_0x2dacb0(0x1c4)](_0x2dacb0(0x1b9))??'')['toLowerCase']()['includes'](_0x2dacb0(0x1fb)))throw CliErrors['apiError']('SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.');let _0x511cc1;try{_0x511cc1=await _0x6241fe['json']();}catch{throw CliErrors['apiError'](_0x2dacb0(0x1e0));}return parseDevelopmentSearchResponse(readEnvelopeData(_0x511cc1),_0x2583f9[_0x2dacb0(0x1fd)]);}function readEnvelopeData(_0x4bae6a){const _0x5f37ab=a283_0x19c988,_0x5a645f=requireRecord(_0x4bae6a,'response\x20envelope');if(_0x5a645f[_0x5f37ab(0x1d9)]===![])throw CliErrors['apiError'](_0x5f37ab(0x1f5));if(!(_0x5f37ab(0x1cd)in _0x5a645f))throw invalidContract(_0x5f37ab(0x1db));return _0x5a645f[_0x5f37ab(0x1cd)];}function validateTopK(_0x1b3c9d){const _0x47630a=a283_0x19c988;if(_0x1b3c9d!==undefined&&(!Number[_0x47630a(0x1f6)](_0x1b3c9d)||_0x1b3c9d<0x1||_0x1b3c9d>0x32))throw CliErrors['validation'](_0x47630a(0x1f2));}function a283_0xacac(){const _0x53222d=['name','455208CFuidR','get','/smartapi/knowledge/company-public/search','cookie','isArray','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','chunkId','14hLkzRE','development','keys','data','1402756UGLdEW','number','length','81835VJicef','7uUwcQW','438565ElFNxc','30987xdDfWF','string','appCode','timingsMs','authRequired','success','rawScore','response\x20envelope','test','toLowerCase','12166YkLERZ','score','SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','query','POST','finalScore','3dMYqAJ','total','hits','5964xaBmcB','signal','public','AbortError','isFinite','strategyFingerprint','headers','scoreKind','Knowledge\x20search\x20appCode\x20is\x20required.','object','SmartCode\x20knowledge\x20search\x20request\x20failed.','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','title','text','SmartCode\x20knowledge\x20search\x20failed.','isSafeInteger','networkError','cache-control','scope','cli:rabetbase','application/json','response','topK','entries','sort','revision','stringify','Knowledge\x20search\x20query\x20is\x20required.','status','trim','rank','283432ICDlaS','apiError','some','content-type','schemaVersion','tags','validation','\x20contract.','documentId','hits[','370mWrwBj','profile'];a283_0xacac=function(){return _0x53222d;};return a283_0xacac();}function hasNoStore(_0x3e2936){const _0x36cc64=a283_0x19c988;return(_0x3e2936['get'](_0x36cc64(0x1f8))??'')['split'](',')[_0x36cc64(0x1b8)](_0x23caf6=>_0x23caf6[_0x36cc64(0x204)]()[_0x36cc64(0x1dd)]()==='no-store');}function parseDevelopmentSearchResponse(_0x22f4ab,_0x2045d4){const _0x2dbb09=a283_0x19c988,_0x3538a8=requireExactRecord(_0x22f4ab,RESPONSE_KEYS,_0x2dbb09(0x1fc));if(_0x3538a8[_0x2dbb09(0x1ba)]!==0x2||_0x3538a8[_0x2dbb09(0x1c1)]!==_0x2dbb09(0x1cb))throw invalidContract(_0x2dbb09(0x1c1));if(!Array[_0x2dbb09(0x1c7)](_0x3538a8[_0x2dbb09(0x1e6)])||_0x3538a8[_0x2dbb09(0x1e6)][_0x2dbb09(0x1d0)]>(_0x2045d4??0x32))throw invalidContract(_0x2dbb09(0x1e6));if(typeof _0x3538a8[_0x2dbb09(0x1ec)]!==_0x2dbb09(0x1d5)||!/^sha256:[0-9a-f]{64}$/[_0x2dbb09(0x1dc)](_0x3538a8[_0x2dbb09(0x1ec)]))throw invalidContract('strategyFingerprint');const _0x5a8916=requireRecord(_0x3538a8[_0x2dbb09(0x1d7)],_0x2dbb09(0x1d7)),_0x3023a4={};for(const [_0x54ac5f,_0x52075a]of Object[_0x2dbb09(0x1fe)](_0x5a8916)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x2dbb09(0x1dc)](_0x54ac5f)||typeof _0x52075a!==_0x2dbb09(0x1cf)||!Number[_0x2dbb09(0x1eb)](_0x52075a)||_0x52075a<0x0)throw invalidContract(_0x2dbb09(0x1d7));_0x3023a4[_0x54ac5f]=_0x52075a;}const _0x3ba5dc=_0x3538a8[_0x2dbb09(0x1e6)]['map']((_0xf93bc,_0x2eb726)=>parseHit(_0xf93bc,_0x2eb726));if(!Number[_0x2dbb09(0x1f6)](_0x3538a8[_0x2dbb09(0x1e5)])||_0x3538a8[_0x2dbb09(0x1e5)]!==_0x3ba5dc[_0x2dbb09(0x1d0)])throw invalidContract(_0x2dbb09(0x1e5));return{'schemaVersion':_0x3538a8[_0x2dbb09(0x1ba)],'profile':_0x3538a8['profile'],'total':_0x3538a8['total'],'strategyFingerprint':_0x3538a8['strategyFingerprint'],'timingsMs':_0x3023a4,'hits':_0x3ba5dc};}function parseHit(_0x5cfb87,_0x59a254){const _0x5c315f=a283_0x19c988,_0x138a3b=requireExactRecord(_0x5cfb87,HIT_KEYS,_0x5c315f(0x1bf)+_0x59a254+']'),_0x241bce=_0x50e4fd=>{const _0x340a76=_0x5c315f,_0x66bb66=_0x138a3b[_0x50e4fd];if(typeof _0x66bb66!==_0x340a76(0x1d5)||!_0x66bb66)throw invalidContract(_0x50e4fd);return _0x66bb66;};if(!Number[_0x5c315f(0x1f6)](_0x138a3b[_0x5c315f(0x200)])||_0x138a3b[_0x5c315f(0x200)]<0x1)throw invalidContract(_0x5c315f(0x200));if(_0x138a3b[_0x5c315f(0x1f9)]!==_0x5c315f(0x1e9)&&_0x138a3b['scope']!=='company')throw invalidContract(_0x5c315f(0x1f9));if(typeof _0x138a3b['title']!=='string'||typeof _0x138a3b[_0x5c315f(0x1f4)]!=='string')throw invalidContract('text');if(!Array['isArray'](_0x138a3b[_0x5c315f(0x1bb)])||_0x138a3b[_0x5c315f(0x1bb)][_0x5c315f(0x1b8)](_0x16e8e2=>typeof _0x16e8e2!=='string'))throw invalidContract('tags');if(!Number[_0x5c315f(0x1f6)](_0x138a3b[_0x5c315f(0x205)])||_0x138a3b['rank']!==_0x59a254+0x1)throw invalidContract(_0x5c315f(0x205));if(!isFiniteNumber(_0x138a3b[_0x5c315f(0x1da)])||!isFiniteNumber(_0x138a3b['finalScore']))throw invalidContract(_0x5c315f(0x1df));return{'documentId':_0x241bce(_0x5c315f(0x1be)),'revision':_0x138a3b[_0x5c315f(0x200)],'chunkId':_0x241bce(_0x5c315f(0x1c9)),'scope':_0x138a3b[_0x5c315f(0x1f9)],'title':_0x138a3b[_0x5c315f(0x1f3)],'text':_0x138a3b[_0x5c315f(0x1f4)],'tags':[..._0x138a3b[_0x5c315f(0x1bb)]],'rank':_0x138a3b['rank'],'rawScore':_0x138a3b[_0x5c315f(0x1da)],'finalScore':_0x138a3b[_0x5c315f(0x1e3)],'scoreKind':_0x241bce(_0x5c315f(0x1ee))};}function requireExactRecord(_0x50d57a,_0xebd378,_0x4ad38c){const _0x420735=a283_0x19c988,_0x288a51=requireRecord(_0x50d57a,_0x4ad38c),_0x53be66=Object[_0x420735(0x1cc)](_0x288a51)['sort'](),_0xd148bc=[..._0xebd378][_0x420735(0x1ff)]();if(_0x53be66[_0x420735(0x1d0)]!==_0xd148bc['length']||_0x53be66['some']((_0x142ad1,_0x1f2fb7)=>_0x142ad1!==_0xd148bc[_0x1f2fb7]))throw invalidContract(_0x4ad38c);return _0x288a51;}function requireRecord(_0xdfdc38,_0x5e3ac0){const _0x4fdb53=a283_0x19c988;if(!_0xdfdc38||typeof _0xdfdc38!==_0x4fdb53(0x1f0)||Array[_0x4fdb53(0x1c7)](_0xdfdc38))throw invalidContract(_0x5e3ac0);return _0xdfdc38;}function isFiniteNumber(_0x4805bc){const _0x4f52a1=a283_0x19c988;return typeof _0x4805bc===_0x4f52a1(0x1cf)&&Number['isFinite'](_0x4805bc);}function invalidContract(_0x52e572){const _0xc04db6=a283_0x19c988;return CliErrors[_0xc04db6(0x207)]('SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20'+_0x52e572+_0xc04db6(0x1bd));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a284_0x34e95e=a284_0x21d3;(function(_0xf9227e,_0x27664b){const _0x57b7fe=a284_0x21d3,_0x329982=_0xf9227e();while(!![]){try{const _0x18392b=-parseInt(_0x57b7fe(0x179))/0x1+-parseInt(_0x57b7fe(0x17b))/0x2*(parseInt(_0x57b7fe(0x170))/0x3)+-parseInt(_0x57b7fe(0x189))/0x4+parseInt(_0x57b7fe(0x174))/0x5*(-parseInt(_0x57b7fe(0x17c))/0x6)+-parseInt(_0x57b7fe(0x183))/0x7*(parseInt(_0x57b7fe(0x17d))/0x8)+parseInt(_0x57b7fe(0x182))/0x9+parseInt(_0x57b7fe(0x187))/0xa*(parseInt(_0x57b7fe(0x17f))/0xb);if(_0x18392b===_0x27664b)break;else _0x329982['push'](_0x329982['shift']());}catch(_0x44d4c0){_0x329982['push'](_0x329982['shift']());}}}(a284_0x5366,0xbfbe1));import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a284_0x5366(){const _0x496733=['Page\x20directory\x20is\x20not\x20a\x20directory:\x20','6171995xeqGpv','page','toUpperCase','isDirectory','name','1159008AUaMfw','cwd','1483554PaSItW','6qpQzjl','152XEMfrK','.json','749012jQpQiN','sort','flagMissing','14040423OaIgqa','291095eoxEEp','localeCompare','split','page.lock.json','670SUyrTH','appPagesDir','5646140gzQudF','trim','validation','3AChldV','Page\x20directory\x20not\x20found:\x20','.rabetbase'];a284_0x5366=function(){return _0x496733;};return a284_0x5366();}import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x320400,_0x2f4acf=process[a284_0x34e95e(0x17a)]()){const _0x318f40=a284_0x34e95e,_0x3adb4c=resolve(_0x2f4acf),_0x304dce=join(_0x3adb4c,_0x318f40(0x172),_0x318f40(0x175));return{'projectRoot':_0x3adb4c,'pagesBaseDir':_0x304dce,'appPagesDir':join(_0x304dce,_0x320400),'lockFilePath':join(_0x3adb4c,_0x318f40(0x172),_0x318f40(0x186))};}export function buildPageFileName(_0x5a77af,_0x2aeae8){const _0x393b15=a284_0x34e95e;return _0x5a77af+'-'+_0x2aeae8[_0x393b15(0x176)]()+_0x393b15(0x17e);}export function resolvePageFilePath(_0x376849,_0xd98a3a,_0x574a90){const _0x5e4417=a284_0x34e95e;return join(_0x376849[_0x5e4417(0x188)],buildPageFileName(_0xd98a3a,_0x574a90));}export async function ensureParentDirectory(_0x329f1f){await mkdir(dirname(_0x329f1f),{'recursive':!![]});}export async function fileExists(_0x577b02){try{return await access(_0x577b02,constants['F_OK']),!![];}catch{return![];}}function a284_0x21d3(_0x5da84e,_0x2b718d){_0x5da84e=_0x5da84e-0x170;const _0x5366ba=a284_0x5366();let _0x21d398=_0x5366ba[_0x5da84e];return _0x21d398;}export async function readCustomPageDirectory(_0x3cf845){const _0x57cd06=a284_0x34e95e,_0x64469c=_0x3cf845[_0x57cd06(0x18a)]();if(!_0x64469c)throw CliErrors[_0x57cd06(0x181)]('page-dir');const _0x441b6b=resolve(_0x64469c);let _0x214c66;try{_0x214c66=await lstat(_0x441b6b);}catch{throw CliErrors[_0x57cd06(0x18b)](_0x57cd06(0x171)+_0x64469c);}if(!_0x214c66[_0x57cd06(0x177)]())throw CliErrors[_0x57cd06(0x18b)](_0x57cd06(0x173)+_0x64469c);const _0x4ce919={};return await readDirectory(_0x441b6b,_0x441b6b,_0x4ce919),_0x4ce919;}async function readDirectory(_0x588824,_0x44792c,_0x2c7363){const _0x47687f=a284_0x34e95e,_0x1f1c3c=await readdir(_0x44792c,{'withFileTypes':!![]});for(const _0x16b3e1 of _0x1f1c3c[_0x47687f(0x180)]((_0x4ef45f,_0x1949f8)=>_0x4ef45f[_0x47687f(0x178)][_0x47687f(0x184)](_0x1949f8[_0x47687f(0x178)]))){const _0x53a943=join(_0x44792c,_0x16b3e1['name']);if(_0x16b3e1[_0x47687f(0x177)]()){await readDirectory(_0x588824,_0x53a943,_0x2c7363);continue;}if(!_0x16b3e1['isFile']())throw CliErrors[_0x47687f(0x18b)]('Unsupported\x20file\x20in\x20page\x20directory:\x20'+_0x53a943);_0x2c7363[relative(_0x588824,_0x53a943)[_0x47687f(0x185)](sep)['join']('/')]=await readFile(_0x53a943,'utf8');}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a285_0x78b2(_0x12816b,_0x3ea7c6){_0x12816b=_0x12816b-0x14a;const _0x3760d8=a285_0x3760();let _0x78b2b9=_0x3760d8[_0x12816b];return _0x78b2b9;}(function(_0x5da665,_0x533c1b){const _0x628e05=a285_0x78b2,_0x469f75=_0x5da665();while(!![]){try{const _0x49e339=-parseInt(_0x628e05(0x153))/0x1*(parseInt(_0x628e05(0x157))/0x2)+parseInt(_0x628e05(0x152))/0x3*(-parseInt(_0x628e05(0x14f))/0x4)+parseInt(_0x628e05(0x154))/0x5+parseInt(_0x628e05(0x150))/0x6*(-parseInt(_0x628e05(0x159))/0x7)+parseInt(_0x628e05(0x14d))/0x8+parseInt(_0x628e05(0x14b))/0x9*(-parseInt(_0x628e05(0x14c))/0xa)+-parseInt(_0x628e05(0x155))/0xb*(-parseInt(_0x628e05(0x151))/0xc);if(_0x49e339===_0x533c1b)break;else _0x469f75['push'](_0x469f75['shift']());}catch(_0xabede3){_0x469f75['push'](_0x469f75['shift']());}}}(a285_0x3760,0x60b2c));function a285_0x3760(){const _0x445fac=['206090OfKxpZ','2714424qhKUgL','createHash','12396IiEwFR','168ReNtoD','12lnUylj','411WyAliS','1nyAZId','137225GBNgRF','18535429vMaNQi','md5','1497904yTEnef','update','79331gLuUwY','stringify','72hUxKFS'];a285_0x3760=function(){return _0x445fac;};return a285_0x3760();}import a285_0x577d8f from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x526bab){const _0x502d8f=a285_0x78b2;return JSON[_0x502d8f(0x14a)](JSON['parse'](_0x526bab),null,0x2)+'\x0a';}export function computePageContentHash(_0x2c2bd1){const _0x57eb97=a285_0x78b2;return a285_0x577d8f[_0x57eb97(0x14e)](_0x57eb97(0x156))[_0x57eb97(0x158)](_0x2c2bd1)['digest']('hex');}export function computeSerializedSchemaHash(_0x4f2773){return computePageContentHash(serializePageSchemaForFile(_0x4f2773));}export async function computePageFileHash(_0x44502f){const _0x4092a6=await readFile(_0x44502f,'utf8');return computePageContentHash(_0x4092a6);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xf9ae44,_0x403703){const _0x3bdfd7=a286_0x4a9d,_0x45811c=_0xf9ae44();while(!![]){try{const _0x29651e=-parseInt(_0x3bdfd7(0x125))/0x1*(-parseInt(_0x3bdfd7(0x128))/0x2)+-parseInt(_0x3bdfd7(0x11b))/0x3*(-parseInt(_0x3bdfd7(0x11d))/0x4)+-parseInt(_0x3bdfd7(0x126))/0x5*(-parseInt(_0x3bdfd7(0x12a))/0x6)+parseInt(_0x3bdfd7(0x11f))/0x7+-parseInt(_0x3bdfd7(0x122))/0x8+-parseInt(_0x3bdfd7(0x127))/0x9+-parseInt(_0x3bdfd7(0x11a))/0xa;if(_0x29651e===_0x403703)break;else _0x45811c['push'](_0x45811c['shift']());}catch(_0x56145a){_0x45811c['push'](_0x45811c['shift']());}}}(a286_0x4cc0,0xa54a9));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x30dfa9,_0x10eab5){const _0x20b1dc=a286_0x4a9d,_0x5105da={'apps':_0x30dfa9[_0x20b1dc(0x121)]&&typeof _0x30dfa9[_0x20b1dc(0x121)]===_0x20b1dc(0x11e)?_0x30dfa9[_0x20b1dc(0x121)]:{}};let _0x1124cc=_0x5105da[_0x20b1dc(0x121)][_0x10eab5];if(!_0x1124cc)return _0x1124cc={'lastSync':'','pages':{}},_0x5105da['apps'][_0x10eab5]=_0x1124cc,{'lockData':_0x5105da,'appLock':_0x1124cc};return!_0x1124cc[_0x20b1dc(0x11c)]&&(_0x1124cc[_0x20b1dc(0x11c)]=''),(!_0x1124cc[_0x20b1dc(0x123)]||typeof _0x1124cc[_0x20b1dc(0x123)]!==_0x20b1dc(0x11e))&&(_0x1124cc[_0x20b1dc(0x123)]={}),{'lockData':_0x5105da,'appLock':_0x1124cc};}export async function readPageLockFile(_0x14cdd4){const _0x7d22e7=a286_0x4a9d;try{const _0xffcb2f=await readFile(_0x14cdd4,_0x7d22e7(0x129)),_0x559de4=JSON['parse'](_0xffcb2f);return{'apps':_0x559de4['apps']&&typeof _0x559de4[_0x7d22e7(0x121)]===_0x7d22e7(0x11e)?_0x559de4[_0x7d22e7(0x121)]:{}};}catch(_0x3ed2f1){if(_0x3ed2f1[_0x7d22e7(0x119)]==='ENOENT')return null;throw new Error(_0x7d22e7(0x124)+String(_0x3ed2f1));}}export async function writePageLockFile(_0x5d82fb,_0x1bb5db){const _0x5aec8a=a286_0x4a9d;await mkdir(dirname(_0x5d82fb),{'recursive':!![]}),await writeFile(_0x5d82fb,JSON[_0x5aec8a(0x120)](_0x1bb5db,null,0x2),_0x5aec8a(0x129));}function a286_0x4a9d(_0x4b899e,_0x2ac428){_0x4b899e=_0x4b899e-0x119;const _0x4cc04d=a286_0x4cc0();let _0x4a9dba=_0x4cc04d[_0x4b899e];return _0x4a9dba;}function a286_0x4cc0(){const _0x36a8d2=['8518736UPqDox','pages','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','2UPnnob','5EZgvMX','4250700OlOUOp','921096mGjVFf','utf8','2094216lBCYhP','code','5204920PTClTs','9RQwySt','lastSync','286468qZqesX','object','8747788DlneqR','stringify','apps'];a286_0x4cc0=function(){return _0x36a8d2;};return a286_0x4cc0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b7fed,_0x519239){const _0x1f9150=a287_0x445a,_0x17f11d=_0x1b7fed();while(!![]){try{const _0x38e766=parseInt(_0x1f9150(0xf7))/0x1+parseInt(_0x1f9150(0x103))/0x2+parseInt(_0x1f9150(0x11b))/0x3*(-parseInt(_0x1f9150(0x111))/0x4)+-parseInt(_0x1f9150(0x10e))/0x5*(-parseInt(_0x1f9150(0x11a))/0x6)+-parseInt(_0x1f9150(0x122))/0x7+parseInt(_0x1f9150(0x10a))/0x8*(-parseInt(_0x1f9150(0x10f))/0x9)+-parseInt(_0x1f9150(0x125))/0xa;if(_0x38e766===_0x519239)break;else _0x17f11d['push'](_0x17f11d['shift']());}catch(_0x15575a){_0x17f11d['push'](_0x17f11d['shift']());}}}(a287_0x314b,0xf22c7));function a287_0x445a(_0x3f11b7,_0x346d0e){_0x3f11b7=_0x3f11b7-0xf7;const _0x314b2a=a287_0x314b();let _0x445a37=_0x314b2a[_0x3f11b7];return _0x445a37;}import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0x5c972a,_0x50ef04,_0x25ee88){const _0x1109ff=a287_0x445a,_0x37ef47=parseSchema(_0x5c972a,_0x1109ff(0x116)),_0x5738f5=parseSchema(_0x50ef04,_0x1109ff(0x112)),_0x1dc3fd=collectLrSmartJsx(_0x37ef47,!![]);if(_0x1dc3fd[_0x1109ff(0x11e)]===0x0)return{'content':_0x5c972a,'compiledNodes':0x0,'normalizedNodes':0x0};const _0xaece86=new Map(collectLrSmartJsx(_0x5738f5)[_0x1109ff(0x10c)](_0x2e5352=>[_0x2e5352[_0x1109ff(0xfc)],_0x2e5352]));let _0x87b61f=0x0,_0xece3aa=0x0;for(const _0x124d09 of _0x1dc3fd){const _0x24476e=readNonEmptyString(_0x124d09[_0x1109ff(0x11f)][_0x1109ff(0x114)]),_0x275ea3=readNonEmptyString(_0x124d09[_0x1109ff(0x11f)][_0x1109ff(0x121)]),_0x15f624=_0xaece86['get'](_0x124d09[_0x1109ff(0xfc)]),_0xe65db3=readNonEmptyString(_0x15f624?.['render'][_0x1109ff(0x114)]),_0x1f82c9=readNonEmptyString(_0x15f624?.['render'][_0x1109ff(0x121)]);let _0x3a9600=![];_0x124d09[_0x1109ff(0x11f)][_0x1109ff(0xfb)]!==_0x1109ff(0xf8)&&(_0x124d09['render'][_0x1109ff(0xfb)]=_0x1109ff(0xf8),_0x3a9600=!![]);!isPageContextExpression(_0x124d09['props'][_0x1109ff(0x100)])&&(_0x124d09[_0x1109ff(0x101)][_0x1109ff(0x100)]={'type':_0x1109ff(0x11c),'value':_0x1109ff(0xff)},_0x3a9600=!![]);if(!_0x24476e){if(!_0x275ea3)throw CliErrors[_0x1109ff(0x120)](_0x1109ff(0x108)+_0x124d09[_0x1109ff(0x107)]+_0x1109ff(0x118),_0x1109ff(0xfa));if(_0x3a9600)_0xece3aa+=0x1;continue;}const _0x31ee7a=!_0x15f624||_0x24476e!==_0xe65db3,_0x4b1643=!_0x275ea3;if(!_0x31ee7a&&_0x275ea3&&_0x1f82c9&&_0x275ea3!==_0x1f82c9)throw CliErrors['validation'](_0x1109ff(0x108)+_0x124d09[_0x1109ff(0x107)]+_0x1109ff(0x117),'Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.');if(_0x31ee7a||_0x4b1643||!_0x1f82c9){const _0xd9b7c1=readNonEmptyString(await _0x25ee88(_0x24476e));if(!_0xd9b7c1)throw CliErrors[_0x1109ff(0x124)](_0x1109ff(0x102)+_0x124d09['label']+'\x22.');_0x124d09['render'][_0x1109ff(0x121)]=_0xd9b7c1,_0x87b61f+=0x1,_0x3a9600=!![];}if(_0x3a9600)_0xece3aa+=0x1;}if(_0xece3aa===0x0)return{'content':_0x5c972a,'compiledNodes':_0x87b61f,'normalizedNodes':_0xece3aa};return{'content':JSON[_0x1109ff(0xf9)](_0x37ef47),'compiledNodes':_0x87b61f,'normalizedNodes':_0xece3aa};}function a287_0x314b(){const _0x5c1d6e=['54mBnEmI','78kjGoeG','JSExpression','\x22\x20has\x20missing\x20or\x20invalid\x20props.render.','length','render','validation','value','2315061tAXWTu','\x20page\x20schema.','apiError','9767120MDrBHa','1680910KpJyoe','JSFunction','stringify','Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.','type','key','id:','trim','this','_context','props','LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22','3214754FycWuJ','\x22\x20has\x20missing\x20or\x20invalid\x20props.','componentName','entries','label','LrSmartJsx\x20node\x20\x22','isArray','248TMZoJk','parse','map','Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.','871375VYaamf','263574rJyqzX','Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.','253772UjVZyO','remote','LrSmartJsx','source','string','local','\x22\x20has\x20a\x20manually\x20changed\x20render.value.','\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.','object'];a287_0x314b=function(){return _0x5c1d6e;};return a287_0x314b();}function parseSchema(_0x3b19cc,_0x2324ae){const _0x2eeb85=a287_0x445a;try{return JSON[_0x2eeb85(0x10b)](_0x3b19cc);}catch{throw CliErrors[_0x2eeb85(0x120)]('Invalid\x20JSON\x20in\x20'+_0x2324ae+_0x2eeb85(0x123));}}function collectLrSmartJsx(_0x1e264b,_0x2b95af=![]){const _0x3a7d31=[],_0x497cca=(_0x109179,_0x26eb50)=>{const _0x4bb196=a287_0x445a;if(Array[_0x4bb196(0x109)](_0x109179)){_0x109179['forEach']((_0x42d233,_0x4c0f22)=>_0x497cca(_0x42d233,_0x26eb50+'['+_0x4c0f22+']'));return;}if(!isObject(_0x109179))return;if(_0x109179['componentName']===_0x4bb196(0x113)){const _0x2f4de9=readNonEmptyString(_0x109179['id']),_0x2dd3ed=_0x2f4de9||_0x26eb50,_0x3c8e4f=isObject(_0x109179[_0x4bb196(0x101)])?_0x109179['props']:undefined;if(!_0x3c8e4f){if(_0x2b95af)throw CliErrors[_0x4bb196(0x120)](_0x4bb196(0x108)+_0x2dd3ed+_0x4bb196(0x104),_0x4bb196(0x10d));return;}const _0x2a6acf=isObject(_0x3c8e4f['render'])?_0x3c8e4f['render']:undefined;if(!_0x2a6acf){if(_0x2b95af)throw CliErrors[_0x4bb196(0x120)]('LrSmartJsx\x20node\x20\x22'+_0x2dd3ed+_0x4bb196(0x11d),_0x4bb196(0x110));return;}_0x3a7d31['push']({'key':_0x2f4de9?_0x4bb196(0xfd)+_0x2f4de9:'path:'+_0x26eb50,'label':_0x2dd3ed,'props':_0x3c8e4f,'render':_0x2a6acf});}for(const [_0x5303e4,_0x4abbfe]of Object[_0x4bb196(0x106)](_0x109179)){if(_0x5303e4===_0x4bb196(0x101)&&_0x109179[_0x4bb196(0x105)]==='LrSmartJsx')continue;_0x497cca(_0x4abbfe,_0x26eb50+'.'+_0x5303e4);}};return _0x497cca(_0x1e264b,'$'),_0x3a7d31;}function isObject(_0x449cc2){const _0x269f4b=a287_0x445a;return Boolean(_0x449cc2)&&typeof _0x449cc2===_0x269f4b(0x119)&&!Array[_0x269f4b(0x109)](_0x449cc2);}function readNonEmptyString(_0x36ada2){const _0x4376d4=a287_0x445a;return typeof _0x36ada2===_0x4376d4(0x115)&&_0x36ada2[_0x4376d4(0xfe)]()?_0x36ada2:undefined;}function isPageContextExpression(_0x263381){const _0x4c7983=a287_0x445a;return isObject(_0x263381)&&_0x263381[_0x4c7983(0xfb)]==='JSExpression'&&_0x263381[_0x4c7983(0x121)]===_0x4c7983(0xff);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3684c2,_0x1682d0){const _0x28636f=a277_0x4c14,_0x36d1cf=_0x3684c2();while(!![]){try{const _0x4b44ae=parseInt(_0x28636f(0x10e))/0x1*(-parseInt(_0x28636f(0x11c))/0x2)+parseInt(_0x28636f(0xfe))/0x3*(-parseInt(_0x28636f(0x139))/0x4)+parseInt(_0x28636f(0x111))/0x5*(-parseInt(_0x28636f(0x11f))/0x6)+parseInt(_0x28636f(0x13b))/0x7+-parseInt(_0x28636f(0x124))/0x8*(parseInt(_0x28636f(0x116))/0x9)+parseInt(_0x28636f(0x13c))/0xa+parseInt(_0x28636f(0x127))/0xb;if(_0x4b44ae===_0x1682d0)break;else _0x36d1cf['push'](_0x36d1cf['shift']());}catch(_0x1d0192){_0x36d1cf['push'](_0x36d1cf['shift']());}}}(a277_0x2483,0x6c298));function a277_0x2483(){const _0x3c1839=['natural','265040JuoFyI','filter','reduce','3409835IzXsiL','indexes','tableName','where','from','JOIN_INDEX_NOT_USABLE','metadataAvailable','length','columns','min','test','inner','warning','matchedPrefix','replaceAll','has','replace','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','548ChmkKq','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','1646400skXWwZ','5240180BcxYIS','trim','matchAll','match','exec','left','slice','push','split','includes','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','using','index','unsupportedReason','toLowerCase','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','sql','4461swRLbr','endsWith','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','\x5c$&','alias','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','(?:^|[^\x5cw$])','position','unsupportedPredicate','startsWith','__sq__','\x5cs*\x5c.\x5cs*[\x5cw$]+','JOIN_INDEX_MISSING','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','table','1rmFTRK','sort','indexOf','105KXhmdR','join','some','INNER','max','18mQQRnZ','cross','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','containsUnresolvedInclude','toUpperCase','unknown','574582KVnDqh','error','map','19686sWTlFB','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','unavailable','covered'];a277_0x2483=function(){return _0x3c1839;};return a277_0x2483();}import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x1d1687,_0x2f83cd){const _0x49236a=a277_0x4c14,_0x10b078=[],_0x28360f=normalizeSqlForStaticAnalysis(_0x1d1687),_0xeb7513=(_0x28360f[_0x49236a(0x11d)]?[]:extractJoinFacts(_0x28360f[_0x49236a(0xfd)]))[_0x49236a(0x11e)](_0x2f7051=>{const _0x49342c=_0x49236a;if(_0x2f7051[_0x49342c(0x106)]||_0x2f7051[_0x49342c(0x12f)][_0x49342c(0x12e)]===0x0)return _0x10b078[_0x49342c(0xf4)]({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0x2f7051[_0x49342c(0x10d)],'alias':_0x2f7051['alias'],'columns':_0x2f7051[_0x49342c(0x12f)],'reason':_0x2f7051[_0x49342c(0xfa)]??_0x49342c(0xf7)}),{'table':_0x2f7051[_0x49342c(0x10d)],'alias':_0x2f7051[_0x49342c(0x102)],'columns':_0x2f7051[_0x49342c(0x12f)],'status':_0x49342c(0x121)};const _0x3d061c=resolveTableMetadata(_0x2f83cd,_0x2f7051[_0x49342c(0x10d)]),_0x766797=(_0x3d061c?.[_0x49342c(0x128)]??[])['map'](_0x165c88=>({'index':_0x165c88,'matchedPrefix':findEqualityPrefix(_0x165c88['columns'],_0x2f7051[_0x49342c(0x12f)])}))[_0x49342c(0x125)](_0x5dcf6a=>_0x5dcf6a[_0x49342c(0x134)]['length']>0x0),_0x46b775=_0x766797[_0x49342c(0x126)]((_0x399ad3,_0x2597e7)=>!_0x399ad3||_0x2597e7[_0x49342c(0x134)][_0x49342c(0x12e)]>_0x399ad3['matchedPrefix'][_0x49342c(0x12e)]?_0x2597e7:_0x399ad3,_0x766797[0x0]);if(_0x46b775)return{'table':_0x2f7051['table'],'alias':_0x2f7051[_0x49342c(0x102)],'columns':_0x2f7051[_0x49342c(0x12f)],'status':_0x49342c(0x122),'matchedIndex':{..._0x46b775[_0x49342c(0xf9)],'matchedPrefix':_0x46b775[_0x49342c(0x134)]}};const _0x532ec0=_0x3d061c?.[_0x49342c(0x128)][_0x49342c(0x125)](_0x49d626=>_0x49d626[_0x49342c(0x12f)][_0x49342c(0x113)](_0x342249=>_0x2f7051[_0x49342c(0x12f)][_0x49342c(0x113)](_0x1c712a=>columnNamesMatch(_0x342249,_0x1c712a))))??[];if(_0x532ec0[_0x49342c(0x12e)]>0x0)return _0x10b078[_0x49342c(0xf4)]({'code':_0x49342c(0x12c),'table':_0x2f7051[_0x49342c(0x10d)],'alias':_0x2f7051[_0x49342c(0x102)],'columns':_0x2f7051[_0x49342c(0x12f)],'reason':_0x49342c(0xfc)}),{'table':_0x2f7051[_0x49342c(0x10d)],'alias':_0x2f7051[_0x49342c(0x102)],'columns':_0x2f7051['columns'],'status':_0x49342c(0x133),'candidateIndexes':_0x532ec0};if(_0x3d061c&&_0x3d061c[_0x49342c(0x12d)]!==![]&&_0x3d061c[_0x49342c(0x128)][_0x49342c(0x12e)]>0x0&&_0x2f7051[_0x49342c(0x12f)]['length']>0x0)return _0x10b078[_0x49342c(0xf4)]({'code':_0x49342c(0x10a),'table':_0x2f7051[_0x49342c(0x10d)],'alias':_0x2f7051[_0x49342c(0x102)],'columns':_0x2f7051[_0x49342c(0x12f)],'reason':_0x49342c(0x100)}),{'table':_0x2f7051[_0x49342c(0x10d)],'alias':_0x2f7051['alias'],'columns':_0x2f7051[_0x49342c(0x12f)],'status':_0x49342c(0x133)};return _0x10b078[_0x49342c(0xf4)]({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x2f7051[_0x49342c(0x10d)],'alias':_0x2f7051[_0x49342c(0x102)],'columns':_0x2f7051['columns'],'reason':_0x3d061c?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':_0x49342c(0x13a)}),{'table':_0x2f7051[_0x49342c(0x10d)],'alias':_0x2f7051[_0x49342c(0x102)],'columns':_0x2f7051[_0x49342c(0x12f)],'status':_0x49342c(0x121)};});return{'checked':_0xeb7513[_0x49236a(0x12e)]>0x0,'joins':_0xeb7513,'warnings':_0x10b078};}function extractJoinFacts(_0x352946){const _0x2c1406=a277_0x4c14,_0x54a0ab=maskNestedQueries(stripSqlNoise(_0x352946)),_0xe5ebe6=maskQuotedIdentifiers(_0x54a0ab),_0x3f7532=[],_0x9ac62a=new Set(),_0x3ada5f=/\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 _0x192fb8 of _0x54a0ab[_0x2c1406(0x13e)](_0x3ada5f)){const _0x1705b3=_0x192fb8[_0x2c1406(0xf9)]??0x0,_0x3e4c22=_0x192fb8[0x0]['search'](/\bJOIN\b/i),_0xaa5fa9=_0x1705b3+Math[_0x2c1406(0x115)](0x0,_0x3e4c22);if(!/^JOIN\b/i[_0x2c1406(0x131)](_0xe5ebe6[_0x2c1406(0xf3)](_0xaa5fa9)))continue;_0x9ac62a['add'](_0xaa5fa9);const _0x15cb31=normalizeIdentifier(_0x192fb8[0x1]||_0x2c1406(0x114)),_0x2a48a2=normalizeIdentifier(_0x192fb8[0x2]??''),_0x5719c9=normalizeIdentifier(_0x192fb8[0x3]||_0x2a48a2[_0x2c1406(0xf5)]('.')['at'](-0x1)||_0x2a48a2),_0x2d1aa9=[],_0x3cb12c=_0x2a48a2===_0x2c1406(0x108);let _0x3984d2=_0x15cb31==='right'||_0x15cb31==='full'||_0x3cb12c,_0x27e704=_0x3984d2?_0x3cb12c?_0x2c1406(0x118):_0x15cb31[_0x2c1406(0x11a)]()+_0x2c1406(0x103):undefined;const _0x198d43=stripOuterParentheses(_0x192fb8[0x4]??''),_0x2f0267=_0x198d43[_0x2c1406(0xf6)](MYBATIS_DYNAMIC_START_MARKER)||_0x198d43[_0x2c1406(0xf6)](MYBATIS_DYNAMIC_END_MARKER),_0x4929fc=_0x198d43[_0x2c1406(0xf6)](MYBATIS_INCLUDE_MARKER);_0x2f0267&&(_0x3984d2=!![],_0x27e704??=_0x2c1406(0x10c));_0x4929fc&&(_0x3984d2=!![],_0x27e704??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0x4de730=_0x198d43[_0x2c1406(0x135)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x2c1406(0x135)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x4de730,'OR')&&(_0x3984d2=!![],_0x27e704??=_0x2c1406(0x10b));for(const _0x4dcdb4 of splitTopLevelAnd(_0x4de730)){const _0x31bd05=stripOuterParentheses(_0x4dcdb4);if(hasTopLevelKeyword(_0x31bd05,'OR')){_0x3984d2=!![],_0x27e704??=_0x2c1406(0x10b);continue;}const _0x1c2ae8=splitEquality(_0x31bd05);if(!_0x1c2ae8){containsColumnReference(_0x4dcdb4,_0x5719c9)&&(_0x3984d2=!![]);continue;}const _0x108984=parseDirectColumnReference(_0x1c2ae8[0x0],_0x5719c9),_0x4c64df=parseDirectColumnReference(_0x1c2ae8[0x1],_0x5719c9),_0x598ccd=containsColumnReference(_0x1c2ae8[0x0],_0x5719c9),_0x3e1a79=containsColumnReference(_0x1c2ae8[0x1],_0x5719c9),_0x131318=_0x108984&&!_0x3e1a79?_0x108984:_0x4c64df&&!_0x598ccd?_0x4c64df:null;if(_0x131318&&!_0x2d1aa9[_0x2c1406(0xf6)](_0x131318))_0x2d1aa9[_0x2c1406(0xf4)](_0x131318);else!_0x131318&&containsColumnReference(_0x4dcdb4,_0x5719c9)&&(_0x3984d2=!![]);}_0x3f7532[_0x2c1406(0xf4)]({'table':_0x2a48a2,'alias':_0x5719c9,'columns':_0x2d1aa9,'unsupportedPredicate':_0x3984d2,'unsupportedReason':_0x27e704,'containsUnresolvedInclude':_0x4929fc,'position':_0xaa5fa9});}for(const _0x1068c4 of _0xe5ebe6[_0x2c1406(0x13e)](/\bJOIN\b/gi)){const _0x2f1cdb=_0x1068c4[_0x2c1406(0xf9)]??0x0;if(_0x9ac62a[_0x2c1406(0x136)](_0x2f1cdb))continue;const _0x1d6ead=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x2c1406(0xf1)](_0x54a0ab[_0x2c1406(0xf3)](_0x2f1cdb+_0x1068c4[0x0][_0x2c1406(0x12e)])),_0x3ae40b=normalizeIdentifier(_0x1d6ead?.[0x1]||_0x2c1406(0x11b)),_0x285157=normalizeIdentifier(_0x1d6ead?.[0x2]||''),_0x5ac1bd=isSqlClauseKeyword(_0x285157)?_0x3ae40b['split']('.')['at'](-0x1)||_0x3ae40b:_0x285157||_0x3ae40b[_0x2c1406(0xf5)]('.')['at'](-0x1)||_0x3ae40b;_0x3f7532[_0x2c1406(0xf4)]({'table':_0x3ae40b,'alias':_0x5ac1bd,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x2c1406(0x120),'position':_0x2f1cdb});}const _0x45db59=_0xe5ebe6[_0x2c1406(0x110)](MYBATIS_INCLUDE_MARKER);return _0x45db59>=0x0&&!_0x3f7532[_0x2c1406(0x113)](_0x33e27f=>_0x33e27f[_0x2c1406(0x119)])&&_0x3f7532['push']({'table':_0x2c1406(0x11b),'alias':_0x2c1406(0x11b),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x2c1406(0x138),'containsUnresolvedInclude':!![],'position':_0x45db59}),_0x3f7532[_0x2c1406(0x10f)]((_0x32c41c,_0x1afff3)=>_0x32c41c[_0x2c1406(0x105)]-_0x1afff3[_0x2c1406(0x105)]);}function stripSqlNoise(_0x2c7172){const _0x191a65=a277_0x4c14,_0x191cb1=Array['from'](_0x2c7172),_0x433212=(_0x1a726f,_0x2507fc)=>{for(let _0x2e1ad4=_0x1a726f;_0x2e1ad4<_0x2507fc;_0x2e1ad4+=0x1){_0x191cb1[_0x2e1ad4]!=='\x0a'&&_0x191cb1[_0x2e1ad4]!=='\x0d'&&(_0x191cb1[_0x2e1ad4]='\x20');}};for(let _0x48d696=0x0;_0x48d696<_0x191cb1[_0x191a65(0x12e)];_0x48d696+=0x1){const _0x4c9f14=_0x191cb1[_0x48d696],_0x141e62=_0x191cb1[_0x48d696+0x1];if(_0x4c9f14==='\x27'||_0x4c9f14==='\x22'||_0x4c9f14==='`'){const _0xdaf49f=_0x4c9f14,_0x480b87=_0x48d696;_0x48d696+=0x1;while(_0x48d696<_0x191cb1[_0x191a65(0x12e)]){if(_0x191cb1[_0x48d696]==='\x5c'&&_0x48d696+0x1<_0x191cb1['length']){_0x48d696+=0x2;continue;}if(_0x191cb1[_0x48d696]!==_0xdaf49f){_0x48d696+=0x1;continue;}if(_0x191cb1[_0x48d696+0x1]===_0xdaf49f){_0x48d696+=0x2;continue;}break;}if(_0xdaf49f==='\x27')_0x433212(_0x480b87,Math[_0x191a65(0x130)](_0x48d696+0x1,_0x191cb1['length']));continue;}if(_0x4c9f14==='-'&&_0x141e62==='-'){const _0x15fb12=_0x48d696;while(_0x48d696<_0x191cb1[_0x191a65(0x12e)]&&_0x191cb1[_0x48d696]!=='\x0a')_0x48d696+=0x1;_0x433212(_0x15fb12,_0x48d696);continue;}if(_0x4c9f14==='/'&&_0x141e62==='*'){const _0xcc9f20=_0x48d696;_0x48d696+=0x2;while(_0x48d696<_0x191cb1[_0x191a65(0x12e)]&&!(_0x191cb1[_0x48d696]==='*'&&_0x191cb1[_0x48d696+0x1]==='/')){_0x48d696+=0x1;}_0x48d696=Math[_0x191a65(0x130)](_0x48d696+0x1,_0x191cb1[_0x191a65(0x12e)]-0x1),_0x433212(_0xcc9f20,_0x48d696+0x1);continue;}if(_0x4c9f14==='#'&&_0x141e62!=='{'){const _0x47615e=_0x48d696;while(_0x48d696<_0x191cb1[_0x191a65(0x12e)]&&_0x191cb1[_0x48d696]!=='\x0a')_0x48d696+=0x1;_0x433212(_0x47615e,_0x48d696);continue;}if((_0x4c9f14==='#'||_0x4c9f14==='$')&&_0x141e62==='{'){const _0xd1144e=_0x48d696;_0x48d696+=0x2;while(_0x48d696<_0x191cb1[_0x191a65(0x12e)]&&_0x191cb1[_0x48d696]!=='}')_0x48d696+=0x1;_0x433212(_0xd1144e,Math[_0x191a65(0x130)](_0x48d696+0x1,_0x191cb1[_0x191a65(0x12e)]));}}return _0x191cb1[_0x191a65(0x112)]('');}function maskQuotedIdentifiers(_0x260016){const _0x2a48f4=a277_0x4c14,_0x5068d4=Array[_0x2a48f4(0x12b)](_0x260016);for(let _0x406b96=0x0;_0x406b96<_0x5068d4[_0x2a48f4(0x12e)];_0x406b96+=0x1){const _0x599f18=_0x5068d4[_0x406b96];if(_0x599f18!=='\x22'&&_0x599f18!=='`')continue;_0x406b96+=0x1;while(_0x406b96<_0x5068d4['length']){if(_0x5068d4[_0x406b96]===_0x599f18){if(_0x5068d4[_0x406b96+0x1]===_0x599f18){_0x5068d4[_0x406b96]='\x20',_0x5068d4[_0x406b96+0x1]='\x20',_0x406b96+=0x2;continue;}break;}_0x5068d4[_0x406b96]='\x20',_0x406b96+=0x1;}}return _0x5068d4[_0x2a48f4(0x112)]('');}function maskNestedQueries(_0x399857){const _0x37f0c8=a277_0x4c14,_0x1ad39b=Array[_0x37f0c8(0x12b)](_0x399857);for(let _0x453da9=0x0;_0x453da9<_0x1ad39b[_0x37f0c8(0x12e)];_0x453da9+=0x1){if(_0x1ad39b[_0x453da9]!=='(')continue;const _0x5160e7=_0x399857[_0x37f0c8(0xf3)](_0x453da9+0x1);if(!/^\s*(?:SELECT|WITH)\b/i['test'](_0x5160e7))continue;let _0x36fe88=0x1,_0x3997ab=_0x453da9+0x1;for(;_0x3997ab<_0x1ad39b['length']&&_0x36fe88>0x0;_0x3997ab+=0x1){if(_0x1ad39b[_0x3997ab]==='(')_0x36fe88+=0x1;if(_0x1ad39b[_0x3997ab]===')')_0x36fe88-=0x1;}if(_0x36fe88!==0x0)continue;for(let _0x57a47d=_0x453da9;_0x57a47d<_0x3997ab;_0x57a47d+=0x1){_0x1ad39b[_0x57a47d]='\x20';}const _0x4815e8=_0x37f0c8(0x108);for(let _0x49aeaf=0x0;_0x49aeaf<_0x4815e8[_0x37f0c8(0x12e)]&&_0x453da9+_0x49aeaf<_0x3997ab;_0x49aeaf+=0x1){_0x1ad39b[_0x453da9+_0x49aeaf]=_0x4815e8[_0x49aeaf];}_0x453da9=_0x3997ab-0x1;}return _0x1ad39b[_0x37f0c8(0x112)]('');}function splitTopLevelAnd(_0x347d47){const _0x2ec11f=a277_0x4c14,_0x21905b=[];let _0x83c4dd=0x0,_0x51e67e=0x0;for(let _0x2b90d3=0x0;_0x2b90d3<_0x347d47[_0x2ec11f(0x12e)];_0x2b90d3+=0x1){const _0x30123b=_0x347d47[_0x2b90d3];if(_0x30123b==='(')_0x83c4dd+=0x1;if(_0x30123b===')')_0x83c4dd=Math[_0x2ec11f(0x115)](0x0,_0x83c4dd-0x1);_0x83c4dd===0x0&&_0x347d47[_0x2ec11f(0xf3)](_0x2b90d3)[_0x2ec11f(0xf0)](/^AND\b/i)&&(_0x2b90d3===0x0||/\s/[_0x2ec11f(0x131)](_0x347d47[_0x2b90d3-0x1]??''))&&(_0x21905b[_0x2ec11f(0xf4)](_0x347d47[_0x2ec11f(0xf3)](_0x51e67e,_0x2b90d3)[_0x2ec11f(0x13d)]()),_0x2b90d3+=0x2,_0x51e67e=_0x2b90d3+0x1);}const _0x571315=_0x347d47['slice'](_0x51e67e)['trim']();if(_0x571315)_0x21905b['push'](_0x571315);return _0x21905b;}function hasTopLevelKeyword(_0x246017,_0x4ad2a5){const _0x2fbee6=a277_0x4c14;let _0x4ed1e2=0x0;for(let _0x34a804=0x0;_0x34a804<_0x246017[_0x2fbee6(0x12e)];_0x34a804+=0x1){const _0x3a3d18=_0x246017[_0x34a804];if(_0x3a3d18==='(')_0x4ed1e2+=0x1;if(_0x3a3d18===')')_0x4ed1e2=Math[_0x2fbee6(0x115)](0x0,_0x4ed1e2-0x1);if(_0x4ed1e2!==0x0)continue;const _0x104d41=_0x246017[_0x2fbee6(0xf3)](_0x34a804,_0x34a804+_0x4ad2a5['length']),_0x58b73b=_0x246017[_0x34a804-0x1]??'\x20',_0xa2a9e3=_0x246017[_0x34a804+_0x4ad2a5[_0x2fbee6(0x12e)]]??'\x20';if(_0x104d41['toUpperCase']()===_0x4ad2a5[_0x2fbee6(0x11a)]()&&!/[\w$]/[_0x2fbee6(0x131)](_0x58b73b)&&!/[\w$]/['test'](_0xa2a9e3))return!![];}return![];}function splitEquality(_0x38aa0c){const _0x427f4e=a277_0x4c14,_0x233bff=stripOuterParentheses(_0x38aa0c);let _0x2fcc08=0x0,_0x562429;for(let _0x175bba=0x0;_0x175bba<_0x233bff[_0x427f4e(0x12e)];_0x175bba+=0x1){const _0x2ea31f=_0x233bff[_0x175bba];if(_0x2ea31f==='(')_0x2fcc08+=0x1;if(_0x2ea31f===')')_0x2fcc08=Math[_0x427f4e(0x115)](0x0,_0x2fcc08-0x1);const _0x40223b=_0x233bff[_0x175bba-0x1]??'',_0x24be4c=_0x233bff[_0x175bba+0x1]??'';if(_0x2ea31f==='='&&_0x2fcc08===0x0&&!/[!<>=:]/[_0x427f4e(0x131)](_0x40223b)&&_0x24be4c!=='='){if(_0x562429!==undefined)return null;_0x562429=_0x175bba;}}return _0x562429===undefined?null:[_0x233bff[_0x427f4e(0xf3)](0x0,_0x562429)[_0x427f4e(0x13d)](),_0x233bff[_0x427f4e(0xf3)](_0x562429+0x1)[_0x427f4e(0x13d)]()];}function parseDirectColumnReference(_0x50dcda,_0x4a446c){const _0x353537=a277_0x4c14,_0x56de10=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x353537(0xf1)](stripOuterParentheses(_0x50dcda));if(!_0x56de10)return null;if(normalizeIdentifier(_0x56de10[0x1]??'')!==normalizeIdentifier(_0x4a446c))return null;return normalizeIdentifier(_0x56de10[0x2]??'');}function containsColumnReference(_0x23e1b6,_0x319e4e){const _0x159be7=a277_0x4c14,_0x332b4c=_0x23e1b6[_0x159be7(0x137)](/[`"]/g,''),_0x3a3c67=_0x319e4e[_0x159be7(0x137)](/[.*+?^${}()|[\]\\]/g,_0x159be7(0x101));return new RegExp(_0x159be7(0x104)+_0x3a3c67+_0x159be7(0x109),'i')[_0x159be7(0x131)](_0x332b4c);}function findEqualityPrefix(_0x19e6e8,_0x442276){const _0xb1f7e3=a277_0x4c14,_0xb0457d=new Set(_0x442276[_0xb1f7e3(0x11e)](normalizeIdentifier)),_0x345030=[];for(const _0x119aed of _0x19e6e8){if(!_0xb0457d[_0xb1f7e3(0x136)](normalizeIdentifier(_0x119aed)))break;_0x345030[_0xb1f7e3(0xf4)](_0x119aed);}return _0x345030;}function resolveTableMetadata(_0x37328f,_0x24e4d2){const _0xef07ca=a277_0x4c14,_0x55bde4=normalizeIdentifier(_0x24e4d2),_0x36a6db=_0x37328f[_0xef07ca(0x125)](_0x6b73f9=>normalizeIdentifier(_0x6b73f9[_0xef07ca(0x129)])===_0x55bde4);if(_0x36a6db[_0xef07ca(0x12e)]===0x1)return _0x36a6db[0x0];const _0x57189c=_0x55bde4[_0xef07ca(0xf6)]('.'),_0xd06536=_0x55bde4[_0xef07ca(0xf5)]('.')['at'](-0x1),_0x2bb7c7=_0x37328f[_0xef07ca(0x125)](_0x1accce=>{const _0x301cfa=_0xef07ca,_0x2066b5=normalizeIdentifier(_0x1accce[_0x301cfa(0x129)]);if(_0x57189c&&_0x2066b5['includes']('.'))return![];return _0x2066b5['split']('.')['at'](-0x1)===_0xd06536;});return _0x2bb7c7[_0xef07ca(0x12e)]===0x1?_0x2bb7c7[0x0]:undefined;}function columnNamesMatch(_0x29ed06,_0x41939b){return normalizeIdentifier(_0x29ed06)===normalizeIdentifier(_0x41939b);}function normalizeIdentifier(_0x4fb553){const _0x54c50a=a277_0x4c14;return _0x4fb553[_0x54c50a(0x137)](/[`"]/g,'')[_0x54c50a(0x13d)]()[_0x54c50a(0xfb)]();}function isSqlClauseKeyword(_0x129aa1){const _0x415438=a277_0x4c14;return new Set(['on',_0x415438(0xf8),_0x415438(0x12a),_0x415438(0x112),_0x415438(0x132),_0x415438(0xf2),'right','full',_0x415438(0x117),_0x415438(0x123)])[_0x415438(0x136)](_0x129aa1);}function a277_0x4c14(_0x18bff5,_0x5c6d41){_0x18bff5=_0x18bff5-0xf0;const _0x248321=a277_0x2483();let _0x4c14a3=_0x248321[_0x18bff5];return _0x4c14a3;}function stripOuterParentheses(_0x39e98a){const _0x4bcd16=a277_0x4c14;let _0x37a99c=_0x39e98a[_0x4bcd16(0x13d)]();while(_0x37a99c[_0x4bcd16(0x107)]('(')&&_0x37a99c[_0x4bcd16(0xff)](')')){let _0x12b388=0x0,_0x5aa64a=!![];for(let _0x129fd1=0x0;_0x129fd1<_0x37a99c['length'];_0x129fd1+=0x1){if(_0x37a99c[_0x129fd1]==='(')_0x12b388+=0x1;if(_0x37a99c[_0x129fd1]===')')_0x12b388-=0x1;if(_0x12b388===0x0&&_0x129fd1<_0x37a99c[_0x4bcd16(0x12e)]-0x1){_0x5aa64a=![];break;}}if(!_0x5aa64a||_0x12b388!==0x0)break;_0x37a99c=_0x37a99c[_0x4bcd16(0xf3)](0x1,-0x1)['trim']();}return _0x37a99c;}
|
|
1
|
+
(function(_0x3aa4a8,_0x396a63){const _0x40abbd=a289_0x4a96,_0x13facb=_0x3aa4a8();while(!![]){try{const _0xc5a451=-parseInt(_0x40abbd(0x17b))/0x1+parseInt(_0x40abbd(0x17a))/0x2*(-parseInt(_0x40abbd(0x14e))/0x3)+parseInt(_0x40abbd(0x15a))/0x4*(parseInt(_0x40abbd(0x15c))/0x5)+-parseInt(_0x40abbd(0x179))/0x6*(parseInt(_0x40abbd(0x165))/0x7)+-parseInt(_0x40abbd(0x150))/0x8*(-parseInt(_0x40abbd(0x169))/0x9)+-parseInt(_0x40abbd(0x178))/0xa*(parseInt(_0x40abbd(0x156))/0xb)+parseInt(_0x40abbd(0x15e))/0xc;if(_0xc5a451===_0x396a63)break;else _0x13facb['push'](_0x13facb['shift']());}catch(_0x4fcef0){_0x13facb['push'](_0x13facb['shift']());}}}(a289_0x5e06,0x1a218));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x475740,_0xeb67c1){const _0x46ef55=a289_0x4a96,_0x27f709=[],_0x51f340=normalizeSqlForStaticAnalysis(_0x475740),_0x140f83=(_0x51f340[_0x46ef55(0x14a)]?[]:extractJoinFacts(_0x51f340[_0x46ef55(0x16f)]))[_0x46ef55(0x15f)](_0x4a4e26=>{const _0x175b2b=_0x46ef55;if(_0x4a4e26['unsupportedPredicate']||_0x4a4e26['columns'][_0x175b2b(0x158)]===0x0)return _0x27f709[_0x175b2b(0x17c)]({'code':_0x175b2b(0x15b),'table':_0x4a4e26[_0x175b2b(0x17d)],'alias':_0x4a4e26[_0x175b2b(0x177)],'columns':_0x4a4e26['columns'],'reason':_0x4a4e26[_0x175b2b(0x16c)]??'Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.'}),{'table':_0x4a4e26[_0x175b2b(0x17d)],'alias':_0x4a4e26[_0x175b2b(0x177)],'columns':_0x4a4e26[_0x175b2b(0x147)],'status':_0x175b2b(0x13c)};const _0x17431a=resolveTableMetadata(_0xeb67c1,_0x4a4e26[_0x175b2b(0x17d)]),_0xf8ebc8=(_0x17431a?.[_0x175b2b(0x164)]??[])[_0x175b2b(0x15f)](_0x4ef24e=>({'index':_0x4ef24e,'matchedPrefix':findEqualityPrefix(_0x4ef24e[_0x175b2b(0x147)],_0x4a4e26[_0x175b2b(0x147)])}))[_0x175b2b(0x182)](_0x531b0a=>_0x531b0a[_0x175b2b(0x159)]['length']>0x0),_0x3b6af5=_0xf8ebc8[_0x175b2b(0x17f)]((_0x14c4a6,_0x81b398)=>!_0x14c4a6||_0x81b398['matchedPrefix']['length']>_0x14c4a6['matchedPrefix'][_0x175b2b(0x158)]?_0x81b398:_0x14c4a6,_0xf8ebc8[0x0]);if(_0x3b6af5)return{'table':_0x4a4e26[_0x175b2b(0x17d)],'alias':_0x4a4e26['alias'],'columns':_0x4a4e26[_0x175b2b(0x147)],'status':_0x175b2b(0x167),'matchedIndex':{..._0x3b6af5[_0x175b2b(0x13a)],'matchedPrefix':_0x3b6af5[_0x175b2b(0x159)]}};const _0xb6d72a=_0x17431a?.[_0x175b2b(0x164)]['filter'](_0x5d1f1e=>_0x5d1f1e[_0x175b2b(0x147)][_0x175b2b(0x13b)](_0x7d17fa=>_0x4a4e26[_0x175b2b(0x147)][_0x175b2b(0x13b)](_0x4eaee5=>columnNamesMatch(_0x7d17fa,_0x4eaee5))))??[];if(_0xb6d72a[_0x175b2b(0x158)]>0x0)return _0x27f709[_0x175b2b(0x17c)]({'code':_0x175b2b(0x163),'table':_0x4a4e26[_0x175b2b(0x17d)],'alias':_0x4a4e26['alias'],'columns':_0x4a4e26[_0x175b2b(0x147)],'reason':_0x175b2b(0x16b)}),{'table':_0x4a4e26['table'],'alias':_0x4a4e26[_0x175b2b(0x177)],'columns':_0x4a4e26[_0x175b2b(0x147)],'status':'warning','candidateIndexes':_0xb6d72a};if(_0x17431a&&_0x17431a['metadataAvailable']!==![]&&_0x17431a[_0x175b2b(0x164)][_0x175b2b(0x158)]>0x0&&_0x4a4e26[_0x175b2b(0x147)][_0x175b2b(0x158)]>0x0)return _0x27f709[_0x175b2b(0x17c)]({'code':_0x175b2b(0x17e),'table':_0x4a4e26['table'],'alias':_0x4a4e26[_0x175b2b(0x177)],'columns':_0x4a4e26[_0x175b2b(0x147)],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x4a4e26['table'],'alias':_0x4a4e26['alias'],'columns':_0x4a4e26['columns'],'status':'warning'};return _0x27f709[_0x175b2b(0x17c)]({'code':_0x175b2b(0x140),'table':_0x4a4e26[_0x175b2b(0x17d)],'alias':_0x4a4e26[_0x175b2b(0x177)],'columns':_0x4a4e26[_0x175b2b(0x147)],'reason':_0x17431a?_0x175b2b(0x180):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x4a4e26['table'],'alias':_0x4a4e26['alias'],'columns':_0x4a4e26[_0x175b2b(0x147)],'status':_0x175b2b(0x13c)};});return{'checked':_0x140f83[_0x46ef55(0x158)]>0x0,'joins':_0x140f83,'warnings':_0x27f709};}function extractJoinFacts(_0x34411b){const _0x1c4c40=a289_0x4a96,_0xd5df95=maskNestedQueries(stripSqlNoise(_0x34411b)),_0x463718=maskQuotedIdentifiers(_0xd5df95),_0xe4bb18=[],_0x388925=new Set(),_0x5146fd=/\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 _0x5d4a71 of _0xd5df95[_0x1c4c40(0x16d)](_0x5146fd)){const _0x14ae02=_0x5d4a71[_0x1c4c40(0x13a)]??0x0,_0x2957bc=_0x5d4a71[0x0][_0x1c4c40(0x152)](/\bJOIN\b/i),_0x50adf1=_0x14ae02+Math[_0x1c4c40(0x161)](0x0,_0x2957bc);if(!/^JOIN\b/i[_0x1c4c40(0x14b)](_0x463718[_0x1c4c40(0x149)](_0x50adf1)))continue;_0x388925['add'](_0x50adf1);const _0x5531cf=normalizeIdentifier(_0x5d4a71[0x1]||_0x1c4c40(0x154)),_0x227703=normalizeIdentifier(_0x5d4a71[0x2]??''),_0xf680b=normalizeIdentifier(_0x5d4a71[0x3]||_0x227703[_0x1c4c40(0x176)]('.')['at'](-0x1)||_0x227703),_0x3ed991=[],_0x1c24e0=_0x227703==='__sq__';let _0x5b02fd=_0x5531cf===_0x1c4c40(0x16e)||_0x5531cf===_0x1c4c40(0x181)||_0x1c24e0,_0x3ff563=_0x5b02fd?_0x1c24e0?'Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.':_0x5531cf[_0x1c4c40(0x13d)]()+_0x1c4c40(0x142):undefined;const _0x48198d=stripOuterParentheses(_0x5d4a71[0x4]??''),_0x4f8241=_0x48198d[_0x1c4c40(0x175)](MYBATIS_DYNAMIC_START_MARKER)||_0x48198d['includes'](MYBATIS_DYNAMIC_END_MARKER),_0x3e943b=_0x48198d['includes'](MYBATIS_INCLUDE_MARKER);_0x4f8241&&(_0x5b02fd=!![],_0x3ff563??=_0x1c4c40(0x146));_0x3e943b&&(_0x5b02fd=!![],_0x3ff563??=_0x1c4c40(0x153));const _0x204f38=_0x48198d[_0x1c4c40(0x141)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x1c4c40(0x141)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x1c4c40(0x141)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x204f38,'OR')&&(_0x5b02fd=!![],_0x3ff563??=_0x1c4c40(0x14c));for(const _0xcaf9d3 of splitTopLevelAnd(_0x204f38)){const _0x4391c7=stripOuterParentheses(_0xcaf9d3);if(hasTopLevelKeyword(_0x4391c7,'OR')){_0x5b02fd=!![],_0x3ff563??=_0x1c4c40(0x14c);continue;}const _0x5132a6=splitEquality(_0x4391c7);if(!_0x5132a6){containsColumnReference(_0xcaf9d3,_0xf680b)&&(_0x5b02fd=!![]);continue;}const _0x212e73=parseDirectColumnReference(_0x5132a6[0x0],_0xf680b),_0x4b6e0b=parseDirectColumnReference(_0x5132a6[0x1],_0xf680b),_0x5a8021=containsColumnReference(_0x5132a6[0x0],_0xf680b),_0xf32bac=containsColumnReference(_0x5132a6[0x1],_0xf680b),_0x4e2ed1=_0x212e73&&!_0xf32bac?_0x212e73:_0x4b6e0b&&!_0x5a8021?_0x4b6e0b:null;if(_0x4e2ed1&&!_0x3ed991['includes'](_0x4e2ed1))_0x3ed991['push'](_0x4e2ed1);else!_0x4e2ed1&&containsColumnReference(_0xcaf9d3,_0xf680b)&&(_0x5b02fd=!![]);}_0xe4bb18[_0x1c4c40(0x17c)]({'table':_0x227703,'alias':_0xf680b,'columns':_0x3ed991,'unsupportedPredicate':_0x5b02fd,'unsupportedReason':_0x3ff563,'containsUnresolvedInclude':_0x3e943b,'position':_0x50adf1});}for(const _0x3550ed of _0x463718[_0x1c4c40(0x16d)](/\bJOIN\b/gi)){const _0xc5a4c7=_0x3550ed[_0x1c4c40(0x13a)]??0x0;if(_0x388925[_0x1c4c40(0x155)](_0xc5a4c7))continue;const _0x3ceb12=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x1c4c40(0x14d)](_0xd5df95[_0x1c4c40(0x149)](_0xc5a4c7+_0x3550ed[0x0][_0x1c4c40(0x158)])),_0x421294=normalizeIdentifier(_0x3ceb12?.[0x1]||_0x1c4c40(0x14f)),_0x4aa13a=normalizeIdentifier(_0x3ceb12?.[0x2]||''),_0x305757=isSqlClauseKeyword(_0x4aa13a)?_0x421294[_0x1c4c40(0x176)]('.')['at'](-0x1)||_0x421294:_0x4aa13a||_0x421294[_0x1c4c40(0x176)]('.')['at'](-0x1)||_0x421294;_0xe4bb18[_0x1c4c40(0x17c)]({'table':_0x421294,'alias':_0x305757,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1c4c40(0x148),'position':_0xc5a4c7});}const _0x21dd93=_0x463718[_0x1c4c40(0x162)](MYBATIS_INCLUDE_MARKER);return _0x21dd93>=0x0&&!_0xe4bb18[_0x1c4c40(0x13b)](_0x1d9695=>_0x1d9695['containsUnresolvedInclude'])&&_0xe4bb18['push']({'table':_0x1c4c40(0x14f),'alias':_0x1c4c40(0x14f),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1c4c40(0x174),'containsUnresolvedInclude':!![],'position':_0x21dd93}),_0xe4bb18[_0x1c4c40(0x144)]((_0x322cd0,_0xf1ea79)=>_0x322cd0['position']-_0xf1ea79[_0x1c4c40(0x143)]);}function stripSqlNoise(_0xb553a2){const _0x505c68=a289_0x4a96,_0xafe797=Array[_0x505c68(0x157)](_0xb553a2),_0x2f0656=(_0x197918,_0x47d2fb)=>{for(let _0x2f83b7=_0x197918;_0x2f83b7<_0x47d2fb;_0x2f83b7+=0x1){_0xafe797[_0x2f83b7]!=='\x0a'&&_0xafe797[_0x2f83b7]!=='\x0d'&&(_0xafe797[_0x2f83b7]='\x20');}};for(let _0x2c1e66=0x0;_0x2c1e66<_0xafe797['length'];_0x2c1e66+=0x1){const _0x267f82=_0xafe797[_0x2c1e66],_0x9f219e=_0xafe797[_0x2c1e66+0x1];if(_0x267f82==='\x27'||_0x267f82==='\x22'||_0x267f82==='`'){const _0xf09dc1=_0x267f82,_0x13503d=_0x2c1e66;_0x2c1e66+=0x1;while(_0x2c1e66<_0xafe797[_0x505c68(0x158)]){if(_0xafe797[_0x2c1e66]==='\x5c'&&_0x2c1e66+0x1<_0xafe797[_0x505c68(0x158)]){_0x2c1e66+=0x2;continue;}if(_0xafe797[_0x2c1e66]!==_0xf09dc1){_0x2c1e66+=0x1;continue;}if(_0xafe797[_0x2c1e66+0x1]===_0xf09dc1){_0x2c1e66+=0x2;continue;}break;}if(_0xf09dc1==='\x27')_0x2f0656(_0x13503d,Math[_0x505c68(0x16a)](_0x2c1e66+0x1,_0xafe797[_0x505c68(0x158)]));continue;}if(_0x267f82==='-'&&_0x9f219e==='-'){const _0x3e72e5=_0x2c1e66;while(_0x2c1e66<_0xafe797[_0x505c68(0x158)]&&_0xafe797[_0x2c1e66]!=='\x0a')_0x2c1e66+=0x1;_0x2f0656(_0x3e72e5,_0x2c1e66);continue;}if(_0x267f82==='/'&&_0x9f219e==='*'){const _0x54a7eb=_0x2c1e66;_0x2c1e66+=0x2;while(_0x2c1e66<_0xafe797[_0x505c68(0x158)]&&!(_0xafe797[_0x2c1e66]==='*'&&_0xafe797[_0x2c1e66+0x1]==='/')){_0x2c1e66+=0x1;}_0x2c1e66=Math[_0x505c68(0x16a)](_0x2c1e66+0x1,_0xafe797[_0x505c68(0x158)]-0x1),_0x2f0656(_0x54a7eb,_0x2c1e66+0x1);continue;}if(_0x267f82==='#'&&_0x9f219e!=='{'){const _0x4d66d2=_0x2c1e66;while(_0x2c1e66<_0xafe797[_0x505c68(0x158)]&&_0xafe797[_0x2c1e66]!=='\x0a')_0x2c1e66+=0x1;_0x2f0656(_0x4d66d2,_0x2c1e66);continue;}if((_0x267f82==='#'||_0x267f82==='$')&&_0x9f219e==='{'){const _0x1520bb=_0x2c1e66;_0x2c1e66+=0x2;while(_0x2c1e66<_0xafe797[_0x505c68(0x158)]&&_0xafe797[_0x2c1e66]!=='}')_0x2c1e66+=0x1;_0x2f0656(_0x1520bb,Math[_0x505c68(0x16a)](_0x2c1e66+0x1,_0xafe797['length']));}}return _0xafe797[_0x505c68(0x139)]('');}function maskQuotedIdentifiers(_0x5ea5de){const _0xde52a7=a289_0x4a96,_0x393ad3=Array[_0xde52a7(0x157)](_0x5ea5de);for(let _0x27f1bf=0x0;_0x27f1bf<_0x393ad3[_0xde52a7(0x158)];_0x27f1bf+=0x1){const _0x32db7a=_0x393ad3[_0x27f1bf];if(_0x32db7a!=='\x22'&&_0x32db7a!=='`')continue;_0x27f1bf+=0x1;while(_0x27f1bf<_0x393ad3['length']){if(_0x393ad3[_0x27f1bf]===_0x32db7a){if(_0x393ad3[_0x27f1bf+0x1]===_0x32db7a){_0x393ad3[_0x27f1bf]='\x20',_0x393ad3[_0x27f1bf+0x1]='\x20',_0x27f1bf+=0x2;continue;}break;}_0x393ad3[_0x27f1bf]='\x20',_0x27f1bf+=0x1;}}return _0x393ad3[_0xde52a7(0x139)]('');}function a289_0x5e06(){const _0x1e1ca5=['unsupportedReason','matchAll','right','sql','startsWith','__sq__','\x5c$&','endsWith','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','includes','split','alias','230xIyoqX','44166BWyTdg','98XlxwXK','111113HpEZrO','push','table','JOIN_INDEX_MISSING','reduce','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','full','filter','toLowerCase','join','index','some','unavailable','toUpperCase','using','trim','INDEX_METADATA_UNAVAILABLE','replaceAll','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','position','sort','left','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','columns','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','slice','error','test','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','exec','93NffxFJ','unknown','8cJjTeq','replace','search','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','INNER','has','49291pAsiPo','from','length','matchedPrefix','1752AWlyFQ','JOIN_PREDICATE_UNSUPPORTED','1135qorCTI','cross','2181636kgGSCr','map','natural','max','indexOf','JOIN_INDEX_NOT_USABLE','indexes','63uzWqNd','match','covered','tableName','969723ocBsCT','min','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'];a289_0x5e06=function(){return _0x1e1ca5;};return a289_0x5e06();}function maskNestedQueries(_0x427b45){const _0x330ee0=a289_0x4a96,_0x5992fe=Array['from'](_0x427b45);for(let _0x134798=0x0;_0x134798<_0x5992fe[_0x330ee0(0x158)];_0x134798+=0x1){if(_0x5992fe[_0x134798]!=='(')continue;const _0x1af577=_0x427b45['slice'](_0x134798+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x330ee0(0x14b)](_0x1af577))continue;let _0x44250a=0x1,_0x116260=_0x134798+0x1;for(;_0x116260<_0x5992fe[_0x330ee0(0x158)]&&_0x44250a>0x0;_0x116260+=0x1){if(_0x5992fe[_0x116260]==='(')_0x44250a+=0x1;if(_0x5992fe[_0x116260]===')')_0x44250a-=0x1;}if(_0x44250a!==0x0)continue;for(let _0x2d44cc=_0x134798;_0x2d44cc<_0x116260;_0x2d44cc+=0x1){_0x5992fe[_0x2d44cc]='\x20';}const _0x2ae69f=_0x330ee0(0x171);for(let _0x564939=0x0;_0x564939<_0x2ae69f[_0x330ee0(0x158)]&&_0x134798+_0x564939<_0x116260;_0x564939+=0x1){_0x5992fe[_0x134798+_0x564939]=_0x2ae69f[_0x564939];}_0x134798=_0x116260-0x1;}return _0x5992fe[_0x330ee0(0x139)]('');}function a289_0x4a96(_0x2dd8dc,_0x32d27b){_0x2dd8dc=_0x2dd8dc-0x139;const _0x5e06c4=a289_0x5e06();let _0x4a96d6=_0x5e06c4[_0x2dd8dc];return _0x4a96d6;}function splitTopLevelAnd(_0x392a64){const _0x472eef=a289_0x4a96,_0x4e2996=[];let _0x41285d=0x0,_0x4171d4=0x0;for(let _0x47686f=0x0;_0x47686f<_0x392a64[_0x472eef(0x158)];_0x47686f+=0x1){const _0x41916a=_0x392a64[_0x47686f];if(_0x41916a==='(')_0x41285d+=0x1;if(_0x41916a===')')_0x41285d=Math[_0x472eef(0x161)](0x0,_0x41285d-0x1);_0x41285d===0x0&&_0x392a64[_0x472eef(0x149)](_0x47686f)[_0x472eef(0x166)](/^AND\b/i)&&(_0x47686f===0x0||/\s/['test'](_0x392a64[_0x47686f-0x1]??''))&&(_0x4e2996[_0x472eef(0x17c)](_0x392a64['slice'](_0x4171d4,_0x47686f)[_0x472eef(0x13f)]()),_0x47686f+=0x2,_0x4171d4=_0x47686f+0x1);}const _0x42ce14=_0x392a64[_0x472eef(0x149)](_0x4171d4)[_0x472eef(0x13f)]();if(_0x42ce14)_0x4e2996[_0x472eef(0x17c)](_0x42ce14);return _0x4e2996;}function hasTopLevelKeyword(_0x4fa334,_0x334dd5){const _0x199e66=a289_0x4a96;let _0x3d7592=0x0;for(let _0x24e08c=0x0;_0x24e08c<_0x4fa334[_0x199e66(0x158)];_0x24e08c+=0x1){const _0x2ff999=_0x4fa334[_0x24e08c];if(_0x2ff999==='(')_0x3d7592+=0x1;if(_0x2ff999===')')_0x3d7592=Math[_0x199e66(0x161)](0x0,_0x3d7592-0x1);if(_0x3d7592!==0x0)continue;const _0x5a3f39=_0x4fa334[_0x199e66(0x149)](_0x24e08c,_0x24e08c+_0x334dd5[_0x199e66(0x158)]),_0x437fc1=_0x4fa334[_0x24e08c-0x1]??'\x20',_0x5912b7=_0x4fa334[_0x24e08c+_0x334dd5[_0x199e66(0x158)]]??'\x20';if(_0x5a3f39[_0x199e66(0x13d)]()===_0x334dd5[_0x199e66(0x13d)]()&&!/[\w$]/[_0x199e66(0x14b)](_0x437fc1)&&!/[\w$]/[_0x199e66(0x14b)](_0x5912b7))return!![];}return![];}function splitEquality(_0x5e9b9d){const _0x8ecc7f=a289_0x4a96,_0x755d4e=stripOuterParentheses(_0x5e9b9d);let _0x3f4e32=0x0,_0x3f0193;for(let _0x30c53b=0x0;_0x30c53b<_0x755d4e['length'];_0x30c53b+=0x1){const _0x48e87b=_0x755d4e[_0x30c53b];if(_0x48e87b==='(')_0x3f4e32+=0x1;if(_0x48e87b===')')_0x3f4e32=Math[_0x8ecc7f(0x161)](0x0,_0x3f4e32-0x1);const _0x198151=_0x755d4e[_0x30c53b-0x1]??'',_0x215c93=_0x755d4e[_0x30c53b+0x1]??'';if(_0x48e87b==='='&&_0x3f4e32===0x0&&!/[!<>=:]/[_0x8ecc7f(0x14b)](_0x198151)&&_0x215c93!=='='){if(_0x3f0193!==undefined)return null;_0x3f0193=_0x30c53b;}}return _0x3f0193===undefined?null:[_0x755d4e[_0x8ecc7f(0x149)](0x0,_0x3f0193)['trim'](),_0x755d4e[_0x8ecc7f(0x149)](_0x3f0193+0x1)[_0x8ecc7f(0x13f)]()];}function parseDirectColumnReference(_0x215844,_0x8f9089){const _0x23365d=a289_0x4a96,_0x416f0d=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x23365d(0x14d)](stripOuterParentheses(_0x215844));if(!_0x416f0d)return null;if(normalizeIdentifier(_0x416f0d[0x1]??'')!==normalizeIdentifier(_0x8f9089))return null;return normalizeIdentifier(_0x416f0d[0x2]??'');}function containsColumnReference(_0x2e4cb0,_0x138848){const _0x2930d2=a289_0x4a96,_0x55a7d3=_0x2e4cb0[_0x2930d2(0x151)](/[`"]/g,''),_0x134ebb=_0x138848[_0x2930d2(0x151)](/[.*+?^${}()|[\]\\]/g,_0x2930d2(0x172));return new RegExp('(?:^|[^\x5cw$])'+_0x134ebb+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x2930d2(0x14b)](_0x55a7d3);}function findEqualityPrefix(_0x347162,_0x4972a){const _0x3eea19=a289_0x4a96,_0xc67516=new Set(_0x4972a[_0x3eea19(0x15f)](normalizeIdentifier)),_0x5ef9c2=[];for(const _0x524de2 of _0x347162){if(!_0xc67516['has'](normalizeIdentifier(_0x524de2)))break;_0x5ef9c2[_0x3eea19(0x17c)](_0x524de2);}return _0x5ef9c2;}function resolveTableMetadata(_0x358ce3,_0x4fb186){const _0x5f2499=a289_0x4a96,_0x628561=normalizeIdentifier(_0x4fb186),_0x5135e7=_0x358ce3[_0x5f2499(0x182)](_0xac1676=>normalizeIdentifier(_0xac1676['tableName'])===_0x628561);if(_0x5135e7[_0x5f2499(0x158)]===0x1)return _0x5135e7[0x0];const _0x127069=_0x628561[_0x5f2499(0x175)]('.'),_0x3e1ac0=_0x628561['split']('.')['at'](-0x1),_0x4244f8=_0x358ce3[_0x5f2499(0x182)](_0x163267=>{const _0x21dd0b=_0x5f2499,_0x2e164c=normalizeIdentifier(_0x163267[_0x21dd0b(0x168)]);if(_0x127069&&_0x2e164c['includes']('.'))return![];return _0x2e164c[_0x21dd0b(0x176)]('.')['at'](-0x1)===_0x3e1ac0;});return _0x4244f8[_0x5f2499(0x158)]===0x1?_0x4244f8[0x0]:undefined;}function columnNamesMatch(_0x1429fb,_0x5426ba){return normalizeIdentifier(_0x1429fb)===normalizeIdentifier(_0x5426ba);}function normalizeIdentifier(_0x3f89d8){const _0x30325f=a289_0x4a96;return _0x3f89d8['replace'](/[`"]/g,'')[_0x30325f(0x13f)]()[_0x30325f(0x183)]();}function isSqlClauseKeyword(_0x882ec0){const _0x50b0cf=a289_0x4a96;return new Set(['on',_0x50b0cf(0x13e),'where',_0x50b0cf(0x139),'inner',_0x50b0cf(0x145),'right',_0x50b0cf(0x181),_0x50b0cf(0x15d),_0x50b0cf(0x160)])[_0x50b0cf(0x155)](_0x882ec0);}function stripOuterParentheses(_0x3694f2){const _0x1e2b1f=a289_0x4a96;let _0x35b801=_0x3694f2[_0x1e2b1f(0x13f)]();while(_0x35b801[_0x1e2b1f(0x170)]('(')&&_0x35b801[_0x1e2b1f(0x173)](')')){let _0x35929e=0x0,_0x5a540d=!![];for(let _0x16bc33=0x0;_0x16bc33<_0x35b801[_0x1e2b1f(0x158)];_0x16bc33+=0x1){if(_0x35b801[_0x16bc33]==='(')_0x35929e+=0x1;if(_0x35b801[_0x16bc33]===')')_0x35929e-=0x1;if(_0x35929e===0x0&&_0x16bc33<_0x35b801[_0x1e2b1f(0x158)]-0x1){_0x5a540d=![];break;}}if(!_0x5a540d||_0x35929e!==0x0)break;_0x35b801=_0x35b801[_0x1e2b1f(0x149)](0x1,-0x1)[_0x1e2b1f(0x13f)]();}return _0x35b801;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a290_0x2c4ce1=a290_0x43c2;function a290_0x43c2(_0xf03ad4,_0x1bf828){_0xf03ad4=_0xf03ad4-0x1cd;const _0x4f980c=a290_0x4f98();let _0x43c267=_0x4f980c[_0xf03ad4];return _0x43c267;}function a290_0x4f98(){const _0x55674c=['1384112ZmyPIW','/sql','82494ePhyry','10jFeXpq','sql.lock.json','332705XnaDYc','1678901cqVTXt','.rabetbase','2rmEdHd','1090884BLXkOR','sql','390NOkwZq','8iinfEj','475377WaDmEc','55WzilMw','551238MJbVsb'];a290_0x4f98=function(){return _0x55674c;};return a290_0x4f98();}(function(_0x4478cf,_0xe95ffa){const _0x5d5052=a290_0x43c2,_0x58e69e=_0x4478cf();while(!![]){try{const _0xa8b009=parseInt(_0x5d5052(0x1d6))/0x1*(-parseInt(_0x5d5052(0x1d9))/0x2)+-parseInt(_0x5d5052(0x1ce))/0x3+parseInt(_0x5d5052(0x1d1))/0x4+parseInt(_0x5d5052(0x1d4))/0x5*(parseInt(_0x5d5052(0x1d0))/0x6)+parseInt(_0x5d5052(0x1d7))/0x7*(parseInt(_0x5d5052(0x1cd))/0x8)+-parseInt(_0x5d5052(0x1d3))/0x9*(-parseInt(_0x5d5052(0x1dc))/0xa)+parseInt(_0x5d5052(0x1cf))/0xb*(-parseInt(_0x5d5052(0x1da))/0xc);if(_0xa8b009===_0xe95ffa)break;else _0x58e69e['push'](_0x58e69e['shift']());}catch(_0x3aaf28){_0x58e69e['push'](_0x58e69e['shift']());}}}(a290_0x4f98,0x2c490));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a290_0x2c4ce1(0x1d8),LOCK_FILE_NAME=a290_0x2c4ce1(0x1d5),TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x24d338,_0x105c79){const _0x58e239=a290_0x2c4ce1,_0x5209ba=resolve(_0x105c79??findProjectRootDirectory()),_0x1750f8=DOT_DIR+_0x58e239(0x1d2),_0x26b8d1=_0x1750f8+'/'+_0x24d338;return{'projectRoot':_0x5209ba,'appCode':_0x24d338,'sqlWorkspaceRoot':_0x1750f8,'sqlRoot':_0x26b8d1,'sqlRootDir':resolve(_0x5209ba,DOT_DIR,_0x58e239(0x1db),_0x24d338),'lockFilePath':resolve(_0x5209ba,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x5209ba,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a291_0x2741(){const _0x3391be=['replace','339163MhCPQO','308872lEpdxf','name','sqlCode','mode','sqlName','test','.xml','142808GMCHXK','push','filter','6671380ZRlkXj','slice','4SrlSGz','split','length','3356751pXhdwA','sql','7ldurra','348PliXBV','16KqtyeL','297HaOZpX','indexOf','sqlRootDir','9810546ozTKww','mybatisXml','.sql','4023865bsOnur'];a291_0x2741=function(){return _0x3391be;};return a291_0x2741();}(function(_0x196d04,_0x5d6c44){const _0x4734c0=a291_0x48e1,_0x2731bc=_0x196d04();while(!![]){try{const _0x430bed=-parseInt(_0x4734c0(0x1fc))/0x1*(-parseInt(_0x4734c0(0x1eb))/0x2)+-parseInt(_0x4734c0(0x1e7))/0x3+-parseInt(_0x4734c0(0x1e4))/0x4*(-parseInt(_0x4734c0(0x1f2))/0x5)+-parseInt(_0x4734c0(0x1ef))/0x6*(-parseInt(_0x4734c0(0x1e9))/0x7)+-parseInt(_0x4734c0(0x1f5))/0x8*(parseInt(_0x4734c0(0x1ec))/0x9)+parseInt(_0x4734c0(0x1ff))/0xa+-parseInt(_0x4734c0(0x1f4))/0xb*(parseInt(_0x4734c0(0x1ea))/0xc);if(_0x430bed===_0x5d6c44)break;else _0x2731bc['push'](_0x2731bc['shift']());}catch(_0x33787e){_0x2731bc['push'](_0x2731bc['shift']());}}}(a291_0x2741,0xeaef7));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x394cee){const _0x3d87af=a291_0x48e1;if(_0x394cee===_0x3d87af(0x1f1))return _0x3d87af(0x1e8);if(_0x394cee===_0x3d87af(0x1fb))return _0x3d87af(0x1f0);return undefined;}async function scanSqlFilesRecursively(_0x7005fd,_0x32ff64){const _0x2a47a9=a291_0x48e1,_0x4ac68d=[];try{const _0xc8acc3=await readdir(_0x7005fd,{'withFileTypes':!![]});for(const _0x877bc4 of _0xc8acc3){const _0x4f98c1=join(_0x7005fd,_0x877bc4['name']);if(_0x877bc4['isDirectory']()){_0x4ac68d[_0x2a47a9(0x1fd)](...await scanSqlFilesRecursively(_0x4f98c1,_0x32ff64));continue;}if(!_0x877bc4['isFile']())continue;const _0x4b59ae=extname(_0x877bc4[_0x2a47a9(0x1f6)])['toLowerCase'](),_0x16d365=extensionToMode(_0x4b59ae);if(!_0x16d365)continue;const _0x103eff=relative(_0x32ff64,_0x4f98c1)[_0x2a47a9(0x1f3)](/\\/g,'/'),_0x5a14ea=_0x103eff[_0x2a47a9(0x1e5)]('/')[_0x2a47a9(0x1fe)](Boolean),_0x205d1f=parseSqlPath(_0x5a14ea,_0x877bc4[_0x2a47a9(0x1f6)],_0x4b59ae);if(!_0x205d1f)continue;_0x4ac68d['push']({'sqlCode':_0x205d1f[_0x2a47a9(0x1f7)],'sqlName':_0x205d1f['sqlName'],'dbDirectory':_0x5a14ea[0x0],'filePath':_0x4f98c1,'relativePath':_0x103eff,'lockKey':_0x205d1f[_0x2a47a9(0x1f7)],'mode':_0x16d365});}}catch(_0x3b0697){if(_0x3b0697['code']!=='ENOENT')throw _0x3b0697;}return _0x4ac68d;}export async function scanLocalSqlQueries(_0x20138d){const _0x1e08a6=a291_0x48e1;return scanSqlFilesRecursively(_0x20138d['sqlRootDir'],_0x20138d[_0x1e08a6(0x1ee)]);}function a291_0x48e1(_0x26adae,_0x190833){_0x26adae=_0x26adae-0x1e4;const _0x27413a=a291_0x2741();let _0x48e10e=_0x27413a[_0x26adae];return _0x48e10e;}export function resolveLocalSqlFilePath(_0x40635e,_0x1e16df,_0x95f609){const _0x4d3a8f=a291_0x48e1,_0x2ca46a=_0x95f609?.['path']||(_0x95f609?.[_0x4d3a8f(0x1f9)]||_0x95f609?.['dbName']?buildSqlRelativePath(_0x1e16df,_0x95f609?.[_0x4d3a8f(0x1f9)],_0x95f609?.['dbName'],_0x95f609?.[_0x4d3a8f(0x1f8)]||_0x4d3a8f(0x1e8),_0x95f609?.['dbId']):buildDefaultSqlFileName(_0x1e16df,_0x95f609?.[_0x4d3a8f(0x1f8)]||_0x4d3a8f(0x1e8)));return join(_0x40635e[_0x4d3a8f(0x1ee)],_0x2ca46a);}export async function directoryExists(_0x3dbe89){try{const _0xe14559=await stat(_0x3dbe89);return _0xe14559['isDirectory']();}catch{return![];}}function parseSqlPath(_0x552af3,_0x25109e,_0x419455){const _0x2308ea=a291_0x48e1,_0x2f7f96=_0x25109e['slice'](0x0,-_0x419455[_0x2308ea(0x1e6)]);if(_0x552af3[_0x2308ea(0x1e6)]<0x2)return null;const _0x3979d1=_0x2f7f96[_0x2308ea(0x1ed)]('_');if(_0x3979d1<=0x0||_0x3979d1>=_0x2f7f96[_0x2308ea(0x1e6)]-0x1)return null;const _0x525d4f=_0x2f7f96[_0x2308ea(0x200)](0x0,_0x3979d1);if(!isLikelySqlCode(_0x525d4f))return null;return{'sqlCode':_0x525d4f,'sqlName':_0x2f7f96['slice'](_0x3979d1+0x1)};}function isLikelySqlCode(_0x37df6c){const _0x2e2187=a291_0x48e1;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x2e2187(0x1fa)](_0x37df6c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e9619,_0x4f499c){const _0x31d767=a292_0x3acb,_0x1ed55f=_0x4e9619();while(!![]){try{const _0x3c140e=parseInt(_0x31d767(0xcf))/0x1*(-parseInt(_0x31d767(0xcb))/0x2)+-parseInt(_0x31d767(0xd7))/0x3*(-parseInt(_0x31d767(0xca))/0x4)+-parseInt(_0x31d767(0xd3))/0x5+-parseInt(_0x31d767(0xd4))/0x6*(parseInt(_0x31d767(0xd1))/0x7)+parseInt(_0x31d767(0xd2))/0x8*(parseInt(_0x31d767(0xc9))/0x9)+parseInt(_0x31d767(0xd0))/0xa*(parseInt(_0x31d767(0xd6))/0xb)+-parseInt(_0x31d767(0xcc))/0xc*(-parseInt(_0x31d767(0xd5))/0xd);if(_0x3c140e===_0x4f499c)break;else _0x1ed55f['push'](_0x1ed55f['shift']());}catch(_0x29d87e){_0x1ed55f['push'](_0x1ed55f['shift']());}}}(a292_0x2f03,0xd99ab));import{readFile}from'node:fs/promises';import a292_0x297d5f from'node:crypto';function a292_0x3acb(_0x413ce5,_0x528250){_0x413ce5=_0x413ce5-0xc9;const _0x2f03c2=a292_0x2f03();let _0x3acba0=_0x2f03c2[_0x413ce5];return _0x3acba0;}function a292_0x2f03(){const _0x5bb5c8=['update','hex','3WuhVbr','2510PUJtlU','21CldWiH','2337872QDfXuF','5650590kyJGtY','415722otEHoc','5660733cIcfWG','6831qEIxkE','3qEZiyJ','md5','54uRuncF','713068byJLBv','195798FRjLGU','12DHrcif'];a292_0x2f03=function(){return _0x5bb5c8;};return a292_0x2f03();}export function computeSqlContentHash(_0x5529e9){const _0x5f3eb4=a292_0x3acb;return a292_0x297d5f['createHash'](_0x5f3eb4(0xd8))[_0x5f3eb4(0xcd)](_0x5529e9)['digest'](_0x5f3eb4(0xce));}export async function computeSqlFileHash(_0x560d28){const _0x12d9b1=await readFile(_0x560d28,'utf8');return computeSqlContentHash(_0x12d9b1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xa252b0,_0x34de8a){const _0x38511c=a293_0x33ff,_0x8b8b86=_0xa252b0();while(!![]){try{const _0x5759a9=-parseInt(_0x38511c(0xb0))/0x1+parseInt(_0x38511c(0xa4))/0x2*(-parseInt(_0x38511c(0xa7))/0x3)+parseInt(_0x38511c(0xb9))/0x4*(parseInt(_0x38511c(0xa5))/0x5)+-parseInt(_0x38511c(0xb6))/0x6*(parseInt(_0x38511c(0xb2))/0x7)+parseInt(_0x38511c(0xb8))/0x8*(parseInt(_0x38511c(0xaa))/0x9)+-parseInt(_0x38511c(0xa8))/0xa+parseInt(_0x38511c(0xaf))/0xb;if(_0x5759a9===_0x34de8a)break;else _0x8b8b86['push'](_0x8b8b86['shift']());}catch(_0x5d41c9){_0x8b8b86['push'](_0x8b8b86['shift']());}}}(a293_0x4017,0x24ed5));import{mkdir,readFile,writeFile}from'node:fs/promises';function a293_0x33ff(_0x52a570,_0x1f4226){_0x52a570=_0x52a570-0xa3;const _0x401788=a293_0x4017();let _0x33ff04=_0x401788[_0x52a570];return _0x33ff04;}import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x48d51e,_0x16c0bc,_0x4369a7,_0x10cc42){const _0x38c386=a293_0x33ff,_0x4f7c34=_0x48d51e??createEmptySqlLock();let _0x1fcc33=_0x4f7c34[_0x38c386(0xb5)][_0x16c0bc];if(!_0x1fcc33)return _0x1fcc33={'sqlRoot':_0x4369a7,'lastSync':'','sqls':{}},_0x4f7c34['apps'][_0x16c0bc]=_0x1fcc33,{'lockData':_0x4f7c34,'appLock':_0x1fcc33};if(!_0x1fcc33['sqlRoot'])_0x1fcc33['sqlRoot']=_0x4369a7;else{if(_0x1fcc33[_0x38c386(0xb7)]!==_0x4369a7)throw new Error(_0x10cc42+_0x38c386(0xad)+_0x4369a7+_0x38c386(0xae)+_0x1fcc33['sqlRoot']+'\x22.\x20'+_0x38c386(0xa9));}return!_0x1fcc33['sqls']&&(_0x1fcc33[_0x38c386(0xa6)]={}),!_0x1fcc33[_0x38c386(0xb3)]&&(_0x1fcc33[_0x38c386(0xb3)]=''),{'lockData':_0x4f7c34,'appLock':_0x1fcc33};}export async function readSqlLockFile(_0x5d43b0){const _0x1dda2e=a293_0x33ff;try{const _0x576632=await readFile(_0x5d43b0,_0x1dda2e(0xac));return JSON[_0x1dda2e(0xa3)](_0x576632);}catch(_0x3a4b01){if(_0x3a4b01[_0x1dda2e(0xab)]==='ENOENT')return null;throw new Error(_0x1dda2e(0xb4)+String(_0x3a4b01));}}function a293_0x4017(){const _0x155b5f=[':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','\x22\x20vs\x20lock\x20\x22','8046577CNUOnB','21914CiktNz','stringify','2023441BrxpkB','lastSync','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','apps','6rhaJDN','sqlRoot','5192hxtifk','727700EIsvEm','parse','286ovNCCO','5KxybjR','sqls','5361ZBpRsV','2664020aRsbQH','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','981RfNhZY','code','utf8'];a293_0x4017=function(){return _0x155b5f;};return a293_0x4017();}export async function writeSqlLockFile(_0xc480e9,_0x4eba5b){const _0x1cf5f5=a293_0x33ff;await mkdir(dirname(_0xc480e9),{'recursive':!![]}),await writeFile(_0xc480e9,JSON[_0x1cf5f5(0xb1)](_0x4eba5b,null,0x2),_0x1cf5f5(0xac));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a295_0x1ef0(_0x4efb85,_0x4a2aca){_0x4efb85=_0x4efb85-0x11f;const _0x4bcfb0=a295_0x4bcf();let _0x1ef0d6=_0x4bcfb0[_0x4efb85];return _0x1ef0d6;}(function(_0x514249,_0x1f3b66){const _0x481c33=a295_0x1ef0,_0x4f215d=_0x514249();while(!![]){try{const _0x3f78e1=parseInt(_0x481c33(0x121))/0x1+-parseInt(_0x481c33(0x124))/0x2*(-parseInt(_0x481c33(0x131))/0x3)+parseInt(_0x481c33(0x12f))/0x4*(-parseInt(_0x481c33(0x128))/0x5)+-parseInt(_0x481c33(0x125))/0x6+parseInt(_0x481c33(0x12b))/0x7*(-parseInt(_0x481c33(0x122))/0x8)+-parseInt(_0x481c33(0x12a))/0x9*(parseInt(_0x481c33(0x129))/0xa)+parseInt(_0x481c33(0x12e))/0xb*(parseInt(_0x481c33(0x130))/0xc);if(_0x3f78e1===_0x1f3b66)break;else _0x4f215d['push'](_0x4f215d['shift']());}catch(_0x315896){_0x4f215d['push'](_0x4f215d['shift']());}}}(a295_0x4bcf,0xcc725));function a295_0x4bcf(){const _0x483628=['3GuwrGE','test','replace','mybatisXml','58664wqmWXn','333208oSFPho','.sql','2503874DbnJop','1318290hSlnTQ','trim','trimStart','2351735GKEywz','10ulZyrD','4437468qPBIyd','224BCyTkq','.xml','sql','473XsLJvf','4uSqech','570072qmAAAV'];a295_0x4bcf=function(){return _0x483628;};return a295_0x4bcf();}export function detectSqlMode(_0xf32be2){const _0x1d1a3f=a295_0x1ef0,_0x693d9c=_0xf32be2[_0x1d1a3f(0x127)]();if(/^<(select|insert|update|delete)\b/i[_0x1d1a3f(0x132)](_0x693d9c))return _0x1d1a3f(0x120);return _0x1d1a3f(0x12d);}export function getSqlFileExtension(_0x4c3411){const _0x575334=a295_0x1ef0;return _0x4c3411===_0x575334(0x120)?_0x575334(0x12c):_0x575334(0x123);}export function buildDefaultSqlFileName(_0x817611,_0x2870c4){return''+_0x817611+getSqlFileExtension(_0x2870c4);}export function sanitizeSqlPathSegment(_0x3a629f,_0x26a0c6){const _0x2a2f7b=a295_0x1ef0,_0x4efdf5=String(_0x3a629f??'')[_0x2a2f7b(0x126)](),_0x43218a=_0x4efdf5[_0x2a2f7b(0x11f)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x2a2f7b(0x11f)](/\s+/g,'-')[_0x2a2f7b(0x11f)](/-+/g,'-')['replace'](/^\.+/,'')[_0x2a2f7b(0x11f)](/\.+$/,'')[_0x2a2f7b(0x11f)](/^-+/,'')[_0x2a2f7b(0x11f)](/-+$/,'');return _0x43218a||_0x26a0c6;}export function buildDbDirectoryName(_0x51d838,_0x460b2e){return sanitizeSqlPathSegment(_0x51d838,_0x460b2e!=null?'db-'+_0x460b2e:'unknown-db');}export function buildSqlRelativePath(_0xf66907,_0x30d777,_0x1a9c93,_0xf4665f,_0x45ab8d){const _0xbe029a=buildDbDirectoryName(_0x1a9c93,_0x45ab8d),_0x5141a5=sanitizeSqlPathSegment(_0xf66907,'unknown-sql'),_0x267518=sanitizeSqlPathSegment(_0x30d777,_0x5141a5);return _0xbe029a+'/'+_0x5141a5+'_'+_0x267518+getSqlFileExtension(_0xf4665f);}
|