@lovrabet/rabetbase-cli 2.3.16-beta.4 → 2.3.16-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.d.ts +9 -0
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.d.ts +2 -0
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +8 -0
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.d.ts +13 -0
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.d.ts +25 -0
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.d.ts +2 -0
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.d.ts +1 -0
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.d.ts +51 -0
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.d.ts +1 -0
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.d.ts +5 -0
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.d.ts +1 -0
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.d.ts +12 -0
- package/lib/cli-flags.js +1 -1
- package/lib/cli.d.ts +2 -0
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.d.ts +2 -0
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.d.ts +2 -0
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.d.ts +2 -0
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.d.ts +2 -0
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.d.ts +18 -0
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.d.ts +5 -0
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.d.ts +10 -0
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.d.ts +2 -0
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.d.ts +11 -0
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.d.ts +46 -0
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.d.ts +2 -0
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.d.ts +2 -0
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.d.ts +2 -0
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.d.ts +2 -0
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.d.ts +2 -0
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.d.ts +105 -0
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.d.ts +2 -0
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.d.ts +4 -0
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.d.ts +2 -0
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.d.ts +2 -0
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.d.ts +5 -0
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.d.ts +2 -0
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.d.ts +2 -0
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.d.ts +2 -0
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.d.ts +2 -0
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.d.ts +8 -0
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.d.ts +2 -0
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.d.ts +2 -0
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.d.ts +2 -0
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.d.ts +2 -0
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.d.ts +17 -0
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.d.ts +17 -0
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.d.ts +11 -0
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.d.ts +12 -0
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.d.ts +26 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.d.ts +6 -0
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.d.ts +13 -0
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.d.ts +5 -0
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.d.ts +5 -0
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.d.ts +5 -0
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.d.ts +5 -0
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.d.ts +16 -0
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.d.ts +7 -0
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.d.ts +7 -0
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.d.ts +8 -0
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.d.ts +33 -0
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.d.ts +18 -0
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.d.ts +11 -0
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.d.ts +2 -0
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.d.ts +2 -0
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.d.ts +26 -0
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.d.ts +27 -0
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.d.ts +3 -0
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.d.ts +2 -0
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.d.ts +2 -0
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.d.ts +2 -0
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.d.ts +2 -0
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.d.ts +2 -0
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.d.ts +2 -0
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.d.ts +128 -0
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.d.ts +2 -0
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.d.ts +53 -0
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.d.ts +17 -0
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.d.ts +2 -0
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.d.ts +30 -0
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.d.ts +2 -0
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.d.ts +2 -0
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.d.ts +2 -0
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.d.ts +2 -0
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.d.ts +2 -0
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.d.ts +2 -0
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.d.ts +2 -0
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.d.ts +2 -0
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.d.ts +5 -0
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.d.ts +2 -0
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.d.ts +15 -0
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.d.ts +2 -0
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.d.ts +2 -0
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.d.ts +2 -0
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.d.ts +2 -0
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.d.ts +2 -0
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.d.ts +11 -0
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.d.ts +2 -0
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.d.ts +23 -0
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.d.ts +2 -0
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.d.ts +32 -0
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.d.ts +2 -0
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.d.ts +2 -0
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.d.ts +2 -0
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.d.ts +2 -0
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.d.ts +2 -0
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.d.ts +33 -0
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.d.ts +2 -0
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.d.ts +5 -0
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.d.ts +2 -0
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.d.ts +2 -0
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.d.ts +3 -0
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.d.ts +2 -0
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.d.ts +2 -0
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.d.ts +2 -0
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.d.ts +17 -0
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.d.ts +2 -0
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.d.ts +2 -0
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.d.ts +2 -0
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.d.ts +2 -0
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.d.ts +27 -0
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.d.ts +51 -0
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.d.ts +12 -0
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.d.ts +12 -0
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.d.ts +10 -0
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.d.ts +12 -0
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.d.ts +28 -0
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.d.ts +69 -0
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.d.ts +17 -0
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.d.ts +7 -0
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/types.d.ts +162 -0
- package/lib/commands/menu/shared/update-core.d.ts +11 -0
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.d.ts +6 -0
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.d.ts +2 -0
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.d.ts +2 -0
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.d.ts +2 -0
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.d.ts +2 -0
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.d.ts +2 -0
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.d.ts +2 -0
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.d.ts +2 -0
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.d.ts +2 -0
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.d.ts +2 -0
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.d.ts +2 -0
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.d.ts +2 -0
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.d.ts +105 -0
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.d.ts +2 -0
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.d.ts +2 -0
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.d.ts +2 -0
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.d.ts +2 -0
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.d.ts +2 -0
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.d.ts +2 -0
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.d.ts +2 -0
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.d.ts +2 -0
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.d.ts +74 -0
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.d.ts +7 -0
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.d.ts +1 -0
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.d.ts +6 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.d.ts +9 -0
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.d.ts +4 -0
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.d.ts +1 -0
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.d.ts +1 -0
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.d.ts +1 -0
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.d.ts +2 -0
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.d.ts +1 -0
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.d.ts +66 -0
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.d.ts +2 -0
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.d.ts +2 -0
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.d.ts +2 -0
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.d.ts +2 -0
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.d.ts +2 -0
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.d.ts +107 -0
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.d.ts +2 -0
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.d.ts +2 -0
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.d.ts +2 -0
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.d.ts +2 -0
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.d.ts +2 -0
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.d.ts +5 -0
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.d.ts +10 -0
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.d.ts +5 -0
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.d.ts +2 -0
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.d.ts +2 -0
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.d.ts +5 -0
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.d.ts +2 -0
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.d.ts +5 -0
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.d.ts +5 -0
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.d.ts +23 -0
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.d.ts +5 -0
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.d.ts +2 -0
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.d.ts +2 -0
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.d.ts +2 -0
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.d.ts +2 -0
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.d.ts +2 -0
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.d.ts +10 -0
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/workspace/add.d.ts +6 -0
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.d.ts +11 -0
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.d.ts +6 -0
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.d.ts +50 -0
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.d.ts +1 -0
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.d.ts +34 -0
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.d.ts +10 -0
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.d.ts +14 -0
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.d.ts +11 -0
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.d.ts +1 -0
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.d.ts +5 -0
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.d.ts +1 -0
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.d.ts +36 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.d.ts +5 -0
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.d.ts +61 -0
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +102 -0
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.d.ts +31 -0
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +1018 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.d.ts +8 -0
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.d.ts +28 -0
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.d.ts +7 -0
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.d.ts +25 -0
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/types.d.ts +92 -0
- package/lib/core/bff/utils.d.ts +25 -0
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.d.ts +43 -0
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.d.ts +6 -0
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.d.ts +4 -0
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.d.ts +8 -0
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/types.d.ts +22 -0
- package/lib/core/sql-index-auditor.d.ts +33 -0
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.d.ts +7 -0
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.d.ts +7 -0
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.d.ts +5 -0
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.d.ts +14 -0
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/types.d.ts +43 -0
- package/lib/core/sql-sync/utils.d.ts +10 -0
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.d.ts +34 -0
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.d.ts +3 -0
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.d.ts +2 -0
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.d.ts +9 -0
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.d.ts +3 -0
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.d.ts +3 -0
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.d.ts +4 -0
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.d.ts +11 -0
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.d.ts +15 -0
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.d.ts +2 -0
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.d.ts +14 -0
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.d.ts +36 -0
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.d.ts +3 -0
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.d.ts +63 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -0
- package/lib/generated/build-info.js +1 -1
- package/lib/help.d.ts +1 -0
- package/lib/help.js +1 -1
- package/lib/runtime/confirmation.d.ts +4 -0
- package/lib/runtime/confirmation.js +1 -0
- package/lib/runtime/event.d.ts +5 -0
- package/lib/runtime/event.js +1 -0
- package/lib/runtime/index.d.ts +7 -0
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/queue.d.ts +5 -0
- package/lib/runtime/queue.js +1 -0
- package/lib/runtime/resolve.d.ts +8 -0
- package/lib/runtime/resolve.js +1 -0
- package/lib/runtime/types.d.ts +50 -0
- package/lib/runtime/types.js +1 -0
- package/lib/skills/main.d.ts +41 -0
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +99 -0
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.d.ts +44 -0
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.d.ts +12 -0
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.d.ts +8 -0
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.d.ts +6 -0
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.d.ts +3 -0
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.d.ts +17 -0
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.d.ts +26 -0
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/types/index.d.ts +93 -0
- package/lib/utils/ai_config.d.ts +47 -0
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.d.ts +1 -0
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.d.ts +42 -0
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.d.ts +23 -0
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.d.ts +37 -0
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.d.ts +9 -0
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.d.ts +42 -0
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.d.ts +1 -0
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.d.ts +30 -0
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.d.ts +25 -0
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.d.ts +80 -0
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.d.ts +30 -0
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.d.ts +7 -0
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.d.ts +62 -0
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.d.ts +15 -0
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.d.ts +21 -0
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.d.ts +38 -0
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.d.ts +1 -0
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.d.ts +55 -0
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.d.ts +10 -0
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.d.ts +1 -0
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.d.ts +1 -0
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.d.ts +6 -0
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +9 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BFF 同步体系 —— 工具函数
|
|
3
|
+
*
|
|
4
|
+
* 纯逻辑工具,不依赖 CLI 交互、cookie、domain 等运行时环境。
|
|
5
|
+
*/
|
|
6
|
+
import type { BffLockEntry, HookLocation } from "../../core/bff/types.js";
|
|
7
|
+
export declare function snakeToCamel(value: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Reverse-lookup a HOOK location from lock entries by remote script ID.
|
|
10
|
+
* Used as fallback when statistics data doesn't cover a given script.
|
|
11
|
+
*/
|
|
12
|
+
export declare function findHookLocationByRemoteId(lockFunctions: Record<string, BffLockEntry>, remoteId?: number): HookLocation | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Extract description from a script's header comment block.
|
|
15
|
+
* Looks for `[脚本描述] xxx` pattern.
|
|
16
|
+
*/
|
|
17
|
+
export declare function extractScriptDescription(scriptContent: string): string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Validate that a string is a legal JavaScript identifier (for function names).
|
|
20
|
+
*/
|
|
21
|
+
export declare function isValidBffFunctionName(functionName: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Normalize HOOK function node to "before" or "after".
|
|
24
|
+
*/
|
|
25
|
+
export declare function normalizeHookFunctionNode(functionNode?: string): "before" | "after" | undefined;
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a214_0x3b2f(_0x208505,_0x4bf67f){_0x208505=_0x208505-0x133;const _0x5f232d=a214_0x5f23();let _0x3b2f15=_0x5f232d[_0x208505];return _0x3b2f15;}(function(_0x43d924,_0x420b0a){const _0x400593=a214_0x3b2f,_0x135323=_0x43d924();while(!![]){try{const _0x1b945e=-parseInt(_0x400593(0x13c))/0x1*(-parseInt(_0x400593(0x13e))/0x2)+parseInt(_0x400593(0x140))/0x3+parseInt(_0x400593(0x148))/0x4+parseInt(_0x400593(0x136))/0x5*(-parseInt(_0x400593(0x139))/0x6)+-parseInt(_0x400593(0x137))/0x7+parseInt(_0x400593(0x143))/0x8*(parseInt(_0x400593(0x146))/0x9)+parseInt(_0x400593(0x13f))/0xa*(-parseInt(_0x400593(0x142))/0xb);if(_0x1b945e===_0x420b0a)break;else _0x135323['push'](_0x135323['shift']());}catch(_0x37af81){_0x135323['push'](_0x135323['shift']());}}}(a214_0x5f23,0x56b63));export function snakeToCamel(_0x65168f){const _0x345990=a214_0x3b2f;return _0x65168f['toLowerCase']()[_0x345990(0x134)](/_([a-z])/g,(_0x3e141b,_0x295a31)=>_0x295a31[_0x345990(0x147)]());}export function findHookLocationByRemoteId(_0x360eb3,_0x36861f){const _0x165ac0=a214_0x3b2f;if(!_0x36861f)return undefined;for(const _0x23bf40 of Object[_0x165ac0(0x138)](_0x360eb3)){if(_0x23bf40[_0x165ac0(0x13a)]===_0x36861f&&_0x23bf40[_0x165ac0(0x145)]&&_0x23bf40[_0x165ac0(0x135)]&&_0x23bf40[_0x165ac0(0x13d)])return{'datasetCode':_0x23bf40[_0x165ac0(0x145)],'operationType':_0x23bf40[_0x165ac0(0x135)],'functionNode':_0x23bf40[_0x165ac0(0x13d)]};}return undefined;}export function extractScriptDescription(_0x565846){const _0x333a4d=a214_0x3b2f,_0x2d786f=_0x565846[_0x333a4d(0x13b)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x2d786f?.[0x1]?.[_0x333a4d(0x141)]()||undefined;}export function isValidBffFunctionName(_0x21917c){return/^[A-Za-z_$][A-Za-z0-9_$]*$/['test'](_0x21917c);}export function normalizeHookFunctionNode(_0x181459){const _0x5d5c6a=a214_0x3b2f;if(!_0x181459)return undefined;const _0x2b0d64=_0x181459[_0x5d5c6a(0x141)]()['toLowerCase']();if(_0x2b0d64===_0x5d5c6a(0x144)||_0x2b0d64===_0x5d5c6a(0x133))return _0x2b0d64;return undefined;}function a214_0x5f23(){const _0x314301=['remoteId','match','5wVBKkn','functionNode','116718CVAMAu','9492130qUUriY','79095xFYYXo','trim','11NBWIIR','5410968KNAydC','before','datasetCode','9cAiWVl','toUpperCase','2735808dqdjwq','after','replace','operationType','1060InMKgp','180481kAJNYD','values','9858gTKIKF'];a214_0x5f23=function(){return _0x314301;};return a214_0x5f23();}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 通用数据库解析层
|
|
3
|
+
*
|
|
4
|
+
* 任何需要 dbId 的命令都通过此模块解析:
|
|
5
|
+
* - 传数字 → 直接当 dbId
|
|
6
|
+
* - 传字符串 → 按 dbName 模糊匹配
|
|
7
|
+
* - 不传 → 返回当前应用所有关联数据库
|
|
8
|
+
*
|
|
9
|
+
* 内部通过 dataset list 构建 dbId ↔ dbName 映射,
|
|
10
|
+
* 同一 appCode 在单次 CLI 调用中只请求一次(进程级缓存)。
|
|
11
|
+
*/
|
|
12
|
+
export interface DbEntry {
|
|
13
|
+
dbId: number;
|
|
14
|
+
dbName: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 获取当前应用的所有数据库连接信息
|
|
18
|
+
*/
|
|
19
|
+
export declare function listDatabases(appCode: string): Promise<DbEntry[]>;
|
|
20
|
+
export interface ResolveResult {
|
|
21
|
+
resolved: DbEntry[];
|
|
22
|
+
/** 解析失败时的错误信息(resolved 为空时存在) */
|
|
23
|
+
error?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 解析 --db 参数:
|
|
27
|
+
* - undefined / "" → 返回全部数据库
|
|
28
|
+
* - 纯数字字符串 → 按 dbId 精确匹配
|
|
29
|
+
* - 其他字符串 → 按 dbName 包含匹配(大小写不敏感)
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveDb(appCode: string, dbFlag?: string): Promise<ResolveResult>;
|
|
32
|
+
/**
|
|
33
|
+
* 解析单个数据库(用于 sql create 等必须指定单库的场景)
|
|
34
|
+
* dbFlag 为空时,若应用只有一个数据库则自动选中
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveOneDb(appCode: string, dbFlag?: string): Promise<{
|
|
37
|
+
db: DbEntry | null;
|
|
38
|
+
error?: string;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* 根据 dbId 查找 dbName(用于输出增强,给纯数字 ID 加上可读名称)
|
|
42
|
+
*/
|
|
43
|
+
export declare function getDbName(appCode: string, dbId: number): Promise<string | undefined>;
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3fd628,_0x2c0ea8){const _0x5ea63b=a215_0x322d,_0x5695a6=_0x3fd628();while(!![]){try{const _0x46ab80=-parseInt(_0x5ea63b(0x1f5))/0x1*(parseInt(_0x5ea63b(0x204))/0x2)+parseInt(_0x5ea63b(0x1f8))/0x3+-parseInt(_0x5ea63b(0x1f2))/0x4+parseInt(_0x5ea63b(0x20c))/0x5+-parseInt(_0x5ea63b(0x205))/0x6+-parseInt(_0x5ea63b(0x200))/0x7+-parseInt(_0x5ea63b(0x201))/0x8*(-parseInt(_0x5ea63b(0x203))/0x9);if(_0x46ab80===_0x2c0ea8)break;else _0x5695a6['push'](_0x5695a6['shift']());}catch(_0x2a9ade){_0x5695a6['push'](_0x5695a6['shift']());}}}(a215_0x286b,0x6c4e5));import{listDatasets}from'../core/api-client.js';const cache=new Map();function a215_0x322d(_0xbdb6c9,_0xf26197){_0xbdb6c9=_0xbdb6c9-0x1f2;const _0x286b56=a215_0x286b();let _0x322d0c=_0x286b56[_0xbdb6c9];return _0x322d0c;}export async function listDatabases(_0x48a73d){const _0x21b602=a215_0x322d;if(cache[_0x21b602(0x208)](_0x48a73d))return cache[_0x21b602(0x202)](_0x48a73d);const _0x4866ce=await listDatasets(_0x48a73d),_0xf83f85=new Map();for(const _0x3d5146 of _0x4866ce){const _0x1342c3=_0x3d5146[_0x21b602(0x1fc)];_0x1342c3?.[_0x21b602(0x1fe)]!=null&&_0xf83f85[_0x21b602(0x1fd)](_0x1342c3[_0x21b602(0x1fe)],_0x1342c3[_0x21b602(0x1f3)]??_0x21b602(0x206)+_0x1342c3[_0x21b602(0x1fe)]);}const _0x3ca932=[..._0xf83f85[_0x21b602(0x209)]()][_0x21b602(0x1ff)](([_0x448dbb,_0x340598])=>({'dbId':_0x448dbb,'dbName':_0x340598}));return cache['set'](_0x48a73d,_0x3ca932),_0x3ca932;}function a215_0x286b(){const _0x26da39=['No\x20database\x20matching\x20\x22','dbtableConfig','set','dbId','map','1430660nqIFAA','279944ndiytb','get','252YnwnQO','8fGHDFp','1385178spUVnZ','db-','filter','has','entries','isNaN','toLowerCase','4034600SNMYuf','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','\x22\x20matches\x20multiple\x20databases:\x20','1418352SEKXIz','dbName','\x22\x20under\x20app\x20\x22','186817kPnVVE','join','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','581988uhkIZJ','length','\x22.\x20Available:\x20'];a215_0x286b=function(){return _0x26da39;};return a215_0x286b();}export async function resolveDb(_0x3c42ca,_0x512d49){const _0x246703=a215_0x322d,_0x1ea2d1=await listDatabases(_0x3c42ca);if(_0x1ea2d1[_0x246703(0x1f9)]===0x0)return{'resolved':[],'error':_0x246703(0x20e)+_0x3c42ca+_0x246703(0x20f)};if(!_0x512d49)return{'resolved':_0x1ea2d1};const _0x5070a4=Number(_0x512d49);if(!Number[_0x246703(0x20a)](_0x5070a4)){const _0x18102d=_0x1ea2d1['find'](_0x1ff6c6=>_0x1ff6c6['dbId']===_0x5070a4);if(_0x18102d)return{'resolved':[_0x18102d]};}const _0x2a13be=_0x512d49['toLowerCase'](),_0x1eb34b=_0x1ea2d1[_0x246703(0x207)](_0x2f7b21=>_0x2f7b21[_0x246703(0x1f3)][_0x246703(0x20b)]()['includes'](_0x2a13be));if(_0x1eb34b[_0x246703(0x1f9)]>0x0)return{'resolved':_0x1eb34b};const _0xecbc7a=_0x1ea2d1['map'](_0x180714=>_0x180714['dbName']+'\x20('+_0x180714['dbId']+')')['join'](',\x20');return{'resolved':[],'error':_0x246703(0x1fb)+_0x512d49+_0x246703(0x1f4)+_0x3c42ca+_0x246703(0x1fa)+_0xecbc7a+_0x246703(0x20d)};}export async function resolveOneDb(_0x1d6a7f,_0x2b9acd){const _0x27bc32=a215_0x322d,{resolved:_0x1ccc98,error:_0x39d85f}=await resolveDb(_0x1d6a7f,_0x2b9acd);if(_0x39d85f)return{'db':null,'error':_0x39d85f};if(_0x1ccc98[_0x27bc32(0x1f9)]===0x1)return{'db':_0x1ccc98[0x0]};if(!_0x2b9acd){const _0x14b0a9=_0x1ccc98[_0x27bc32(0x1ff)](_0x15ec75=>_0x15ec75[_0x27bc32(0x1f3)]+'\x20('+_0x15ec75[_0x27bc32(0x1fe)]+')')[_0x27bc32(0x1f6)](',\x20');return{'db':null,'error':_0x27bc32(0x1f7)+_0x14b0a9};}const _0x16df74=_0x1ccc98['map'](_0x180463=>_0x180463['dbName']+'\x20('+_0x180463[_0x27bc32(0x1fe)]+')')[_0x27bc32(0x1f6)](',\x20');return{'db':null,'error':'\x22'+_0x2b9acd+_0x27bc32(0x210)+_0x16df74+'.\x20Be\x20more\x20specific.'};}export async function getDbName(_0x1a47fe,_0xfc7c46){const _0x35a144=a215_0x322d,_0x10c3e5=await listDatabases(_0x1a47fe);return _0x10c3e5['find'](_0x2dc911=>_0x2dc911[_0x35a144(0x1fe)]===_0xfc7c46)?.[_0x35a144(0x1f3)];}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PageProjectConfig } from "../../core/page/types.js";
|
|
2
|
+
export declare function loadPageProjectConfig(appCode: string, cwd?: string): PageProjectConfig;
|
|
3
|
+
export declare function buildPageFileName(pageId: number, type: string): string;
|
|
4
|
+
export declare function resolvePageFilePath(config: PageProjectConfig, pageId: number, type: string): string;
|
|
5
|
+
export declare function ensureParentDirectory(filePath: string): Promise<void>;
|
|
6
|
+
export declare function fileExists(filePath: string): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a216_0x51d4dc=a216_0x13f1;(function(_0x20fff0,_0x46f1f4){const _0x1bc757=a216_0x13f1,_0x51f68f=_0x20fff0();while(!![]){try{const _0x242079=parseInt(_0x1bc757(0x162))/0x1*(parseInt(_0x1bc757(0x16b))/0x2)+parseInt(_0x1bc757(0x168))/0x3+parseInt(_0x1bc757(0x16a))/0x4*(parseInt(_0x1bc757(0x16f))/0x5)+parseInt(_0x1bc757(0x163))/0x6+parseInt(_0x1bc757(0x166))/0x7*(parseInt(_0x1bc757(0x169))/0x8)+-parseInt(_0x1bc757(0x16c))/0x9*(-parseInt(_0x1bc757(0x15e))/0xa)+parseInt(_0x1bc757(0x15f))/0xb*(-parseInt(_0x1bc757(0x160))/0xc);if(_0x242079===_0x46f1f4)break;else _0x51f68f['push'](_0x51f68f['shift']());}catch(_0x57c1c8){_0x51f68f['push'](_0x51f68f['shift']());}}}(a216_0x3395,0x93a81));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0xc8c978,_0x397218=process[a216_0x51d4dc(0x165)]()){const _0x597f94=a216_0x51d4dc,_0x2b8b7e=resolve(_0x397218),_0x4e0887=join(_0x2b8b7e,_0x597f94(0x16d),_0x597f94(0x161));return{'projectRoot':_0x2b8b7e,'pagesBaseDir':_0x4e0887,'appPagesDir':join(_0x4e0887,_0xc8c978),'lockFilePath':join(_0x2b8b7e,'.rabetbase','page.lock.json')};}function a216_0x13f1(_0x41a3a9,_0x3ee719){_0x41a3a9=_0x41a3a9-0x15e;const _0x3395d7=a216_0x3395();let _0x13f14e=_0x3395d7[_0x41a3a9];return _0x13f14e;}export function buildPageFileName(_0x24275b,_0x1fdc1b){const _0x47abc3=a216_0x51d4dc;return _0x24275b+'-'+String(_0x1fdc1b)['toUpperCase']()+_0x47abc3(0x16e);}export function resolvePageFilePath(_0xa14a41,_0x4736b1,_0x5f29b2){const _0x578396=a216_0x51d4dc;return join(_0xa14a41[_0x578396(0x167)],buildPageFileName(_0x4736b1,_0x5f29b2));}export async function ensureParentDirectory(_0x5227b9){await mkdir(dirname(_0x5227b9),{'recursive':!![]});}function a216_0x3395(){const _0x313df3=['191849RnhXuJ','appPagesDir','2109915BbqVTy','96ozrpZh','406408MXcjjh','10FbzSlG','241308VTwpMq','.rabetbase','.json','10tiCbRu','110vSgtRS','704iZMwrs','370920mIYTNV','page','128665NQrrFo','2456346IPEvfS','F_OK','cwd'];a216_0x3395=function(){return _0x313df3;};return a216_0x3395();}export async function fileExists(_0x56cc82){const _0x847496=a216_0x51d4dc;try{return await access(_0x56cc82,constants[_0x847496(0x164)]),!![];}catch{return![];}}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function serializePageSchemaForFile(schema: string): string;
|
|
2
|
+
export declare function computePageContentHash(content: string): string;
|
|
3
|
+
export declare function computeSerializedSchemaHash(schema: string): string;
|
|
4
|
+
export declare function computePageFileHash(filePath: string): Promise<string>;
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a217_0x4704(_0xefc52f,_0x5c3926){_0xefc52f=_0xefc52f-0xf2;const _0x43d49e=a217_0x43d4();let _0x4704b4=_0x43d49e[_0xefc52f];return _0x4704b4;}(function(_0x188397,_0x5db4d3){const _0x3a0af5=a217_0x4704,_0x109af3=_0x188397();while(!![]){try{const _0x58caa7=parseInt(_0x3a0af5(0xfd))/0x1*(-parseInt(_0x3a0af5(0xf3))/0x2)+parseInt(_0x3a0af5(0xf7))/0x3*(parseInt(_0x3a0af5(0x101))/0x4)+-parseInt(_0x3a0af5(0x100))/0x5+-parseInt(_0x3a0af5(0xfc))/0x6*(parseInt(_0x3a0af5(0xf5))/0x7)+-parseInt(_0x3a0af5(0xf2))/0x8+parseInt(_0x3a0af5(0xf8))/0x9*(-parseInt(_0x3a0af5(0xfa))/0xa)+parseInt(_0x3a0af5(0xfe))/0xb*(parseInt(_0x3a0af5(0xfb))/0xc);if(_0x58caa7===_0x5db4d3)break;else _0x109af3['push'](_0x109af3['shift']());}catch(_0x42a389){_0x109af3['push'](_0x109af3['shift']());}}}(a217_0x43d4,0x38a27));function a217_0x43d4(){const _0x138809=['164129FcCRfD','utf8','183vekilz','9gGfSst','createHash','95590djjKMG','70692MRpaag','102fkriOL','291976jAOqEX','2277VOaVpr','parse','1738200AQJbeW','15116rqKscU','stringify','update','hex','1361656OTixbE','2lqqieH','md5'];a217_0x43d4=function(){return _0x138809;};return a217_0x43d4();}import a217_0x2da018 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x2ed9a2){const _0x4b940e=a217_0x4704;return JSON[_0x4b940e(0x102)](JSON[_0x4b940e(0xff)](_0x2ed9a2),null,0x2)+'\x0a';}export function computePageContentHash(_0x1dd2e6){const _0x4ddf8d=a217_0x4704;return a217_0x2da018[_0x4ddf8d(0xf9)](_0x4ddf8d(0xf4))[_0x4ddf8d(0x103)](_0x1dd2e6)['digest'](_0x4ddf8d(0x104));}export function computeSerializedSchemaHash(_0x160a81){return computePageContentHash(serializePageSchemaForFile(_0x160a81));}export async function computePageFileHash(_0x44c8c5){const _0x323f86=a217_0x4704,_0x4f9c55=await readFile(_0x44c8c5,_0x323f86(0xf6));return computePageContentHash(_0x4f9c55);}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PageLockFile, PageLockScope } from "../../core/page/types.js";
|
|
2
|
+
export declare function createEmptyPageLock(): PageLockFile;
|
|
3
|
+
export declare function ensurePageLockScope(lockData: PageLockFile, appCode: string): {
|
|
4
|
+
lockData: PageLockFile;
|
|
5
|
+
appLock: PageLockScope;
|
|
6
|
+
};
|
|
7
|
+
export declare function readPageLockFile(lockFilePath: string): Promise<PageLockFile | null>;
|
|
8
|
+
export declare function writePageLockFile(lockFilePath: string, lockData: PageLockFile): Promise<void>;
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x32e002,_0x44e809){const _0x3322c6=a218_0x5a1f,_0x532e51=_0x32e002();while(!![]){try{const _0x19c5a1=-parseInt(_0x3322c6(0x1ad))/0x1+-parseInt(_0x3322c6(0x1a0))/0x2+-parseInt(_0x3322c6(0x1ae))/0x3*(parseInt(_0x3322c6(0x19e))/0x4)+parseInt(_0x3322c6(0x1a8))/0x5*(parseInt(_0x3322c6(0x1a5))/0x6)+-parseInt(_0x3322c6(0x1a2))/0x7*(-parseInt(_0x3322c6(0x19f))/0x8)+parseInt(_0x3322c6(0x1a3))/0x9+parseInt(_0x3322c6(0x1ac))/0xa*(-parseInt(_0x3322c6(0x1aa))/0xb);if(_0x19c5a1===_0x44e809)break;else _0x532e51['push'](_0x532e51['shift']());}catch(_0x3d861c){_0x532e51['push'](_0x532e51['shift']());}}}(a218_0x2087,0xaebdf));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a218_0x5a1f(_0x352f20,_0x5c82b1){_0x352f20=_0x352f20-0x19d;const _0x208754=a218_0x2087();let _0x5a1fba=_0x208754[_0x352f20];return _0x5a1fba;}function a218_0x2087(){const _0x1de809=['apps','2226WHXIuf','code','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','18565tGSdKW','pages','568084bPYAHU','parse','10jAlVfq','789730dwMRLU','371502WohMQA','object','utf8','8QNmoBf','1496gtckpy','1862404nbPZbE','lastSync','9100IQWGSx','10038276wayRlN'];a218_0x2087=function(){return _0x1de809;};return a218_0x2087();}export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x43a495,_0xb5399){const _0x3c236d=a218_0x5a1f,_0x3eedb2={'apps':_0x43a495[_0x3c236d(0x1a4)]&&typeof _0x43a495[_0x3c236d(0x1a4)]===_0x3c236d(0x1af)?_0x43a495['apps']:{}};let _0x5434bc=_0x3eedb2[_0x3c236d(0x1a4)][_0xb5399];if(!_0x5434bc)return _0x5434bc={'lastSync':'','pages':{}},_0x3eedb2['apps'][_0xb5399]=_0x5434bc,{'lockData':_0x3eedb2,'appLock':_0x5434bc};return!_0x5434bc['lastSync']&&(_0x5434bc[_0x3c236d(0x1a1)]=''),(!_0x5434bc['pages']||typeof _0x5434bc[_0x3c236d(0x1a9)]!==_0x3c236d(0x1af))&&(_0x5434bc['pages']={}),{'lockData':_0x3eedb2,'appLock':_0x5434bc};}export async function readPageLockFile(_0x375ddb){const _0x590d42=a218_0x5a1f;try{const _0x5b3adf=await readFile(_0x375ddb,_0x590d42(0x19d)),_0x46574d=JSON[_0x590d42(0x1ab)](_0x5b3adf);return{'apps':_0x46574d[_0x590d42(0x1a4)]&&typeof _0x46574d[_0x590d42(0x1a4)]===_0x590d42(0x1af)?_0x46574d['apps']:{}};}catch(_0x214c19){if(_0x214c19[_0x590d42(0x1a6)]==='ENOENT')return null;throw new Error(_0x590d42(0x1a7)+String(_0x214c19));}}export async function writePageLockFile(_0x46dc82,_0x224f2c){const _0x20cbd6=a218_0x5a1f;await mkdir(dirname(_0x46dc82),{'recursive':!![]}),await writeFile(_0x46dc82,JSON['stringify'](_0x224f2c,null,0x2),_0x20cbd6(0x19d));}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface PageProjectConfig {
|
|
2
|
+
projectRoot: string;
|
|
3
|
+
pagesBaseDir: string;
|
|
4
|
+
appPagesDir: string;
|
|
5
|
+
lockFilePath: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PageLockEntry {
|
|
8
|
+
hash: string;
|
|
9
|
+
pageId: number;
|
|
10
|
+
pageVersion?: number | null;
|
|
11
|
+
type: string;
|
|
12
|
+
title: string;
|
|
13
|
+
datasetIds: number[];
|
|
14
|
+
versionTag?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface PageLockScope {
|
|
17
|
+
lastSync: string;
|
|
18
|
+
pages: Record<string, PageLockEntry>;
|
|
19
|
+
}
|
|
20
|
+
export interface PageLockFile {
|
|
21
|
+
apps: Record<string, PageLockScope>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface SqlIndexMetadata {
|
|
2
|
+
name?: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
columns: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface SqlTableIndexMetadata {
|
|
7
|
+
tableName: string;
|
|
8
|
+
indexes: SqlIndexMetadata[];
|
|
9
|
+
metadataAvailable?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface SqlJoinIndexAuditResult {
|
|
12
|
+
checked: boolean;
|
|
13
|
+
joins: SqlJoinIndexCheck[];
|
|
14
|
+
warnings: SqlJoinIndexWarning[];
|
|
15
|
+
}
|
|
16
|
+
export interface SqlJoinIndexCheck {
|
|
17
|
+
table: string;
|
|
18
|
+
alias: string;
|
|
19
|
+
columns: string[];
|
|
20
|
+
status: "covered" | "warning" | "unavailable";
|
|
21
|
+
matchedIndex?: SqlIndexMetadata & {
|
|
22
|
+
matchedPrefix: string[];
|
|
23
|
+
};
|
|
24
|
+
candidateIndexes?: SqlIndexMetadata[];
|
|
25
|
+
}
|
|
26
|
+
export interface SqlJoinIndexWarning {
|
|
27
|
+
code: "JOIN_INDEX_MISSING" | "JOIN_INDEX_NOT_USABLE" | "INDEX_METADATA_UNAVAILABLE" | "JOIN_PREDICATE_UNSUPPORTED";
|
|
28
|
+
table: string;
|
|
29
|
+
alias: string;
|
|
30
|
+
columns: string[];
|
|
31
|
+
reason: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function auditSqlJoinIndexes(sqlContent: string, tables: SqlTableIndexMetadata[]): SqlJoinIndexAuditResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x228adb,_0x50f56f){const _0x46bdfa=a220_0x52c2,_0x5e3cbb=_0x228adb();while(!![]){try{const _0x28f832=parseInt(_0x46bdfa(0x125))/0x1*(-parseInt(_0x46bdfa(0x13b))/0x2)+parseInt(_0x46bdfa(0x13a))/0x3+parseInt(_0x46bdfa(0x131))/0x4*(parseInt(_0x46bdfa(0x137))/0x5)+parseInt(_0x46bdfa(0x140))/0x6*(-parseInt(_0x46bdfa(0x143))/0x7)+-parseInt(_0x46bdfa(0x150))/0x8+parseInt(_0x46bdfa(0x14e))/0x9*(parseInt(_0x46bdfa(0x122))/0xa)+parseInt(_0x46bdfa(0x12f))/0xb*(parseInt(_0x46bdfa(0x112))/0xc);if(_0x28f832===_0x50f56f)break;else _0x5e3cbb['push'](_0x5e3cbb['shift']());}catch(_0x45aeb1){_0x5e3cbb['push'](_0x5e3cbb['shift']());}}}(a220_0x4ac6,0x1b54c));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';function a220_0x52c2(_0x1a3904,_0x44d07b){_0x1a3904=_0x1a3904-0x10b;const _0x4ac666=a220_0x4ac6();let _0x52c20e=_0x4ac666[_0x1a3904];return _0x52c20e;}export function auditSqlJoinIndexes(_0x5f1a0b,_0x1099b7){const _0x5e9a5a=a220_0x52c2,_0x57257b=[],_0x3f829b=normalizeSqlForStaticAnalysis(_0x5f1a0b),_0x4abd59=(_0x3f829b[_0x5e9a5a(0x111)]?[]:extractJoinFacts(_0x3f829b['sql']))[_0x5e9a5a(0x124)](_0x340a17=>{const _0x55c122=_0x5e9a5a;if(_0x340a17[_0x55c122(0x146)]||_0x340a17['columns']['length']===0x0)return _0x57257b[_0x55c122(0x13f)]({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0x340a17[_0x55c122(0x148)],'alias':_0x340a17[_0x55c122(0x115)],'columns':_0x340a17[_0x55c122(0x130)],'reason':_0x340a17[_0x55c122(0x132)]??_0x55c122(0x14a)}),{'table':_0x340a17['table'],'alias':_0x340a17[_0x55c122(0x115)],'columns':_0x340a17[_0x55c122(0x130)],'status':'unavailable'};const _0x2d3e0f=resolveTableMetadata(_0x1099b7,_0x340a17[_0x55c122(0x148)]),_0x29de15=(_0x2d3e0f?.[_0x55c122(0x11d)]??[])[_0x55c122(0x124)](_0x1160ac=>({'index':_0x1160ac,'matchedPrefix':findEqualityPrefix(_0x1160ac[_0x55c122(0x130)],_0x340a17[_0x55c122(0x130)])}))['filter'](_0x8063bc=>_0x8063bc['matchedPrefix'][_0x55c122(0x121)]>0x0),_0x512d7e=_0x29de15['reduce']((_0x4264d3,_0x20cca6)=>!_0x4264d3||_0x20cca6[_0x55c122(0x10f)]['length']>_0x4264d3[_0x55c122(0x10f)][_0x55c122(0x121)]?_0x20cca6:_0x4264d3,_0x29de15[0x0]);if(_0x512d7e)return{'table':_0x340a17[_0x55c122(0x148)],'alias':_0x340a17['alias'],'columns':_0x340a17[_0x55c122(0x130)],'status':_0x55c122(0x11c),'matchedIndex':{..._0x512d7e[_0x55c122(0x158)],'matchedPrefix':_0x512d7e['matchedPrefix']}};const _0x2a47be=_0x2d3e0f?.['indexes'][_0x55c122(0x10e)](_0x43758d=>_0x43758d[_0x55c122(0x130)][_0x55c122(0x12e)](_0x2848e0=>_0x340a17[_0x55c122(0x130)][_0x55c122(0x12e)](_0x12838d=>columnNamesMatch(_0x2848e0,_0x12838d))))??[];if(_0x2a47be[_0x55c122(0x121)]>0x0)return _0x57257b['push']({'code':_0x55c122(0x156),'table':_0x340a17[_0x55c122(0x148)],'alias':_0x340a17[_0x55c122(0x115)],'columns':_0x340a17[_0x55c122(0x130)],'reason':_0x55c122(0x157)}),{'table':_0x340a17[_0x55c122(0x148)],'alias':_0x340a17[_0x55c122(0x115)],'columns':_0x340a17['columns'],'status':'warning','candidateIndexes':_0x2a47be};if(_0x2d3e0f&&_0x2d3e0f[_0x55c122(0x151)]!==![]&&_0x2d3e0f[_0x55c122(0x11d)][_0x55c122(0x121)]>0x0&&_0x340a17[_0x55c122(0x130)][_0x55c122(0x121)]>0x0)return _0x57257b[_0x55c122(0x13f)]({'code':'JOIN_INDEX_MISSING','table':_0x340a17[_0x55c122(0x148)],'alias':_0x340a17[_0x55c122(0x115)],'columns':_0x340a17[_0x55c122(0x130)],'reason':_0x55c122(0x10c)}),{'table':_0x340a17['table'],'alias':_0x340a17[_0x55c122(0x115)],'columns':_0x340a17['columns'],'status':_0x55c122(0x128)};return _0x57257b[_0x55c122(0x13f)]({'code':_0x55c122(0x110),'table':_0x340a17[_0x55c122(0x148)],'alias':_0x340a17[_0x55c122(0x115)],'columns':_0x340a17[_0x55c122(0x130)],'reason':_0x2d3e0f?_0x55c122(0x12b):_0x55c122(0x144)}),{'table':_0x340a17[_0x55c122(0x148)],'alias':_0x340a17[_0x55c122(0x115)],'columns':_0x340a17[_0x55c122(0x130)],'status':_0x55c122(0x12d)};});return{'checked':_0x4abd59[_0x5e9a5a(0x121)]>0x0,'joins':_0x4abd59,'warnings':_0x57257b};}function extractJoinFacts(_0x4f85af){const _0x3f8d2c=a220_0x52c2,_0x3ed830=maskNestedQueries(stripSqlNoise(_0x4f85af)),_0x3cda9b=maskQuotedIdentifiers(_0x3ed830),_0x3dd374=[],_0x4e53bf=new Set(),_0x3ab670=/\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 _0x4e53c0 of _0x3ed830[_0x3f8d2c(0x11e)](_0x3ab670)){const _0x324929=_0x4e53c0[_0x3f8d2c(0x158)]??0x0,_0x26da17=_0x4e53c0[0x0][_0x3f8d2c(0x126)](/\bJOIN\b/i),_0x4f9a58=_0x324929+Math[_0x3f8d2c(0x114)](0x0,_0x26da17);if(!/^JOIN\b/i[_0x3f8d2c(0x12c)](_0x3cda9b[_0x3f8d2c(0x147)](_0x4f9a58)))continue;_0x4e53bf[_0x3f8d2c(0x129)](_0x4f9a58);const _0x58c5aa=normalizeIdentifier(_0x4e53c0[0x1]||'INNER'),_0x381b4e=normalizeIdentifier(_0x4e53c0[0x2]??''),_0x25b70b=normalizeIdentifier(_0x4e53c0[0x3]||_0x381b4e[_0x3f8d2c(0x10b)]('.')['at'](-0x1)||_0x381b4e),_0x3cd42d=[],_0x536d02=_0x381b4e===_0x3f8d2c(0x14c);let _0x17797b=_0x58c5aa===_0x3f8d2c(0x152)||_0x58c5aa===_0x3f8d2c(0x13c)||_0x536d02,_0x6a0c78=_0x17797b?_0x536d02?_0x3f8d2c(0x136):_0x58c5aa[_0x3f8d2c(0x14b)]()+_0x3f8d2c(0x10d):undefined;const _0x41cf1f=stripOuterParentheses(_0x4e53c0[0x4]??''),_0x1ebd46=_0x41cf1f[_0x3f8d2c(0x127)](MYBATIS_DYNAMIC_START_MARKER)||_0x41cf1f[_0x3f8d2c(0x127)](MYBATIS_DYNAMIC_END_MARKER),_0x5b5fc3=_0x41cf1f[_0x3f8d2c(0x127)](MYBATIS_INCLUDE_MARKER);_0x1ebd46&&(_0x17797b=!![],_0x6a0c78??=_0x3f8d2c(0x12a));_0x5b5fc3&&(_0x17797b=!![],_0x6a0c78??=_0x3f8d2c(0x116));const _0x24b689=_0x41cf1f[_0x3f8d2c(0x11f)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x3f8d2c(0x11f)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x24b689,'OR')&&(_0x17797b=!![],_0x6a0c78??=_0x3f8d2c(0x142));for(const _0x1827c8 of splitTopLevelAnd(_0x24b689)){const _0x6d6038=stripOuterParentheses(_0x1827c8);if(hasTopLevelKeyword(_0x6d6038,'OR')){_0x17797b=!![],_0x6a0c78??=_0x3f8d2c(0x142);continue;}const _0x101eeb=splitEquality(_0x6d6038);if(!_0x101eeb){containsColumnReference(_0x1827c8,_0x25b70b)&&(_0x17797b=!![]);continue;}const _0x5eaf1a=parseDirectColumnReference(_0x101eeb[0x0],_0x25b70b),_0x59c885=parseDirectColumnReference(_0x101eeb[0x1],_0x25b70b),_0x357e7c=containsColumnReference(_0x101eeb[0x0],_0x25b70b),_0x372043=containsColumnReference(_0x101eeb[0x1],_0x25b70b),_0x11438c=_0x5eaf1a&&!_0x372043?_0x5eaf1a:_0x59c885&&!_0x357e7c?_0x59c885:null;if(_0x11438c&&!_0x3cd42d[_0x3f8d2c(0x127)](_0x11438c))_0x3cd42d[_0x3f8d2c(0x13f)](_0x11438c);else!_0x11438c&&containsColumnReference(_0x1827c8,_0x25b70b)&&(_0x17797b=!![]);}_0x3dd374['push']({'table':_0x381b4e,'alias':_0x25b70b,'columns':_0x3cd42d,'unsupportedPredicate':_0x17797b,'unsupportedReason':_0x6a0c78,'containsUnresolvedInclude':_0x5b5fc3,'position':_0x4f9a58});}for(const _0x39fd38 of _0x3cda9b[_0x3f8d2c(0x11e)](/\bJOIN\b/gi)){const _0x11f407=_0x39fd38[_0x3f8d2c(0x158)]??0x0;if(_0x4e53bf[_0x3f8d2c(0x13e)](_0x11f407))continue;const _0x4e5a7e=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x3f8d2c(0x135)](_0x3ed830[_0x3f8d2c(0x147)](_0x11f407+_0x39fd38[0x0]['length'])),_0x112e73=normalizeIdentifier(_0x4e5a7e?.[0x1]||_0x3f8d2c(0x13d)),_0x388050=normalizeIdentifier(_0x4e5a7e?.[0x2]||''),_0x57e8b2=isSqlClauseKeyword(_0x388050)?_0x112e73[_0x3f8d2c(0x10b)]('.')['at'](-0x1)||_0x112e73:_0x388050||_0x112e73[_0x3f8d2c(0x10b)]('.')['at'](-0x1)||_0x112e73;_0x3dd374[_0x3f8d2c(0x13f)]({'table':_0x112e73,'alias':_0x57e8b2,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x3f8d2c(0x113),'position':_0x11f407});}const _0x8e57ea=_0x3cda9b[_0x3f8d2c(0x11b)](MYBATIS_INCLUDE_MARKER);return _0x8e57ea>=0x0&&!_0x3dd374[_0x3f8d2c(0x12e)](_0x3ca87a=>_0x3ca87a[_0x3f8d2c(0x120)])&&_0x3dd374[_0x3f8d2c(0x13f)]({'table':_0x3f8d2c(0x13d),'alias':_0x3f8d2c(0x13d),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x3f8d2c(0x154),'containsUnresolvedInclude':!![],'position':_0x8e57ea}),_0x3dd374['sort']((_0x34136e,_0x47fc99)=>_0x34136e[_0x3f8d2c(0x14d)]-_0x47fc99[_0x3f8d2c(0x14d)]);}function stripSqlNoise(_0x31bf7e){const _0x3813e3=a220_0x52c2,_0x4d28c1=Array[_0x3813e3(0x155)](_0x31bf7e),_0x3b9df9=(_0x34dd19,_0xddf98d)=>{for(let _0x46fcc4=_0x34dd19;_0x46fcc4<_0xddf98d;_0x46fcc4+=0x1){_0x4d28c1[_0x46fcc4]!=='\x0a'&&_0x4d28c1[_0x46fcc4]!=='\x0d'&&(_0x4d28c1[_0x46fcc4]='\x20');}};for(let _0x274648=0x0;_0x274648<_0x4d28c1[_0x3813e3(0x121)];_0x274648+=0x1){const _0x54807a=_0x4d28c1[_0x274648],_0x505bd6=_0x4d28c1[_0x274648+0x1];if(_0x54807a==='\x27'||_0x54807a==='\x22'||_0x54807a==='`'){const _0x37993e=_0x54807a,_0x4309d6=_0x274648;_0x274648+=0x1;while(_0x274648<_0x4d28c1[_0x3813e3(0x121)]){if(_0x4d28c1[_0x274648]==='\x5c'&&_0x274648+0x1<_0x4d28c1['length']){_0x274648+=0x2;continue;}if(_0x4d28c1[_0x274648]!==_0x37993e){_0x274648+=0x1;continue;}if(_0x4d28c1[_0x274648+0x1]===_0x37993e){_0x274648+=0x2;continue;}break;}if(_0x37993e==='\x27')_0x3b9df9(_0x4309d6,Math[_0x3813e3(0x134)](_0x274648+0x1,_0x4d28c1[_0x3813e3(0x121)]));continue;}if(_0x54807a==='-'&&_0x505bd6==='-'){const _0xbe3e6d=_0x274648;while(_0x274648<_0x4d28c1[_0x3813e3(0x121)]&&_0x4d28c1[_0x274648]!=='\x0a')_0x274648+=0x1;_0x3b9df9(_0xbe3e6d,_0x274648);continue;}if(_0x54807a==='/'&&_0x505bd6==='*'){const _0x47c0dc=_0x274648;_0x274648+=0x2;while(_0x274648<_0x4d28c1[_0x3813e3(0x121)]&&!(_0x4d28c1[_0x274648]==='*'&&_0x4d28c1[_0x274648+0x1]==='/')){_0x274648+=0x1;}_0x274648=Math[_0x3813e3(0x134)](_0x274648+0x1,_0x4d28c1[_0x3813e3(0x121)]-0x1),_0x3b9df9(_0x47c0dc,_0x274648+0x1);continue;}if(_0x54807a==='#'&&_0x505bd6!=='{'){const _0x126b18=_0x274648;while(_0x274648<_0x4d28c1[_0x3813e3(0x121)]&&_0x4d28c1[_0x274648]!=='\x0a')_0x274648+=0x1;_0x3b9df9(_0x126b18,_0x274648);continue;}if((_0x54807a==='#'||_0x54807a==='$')&&_0x505bd6==='{'){const _0x11f274=_0x274648;_0x274648+=0x2;while(_0x274648<_0x4d28c1[_0x3813e3(0x121)]&&_0x4d28c1[_0x274648]!=='}')_0x274648+=0x1;_0x3b9df9(_0x11f274,Math[_0x3813e3(0x134)](_0x274648+0x1,_0x4d28c1[_0x3813e3(0x121)]));}}return _0x4d28c1[_0x3813e3(0x153)]('');}function maskQuotedIdentifiers(_0x17a470){const _0x41de95=a220_0x52c2,_0x2a05b6=Array[_0x41de95(0x155)](_0x17a470);for(let _0x385d30=0x0;_0x385d30<_0x2a05b6[_0x41de95(0x121)];_0x385d30+=0x1){const _0x49c143=_0x2a05b6[_0x385d30];if(_0x49c143!=='\x22'&&_0x49c143!=='`')continue;_0x385d30+=0x1;while(_0x385d30<_0x2a05b6[_0x41de95(0x121)]){if(_0x2a05b6[_0x385d30]===_0x49c143){if(_0x2a05b6[_0x385d30+0x1]===_0x49c143){_0x2a05b6[_0x385d30]='\x20',_0x2a05b6[_0x385d30+0x1]='\x20',_0x385d30+=0x2;continue;}break;}_0x2a05b6[_0x385d30]='\x20',_0x385d30+=0x1;}}return _0x2a05b6['join']('');}function maskNestedQueries(_0x202657){const _0x3dbcaa=a220_0x52c2,_0x4b89ef=Array[_0x3dbcaa(0x155)](_0x202657);for(let _0x14acbe=0x0;_0x14acbe<_0x4b89ef[_0x3dbcaa(0x121)];_0x14acbe+=0x1){if(_0x4b89ef[_0x14acbe]!=='(')continue;const _0x490212=_0x202657[_0x3dbcaa(0x147)](_0x14acbe+0x1);if(!/^\s*(?:SELECT|WITH)\b/i['test'](_0x490212))continue;let _0x1b5f5e=0x1,_0x19cbbd=_0x14acbe+0x1;for(;_0x19cbbd<_0x4b89ef[_0x3dbcaa(0x121)]&&_0x1b5f5e>0x0;_0x19cbbd+=0x1){if(_0x4b89ef[_0x19cbbd]==='(')_0x1b5f5e+=0x1;if(_0x4b89ef[_0x19cbbd]===')')_0x1b5f5e-=0x1;}if(_0x1b5f5e!==0x0)continue;for(let _0x318ec8=_0x14acbe;_0x318ec8<_0x19cbbd;_0x318ec8+=0x1){_0x4b89ef[_0x318ec8]='\x20';}const _0x4bc7ff=_0x3dbcaa(0x14c);for(let _0x22f226=0x0;_0x22f226<_0x4bc7ff['length']&&_0x14acbe+_0x22f226<_0x19cbbd;_0x22f226+=0x1){_0x4b89ef[_0x14acbe+_0x22f226]=_0x4bc7ff[_0x22f226];}_0x14acbe=_0x19cbbd-0x1;}return _0x4b89ef[_0x3dbcaa(0x153)]('');}function splitTopLevelAnd(_0x1de89a){const _0x28620e=a220_0x52c2,_0x5e3818=[];let _0x2c4047=0x0,_0x1ac4b7=0x0;for(let _0x391cf2=0x0;_0x391cf2<_0x1de89a[_0x28620e(0x121)];_0x391cf2+=0x1){const _0x5036be=_0x1de89a[_0x391cf2];if(_0x5036be==='(')_0x2c4047+=0x1;if(_0x5036be===')')_0x2c4047=Math['max'](0x0,_0x2c4047-0x1);_0x2c4047===0x0&&_0x1de89a[_0x28620e(0x147)](_0x391cf2)[_0x28620e(0x123)](/^AND\b/i)&&(_0x391cf2===0x0||/\s/['test'](_0x1de89a[_0x391cf2-0x1]??''))&&(_0x5e3818[_0x28620e(0x13f)](_0x1de89a[_0x28620e(0x147)](_0x1ac4b7,_0x391cf2)['trim']()),_0x391cf2+=0x2,_0x1ac4b7=_0x391cf2+0x1);}const _0x149bb5=_0x1de89a['slice'](_0x1ac4b7)[_0x28620e(0x14f)]();if(_0x149bb5)_0x5e3818[_0x28620e(0x13f)](_0x149bb5);return _0x5e3818;}function a220_0x4ac6(){const _0x4a06b9=['inner','(?:^|[^\x5cw$])','toLowerCase','indexOf','covered','indexes','matchAll','replaceAll','containsUnresolvedInclude','length','336910zTYAEl','match','map','34660DuHJKS','search','includes','warning','add','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','test','unavailable','some','16753hOytva','columns','37028vohnEK','unsupportedReason','replace','min','exec','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','35tEfVWj','using','\x5c$&','445029xKbaHu','4llsvMn','full','unknown','has','push','157506hPjWeC','left','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','42HuVMmD','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','\x5cs*\x5c.\x5cs*[\x5cw$]+','unsupportedPredicate','slice','table','startsWith','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','toUpperCase','__sq__','position','27FqJGgd','trim','1582392sFmyLS','metadataAvailable','right','join','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','from','JOIN_INDEX_NOT_USABLE','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','index','split','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','filter','matchedPrefix','INDEX_METADATA_UNAVAILABLE','error','1752MfKZrj','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','max','alias','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','tableName'];a220_0x4ac6=function(){return _0x4a06b9;};return a220_0x4ac6();}function hasTopLevelKeyword(_0x3abd06,_0x2c6de9){const _0x15aa48=a220_0x52c2;let _0x4d2fea=0x0;for(let _0x2a8a59=0x0;_0x2a8a59<_0x3abd06[_0x15aa48(0x121)];_0x2a8a59+=0x1){const _0x68d13f=_0x3abd06[_0x2a8a59];if(_0x68d13f==='(')_0x4d2fea+=0x1;if(_0x68d13f===')')_0x4d2fea=Math['max'](0x0,_0x4d2fea-0x1);if(_0x4d2fea!==0x0)continue;const _0x26ff49=_0x3abd06[_0x15aa48(0x147)](_0x2a8a59,_0x2a8a59+_0x2c6de9['length']),_0x1420ab=_0x3abd06[_0x2a8a59-0x1]??'\x20',_0x41c047=_0x3abd06[_0x2a8a59+_0x2c6de9[_0x15aa48(0x121)]]??'\x20';if(_0x26ff49['toUpperCase']()===_0x2c6de9[_0x15aa48(0x14b)]()&&!/[\w$]/['test'](_0x1420ab)&&!/[\w$]/[_0x15aa48(0x12c)](_0x41c047))return!![];}return![];}function splitEquality(_0x499476){const _0x1fbae7=a220_0x52c2,_0x357f8a=stripOuterParentheses(_0x499476);let _0x547c0e=0x0,_0x564842;for(let _0x360b63=0x0;_0x360b63<_0x357f8a[_0x1fbae7(0x121)];_0x360b63+=0x1){const _0x104ce5=_0x357f8a[_0x360b63];if(_0x104ce5==='(')_0x547c0e+=0x1;if(_0x104ce5===')')_0x547c0e=Math[_0x1fbae7(0x114)](0x0,_0x547c0e-0x1);const _0x1021f4=_0x357f8a[_0x360b63-0x1]??'',_0x590ab1=_0x357f8a[_0x360b63+0x1]??'';if(_0x104ce5==='='&&_0x547c0e===0x0&&!/[!<>=:]/[_0x1fbae7(0x12c)](_0x1021f4)&&_0x590ab1!=='='){if(_0x564842!==undefined)return null;_0x564842=_0x360b63;}}return _0x564842===undefined?null:[_0x357f8a[_0x1fbae7(0x147)](0x0,_0x564842)[_0x1fbae7(0x14f)](),_0x357f8a[_0x1fbae7(0x147)](_0x564842+0x1)[_0x1fbae7(0x14f)]()];}function parseDirectColumnReference(_0x136c16,_0x4461ad){const _0x4eb414=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/['exec'](stripOuterParentheses(_0x136c16));if(!_0x4eb414)return null;if(normalizeIdentifier(_0x4eb414[0x1]??'')!==normalizeIdentifier(_0x4461ad))return null;return normalizeIdentifier(_0x4eb414[0x2]??'');}function containsColumnReference(_0x1e5156,_0x3b3914){const _0x641aa4=a220_0x52c2,_0x5a5b6e=_0x1e5156[_0x641aa4(0x133)](/[`"]/g,''),_0x4f48e2=_0x3b3914[_0x641aa4(0x133)](/[.*+?^${}()|[\]\\]/g,_0x641aa4(0x139));return new RegExp(_0x641aa4(0x119)+_0x4f48e2+_0x641aa4(0x145),'i')[_0x641aa4(0x12c)](_0x5a5b6e);}function findEqualityPrefix(_0x8ebe07,_0x499e3b){const _0xa0b2c9=a220_0x52c2,_0x20a580=new Set(_0x499e3b['map'](normalizeIdentifier)),_0x54eb72=[];for(const _0x56abf5 of _0x8ebe07){if(!_0x20a580[_0xa0b2c9(0x13e)](normalizeIdentifier(_0x56abf5)))break;_0x54eb72[_0xa0b2c9(0x13f)](_0x56abf5);}return _0x54eb72;}function resolveTableMetadata(_0x214686,_0x495016){const _0x3d6d65=a220_0x52c2,_0x32f8a8=normalizeIdentifier(_0x495016),_0x3b5423=_0x214686[_0x3d6d65(0x10e)](_0x380ffc=>normalizeIdentifier(_0x380ffc[_0x3d6d65(0x117)])===_0x32f8a8);if(_0x3b5423[_0x3d6d65(0x121)]===0x1)return _0x3b5423[0x0];const _0x4c996e=_0x32f8a8[_0x3d6d65(0x127)]('.'),_0xef0fef=_0x32f8a8[_0x3d6d65(0x10b)]('.')['at'](-0x1),_0x32c7cb=_0x214686['filter'](_0x237088=>{const _0x27fe0a=_0x3d6d65,_0x2c6324=normalizeIdentifier(_0x237088[_0x27fe0a(0x117)]);if(_0x4c996e&&_0x2c6324[_0x27fe0a(0x127)]('.'))return![];return _0x2c6324[_0x27fe0a(0x10b)]('.')['at'](-0x1)===_0xef0fef;});return _0x32c7cb[_0x3d6d65(0x121)]===0x1?_0x32c7cb[0x0]:undefined;}function columnNamesMatch(_0x52d90f,_0x34f34c){return normalizeIdentifier(_0x52d90f)===normalizeIdentifier(_0x34f34c);}function normalizeIdentifier(_0x4dbd03){const _0x4ed98f=a220_0x52c2;return _0x4dbd03['replace'](/[`"]/g,'')['trim']()[_0x4ed98f(0x11a)]();}function isSqlClauseKeyword(_0x3b914f){const _0x4120d3=a220_0x52c2;return new Set(['on',_0x4120d3(0x138),'where',_0x4120d3(0x153),_0x4120d3(0x118),_0x4120d3(0x141),_0x4120d3(0x152),_0x4120d3(0x13c),'cross','natural'])[_0x4120d3(0x13e)](_0x3b914f);}function stripOuterParentheses(_0x4b42eb){const _0x363aea=a220_0x52c2;let _0x10a09f=_0x4b42eb[_0x363aea(0x14f)]();while(_0x10a09f[_0x363aea(0x149)]('(')&&_0x10a09f['endsWith'](')')){let _0x5b28d0=0x0,_0x594ee6=!![];for(let _0x5bcba0=0x0;_0x5bcba0<_0x10a09f[_0x363aea(0x121)];_0x5bcba0+=0x1){if(_0x10a09f[_0x5bcba0]==='(')_0x5b28d0+=0x1;if(_0x10a09f[_0x5bcba0]===')')_0x5b28d0-=0x1;if(_0x5b28d0===0x0&&_0x5bcba0<_0x10a09f[_0x363aea(0x121)]-0x1){_0x594ee6=![];break;}}if(!_0x594ee6||_0x5b28d0!==0x0)break;_0x10a09f=_0x10a09f[_0x363aea(0x147)](0x1,-0x1)['trim']();}return _0x10a09f;}
|
|
1
|
+
(function(_0x495686,_0xa47759){const _0x4220f0=a220_0x5e71,_0x469fe7=_0x495686();while(!![]){try{const _0x228721=parseInt(_0x4220f0(0x1cd))/0x1+-parseInt(_0x4220f0(0x1b8))/0x2+-parseInt(_0x4220f0(0x1d5))/0x3*(-parseInt(_0x4220f0(0x1c1))/0x4)+-parseInt(_0x4220f0(0x1ab))/0x5+-parseInt(_0x4220f0(0x1f4))/0x6+parseInt(_0x4220f0(0x1ef))/0x7+parseInt(_0x4220f0(0x1e1))/0x8*(parseInt(_0x4220f0(0x1d0))/0x9);if(_0x228721===_0xa47759)break;else _0x469fe7['push'](_0x469fe7['shift']());}catch(_0x5dc2f3){_0x469fe7['push'](_0x469fe7['shift']());}}}(a220_0x1296,0xf002b));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x9d59e7,_0x4ac8a1){const _0x38a6e7=a220_0x5e71,_0x40ba26=[],_0x15dec4=normalizeSqlForStaticAnalysis(_0x9d59e7),_0x92951e=(_0x15dec4[_0x38a6e7(0x1d4)]?[]:extractJoinFacts(_0x15dec4[_0x38a6e7(0x1cf)]))[_0x38a6e7(0x1dd)](_0x104547=>{const _0x108508=_0x38a6e7;if(_0x104547[_0x108508(0x1b4)]||_0x104547[_0x108508(0x1de)][_0x108508(0x1c6)]===0x0)return _0x40ba26[_0x108508(0x1bc)]({'code':_0x108508(0x1d8),'table':_0x104547['table'],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547['columns'],'reason':_0x104547[_0x108508(0x1ce)]??_0x108508(0x1c4)}),{'table':_0x104547[_0x108508(0x1b2)],'alias':_0x104547['alias'],'columns':_0x104547['columns'],'status':'unavailable'};const _0x4bf7a3=resolveTableMetadata(_0x4ac8a1,_0x104547['table']),_0x5cb36b=(_0x4bf7a3?.['indexes']??[])[_0x108508(0x1dd)](_0x29dfd7=>({'index':_0x29dfd7,'matchedPrefix':findEqualityPrefix(_0x29dfd7[_0x108508(0x1de)],_0x104547[_0x108508(0x1de)])}))[_0x108508(0x1e7)](_0x2f0f78=>_0x2f0f78[_0x108508(0x1bb)][_0x108508(0x1c6)]>0x0),_0x41086e=_0x5cb36b[_0x108508(0x1cc)]((_0x5dd8bc,_0x50b4a3)=>!_0x5dd8bc||_0x50b4a3['matchedPrefix'][_0x108508(0x1c6)]>_0x5dd8bc[_0x108508(0x1bb)][_0x108508(0x1c6)]?_0x50b4a3:_0x5dd8bc,_0x5cb36b[0x0]);if(_0x41086e)return{'table':_0x104547['table'],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547[_0x108508(0x1de)],'status':_0x108508(0x1ee),'matchedIndex':{..._0x41086e[_0x108508(0x1e8)],'matchedPrefix':_0x41086e[_0x108508(0x1bb)]}};const _0xb59fa3=_0x4bf7a3?.['indexes'][_0x108508(0x1e7)](_0x5d7688=>_0x5d7688[_0x108508(0x1de)][_0x108508(0x1f1)](_0x3c2d29=>_0x104547[_0x108508(0x1de)]['some'](_0x41b4df=>columnNamesMatch(_0x3c2d29,_0x41b4df))))??[];if(_0xb59fa3['length']>0x0)return _0x40ba26[_0x108508(0x1bc)]({'code':_0x108508(0x1af),'table':_0x104547[_0x108508(0x1b2)],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547['columns'],'reason':_0x108508(0x1e4)}),{'table':_0x104547[_0x108508(0x1b2)],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547[_0x108508(0x1de)],'status':'warning','candidateIndexes':_0xb59fa3};if(_0x4bf7a3&&_0x4bf7a3[_0x108508(0x1ca)]!==![]&&_0x4bf7a3['indexes'][_0x108508(0x1c6)]>0x0&&_0x104547['columns'][_0x108508(0x1c6)]>0x0)return _0x40ba26[_0x108508(0x1bc)]({'code':_0x108508(0x1ac),'table':_0x104547['table'],'alias':_0x104547['alias'],'columns':_0x104547[_0x108508(0x1de)],'reason':_0x108508(0x1e0)}),{'table':_0x104547['table'],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547[_0x108508(0x1de)],'status':_0x108508(0x1c8)};return _0x40ba26['push']({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x104547[_0x108508(0x1b2)],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547[_0x108508(0x1de)],'reason':_0x4bf7a3?_0x108508(0x1eb):_0x108508(0x1f6)}),{'table':_0x104547['table'],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547[_0x108508(0x1de)],'status':_0x108508(0x1dc)};});return{'checked':_0x92951e['length']>0x0,'joins':_0x92951e,'warnings':_0x40ba26};}function extractJoinFacts(_0x5835af){const _0x3561f6=a220_0x5e71,_0x3e6256=maskNestedQueries(stripSqlNoise(_0x5835af)),_0x54dde1=maskQuotedIdentifiers(_0x3e6256),_0x530f51=[],_0x3a9197=new Set(),_0x219daa=/\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 _0x4b12f7 of _0x3e6256['matchAll'](_0x219daa)){const _0x597c5c=_0x4b12f7[_0x3561f6(0x1e8)]??0x0,_0x11f308=_0x4b12f7[0x0]['search'](/\bJOIN\b/i),_0xddb01c=_0x597c5c+Math[_0x3561f6(0x1d7)](0x0,_0x11f308);if(!/^JOIN\b/i[_0x3561f6(0x1b3)](_0x54dde1['slice'](_0xddb01c)))continue;_0x3a9197[_0x3561f6(0x1d3)](_0xddb01c);const _0x9305df=normalizeIdentifier(_0x4b12f7[0x1]||_0x3561f6(0x1e9)),_0x5d420a=normalizeIdentifier(_0x4b12f7[0x2]??''),_0x19d7ce=normalizeIdentifier(_0x4b12f7[0x3]||_0x5d420a[_0x3561f6(0x1ae)]('.')['at'](-0x1)||_0x5d420a),_0xc8602a=[],_0x330811=_0x5d420a===_0x3561f6(0x1e6);let _0x1f1f7e=_0x9305df===_0x3561f6(0x1f3)||_0x9305df==='full'||_0x330811,_0x2b7d20=_0x1f1f7e?_0x330811?_0x3561f6(0x1ba):_0x9305df[_0x3561f6(0x1be)]()+_0x3561f6(0x1c5):undefined;const _0x95f1eb=stripOuterParentheses(_0x4b12f7[0x4]??''),_0xe1b146=_0x95f1eb['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x95f1eb[_0x3561f6(0x1ed)](MYBATIS_DYNAMIC_END_MARKER),_0x57869a=_0x95f1eb['includes'](MYBATIS_INCLUDE_MARKER);_0xe1b146&&(_0x1f1f7e=!![],_0x2b7d20??=_0x3561f6(0x1c9));_0x57869a&&(_0x1f1f7e=!![],_0x2b7d20??=_0x3561f6(0x1df));const _0x557a3d=_0x95f1eb[_0x3561f6(0x1a9)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x3561f6(0x1a9)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x3561f6(0x1a9)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x557a3d,'OR')&&(_0x1f1f7e=!![],_0x2b7d20??=_0x3561f6(0x1b6));for(const _0xde90dc of splitTopLevelAnd(_0x557a3d)){const _0x503630=stripOuterParentheses(_0xde90dc);if(hasTopLevelKeyword(_0x503630,'OR')){_0x1f1f7e=!![],_0x2b7d20??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x37de4c=splitEquality(_0x503630);if(!_0x37de4c){containsColumnReference(_0xde90dc,_0x19d7ce)&&(_0x1f1f7e=!![]);continue;}const _0xfbb4c=parseDirectColumnReference(_0x37de4c[0x0],_0x19d7ce),_0x272ce0=parseDirectColumnReference(_0x37de4c[0x1],_0x19d7ce),_0x4a8fcc=containsColumnReference(_0x37de4c[0x0],_0x19d7ce),_0x1bdd1b=containsColumnReference(_0x37de4c[0x1],_0x19d7ce),_0x57282f=_0xfbb4c&&!_0x1bdd1b?_0xfbb4c:_0x272ce0&&!_0x4a8fcc?_0x272ce0:null;if(_0x57282f&&!_0xc8602a['includes'](_0x57282f))_0xc8602a[_0x3561f6(0x1bc)](_0x57282f);else!_0x57282f&&containsColumnReference(_0xde90dc,_0x19d7ce)&&(_0x1f1f7e=!![]);}_0x530f51[_0x3561f6(0x1bc)]({'table':_0x5d420a,'alias':_0x19d7ce,'columns':_0xc8602a,'unsupportedPredicate':_0x1f1f7e,'unsupportedReason':_0x2b7d20,'containsUnresolvedInclude':_0x57869a,'position':_0xddb01c});}for(const _0x436d68 of _0x54dde1[_0x3561f6(0x1b1)](/\bJOIN\b/gi)){const _0x70d553=_0x436d68[_0x3561f6(0x1e8)]??0x0;if(_0x3a9197['has'](_0x70d553))continue;const _0x465539=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x3561f6(0x1aa)](_0x3e6256['slice'](_0x70d553+_0x436d68[0x0][_0x3561f6(0x1c6)])),_0x12cd27=normalizeIdentifier(_0x465539?.[0x1]||'unknown'),_0x225906=normalizeIdentifier(_0x465539?.[0x2]||''),_0x22df3b=isSqlClauseKeyword(_0x225906)?_0x12cd27[_0x3561f6(0x1ae)]('.')['at'](-0x1)||_0x12cd27:_0x225906||_0x12cd27[_0x3561f6(0x1ae)]('.')['at'](-0x1)||_0x12cd27;_0x530f51[_0x3561f6(0x1bc)]({'table':_0x12cd27,'alias':_0x22df3b,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x3561f6(0x1f0),'position':_0x70d553});}const _0x12c8aa=_0x54dde1[_0x3561f6(0x1d2)](MYBATIS_INCLUDE_MARKER);return _0x12c8aa>=0x0&&!_0x530f51[_0x3561f6(0x1f1)](_0xa06776=>_0xa06776['containsUnresolvedInclude'])&&_0x530f51[_0x3561f6(0x1bc)]({'table':_0x3561f6(0x1d6),'alias':_0x3561f6(0x1d6),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x3561f6(0x1e2),'containsUnresolvedInclude':!![],'position':_0x12c8aa}),_0x530f51[_0x3561f6(0x1f5)]((_0x21651c,_0x245fff)=>_0x21651c[_0x3561f6(0x1bd)]-_0x245fff[_0x3561f6(0x1bd)]);}function stripSqlNoise(_0x517aba){const _0x293b03=a220_0x5e71,_0x31e2c5=Array[_0x293b03(0x1db)](_0x517aba),_0x1de39b=(_0xa3a979,_0x4ae783)=>{for(let _0x30c31b=_0xa3a979;_0x30c31b<_0x4ae783;_0x30c31b+=0x1){_0x31e2c5[_0x30c31b]!=='\x0a'&&_0x31e2c5[_0x30c31b]!=='\x0d'&&(_0x31e2c5[_0x30c31b]='\x20');}};for(let _0x1f207e=0x0;_0x1f207e<_0x31e2c5['length'];_0x1f207e+=0x1){const _0x312537=_0x31e2c5[_0x1f207e],_0x25996e=_0x31e2c5[_0x1f207e+0x1];if(_0x312537==='\x27'||_0x312537==='\x22'||_0x312537==='`'){const _0x4e8a84=_0x312537,_0x4b63b1=_0x1f207e;_0x1f207e+=0x1;while(_0x1f207e<_0x31e2c5[_0x293b03(0x1c6)]){if(_0x31e2c5[_0x1f207e]==='\x5c'&&_0x1f207e+0x1<_0x31e2c5[_0x293b03(0x1c6)]){_0x1f207e+=0x2;continue;}if(_0x31e2c5[_0x1f207e]!==_0x4e8a84){_0x1f207e+=0x1;continue;}if(_0x31e2c5[_0x1f207e+0x1]===_0x4e8a84){_0x1f207e+=0x2;continue;}break;}if(_0x4e8a84==='\x27')_0x1de39b(_0x4b63b1,Math['min'](_0x1f207e+0x1,_0x31e2c5[_0x293b03(0x1c6)]));continue;}if(_0x312537==='-'&&_0x25996e==='-'){const _0x2ebeef=_0x1f207e;while(_0x1f207e<_0x31e2c5['length']&&_0x31e2c5[_0x1f207e]!=='\x0a')_0x1f207e+=0x1;_0x1de39b(_0x2ebeef,_0x1f207e);continue;}if(_0x312537==='/'&&_0x25996e==='*'){const _0x18dfe0=_0x1f207e;_0x1f207e+=0x2;while(_0x1f207e<_0x31e2c5[_0x293b03(0x1c6)]&&!(_0x31e2c5[_0x1f207e]==='*'&&_0x31e2c5[_0x1f207e+0x1]==='/')){_0x1f207e+=0x1;}_0x1f207e=Math['min'](_0x1f207e+0x1,_0x31e2c5[_0x293b03(0x1c6)]-0x1),_0x1de39b(_0x18dfe0,_0x1f207e+0x1);continue;}if(_0x312537==='#'&&_0x25996e!=='{'){const _0x67e285=_0x1f207e;while(_0x1f207e<_0x31e2c5[_0x293b03(0x1c6)]&&_0x31e2c5[_0x1f207e]!=='\x0a')_0x1f207e+=0x1;_0x1de39b(_0x67e285,_0x1f207e);continue;}if((_0x312537==='#'||_0x312537==='$')&&_0x25996e==='{'){const _0x2fc925=_0x1f207e;_0x1f207e+=0x2;while(_0x1f207e<_0x31e2c5[_0x293b03(0x1c6)]&&_0x31e2c5[_0x1f207e]!=='}')_0x1f207e+=0x1;_0x1de39b(_0x2fc925,Math[_0x293b03(0x1e3)](_0x1f207e+0x1,_0x31e2c5[_0x293b03(0x1c6)]));}}return _0x31e2c5[_0x293b03(0x1ad)]('');}function maskQuotedIdentifiers(_0x1f9ed5){const _0x5c43c6=a220_0x5e71,_0x43d80b=Array[_0x5c43c6(0x1db)](_0x1f9ed5);for(let _0x44de05=0x0;_0x44de05<_0x43d80b['length'];_0x44de05+=0x1){const _0x441ed2=_0x43d80b[_0x44de05];if(_0x441ed2!=='\x22'&&_0x441ed2!=='`')continue;_0x44de05+=0x1;while(_0x44de05<_0x43d80b[_0x5c43c6(0x1c6)]){if(_0x43d80b[_0x44de05]===_0x441ed2){if(_0x43d80b[_0x44de05+0x1]===_0x441ed2){_0x43d80b[_0x44de05]='\x20',_0x43d80b[_0x44de05+0x1]='\x20',_0x44de05+=0x2;continue;}break;}_0x43d80b[_0x44de05]='\x20',_0x44de05+=0x1;}}return _0x43d80b[_0x5c43c6(0x1ad)]('');}function maskNestedQueries(_0x9ddde2){const _0x2838be=a220_0x5e71,_0x515601=Array[_0x2838be(0x1db)](_0x9ddde2);for(let _0x3727cd=0x0;_0x3727cd<_0x515601[_0x2838be(0x1c6)];_0x3727cd+=0x1){if(_0x515601[_0x3727cd]!=='(')continue;const _0x663101=_0x9ddde2[_0x2838be(0x1ea)](_0x3727cd+0x1);if(!/^\s*(?:SELECT|WITH)\b/i['test'](_0x663101))continue;let _0x1a2e45=0x1,_0x1ef440=_0x3727cd+0x1;for(;_0x1ef440<_0x515601['length']&&_0x1a2e45>0x0;_0x1ef440+=0x1){if(_0x515601[_0x1ef440]==='(')_0x1a2e45+=0x1;if(_0x515601[_0x1ef440]===')')_0x1a2e45-=0x1;}if(_0x1a2e45!==0x0)continue;for(let _0xebbc1=_0x3727cd;_0xebbc1<_0x1ef440;_0xebbc1+=0x1){_0x515601[_0xebbc1]='\x20';}const _0x3dea89=_0x2838be(0x1e6);for(let _0x592cec=0x0;_0x592cec<_0x3dea89['length']&&_0x3727cd+_0x592cec<_0x1ef440;_0x592cec+=0x1){_0x515601[_0x3727cd+_0x592cec]=_0x3dea89[_0x592cec];}_0x3727cd=_0x1ef440-0x1;}return _0x515601[_0x2838be(0x1ad)]('');}function splitTopLevelAnd(_0xf85518){const _0x349b97=a220_0x5e71,_0x2fbe89=[];let _0x24fa28=0x0,_0x264a68=0x0;for(let _0x5a2e80=0x0;_0x5a2e80<_0xf85518[_0x349b97(0x1c6)];_0x5a2e80+=0x1){const _0xb21213=_0xf85518[_0x5a2e80];if(_0xb21213==='(')_0x24fa28+=0x1;if(_0xb21213===')')_0x24fa28=Math[_0x349b97(0x1d7)](0x0,_0x24fa28-0x1);_0x24fa28===0x0&&_0xf85518['slice'](_0x5a2e80)['match'](/^AND\b/i)&&(_0x5a2e80===0x0||/\s/[_0x349b97(0x1b3)](_0xf85518[_0x5a2e80-0x1]??''))&&(_0x2fbe89[_0x349b97(0x1bc)](_0xf85518[_0x349b97(0x1ea)](_0x264a68,_0x5a2e80)[_0x349b97(0x1c0)]()),_0x5a2e80+=0x2,_0x264a68=_0x5a2e80+0x1);}const _0x438c0e=_0xf85518['slice'](_0x264a68)[_0x349b97(0x1c0)]();if(_0x438c0e)_0x2fbe89[_0x349b97(0x1bc)](_0x438c0e);return _0x2fbe89;}function hasTopLevelKeyword(_0x31842d,_0x4630ef){const _0x30ca7a=a220_0x5e71;let _0xf94a=0x0;for(let _0x44338d=0x0;_0x44338d<_0x31842d[_0x30ca7a(0x1c6)];_0x44338d+=0x1){const _0x348f74=_0x31842d[_0x44338d];if(_0x348f74==='(')_0xf94a+=0x1;if(_0x348f74===')')_0xf94a=Math['max'](0x0,_0xf94a-0x1);if(_0xf94a!==0x0)continue;const _0x171cf5=_0x31842d[_0x30ca7a(0x1ea)](_0x44338d,_0x44338d+_0x4630ef[_0x30ca7a(0x1c6)]),_0xe66db5=_0x31842d[_0x44338d-0x1]??'\x20',_0x193366=_0x31842d[_0x44338d+_0x4630ef[_0x30ca7a(0x1c6)]]??'\x20';if(_0x171cf5[_0x30ca7a(0x1be)]()===_0x4630ef[_0x30ca7a(0x1be)]()&&!/[\w$]/['test'](_0xe66db5)&&!/[\w$]/['test'](_0x193366))return!![];}return![];}function splitEquality(_0x3869e0){const _0x279646=a220_0x5e71,_0xd7ae1a=stripOuterParentheses(_0x3869e0);let _0x3f3e7d=0x0,_0x323f7c;for(let _0xc1e685=0x0;_0xc1e685<_0xd7ae1a['length'];_0xc1e685+=0x1){const _0x54d7a8=_0xd7ae1a[_0xc1e685];if(_0x54d7a8==='(')_0x3f3e7d+=0x1;if(_0x54d7a8===')')_0x3f3e7d=Math[_0x279646(0x1d7)](0x0,_0x3f3e7d-0x1);const _0x45c6b1=_0xd7ae1a[_0xc1e685-0x1]??'',_0x236b4f=_0xd7ae1a[_0xc1e685+0x1]??'';if(_0x54d7a8==='='&&_0x3f3e7d===0x0&&!/[!<>=:]/[_0x279646(0x1b3)](_0x45c6b1)&&_0x236b4f!=='='){if(_0x323f7c!==undefined)return null;_0x323f7c=_0xc1e685;}}return _0x323f7c===undefined?null:[_0xd7ae1a[_0x279646(0x1ea)](0x0,_0x323f7c)[_0x279646(0x1c0)](),_0xd7ae1a[_0x279646(0x1ea)](_0x323f7c+0x1)['trim']()];}function parseDirectColumnReference(_0x1017a9,_0x436d25){const _0x4db5c1=a220_0x5e71,_0x4e45f0=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x4db5c1(0x1aa)](stripOuterParentheses(_0x1017a9));if(!_0x4e45f0)return null;if(normalizeIdentifier(_0x4e45f0[0x1]??'')!==normalizeIdentifier(_0x436d25))return null;return normalizeIdentifier(_0x4e45f0[0x2]??'');}function containsColumnReference(_0x43f3f6,_0x483a2b){const _0x399afd=a220_0x5e71,_0x1c4ec4=_0x43f3f6[_0x399afd(0x1b9)](/[`"]/g,''),_0xa9a065=_0x483a2b[_0x399afd(0x1b9)](/[.*+?^${}()|[\]\\]/g,_0x399afd(0x1e5));return new RegExp(_0x399afd(0x1bf)+_0xa9a065+_0x399afd(0x1b0),'i')[_0x399afd(0x1b3)](_0x1c4ec4);}function a220_0x5e71(_0x1fc689,_0x2f1dc0){_0x1fc689=_0x1fc689-0x1a9;const _0x129608=a220_0x1296();let _0x5e717c=_0x129608[_0x1fc689];return _0x5e717c;}function findEqualityPrefix(_0x3f9c14,_0x325963){const _0x39af7b=a220_0x5e71,_0x2acd61=new Set(_0x325963[_0x39af7b(0x1dd)](normalizeIdentifier)),_0x1989dd=[];for(const _0x26c19a of _0x3f9c14){if(!_0x2acd61[_0x39af7b(0x1c2)](normalizeIdentifier(_0x26c19a)))break;_0x1989dd[_0x39af7b(0x1bc)](_0x26c19a);}return _0x1989dd;}function resolveTableMetadata(_0x55ae05,_0x4a5dff){const _0x5519d4=a220_0x5e71,_0x537c40=normalizeIdentifier(_0x4a5dff),_0xcdf6ea=_0x55ae05['filter'](_0x4bc6ed=>normalizeIdentifier(_0x4bc6ed[_0x5519d4(0x1c3)])===_0x537c40);if(_0xcdf6ea['length']===0x1)return _0xcdf6ea[0x0];const _0x442ea9=_0x537c40[_0x5519d4(0x1ed)]('.'),_0x4634f4=_0x537c40['split']('.')['at'](-0x1),_0x29800a=_0x55ae05['filter'](_0x2186db=>{const _0x2e3722=_0x5519d4,_0x280f98=normalizeIdentifier(_0x2186db[_0x2e3722(0x1c3)]);if(_0x442ea9&&_0x280f98[_0x2e3722(0x1ed)]('.'))return![];return _0x280f98['split']('.')['at'](-0x1)===_0x4634f4;});return _0x29800a[_0x5519d4(0x1c6)]===0x1?_0x29800a[0x0]:undefined;}function columnNamesMatch(_0xd9dc92,_0x4f84d7){return normalizeIdentifier(_0xd9dc92)===normalizeIdentifier(_0x4f84d7);}function a220_0x1296(){const _0x5e4980=['\x5c$&','__sq__','filter','index','INNER','slice','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','endsWith','includes','covered','2177574dXcKIN','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','some','natural','right','303054bmoJra','sort','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','replaceAll','exec','5220660KgMfnh','JOIN_INDEX_MISSING','join','split','JOIN_INDEX_NOT_USABLE','\x5cs*\x5c.\x5cs*[\x5cw$]+','matchAll','table','test','unsupportedPredicate','startsWith','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','full','2596214IdDuVZ','replace','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','matchedPrefix','push','position','toUpperCase','(?:^|[^\x5cw$])','trim','36kFwACD','has','tableName','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','length','left','warning','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','metadataAvailable','inner','reduce','824721IpAmRN','unsupportedReason','sql','6366141XszmOa','using','indexOf','add','error','39327DMupkB','unknown','max','JOIN_PREDICATE_UNSUPPORTED','alias','cross','from','unavailable','map','columns','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','24TJfmgy','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','min','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'];a220_0x1296=function(){return _0x5e4980;};return a220_0x1296();}function normalizeIdentifier(_0x5d36b8){const _0x4ee8c3=a220_0x5e71;return _0x5d36b8[_0x4ee8c3(0x1b9)](/[`"]/g,'')[_0x4ee8c3(0x1c0)]()['toLowerCase']();}function isSqlClauseKeyword(_0x1639a0){const _0x1748d8=a220_0x5e71;return new Set(['on',_0x1748d8(0x1d1),'where',_0x1748d8(0x1ad),_0x1748d8(0x1cb),_0x1748d8(0x1c7),_0x1748d8(0x1f3),_0x1748d8(0x1b7),_0x1748d8(0x1da),_0x1748d8(0x1f2)])[_0x1748d8(0x1c2)](_0x1639a0);}function stripOuterParentheses(_0x1baf27){const _0x5cd00a=a220_0x5e71;let _0x533d5c=_0x1baf27[_0x5cd00a(0x1c0)]();while(_0x533d5c[_0x5cd00a(0x1b5)]('(')&&_0x533d5c[_0x5cd00a(0x1ec)](')')){let _0x3df03d=0x0,_0x105621=!![];for(let _0xba13b2=0x0;_0xba13b2<_0x533d5c[_0x5cd00a(0x1c6)];_0xba13b2+=0x1){if(_0x533d5c[_0xba13b2]==='(')_0x3df03d+=0x1;if(_0x533d5c[_0xba13b2]===')')_0x3df03d-=0x1;if(_0x3df03d===0x0&&_0xba13b2<_0x533d5c['length']-0x1){_0x105621=![];break;}}if(!_0x105621||_0x3df03d!==0x0)break;_0x533d5c=_0x533d5c[_0x5cd00a(0x1ea)](0x1,-0x1)['trim']();}return _0x533d5c;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a221_0x549a34=a221_0x28c8;(function(_0x30259a,_0x507312){const _0x401e6f=a221_0x28c8,_0x3b1ecd=_0x30259a();while(!![]){try{const _0x47fe52=parseInt(_0x401e6f(0x138))/0x1+-parseInt(_0x401e6f(0x136))/0x2+-parseInt(_0x401e6f(0x13b))/0x3+-parseInt(_0x401e6f(0x13c))/0x4*(-parseInt(_0x401e6f(0x135))/0x5)+-parseInt(_0x401e6f(0x13f))/0x6*(parseInt(_0x401e6f(0x13a))/0x7)+parseInt(_0x401e6f(0x139))/0x8*(-parseInt(_0x401e6f(0x140))/0x9)+parseInt(_0x401e6f(0x13d))/0xa;if(_0x47fe52===_0x507312)break;else _0x3b1ecd['push'](_0x3b1ecd['shift']());}catch(_0x1aa4e8){_0x3b1ecd['push'](_0x3b1ecd['shift']());}}}(a221_0x1759,0x87234));function a221_0x28c8(_0x3a2f43,_0x5af424){_0x3a2f43=_0x3a2f43-0x135;const _0x1759ba=a221_0x1759();let _0x28c8d8=_0x1759ba[_0x3a2f43];return _0x28c8d8;}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a221_0x549a34(0x141),LOCK_FILE_NAME=a221_0x549a34(0x13e),TRASH_DIR_NAME='sql-trash';function a221_0x1759(){const _0xee58fb=['883084qbicnc','/sql','330788aYXuKP','1525232jvvzwM','35hRHgSe','41970jldFmm','69868MEYGJK','8738500XetnNM','sql.lock.json','222636lvcFZs','45ulODQs','.rabetbase','270geJhWT'];a221_0x1759=function(){return _0xee58fb;};return a221_0x1759();}export function loadSqlProjectConfig(_0x49f8e4,_0x2d8a24){const _0x1c5ee5=a221_0x549a34,_0x283f=resolve(_0x2d8a24??findProjectRootDirectory()),_0x481ef4=DOT_DIR+_0x1c5ee5(0x137),_0x27622b=_0x481ef4+'/'+_0x49f8e4;return{'projectRoot':_0x283f,'appCode':_0x49f8e4,'sqlWorkspaceRoot':_0x481ef4,'sqlRoot':_0x27622b,'sqlRootDir':resolve(_0x283f,DOT_DIR,'sql',_0x49f8e4),'lockFilePath':resolve(_0x283f,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x283f,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQL 本地同步体系 —— 本地文件扫描与路径解析
|
|
3
|
+
*/
|
|
4
|
+
import type { LocalSqlQuery, SqlLockEntry, SqlProjectConfig } from "./types.js";
|
|
5
|
+
export declare function scanLocalSqlQueries(config: SqlProjectConfig): Promise<LocalSqlQuery[]>;
|
|
6
|
+
export declare function resolveLocalSqlFilePath(config: SqlProjectConfig, sqlCode: string, lockEntry?: SqlLockEntry): string;
|
|
7
|
+
export declare function directoryExists(dirPath: string): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x37fb9d,_0x59faee){const _0x16910d=a222_0x34d2,_0x3e4400=_0x37fb9d();while(!![]){try{const _0x23ba8a=parseInt(_0x16910d(0x1ea))/0x1+-parseInt(_0x16910d(0x1e5))/0x2+parseInt(_0x16910d(0x1e3))/0x3*(-parseInt(_0x16910d(0x1e0))/0x4)+-parseInt(_0x16910d(0x1db))/0x5+-parseInt(_0x16910d(0x1df))/0x6+-parseInt(_0x16910d(0x1e9))/0x7*(-parseInt(_0x16910d(0x1d7))/0x8)+parseInt(_0x16910d(0x1f0))/0x9*(parseInt(_0x16910d(0x1d5))/0xa);if(_0x23ba8a===_0x59faee)break;else _0x3e4400['push'](_0x3e4400['shift']());}catch(_0x3e5f50){_0x3e4400['push'](_0x3e4400['shift']());}}}(a222_0x14c3,0xa9faa));function a222_0x34d2(_0x2cd372,_0x45ef57){_0x2cd372=_0x2cd372-0x1d5;const _0x14c3f5=a222_0x14c3();let _0x34d2ab=_0x14c3f5[_0x2cd372];return _0x34d2ab;}import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x326398){const _0x3d0c25=a222_0x34d2;if(_0x326398==='.sql')return _0x3d0c25(0x1dc);if(_0x326398===_0x3d0c25(0x1d6))return _0x3d0c25(0x1ee);return undefined;}async function scanSqlFilesRecursively(_0x5c4c3a,_0x4304b4){const _0x43a042=a222_0x34d2,_0x513319=[];try{const _0x3a1626=await readdir(_0x5c4c3a,{'withFileTypes':!![]});for(const _0x2c80b2 of _0x3a1626){const _0x183dc2=join(_0x5c4c3a,_0x2c80b2[_0x43a042(0x1da)]);if(_0x2c80b2[_0x43a042(0x1e8)]()){_0x513319['push'](...await scanSqlFilesRecursively(_0x183dc2,_0x4304b4));continue;}if(!_0x2c80b2[_0x43a042(0x1e7)]())continue;const _0x25242f=extname(_0x2c80b2['name'])[_0x43a042(0x1eb)](),_0xde88ce=extensionToMode(_0x25242f);if(!_0xde88ce)continue;const _0x5162a8=relative(_0x4304b4,_0x183dc2)[_0x43a042(0x1d8)](/\\/g,'/'),_0xe1cf32=_0x5162a8[_0x43a042(0x1e2)]('/')['filter'](Boolean),_0x2a52a1=parseSqlPath(_0xe1cf32,_0x2c80b2[_0x43a042(0x1da)],_0x25242f);if(!_0x2a52a1)continue;_0x513319[_0x43a042(0x1ed)]({'sqlCode':_0x2a52a1[_0x43a042(0x1e6)],'sqlName':_0x2a52a1[_0x43a042(0x1ef)],'dbDirectory':_0xe1cf32[0x0],'filePath':_0x183dc2,'relativePath':_0x5162a8,'lockKey':_0x2a52a1['sqlCode'],'mode':_0xde88ce});}}catch(_0x139b92){if(_0x139b92['code']!==_0x43a042(0x1de))throw _0x139b92;}return _0x513319;}function a222_0x14c3(){const _0x372bc8=['ENOENT','3849102BtltUK','1337036qUBcOh','length','split','3CAWOUH','slice','769388GtTCDE','sqlCode','isFile','isDirectory','9627401Nvzxgd','494500yQLkaY','toLowerCase','dbId','push','mybatisXml','sqlName','171dMzSrf','mode','611270NVqiYW','.xml','8upVmSw','replace','sqlRootDir','name','4872760NdzIWm','sql','dbName'];a222_0x14c3=function(){return _0x372bc8;};return a222_0x14c3();}export async function scanLocalSqlQueries(_0x1ac9e0){const _0x2299f8=a222_0x34d2;return scanSqlFilesRecursively(_0x1ac9e0[_0x2299f8(0x1d9)],_0x1ac9e0['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x43d1f7,_0x8c87fd,_0x15331b){const _0x5b7cb3=a222_0x34d2,_0x32c4a3=_0x15331b?.['path']||(_0x15331b?.[_0x5b7cb3(0x1ef)]||_0x15331b?.[_0x5b7cb3(0x1dd)]?buildSqlRelativePath(_0x8c87fd,_0x15331b?.[_0x5b7cb3(0x1ef)],_0x15331b?.[_0x5b7cb3(0x1dd)],_0x15331b?.[_0x5b7cb3(0x1f1)]||_0x5b7cb3(0x1dc),_0x15331b?.[_0x5b7cb3(0x1ec)]):buildDefaultSqlFileName(_0x8c87fd,_0x15331b?.[_0x5b7cb3(0x1f1)]||'sql'));return join(_0x43d1f7[_0x5b7cb3(0x1d9)],_0x32c4a3);}export async function directoryExists(_0x5cc219){const _0x596020=a222_0x34d2;try{const _0xb25ed=await stat(_0x5cc219);return _0xb25ed[_0x596020(0x1e8)]();}catch{return![];}}function parseSqlPath(_0x2d6b83,_0x3a7601,_0x135291){const _0x958e6f=a222_0x34d2,_0x10fd16=_0x3a7601[_0x958e6f(0x1e4)](0x0,-_0x135291[_0x958e6f(0x1e1)]);if(_0x2d6b83[_0x958e6f(0x1e1)]<0x2)return null;const _0x2fd811=_0x10fd16['indexOf']('_');if(_0x2fd811<=0x0||_0x2fd811>=_0x10fd16['length']-0x1)return null;const _0x967abb=_0x10fd16[_0x958e6f(0x1e4)](0x0,_0x2fd811);if(!isLikelySqlCode(_0x967abb))return null;return{'sqlCode':_0x967abb,'sqlName':_0x10fd16[_0x958e6f(0x1e4)](_0x2fd811+0x1)};}function isLikelySqlCode(_0xc328e6){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0xc328e6);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x597c5d,_0x42fb7c){const _0x389f6f=a223_0x1c35,_0x2dfc24=_0x597c5d();while(!![]){try{const _0x47f31b=parseInt(_0x389f6f(0x182))/0x1*(-parseInt(_0x389f6f(0x17b))/0x2)+parseInt(_0x389f6f(0x185))/0x3+-parseInt(_0x389f6f(0x181))/0x4*(-parseInt(_0x389f6f(0x17f))/0x5)+parseInt(_0x389f6f(0x183))/0x6*(parseInt(_0x389f6f(0x17c))/0x7)+parseInt(_0x389f6f(0x17d))/0x8+parseInt(_0x389f6f(0x17e))/0x9+-parseInt(_0x389f6f(0x17a))/0xa;if(_0x47f31b===_0x42fb7c)break;else _0x2dfc24['push'](_0x2dfc24['shift']());}catch(_0x13d724){_0x2dfc24['push'](_0x2dfc24['shift']());}}}(a223_0x21fc,0xa21cc));function a223_0x21fc(){const _0x1a4502=['7BHvxla','3687160FMEUFd','5873067LVkQcb','2965595adQPxc','md5','8zSWJIj','291YVpSkd','7054680iCsZRx','update','2842164ZFIJDv','createHash','utf8','30848960tDhtwv','4632lDntbW'];a223_0x21fc=function(){return _0x1a4502;};return a223_0x21fc();}import{readFile}from'node:fs/promises';function a223_0x1c35(_0x1a2961,_0x27b5e9){_0x1a2961=_0x1a2961-0x178;const _0x21fc54=a223_0x21fc();let _0x1c3538=_0x21fc54[_0x1a2961];return _0x1c3538;}import a223_0x3ed4f2 from'node:crypto';export function computeSqlContentHash(_0x264df8){const _0x2faddc=a223_0x1c35;return a223_0x3ed4f2[_0x2faddc(0x178)](_0x2faddc(0x180))[_0x2faddc(0x184)](_0x264df8)['digest']('hex');}export async function computeSqlFileHash(_0x10ed15){const _0x193ac7=a223_0x1c35,_0x23afeb=await readFile(_0x10ed15,_0x193ac7(0x179));return computeSqlContentHash(_0x23afeb);}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQL 本地同步体系 —— Lock 文件管理
|
|
3
|
+
*
|
|
4
|
+
* .rabetbase/sql.lock.json 记录每个 appCode 下 SQL 文件的 hash / remoteId / dbId / mode 等信息,
|
|
5
|
+
* 用于 push / pull 的变更检测与本地执行元数据加载。
|
|
6
|
+
*/
|
|
7
|
+
import type { SqlLockFile, SqlLockScope } from "./types.js";
|
|
8
|
+
export declare function createEmptySqlLock(): SqlLockFile;
|
|
9
|
+
export declare function ensureSqlLockScope(lockData: SqlLockFile, currentAppCode: string, currentSqlRoot: string, commandName: string): {
|
|
10
|
+
lockData: SqlLockFile;
|
|
11
|
+
appLock: SqlLockScope;
|
|
12
|
+
};
|
|
13
|
+
export declare function readSqlLockFile(lockFilePath: string): Promise<SqlLockFile | null>;
|
|
14
|
+
export declare function writeSqlLockFile(lockFilePath: string, lockData: SqlLockFile): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a224_0x22bd(){const _0x33f59d=['code',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','2807301BlHAST','1538535DeczQI','338418EPwCYa','24bZeOsn','4rpspCj','55labLRR','utf8','1635220FGXFjR','parse','350167vTQlCe','1283283MqyfOV','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','sqlRoot','306282BkmrzJ','sqls','ENOENT','apps','lastSync'];a224_0x22bd=function(){return _0x33f59d;};return a224_0x22bd();}(function(_0x4b5d07,_0x237f80){const _0x2dd647=a224_0x3806,_0xb60899=_0x4b5d07();while(!![]){try{const _0x2968a4=-parseInt(_0x2dd647(0xb9))/0x1+-parseInt(_0x2dd647(0xc6))/0x2+-parseInt(_0x2dd647(0xc5))/0x3*(-parseInt(_0x2dd647(0xc8))/0x4)+parseInt(_0x2dd647(0xc9))/0x5*(parseInt(_0x2dd647(0xbd))/0x6)+parseInt(_0x2dd647(0xc4))/0x7+parseInt(_0x2dd647(0xc7))/0x8*(-parseInt(_0x2dd647(0xba))/0x9)+-parseInt(_0x2dd647(0xb7))/0xa;if(_0x2968a4===_0x237f80)break;else _0xb60899['push'](_0xb60899['shift']());}catch(_0x47bd8a){_0xb60899['push'](_0xb60899['shift']());}}}(a224_0x22bd,0x590ca));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}function a224_0x3806(_0x4df1c6,_0x4e1bcf){_0x4df1c6=_0x4df1c6-0xb6;const _0x22bd60=a224_0x22bd();let _0x3806a0=_0x22bd60[_0x4df1c6];return _0x3806a0;}export function ensureSqlLockScope(_0x12cd42,_0xb737df,_0x195f77,_0x4e1968){const _0x306ad7=a224_0x3806,_0x2a4fde=_0x12cd42??createEmptySqlLock();let _0x45bfc7=_0x2a4fde[_0x306ad7(0xc0)][_0xb737df];if(!_0x45bfc7)return _0x45bfc7={'sqlRoot':_0x195f77,'lastSync':'','sqls':{}},_0x2a4fde[_0x306ad7(0xc0)][_0xb737df]=_0x45bfc7,{'lockData':_0x2a4fde,'appLock':_0x45bfc7};if(!_0x45bfc7['sqlRoot'])_0x45bfc7['sqlRoot']=_0x195f77;else{if(_0x45bfc7[_0x306ad7(0xbc)]!==_0x195f77)throw new Error(_0x4e1968+_0x306ad7(0xc3)+_0x195f77+'\x22\x20vs\x20lock\x20\x22'+_0x45bfc7[_0x306ad7(0xbc)]+'\x22.\x20'+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x45bfc7[_0x306ad7(0xbe)]&&(_0x45bfc7['sqls']={}),!_0x45bfc7['lastSync']&&(_0x45bfc7[_0x306ad7(0xc1)]=''),{'lockData':_0x2a4fde,'appLock':_0x45bfc7};}export async function readSqlLockFile(_0x253acd){const _0x14026c=a224_0x3806;try{const _0x332b8c=await readFile(_0x253acd,_0x14026c(0xb6));return JSON[_0x14026c(0xb8)](_0x332b8c);}catch(_0x3ceed6){if(_0x3ceed6[_0x14026c(0xc2)]===_0x14026c(0xbf))return null;throw new Error(_0x14026c(0xbb)+String(_0x3ceed6));}}export async function writeSqlLockFile(_0x3a27ff,_0xff5a8f){await mkdir(dirname(_0x3a27ff),{'recursive':!![]}),await writeFile(_0x3a27ff,JSON['stringify'](_0xff5a8f,null,0x2),'utf8');}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQL 本地同步体系 —— 类型定义
|
|
3
|
+
*
|
|
4
|
+
* 覆盖 lock 文件结构、本地 SQL 描述、项目配置等。
|
|
5
|
+
*/
|
|
6
|
+
export type SqlLocalMode = "sql" | "mybatisXml";
|
|
7
|
+
export interface SqlProjectConfig {
|
|
8
|
+
projectRoot: string;
|
|
9
|
+
appCode: string;
|
|
10
|
+
sqlWorkspaceRoot: string;
|
|
11
|
+
sqlRoot: string;
|
|
12
|
+
sqlRootDir: string;
|
|
13
|
+
lockFilePath: string;
|
|
14
|
+
trashDir: string;
|
|
15
|
+
}
|
|
16
|
+
export interface LocalSqlQuery {
|
|
17
|
+
sqlCode: string;
|
|
18
|
+
sqlName?: string;
|
|
19
|
+
dbDirectory?: string;
|
|
20
|
+
filePath: string;
|
|
21
|
+
relativePath: string;
|
|
22
|
+
lockKey: string;
|
|
23
|
+
mode: SqlLocalMode;
|
|
24
|
+
}
|
|
25
|
+
export interface SqlLockEntry {
|
|
26
|
+
path: string;
|
|
27
|
+
hash: string;
|
|
28
|
+
remoteId: number;
|
|
29
|
+
version?: number;
|
|
30
|
+
dbId: number;
|
|
31
|
+
dbName?: string;
|
|
32
|
+
sqlName: string;
|
|
33
|
+
sqlConfig?: string | null;
|
|
34
|
+
mode: SqlLocalMode;
|
|
35
|
+
}
|
|
36
|
+
export interface SqlLockScope {
|
|
37
|
+
sqlRoot: string;
|
|
38
|
+
lastSync: string;
|
|
39
|
+
sqls: Record<string, SqlLockEntry>;
|
|
40
|
+
}
|
|
41
|
+
export interface SqlLockFile {
|
|
42
|
+
apps: Record<string, SqlLockScope>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQL 本地同步体系 —— 工具函数
|
|
3
|
+
*/
|
|
4
|
+
import type { SqlLocalMode } from "./types.js";
|
|
5
|
+
export declare function detectSqlMode(sqlContent: string): SqlLocalMode;
|
|
6
|
+
export declare function getSqlFileExtension(mode: SqlLocalMode): ".sql" | ".xml";
|
|
7
|
+
export declare function buildDefaultSqlFileName(sqlCode: string, mode: SqlLocalMode): string;
|
|
8
|
+
export declare function sanitizeSqlPathSegment(value: string | undefined, fallback: string): string;
|
|
9
|
+
export declare function buildDbDirectoryName(dbName: string | undefined, dbId?: number): string;
|
|
10
|
+
export declare function buildSqlRelativePath(sqlCode: string, sqlName: string | undefined, dbName: string | undefined, mode: SqlLocalMode, dbId?: number): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x17918b,_0x43b67f){const _0xd5584d=a226_0xb939,_0x3c544b=_0x17918b();while(!![]){try{const _0x5caa87=-parseInt(_0xd5584d(0x80))/0x1+-parseInt(_0xd5584d(0x77))/0x2*(parseInt(_0xd5584d(0x76))/0x3)+parseInt(_0xd5584d(0x83))/0x4*(-parseInt(_0xd5584d(0x7b))/0x5)+parseInt(_0xd5584d(0x84))/0x6+parseInt(_0xd5584d(0x74))/0x7+-parseInt(_0xd5584d(0x7e))/0x8+parseInt(_0xd5584d(0x81))/0x9;if(_0x5caa87===_0x43b67f)break;else _0x3c544b['push'](_0x3c544b['shift']());}catch(_0x4b9abb){_0x3c544b['push'](_0x3c544b['shift']());}}}(a226_0x2789,0x58535));export function detectSqlMode(_0x212e62){const _0x146d9e=a226_0xb939,_0x1254f7=_0x212e62['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x146d9e(0x7d)](_0x1254f7))return _0x146d9e(0x7c);return _0x146d9e(0x7f);}function a226_0xb939(_0x2e371,_0x1e0869){_0x2e371=_0x2e371-0x74;const _0x27898d=a226_0x2789();let _0xb939b=_0x27898d[_0x2e371];return _0xb939b;}export function getSqlFileExtension(_0x5b30ad){const _0x3e83c9=a226_0xb939;return _0x5b30ad==='mybatisXml'?_0x3e83c9(0x7a):_0x3e83c9(0x85);}export function buildDefaultSqlFileName(_0x5a8334,_0x4bad67){return''+_0x5a8334+getSqlFileExtension(_0x4bad67);}export function sanitizeSqlPathSegment(_0x4bc0e2,_0x5d8942){const _0x1955e6=a226_0xb939,_0x294d29=String(_0x4bc0e2??'')['trim'](),_0x298641=_0x294d29[_0x1955e6(0x75)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x1955e6(0x75)](/\s+/g,'-')[_0x1955e6(0x75)](/-+/g,'-')[_0x1955e6(0x75)](/^\.+/,'')[_0x1955e6(0x75)](/\.+$/,'')['replace'](/^-+/,'')[_0x1955e6(0x75)](/-+$/,'');return _0x298641||_0x5d8942;}export function buildDbDirectoryName(_0xfa31a9,_0x43a971){const _0x186f05=a226_0xb939;return sanitizeSqlPathSegment(_0xfa31a9,_0x43a971!=null?_0x186f05(0x82)+_0x43a971:_0x186f05(0x79));}export function buildSqlRelativePath(_0x4f0e3b,_0x3c541c,_0x2e7c0f,_0x5dc7c6,_0x585e15){const _0x2d2f1d=a226_0xb939,_0x31de1a=buildDbDirectoryName(_0x2e7c0f,_0x585e15),_0x45faaa=sanitizeSqlPathSegment(_0x4f0e3b,_0x2d2f1d(0x78)),_0x4d7ee6=sanitizeSqlPathSegment(_0x3c541c,_0x45faaa);return _0x31de1a+'/'+_0x45faaa+'_'+_0x4d7ee6+getSqlFileExtension(_0x5dc7c6);}function a226_0x2789(){const _0x18a253=['db-','982060dDoGJM','3027822WdRukm','.sql','4060490kBycpc','replace','213ZEhIuw','2306UTizCF','unknown-sql','unknown-db','.xml','10RTAnvN','mybatisXml','test','1313696mZODNv','sql','61395sNqyic','680166hlhTvH'];a226_0x2789=function(){return _0x18a253;};return a226_0x2789();}
|