@lovrabet/rabetbase-cli 2.3.16-beta.4 → 2.3.16-beta.6
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(_0x3f91f5,_0x401e10){const _0x165ffb=a214_0x516f,_0x477f2e=_0x3f91f5();while(!![]){try{const _0x204899=-parseInt(_0x165ffb(0x1cd))/0x1+parseInt(_0x165ffb(0x1d6))/0x2+-parseInt(_0x165ffb(0x1c8))/0x3+-parseInt(_0x165ffb(0x1c9))/0x4*(-parseInt(_0x165ffb(0x1cf))/0x5)+parseInt(_0x165ffb(0x1ca))/0x6*(parseInt(_0x165ffb(0x1ce))/0x7)+parseInt(_0x165ffb(0x1d3))/0x8*(parseInt(_0x165ffb(0x1c6))/0x9)+parseInt(_0x165ffb(0x1d1))/0xa*(-parseInt(_0x165ffb(0x1d9))/0xb);if(_0x204899===_0x401e10)break;else _0x477f2e['push'](_0x477f2e['shift']());}catch(_0x3f6ea1){_0x477f2e['push'](_0x477f2e['shift']());}}}(a214_0x5a1f,0xc1a73));function a214_0x5a1f(){const _0x3041ae=['316LXyfXS','828246axpjKx','trim','test','516695zpbTeK','7JssYiv','87440LqqsoP','before','10360wIUPkg','toLowerCase','5481560RjmqAe','values','functionNode','2770810zbOVEs','toUpperCase','remoteId','27698ZNAtJT','replace','datasetCode','18zaDZbX','operationType','1070526Poyyqj'];a214_0x5a1f=function(){return _0x3041ae;};return a214_0x5a1f();}export function snakeToCamel(_0x18bb53){const _0x2f18d1=a214_0x516f;return _0x18bb53[_0x2f18d1(0x1d2)]()[_0x2f18d1(0x1c4)](/_([a-z])/g,(_0x2532b2,_0x30da71)=>_0x30da71[_0x2f18d1(0x1d7)]());}export function findHookLocationByRemoteId(_0x303f04,_0x272216){const _0x48b22d=a214_0x516f;if(!_0x272216)return undefined;for(const _0xfd6bf8 of Object[_0x48b22d(0x1d4)](_0x303f04)){if(_0xfd6bf8[_0x48b22d(0x1d8)]===_0x272216&&_0xfd6bf8[_0x48b22d(0x1c5)]&&_0xfd6bf8[_0x48b22d(0x1c7)]&&_0xfd6bf8[_0x48b22d(0x1d5)])return{'datasetCode':_0xfd6bf8[_0x48b22d(0x1c5)],'operationType':_0xfd6bf8[_0x48b22d(0x1c7)],'functionNode':_0xfd6bf8['functionNode']};}return undefined;}export function extractScriptDescription(_0x53eff3){const _0x31e019=a214_0x516f,_0x569547=_0x53eff3['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x569547?.[0x1]?.[_0x31e019(0x1cb)]()||undefined;}function a214_0x516f(_0x5dc404,_0x4b1a32){_0x5dc404=_0x5dc404-0x1c4;const _0x5a1f66=a214_0x5a1f();let _0x516ffa=_0x5a1f66[_0x5dc404];return _0x516ffa;}export function isValidBffFunctionName(_0x29140){const _0xbf2295=a214_0x516f;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0xbf2295(0x1cc)](_0x29140);}export function normalizeHookFunctionNode(_0x2693ec){const _0x26ce7d=a214_0x516f;if(!_0x2693ec)return undefined;const _0x310d95=_0x2693ec[_0x26ce7d(0x1cb)]()[_0x26ce7d(0x1d2)]();if(_0x310d95===_0x26ce7d(0x1d0)||_0x310d95==='after')return _0x310d95;return undefined;}
|
|
@@ -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(_0x21947a,_0x468835){const _0x2fdd31=a215_0x2407,_0xf0c389=_0x21947a();while(!![]){try{const _0x276124=-parseInt(_0x2fdd31(0x1c2))/0x1+parseInt(_0x2fdd31(0x1cb))/0x2+-parseInt(_0x2fdd31(0x1b6))/0x3*(-parseInt(_0x2fdd31(0x1bc))/0x4)+-parseInt(_0x2fdd31(0x1c3))/0x5+-parseInt(_0x2fdd31(0x1b0))/0x6*(-parseInt(_0x2fdd31(0x1bd))/0x7)+-parseInt(_0x2fdd31(0x1bb))/0x8*(-parseInt(_0x2fdd31(0x1cd))/0x9)+parseInt(_0x2fdd31(0x1c7))/0xa;if(_0x276124===_0x468835)break;else _0xf0c389['push'](_0xf0c389['shift']());}catch(_0x24699f){_0xf0c389['push'](_0xf0c389['shift']());}}}(a215_0x3f5d,0x4bc38));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x39ead7){const _0x5ce69c=a215_0x2407;if(cache[_0x5ce69c(0x1b9)](_0x39ead7))return cache['get'](_0x39ead7);const _0x5be2e8=await listDatasets(_0x39ead7),_0x3329e3=new Map();for(const _0x48ddcc of _0x5be2e8){const _0x26c79a=_0x48ddcc[_0x5ce69c(0x1b5)];_0x26c79a?.[_0x5ce69c(0x1c5)]!=null&&_0x3329e3[_0x5ce69c(0x1b7)](_0x26c79a[_0x5ce69c(0x1c5)],_0x26c79a[_0x5ce69c(0x1b1)]??'db-'+_0x26c79a[_0x5ce69c(0x1c5)]);}const _0x495bec=[..._0x3329e3[_0x5ce69c(0x1b4)]()]['map'](([_0x3824b5,_0x5606c1])=>({'dbId':_0x3824b5,'dbName':_0x5606c1}));return cache['set'](_0x39ead7,_0x495bec),_0x495bec;}export async function resolveDb(_0x4d1a76,_0x5a9cd7){const _0x3fe9c4=a215_0x2407,_0x8aea34=await listDatabases(_0x4d1a76);if(_0x8aea34[_0x3fe9c4(0x1c9)]===0x0)return{'resolved':[],'error':_0x3fe9c4(0x1b3)+_0x4d1a76+_0x3fe9c4(0x1c4)};if(!_0x5a9cd7)return{'resolved':_0x8aea34};const _0x5c42c9=Number(_0x5a9cd7);if(!Number[_0x3fe9c4(0x1ca)](_0x5c42c9)){const _0x181e9c=_0x8aea34[_0x3fe9c4(0x1cc)](_0x17f863=>_0x17f863['dbId']===_0x5c42c9);if(_0x181e9c)return{'resolved':[_0x181e9c]};}const _0xdc20c6=_0x5a9cd7[_0x3fe9c4(0x1c1)](),_0x659c88=_0x8aea34[_0x3fe9c4(0x1b2)](_0x596cca=>_0x596cca[_0x3fe9c4(0x1b1)]['toLowerCase']()[_0x3fe9c4(0x1ba)](_0xdc20c6));if(_0x659c88[_0x3fe9c4(0x1c9)]>0x0)return{'resolved':_0x659c88};const _0x5ee077=_0x8aea34[_0x3fe9c4(0x1c8)](_0x4d3ae5=>_0x4d3ae5[_0x3fe9c4(0x1b1)]+'\x20('+_0x4d3ae5['dbId']+')')['join'](',\x20');return{'resolved':[],'error':_0x3fe9c4(0x1be)+_0x5a9cd7+'\x22\x20under\x20app\x20\x22'+_0x4d1a76+'\x22.\x20Available:\x20'+_0x5ee077+_0x3fe9c4(0x1c0)};}function a215_0x3f5d(){const _0x38aa03=['includes','196376qCquUN','24892WWYyjm','5159GyuZLW','No\x20database\x20matching\x20\x22','.\x20Be\x20more\x20specific.','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','toLowerCase','464177BMyqlD','922975nTzyJt','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','dbId','\x22\x20matches\x20multiple\x20databases:\x20','5352780YxYfXQ','map','length','isNaN','354222gYczzr','find','9WXKBWg','1758Imwpgu','dbName','filter','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','entries','dbtableConfig','3FRXmfz','set','join','has'];a215_0x3f5d=function(){return _0x38aa03;};return a215_0x3f5d();}function a215_0x2407(_0x276afc,_0x2bd86d){_0x276afc=_0x276afc-0x1b0;const _0x3f5d9e=a215_0x3f5d();let _0x2407c3=_0x3f5d9e[_0x276afc];return _0x2407c3;}export async function resolveOneDb(_0x3b8082,_0x5ea99f){const _0xe6f66a=a215_0x2407,{resolved:_0x198511,error:_0x4a3984}=await resolveDb(_0x3b8082,_0x5ea99f);if(_0x4a3984)return{'db':null,'error':_0x4a3984};if(_0x198511[_0xe6f66a(0x1c9)]===0x1)return{'db':_0x198511[0x0]};if(!_0x5ea99f){const _0x220722=_0x198511[_0xe6f66a(0x1c8)](_0x4c2ba0=>_0x4c2ba0[_0xe6f66a(0x1b1)]+'\x20('+_0x4c2ba0['dbId']+')')[_0xe6f66a(0x1b8)](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x220722};}const _0xf921e9=_0x198511[_0xe6f66a(0x1c8)](_0x58542f=>_0x58542f[_0xe6f66a(0x1b1)]+'\x20('+_0x58542f[_0xe6f66a(0x1c5)]+')')[_0xe6f66a(0x1b8)](',\x20');return{'db':null,'error':'\x22'+_0x5ea99f+_0xe6f66a(0x1c6)+_0xf921e9+_0xe6f66a(0x1bf)};}export async function getDbName(_0xe85a6d,_0x23d620){const _0x4f5c82=a215_0x2407,_0x1957ef=await listDatabases(_0xe85a6d);return _0x1957ef[_0x4f5c82(0x1cc)](_0x269a12=>_0x269a12[_0x4f5c82(0x1c5)]===_0x23d620)?.[_0x4f5c82(0x1b1)];}
|
|
@@ -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_0x2244c9=a216_0x589c;(function(_0x1ef302,_0x4657fb){const _0x1abada=a216_0x589c,_0x3310dc=_0x1ef302();while(!![]){try{const _0x89c9f9=parseInt(_0x1abada(0x1f5))/0x1*(parseInt(_0x1abada(0x1ee))/0x2)+parseInt(_0x1abada(0x1e6))/0x3+parseInt(_0x1abada(0x1ea))/0x4*(-parseInt(_0x1abada(0x1f7))/0x5)+-parseInt(_0x1abada(0x1eb))/0x6+parseInt(_0x1abada(0x1f0))/0x7+-parseInt(_0x1abada(0x1e9))/0x8*(-parseInt(_0x1abada(0x1f4))/0x9)+-parseInt(_0x1abada(0x1f1))/0xa*(parseInt(_0x1abada(0x1ef))/0xb);if(_0x89c9f9===_0x4657fb)break;else _0x3310dc['push'](_0x3310dc['shift']());}catch(_0x5ed361){_0x3310dc['push'](_0x3310dc['shift']());}}}(a216_0x3dc9,0x6cf08));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';function a216_0x3dc9(){const _0xf3adad=['cwd','2PzrAdt','275jRCrWa','3965388YkhAbC','208410qNfwpE','.rabetbase','.json','9miDOsD','190201yXDbOZ','F_OK','921205XaqPXU','1094478uBpdcj','page','appPagesDir','5077176qoDngT','4JemkHr','3628056wQDGyY','page.lock.json'];a216_0x3dc9=function(){return _0xf3adad;};return a216_0x3dc9();}import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x9083db,_0x27b2e1=process[a216_0x2244c9(0x1ed)]()){const _0x54726f=a216_0x2244c9,_0x373d67=resolve(_0x27b2e1),_0x26df24=join(_0x373d67,'.rabetbase',_0x54726f(0x1e7));return{'projectRoot':_0x373d67,'pagesBaseDir':_0x26df24,'appPagesDir':join(_0x26df24,_0x9083db),'lockFilePath':join(_0x373d67,_0x54726f(0x1f2),_0x54726f(0x1ec))};}function a216_0x589c(_0x55da52,_0x1ab07f){_0x55da52=_0x55da52-0x1e6;const _0x3dc9ce=a216_0x3dc9();let _0x589c35=_0x3dc9ce[_0x55da52];return _0x589c35;}export function buildPageFileName(_0x4f7ee6,_0x4eb026){const _0x1e9d22=a216_0x2244c9;return _0x4f7ee6+'-'+String(_0x4eb026)['toUpperCase']()+_0x1e9d22(0x1f3);}export function resolvePageFilePath(_0x5887f6,_0x4a742d,_0x27cc7d){const _0x28f5f6=a216_0x2244c9;return join(_0x5887f6[_0x28f5f6(0x1e8)],buildPageFileName(_0x4a742d,_0x27cc7d));}export async function ensureParentDirectory(_0x2433b3){await mkdir(dirname(_0x2433b3),{'recursive':!![]});}export async function fileExists(_0x223b8f){const _0x2619d9=a216_0x2244c9;try{return await access(_0x223b8f,constants[_0x2619d9(0x1f6)]),!![];}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_0x5903(_0x34de03,_0x1631c2){_0x34de03=_0x34de03-0xd2;const _0x5070ca=a217_0x5070();let _0x59038a=_0x5070ca[_0x34de03];return _0x59038a;}(function(_0x50fc9a,_0x412c9d){const _0x2a459e=a217_0x5903,_0x2a80fc=_0x50fc9a();while(!![]){try{const _0x54f48f=parseInt(_0x2a459e(0xde))/0x1*(parseInt(_0x2a459e(0xd3))/0x2)+-parseInt(_0x2a459e(0xd4))/0x3+-parseInt(_0x2a459e(0xd6))/0x4+parseInt(_0x2a459e(0xd2))/0x5*(-parseInt(_0x2a459e(0xda))/0x6)+parseInt(_0x2a459e(0xd9))/0x7+-parseInt(_0x2a459e(0xdd))/0x8*(parseInt(_0x2a459e(0xdc))/0x9)+parseInt(_0x2a459e(0xe0))/0xa;if(_0x54f48f===_0x412c9d)break;else _0x2a80fc['push'](_0x2a80fc['shift']());}catch(_0x2aee0b){_0x2a80fc['push'](_0x2a80fc['shift']());}}}(a217_0x5070,0xa6322));import a217_0x570e78 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x671992){const _0x2499aa=a217_0x5903;return JSON[_0x2499aa(0xe1)](JSON[_0x2499aa(0xd8)](_0x671992),null,0x2)+'\x0a';}export function computePageContentHash(_0x3dcef6){const _0x7df491=a217_0x5903;return a217_0x570e78[_0x7df491(0xdb)](_0x7df491(0xdf))['update'](_0x3dcef6)[_0x7df491(0xe2)](_0x7df491(0xd7));}export function computeSerializedSchemaHash(_0x5e8145){return computePageContentHash(serializePageSchemaForFile(_0x5e8145));}export async function computePageFileHash(_0x1c19b2){const _0x229d19=a217_0x5903,_0xef1c6c=await readFile(_0x1c19b2,_0x229d19(0xd5));return computePageContentHash(_0xef1c6c);}function a217_0x5070(){const _0x3d6ce2=['createHash','63kOibZm','81688WbfbqC','521243xUkySl','md5','11038250XYCATq','stringify','digest','5RmsTVE','2LCHyMm','424572VUdwzR','utf8','4302380sGCsRP','hex','parse','7979139SVWAxk','4773666yFmLls'];a217_0x5070=function(){return _0x3d6ce2;};return a217_0x5070();}
|
|
@@ -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(_0x21e00d,_0x4709a1){const _0x9f051=a218_0x579e,_0x1565d4=_0x21e00d();while(!![]){try{const _0x199fb4=parseInt(_0x9f051(0x9e))/0x1*(-parseInt(_0x9f051(0x99))/0x2)+parseInt(_0x9f051(0x9c))/0x3*(-parseInt(_0x9f051(0xa2))/0x4)+-parseInt(_0x9f051(0xa5))/0x5*(-parseInt(_0x9f051(0x95))/0x6)+parseInt(_0x9f051(0x9b))/0x7+parseInt(_0x9f051(0xa1))/0x8+-parseInt(_0x9f051(0x96))/0x9+parseInt(_0x9f051(0x9f))/0xa*(parseInt(_0x9f051(0xa3))/0xb);if(_0x199fb4===_0x4709a1)break;else _0x1565d4['push'](_0x1565d4['shift']());}catch(_0x434700){_0x1565d4['push'](_0x1565d4['shift']());}}}(a218_0x19c2,0x72be8));import{mkdir,readFile,writeFile}from'node:fs/promises';function a218_0x579e(_0x1f3ca3,_0x5ad1c4){_0x1f3ca3=_0x1f3ca3-0x92;const _0x19c215=a218_0x19c2();let _0x579ec8=_0x19c215[_0x1f3ca3];return _0x579ec8;}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x30e9ef,_0x2ef32a){const _0x462d41=a218_0x579e,_0x18eb92={'apps':_0x30e9ef[_0x462d41(0x93)]&&typeof _0x30e9ef[_0x462d41(0x93)]===_0x462d41(0x9a)?_0x30e9ef['apps']:{}};let _0x5e34a4=_0x18eb92[_0x462d41(0x93)][_0x2ef32a];if(!_0x5e34a4)return _0x5e34a4={'lastSync':'','pages':{}},_0x18eb92[_0x462d41(0x93)][_0x2ef32a]=_0x5e34a4,{'lockData':_0x18eb92,'appLock':_0x5e34a4};return!_0x5e34a4['lastSync']&&(_0x5e34a4[_0x462d41(0xa0)]=''),(!_0x5e34a4[_0x462d41(0xa4)]||typeof _0x5e34a4['pages']!==_0x462d41(0x9a))&&(_0x5e34a4[_0x462d41(0xa4)]={}),{'lockData':_0x18eb92,'appLock':_0x5e34a4};}export async function readPageLockFile(_0x51fc10){const _0x42d97f=a218_0x579e;try{const _0x59481a=await readFile(_0x51fc10,_0x42d97f(0x97)),_0x3166e4=JSON[_0x42d97f(0x94)](_0x59481a);return{'apps':_0x3166e4[_0x42d97f(0x93)]&&typeof _0x3166e4[_0x42d97f(0x93)]===_0x42d97f(0x9a)?_0x3166e4[_0x42d97f(0x93)]:{}};}catch(_0x2cb82e){if(_0x2cb82e[_0x42d97f(0x9d)]===_0x42d97f(0xa6))return null;throw new Error(_0x42d97f(0x98)+String(_0x2cb82e));}}export async function writePageLockFile(_0x168821,_0x3226a2){const _0x434546=a218_0x579e;await mkdir(dirname(_0x168821),{'recursive':!![]}),await writeFile(_0x168821,JSON[_0x434546(0x92)](_0x3226a2,null,0x2),_0x434546(0x97));}function a218_0x19c2(){const _0x26de52=['object','2649801DTWKOc','226263KqYKJW','code','887263EGUgLK','170tQeuRI','lastSync','1220656uoxEfY','32CcijIw','1001055szKXHm','pages','32925VzHiRB','ENOENT','stringify','apps','parse','426HWtpsc','5266098LyfMsP','utf8','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','2wbOAFQ'];a218_0x19c2=function(){return _0x26de52;};return a218_0x19c2();}
|
|
@@ -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(_0x147121,_0x1c776b){const _0x5fa7ed=a220_0x5018,_0x25d69f=_0x147121();while(!![]){try{const _0x50c577=parseInt(_0x5fa7ed(0x215))/0x1*(parseInt(_0x5fa7ed(0x225))/0x2)+-parseInt(_0x5fa7ed(0x1ee))/0x3*(parseInt(_0x5fa7ed(0x203))/0x4)+-parseInt(_0x5fa7ed(0x219))/0x5+-parseInt(_0x5fa7ed(0x205))/0x6*(parseInt(_0x5fa7ed(0x1f0))/0x7)+-parseInt(_0x5fa7ed(0x1e9))/0x8+parseInt(_0x5fa7ed(0x1fe))/0x9*(parseInt(_0x5fa7ed(0x213))/0xa)+-parseInt(_0x5fa7ed(0x21e))/0xb*(-parseInt(_0x5fa7ed(0x1f7))/0xc);if(_0x50c577===_0x1c776b)break;else _0x25d69f['push'](_0x25d69f['shift']());}catch(_0x3a048c){_0x25d69f['push'](_0x25d69f['shift']());}}}(a220_0xbc42,0x4e314));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x29089b,_0xebc77e){const _0x25e49b=a220_0x5018,_0x33fff3=[],_0x89eb40=normalizeSqlForStaticAnalysis(_0x29089b),_0x5c0306=(_0x89eb40[_0x25e49b(0x1ed)]?[]:extractJoinFacts(_0x89eb40[_0x25e49b(0x22d)]))['map'](_0x3f11da=>{const _0x226537=_0x25e49b;if(_0x3f11da[_0x226537(0x214)]||_0x3f11da[_0x226537(0x228)]['length']===0x0)return _0x33fff3[_0x226537(0x21c)]({'code':_0x226537(0x223),'table':_0x3f11da[_0x226537(0x1e7)],'alias':_0x3f11da[_0x226537(0x229)],'columns':_0x3f11da['columns'],'reason':_0x3f11da[_0x226537(0x1f6)]??_0x226537(0x1ea)}),{'table':_0x3f11da[_0x226537(0x1e7)],'alias':_0x3f11da[_0x226537(0x229)],'columns':_0x3f11da['columns'],'status':_0x226537(0x1ff)};const _0x5f4da8=resolveTableMetadata(_0xebc77e,_0x3f11da[_0x226537(0x1e7)]),_0x1e9302=(_0x5f4da8?.[_0x226537(0x230)]??[])[_0x226537(0x217)](_0x53573a=>({'index':_0x53573a,'matchedPrefix':findEqualityPrefix(_0x53573a[_0x226537(0x228)],_0x3f11da[_0x226537(0x228)])}))['filter'](_0x15805c=>_0x15805c[_0x226537(0x227)][_0x226537(0x222)]>0x0),_0x400feb=_0x1e9302[_0x226537(0x1eb)]((_0x51c8f4,_0x356228)=>!_0x51c8f4||_0x356228[_0x226537(0x227)][_0x226537(0x222)]>_0x51c8f4['matchedPrefix'][_0x226537(0x222)]?_0x356228:_0x51c8f4,_0x1e9302[0x0]);if(_0x400feb)return{'table':_0x3f11da['table'],'alias':_0x3f11da[_0x226537(0x229)],'columns':_0x3f11da[_0x226537(0x228)],'status':_0x226537(0x1f1),'matchedIndex':{..._0x400feb[_0x226537(0x208)],'matchedPrefix':_0x400feb[_0x226537(0x227)]}};const _0x2ac1ea=_0x5f4da8?.[_0x226537(0x230)][_0x226537(0x209)](_0x3188b3=>_0x3188b3['columns'][_0x226537(0x20b)](_0xfe15fe=>_0x3f11da['columns']['some'](_0x227bf3=>columnNamesMatch(_0xfe15fe,_0x227bf3))))??[];if(_0x2ac1ea[_0x226537(0x222)]>0x0)return _0x33fff3['push']({'code':_0x226537(0x21a),'table':_0x3f11da['table'],'alias':_0x3f11da[_0x226537(0x229)],'columns':_0x3f11da[_0x226537(0x228)],'reason':_0x226537(0x20a)}),{'table':_0x3f11da[_0x226537(0x1e7)],'alias':_0x3f11da[_0x226537(0x229)],'columns':_0x3f11da[_0x226537(0x228)],'status':_0x226537(0x1f8),'candidateIndexes':_0x2ac1ea};if(_0x5f4da8&&_0x5f4da8['metadataAvailable']!==![]&&_0x5f4da8[_0x226537(0x230)]['length']>0x0&&_0x3f11da[_0x226537(0x228)]['length']>0x0)return _0x33fff3['push']({'code':_0x226537(0x218),'table':_0x3f11da[_0x226537(0x1e7)],'alias':_0x3f11da[_0x226537(0x229)],'columns':_0x3f11da[_0x226537(0x228)],'reason':_0x226537(0x1f3)}),{'table':_0x3f11da['table'],'alias':_0x3f11da[_0x226537(0x229)],'columns':_0x3f11da[_0x226537(0x228)],'status':_0x226537(0x1f8)};return _0x33fff3[_0x226537(0x21c)]({'code':_0x226537(0x211),'table':_0x3f11da[_0x226537(0x1e7)],'alias':_0x3f11da[_0x226537(0x229)],'columns':_0x3f11da[_0x226537(0x228)],'reason':_0x5f4da8?_0x226537(0x220):_0x226537(0x22f)}),{'table':_0x3f11da[_0x226537(0x1e7)],'alias':_0x3f11da[_0x226537(0x229)],'columns':_0x3f11da[_0x226537(0x228)],'status':_0x226537(0x1ff)};});return{'checked':_0x5c0306[_0x25e49b(0x222)]>0x0,'joins':_0x5c0306,'warnings':_0x33fff3};}function extractJoinFacts(_0xb4ea00){const _0x12a090=a220_0x5018,_0x610a67=maskNestedQueries(stripSqlNoise(_0xb4ea00)),_0x5439a0=maskQuotedIdentifiers(_0x610a67),_0x3d3c0a=[],_0x2e2ca0=new Set(),_0x2279af=/\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 _0x1fa3a3 of _0x610a67['matchAll'](_0x2279af)){const _0x2648b3=_0x1fa3a3[_0x12a090(0x208)]??0x0,_0x26a731=_0x1fa3a3[0x0][_0x12a090(0x1e4)](/\bJOIN\b/i),_0x55a7a4=_0x2648b3+Math[_0x12a090(0x212)](0x0,_0x26a731);if(!/^JOIN\b/i['test'](_0x5439a0[_0x12a090(0x1e3)](_0x55a7a4)))continue;_0x2e2ca0[_0x12a090(0x224)](_0x55a7a4);const _0x570eb2=normalizeIdentifier(_0x1fa3a3[0x1]||'INNER'),_0x13dccc=normalizeIdentifier(_0x1fa3a3[0x2]??''),_0x422f3d=normalizeIdentifier(_0x1fa3a3[0x3]||_0x13dccc[_0x12a090(0x1f9)]('.')['at'](-0x1)||_0x13dccc),_0x9d0b83=[],_0x3af7a8=_0x13dccc===_0x12a090(0x21d);let _0x433baf=_0x570eb2==='right'||_0x570eb2===_0x12a090(0x202)||_0x3af7a8,_0x4aaf2f=_0x433baf?_0x3af7a8?_0x12a090(0x231):_0x570eb2['toUpperCase']()+_0x12a090(0x1fd):undefined;const _0x355785=stripOuterParentheses(_0x1fa3a3[0x4]??''),_0x588381=_0x355785[_0x12a090(0x22b)](MYBATIS_DYNAMIC_START_MARKER)||_0x355785[_0x12a090(0x22b)](MYBATIS_DYNAMIC_END_MARKER),_0x5651dd=_0x355785[_0x12a090(0x22b)](MYBATIS_INCLUDE_MARKER);_0x588381&&(_0x433baf=!![],_0x4aaf2f??=_0x12a090(0x1e2));_0x5651dd&&(_0x433baf=!![],_0x4aaf2f??=_0x12a090(0x207));const _0x3d27e3=_0x355785['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x12a090(0x22a)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x12a090(0x22a)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x3d27e3,'OR')&&(_0x433baf=!![],_0x4aaf2f??=_0x12a090(0x1e6));for(const _0x5055f0 of splitTopLevelAnd(_0x3d27e3)){const _0x481aca=stripOuterParentheses(_0x5055f0);if(hasTopLevelKeyword(_0x481aca,'OR')){_0x433baf=!![],_0x4aaf2f??=_0x12a090(0x1e6);continue;}const _0x8ae821=splitEquality(_0x481aca);if(!_0x8ae821){containsColumnReference(_0x5055f0,_0x422f3d)&&(_0x433baf=!![]);continue;}const _0x46fecb=parseDirectColumnReference(_0x8ae821[0x0],_0x422f3d),_0x10ed5a=parseDirectColumnReference(_0x8ae821[0x1],_0x422f3d),_0x330549=containsColumnReference(_0x8ae821[0x0],_0x422f3d),_0x40d009=containsColumnReference(_0x8ae821[0x1],_0x422f3d),_0x1ae921=_0x46fecb&&!_0x40d009?_0x46fecb:_0x10ed5a&&!_0x330549?_0x10ed5a:null;if(_0x1ae921&&!_0x9d0b83[_0x12a090(0x22b)](_0x1ae921))_0x9d0b83['push'](_0x1ae921);else!_0x1ae921&&containsColumnReference(_0x5055f0,_0x422f3d)&&(_0x433baf=!![]);}_0x3d3c0a[_0x12a090(0x21c)]({'table':_0x13dccc,'alias':_0x422f3d,'columns':_0x9d0b83,'unsupportedPredicate':_0x433baf,'unsupportedReason':_0x4aaf2f,'containsUnresolvedInclude':_0x5651dd,'position':_0x55a7a4});}for(const _0x2191f2 of _0x5439a0[_0x12a090(0x204)](/\bJOIN\b/gi)){const _0x155eab=_0x2191f2[_0x12a090(0x208)]??0x0;if(_0x2e2ca0[_0x12a090(0x1f4)](_0x155eab))continue;const _0x57a054=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x12a090(0x1fc)](_0x610a67[_0x12a090(0x1e3)](_0x155eab+_0x2191f2[0x0][_0x12a090(0x222)])),_0x3868d7=normalizeIdentifier(_0x57a054?.[0x1]||_0x12a090(0x1ec)),_0x48d38a=normalizeIdentifier(_0x57a054?.[0x2]||''),_0x564da5=isSqlClauseKeyword(_0x48d38a)?_0x3868d7['split']('.')['at'](-0x1)||_0x3868d7:_0x48d38a||_0x3868d7[_0x12a090(0x1f9)]('.')['at'](-0x1)||_0x3868d7;_0x3d3c0a[_0x12a090(0x21c)]({'table':_0x3868d7,'alias':_0x564da5,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x12a090(0x206),'position':_0x155eab});}const _0x4e39f8=_0x5439a0[_0x12a090(0x1e8)](MYBATIS_INCLUDE_MARKER);return _0x4e39f8>=0x0&&!_0x3d3c0a[_0x12a090(0x20b)](_0x1e2769=>_0x1e2769['containsUnresolvedInclude'])&&_0x3d3c0a[_0x12a090(0x21c)]({'table':_0x12a090(0x1ec),'alias':_0x12a090(0x1ec),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x12a090(0x21f),'containsUnresolvedInclude':!![],'position':_0x4e39f8}),_0x3d3c0a[_0x12a090(0x20e)]((_0xa48ad9,_0x186322)=>_0xa48ad9[_0x12a090(0x20c)]-_0x186322[_0x12a090(0x20c)]);}function stripSqlNoise(_0x52fa5a){const _0xfa2a16=a220_0x5018,_0x5aa649=Array[_0xfa2a16(0x1fa)](_0x52fa5a),_0x4fb8d5=(_0xb463bb,_0x394830)=>{for(let _0x3c08e0=_0xb463bb;_0x3c08e0<_0x394830;_0x3c08e0+=0x1){_0x5aa649[_0x3c08e0]!=='\x0a'&&_0x5aa649[_0x3c08e0]!=='\x0d'&&(_0x5aa649[_0x3c08e0]='\x20');}};for(let _0x4dc26d=0x0;_0x4dc26d<_0x5aa649[_0xfa2a16(0x222)];_0x4dc26d+=0x1){const _0x1660a3=_0x5aa649[_0x4dc26d],_0x4f33e5=_0x5aa649[_0x4dc26d+0x1];if(_0x1660a3==='\x27'||_0x1660a3==='\x22'||_0x1660a3==='`'){const _0x249395=_0x1660a3,_0x16c8a7=_0x4dc26d;_0x4dc26d+=0x1;while(_0x4dc26d<_0x5aa649['length']){if(_0x5aa649[_0x4dc26d]==='\x5c'&&_0x4dc26d+0x1<_0x5aa649['length']){_0x4dc26d+=0x2;continue;}if(_0x5aa649[_0x4dc26d]!==_0x249395){_0x4dc26d+=0x1;continue;}if(_0x5aa649[_0x4dc26d+0x1]===_0x249395){_0x4dc26d+=0x2;continue;}break;}if(_0x249395==='\x27')_0x4fb8d5(_0x16c8a7,Math[_0xfa2a16(0x200)](_0x4dc26d+0x1,_0x5aa649[_0xfa2a16(0x222)]));continue;}if(_0x1660a3==='-'&&_0x4f33e5==='-'){const _0x522f0c=_0x4dc26d;while(_0x4dc26d<_0x5aa649['length']&&_0x5aa649[_0x4dc26d]!=='\x0a')_0x4dc26d+=0x1;_0x4fb8d5(_0x522f0c,_0x4dc26d);continue;}if(_0x1660a3==='/'&&_0x4f33e5==='*'){const _0x1f89ec=_0x4dc26d;_0x4dc26d+=0x2;while(_0x4dc26d<_0x5aa649[_0xfa2a16(0x222)]&&!(_0x5aa649[_0x4dc26d]==='*'&&_0x5aa649[_0x4dc26d+0x1]==='/')){_0x4dc26d+=0x1;}_0x4dc26d=Math[_0xfa2a16(0x200)](_0x4dc26d+0x1,_0x5aa649['length']-0x1),_0x4fb8d5(_0x1f89ec,_0x4dc26d+0x1);continue;}if(_0x1660a3==='#'&&_0x4f33e5!=='{'){const _0x1c8732=_0x4dc26d;while(_0x4dc26d<_0x5aa649[_0xfa2a16(0x222)]&&_0x5aa649[_0x4dc26d]!=='\x0a')_0x4dc26d+=0x1;_0x4fb8d5(_0x1c8732,_0x4dc26d);continue;}if((_0x1660a3==='#'||_0x1660a3==='$')&&_0x4f33e5==='{'){const _0x321194=_0x4dc26d;_0x4dc26d+=0x2;while(_0x4dc26d<_0x5aa649['length']&&_0x5aa649[_0x4dc26d]!=='}')_0x4dc26d+=0x1;_0x4fb8d5(_0x321194,Math[_0xfa2a16(0x200)](_0x4dc26d+0x1,_0x5aa649[_0xfa2a16(0x222)]));}}return _0x5aa649[_0xfa2a16(0x221)]('');}function maskQuotedIdentifiers(_0x51c245){const _0x15ca32=a220_0x5018,_0x528607=Array['from'](_0x51c245);for(let _0x46d184=0x0;_0x46d184<_0x528607[_0x15ca32(0x222)];_0x46d184+=0x1){const _0xcd5044=_0x528607[_0x46d184];if(_0xcd5044!=='\x22'&&_0xcd5044!=='`')continue;_0x46d184+=0x1;while(_0x46d184<_0x528607[_0x15ca32(0x222)]){if(_0x528607[_0x46d184]===_0xcd5044){if(_0x528607[_0x46d184+0x1]===_0xcd5044){_0x528607[_0x46d184]='\x20',_0x528607[_0x46d184+0x1]='\x20',_0x46d184+=0x2;continue;}break;}_0x528607[_0x46d184]='\x20',_0x46d184+=0x1;}}return _0x528607[_0x15ca32(0x221)]('');}function maskNestedQueries(_0x42d3a5){const _0x27b923=a220_0x5018,_0x549b86=Array[_0x27b923(0x1fa)](_0x42d3a5);for(let _0x1fd805=0x0;_0x1fd805<_0x549b86[_0x27b923(0x222)];_0x1fd805+=0x1){if(_0x549b86[_0x1fd805]!=='(')continue;const _0x558667=_0x42d3a5[_0x27b923(0x1e3)](_0x1fd805+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x27b923(0x21b)](_0x558667))continue;let _0xf98341=0x1,_0x591d43=_0x1fd805+0x1;for(;_0x591d43<_0x549b86['length']&&_0xf98341>0x0;_0x591d43+=0x1){if(_0x549b86[_0x591d43]==='(')_0xf98341+=0x1;if(_0x549b86[_0x591d43]===')')_0xf98341-=0x1;}if(_0xf98341!==0x0)continue;for(let _0x418d07=_0x1fd805;_0x418d07<_0x591d43;_0x418d07+=0x1){_0x549b86[_0x418d07]='\x20';}const _0x2bf6cc=_0x27b923(0x21d);for(let _0x15b862=0x0;_0x15b862<_0x2bf6cc[_0x27b923(0x222)]&&_0x1fd805+_0x15b862<_0x591d43;_0x15b862+=0x1){_0x549b86[_0x1fd805+_0x15b862]=_0x2bf6cc[_0x15b862];}_0x1fd805=_0x591d43-0x1;}return _0x549b86[_0x27b923(0x221)]('');}function splitTopLevelAnd(_0x6f2dd4){const _0x4386f9=a220_0x5018,_0x5a6e82=[];let _0x464c2c=0x0,_0x165f2b=0x0;for(let _0x1ff213=0x0;_0x1ff213<_0x6f2dd4[_0x4386f9(0x222)];_0x1ff213+=0x1){const _0x44ffe7=_0x6f2dd4[_0x1ff213];if(_0x44ffe7==='(')_0x464c2c+=0x1;if(_0x44ffe7===')')_0x464c2c=Math[_0x4386f9(0x212)](0x0,_0x464c2c-0x1);_0x464c2c===0x0&&_0x6f2dd4[_0x4386f9(0x1e3)](_0x1ff213)[_0x4386f9(0x201)](/^AND\b/i)&&(_0x1ff213===0x0||/\s/[_0x4386f9(0x21b)](_0x6f2dd4[_0x1ff213-0x1]??''))&&(_0x5a6e82['push'](_0x6f2dd4[_0x4386f9(0x1e3)](_0x165f2b,_0x1ff213)[_0x4386f9(0x22e)]()),_0x1ff213+=0x2,_0x165f2b=_0x1ff213+0x1);}const _0x51311b=_0x6f2dd4[_0x4386f9(0x1e3)](_0x165f2b)['trim']();if(_0x51311b)_0x5a6e82[_0x4386f9(0x21c)](_0x51311b);return _0x5a6e82;}function hasTopLevelKeyword(_0x4f1015,_0x34df49){const _0x2460db=a220_0x5018;let _0x1a6104=0x0;for(let _0x5d0926=0x0;_0x5d0926<_0x4f1015[_0x2460db(0x222)];_0x5d0926+=0x1){const _0x3a11cf=_0x4f1015[_0x5d0926];if(_0x3a11cf==='(')_0x1a6104+=0x1;if(_0x3a11cf===')')_0x1a6104=Math['max'](0x0,_0x1a6104-0x1);if(_0x1a6104!==0x0)continue;const _0x24479c=_0x4f1015[_0x2460db(0x1e3)](_0x5d0926,_0x5d0926+_0x34df49['length']),_0x2c8920=_0x4f1015[_0x5d0926-0x1]??'\x20',_0x158402=_0x4f1015[_0x5d0926+_0x34df49['length']]??'\x20';if(_0x24479c[_0x2460db(0x20f)]()===_0x34df49[_0x2460db(0x20f)]()&&!/[\w$]/[_0x2460db(0x21b)](_0x2c8920)&&!/[\w$]/[_0x2460db(0x21b)](_0x158402))return!![];}return![];}function splitEquality(_0x4fd2ca){const _0x36ee7d=a220_0x5018,_0x826399=stripOuterParentheses(_0x4fd2ca);let _0xb282d1=0x0,_0x5206e1;for(let _0x1bea24=0x0;_0x1bea24<_0x826399['length'];_0x1bea24+=0x1){const _0x2d89d0=_0x826399[_0x1bea24];if(_0x2d89d0==='(')_0xb282d1+=0x1;if(_0x2d89d0===')')_0xb282d1=Math[_0x36ee7d(0x212)](0x0,_0xb282d1-0x1);const _0x6db659=_0x826399[_0x1bea24-0x1]??'',_0x4016a9=_0x826399[_0x1bea24+0x1]??'';if(_0x2d89d0==='='&&_0xb282d1===0x0&&!/[!<>=:]/[_0x36ee7d(0x21b)](_0x6db659)&&_0x4016a9!=='='){if(_0x5206e1!==undefined)return null;_0x5206e1=_0x1bea24;}}return _0x5206e1===undefined?null:[_0x826399[_0x36ee7d(0x1e3)](0x0,_0x5206e1)[_0x36ee7d(0x22e)](),_0x826399[_0x36ee7d(0x1e3)](_0x5206e1+0x1)[_0x36ee7d(0x22e)]()];}function a220_0xbc42(){const _0x3b7a1a=['replaceAll','includes','(?:^|[^\x5cw$])','sql','trim','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','indexes','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','toLowerCase','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','slice','search','natural','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','table','indexOf','3122712BVlLMQ','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','reduce','unknown','error','5196TRbhaE','\x5cs*\x5c.\x5cs*[\x5cw$]+','646723xVJWrO','covered','tableName','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','has','left','unsupportedReason','48CQruJZ','warning','split','from','\x5c$&','exec','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','910323lrOSnf','unavailable','min','match','full','732wQoJzy','matchAll','24YxiIKP','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','index','filter','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','some','position','cross','sort','toUpperCase','replace','INDEX_METADATA_UNAVAILABLE','max','50qomyXR','unsupportedPredicate','16GxyhCi','startsWith','map','JOIN_INDEX_MISSING','568400sLsXlk','JOIN_INDEX_NOT_USABLE','test','push','__sq__','1955624dUBxat','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','join','length','JOIN_PREDICATE_UNSUPPORTED','add','36742idjQUE','where','matchedPrefix','columns','alias'];a220_0xbc42=function(){return _0x3b7a1a;};return a220_0xbc42();}function a220_0x5018(_0x46ee72,_0x499659){_0x46ee72=_0x46ee72-0x1e1;const _0xbc425a=a220_0xbc42();let _0x501854=_0xbc425a[_0x46ee72];return _0x501854;}function parseDirectColumnReference(_0x456bc1,_0x2f0694){const _0x3d3cd4=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/['exec'](stripOuterParentheses(_0x456bc1));if(!_0x3d3cd4)return null;if(normalizeIdentifier(_0x3d3cd4[0x1]??'')!==normalizeIdentifier(_0x2f0694))return null;return normalizeIdentifier(_0x3d3cd4[0x2]??'');}function containsColumnReference(_0x18d9f3,_0x48bd39){const _0x6d9c79=a220_0x5018,_0x134664=_0x18d9f3[_0x6d9c79(0x210)](/[`"]/g,''),_0x3f4f73=_0x48bd39['replace'](/[.*+?^${}()|[\]\\]/g,_0x6d9c79(0x1fb));return new RegExp(_0x6d9c79(0x22c)+_0x3f4f73+_0x6d9c79(0x1ef),'i')[_0x6d9c79(0x21b)](_0x134664);}function findEqualityPrefix(_0x5bad50,_0x3ecd93){const _0x11e54c=a220_0x5018,_0x4f4567=new Set(_0x3ecd93[_0x11e54c(0x217)](normalizeIdentifier)),_0x9a8b1d=[];for(const _0x5abeb9 of _0x5bad50){if(!_0x4f4567[_0x11e54c(0x1f4)](normalizeIdentifier(_0x5abeb9)))break;_0x9a8b1d['push'](_0x5abeb9);}return _0x9a8b1d;}function resolveTableMetadata(_0x1bd748,_0x180ae8){const _0x5f4fcc=a220_0x5018,_0x395dc9=normalizeIdentifier(_0x180ae8),_0x273923=_0x1bd748['filter'](_0x221e66=>normalizeIdentifier(_0x221e66[_0x5f4fcc(0x1f2)])===_0x395dc9);if(_0x273923[_0x5f4fcc(0x222)]===0x1)return _0x273923[0x0];const _0x469a6b=_0x395dc9[_0x5f4fcc(0x22b)]('.'),_0x45f8b8=_0x395dc9[_0x5f4fcc(0x1f9)]('.')['at'](-0x1),_0x1a8205=_0x1bd748[_0x5f4fcc(0x209)](_0x1d773f=>{const _0x324ee1=_0x5f4fcc,_0x5ab286=normalizeIdentifier(_0x1d773f[_0x324ee1(0x1f2)]);if(_0x469a6b&&_0x5ab286['includes']('.'))return![];return _0x5ab286[_0x324ee1(0x1f9)]('.')['at'](-0x1)===_0x45f8b8;});return _0x1a8205['length']===0x1?_0x1a8205[0x0]:undefined;}function columnNamesMatch(_0x52c1a4,_0x3d20c8){return normalizeIdentifier(_0x52c1a4)===normalizeIdentifier(_0x3d20c8);}function normalizeIdentifier(_0x28189d){const _0x22cc1b=a220_0x5018;return _0x28189d['replace'](/[`"]/g,'')[_0x22cc1b(0x22e)]()[_0x22cc1b(0x1e1)]();}function isSqlClauseKeyword(_0x5266b3){const _0x47ac72=a220_0x5018;return new Set(['on','using',_0x47ac72(0x226),'join','inner',_0x47ac72(0x1f5),'right','full',_0x47ac72(0x20d),_0x47ac72(0x1e5)])[_0x47ac72(0x1f4)](_0x5266b3);}function stripOuterParentheses(_0x38f85d){const _0x23c891=a220_0x5018;let _0x5a3e91=_0x38f85d['trim']();while(_0x5a3e91[_0x23c891(0x216)]('(')&&_0x5a3e91['endsWith'](')')){let _0x187838=0x0,_0x36fcd3=!![];for(let _0x267265=0x0;_0x267265<_0x5a3e91[_0x23c891(0x222)];_0x267265+=0x1){if(_0x5a3e91[_0x267265]==='(')_0x187838+=0x1;if(_0x5a3e91[_0x267265]===')')_0x187838-=0x1;if(_0x187838===0x0&&_0x267265<_0x5a3e91[_0x23c891(0x222)]-0x1){_0x36fcd3=![];break;}}if(!_0x36fcd3||_0x187838!==0x0)break;_0x5a3e91=_0x5a3e91[_0x23c891(0x1e3)](0x1,-0x1)[_0x23c891(0x22e)]();}return _0x5a3e91;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a221_0x43ce84=a221_0x457b;(function(_0x442b33,_0x56cf35){const _0x1b71f1=a221_0x457b,_0x1fd870=_0x442b33();while(!![]){try{const _0x473b80=-parseInt(_0x1b71f1(0xc3))/0x1+-parseInt(_0x1b71f1(0xc5))/0x2*(parseInt(_0x1b71f1(0xc1))/0x3)+parseInt(_0x1b71f1(0xbf))/0x4+-parseInt(_0x1b71f1(0xc2))/0x5+-parseInt(_0x1b71f1(0xc6))/0x6*(parseInt(_0x1b71f1(0xbd))/0x7)+-parseInt(_0x1b71f1(0xc8))/0x8+parseInt(_0x1b71f1(0xc7))/0x9;if(_0x473b80===_0x56cf35)break;else _0x1fd870['push'](_0x1fd870['shift']());}catch(_0x42f813){_0x1fd870['push'](_0x1fd870['shift']());}}}(a221_0x48c0,0xc3e34));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a221_0x457b(_0x5ec658,_0x4ec900){_0x5ec658=_0x5ec658-0xbc;const _0x48c086=a221_0x48c0();let _0x457bb7=_0x48c086[_0x5ec658];return _0x457bb7;}function a221_0x48c0(){const _0x45ce34=['sql.lock.json','3731zNgwcJ','.rabetbase','300592TKLCPB','sql','699innRjH','2411720AEqaQU','1318126vzOXRP','/sql','3518GJxuZS','2814SEohxz','36662508GiUjDS','7088880xlqSpY'];a221_0x48c0=function(){return _0x45ce34;};return a221_0x48c0();}const DOT_DIR=a221_0x43ce84(0xbe),LOCK_FILE_NAME=a221_0x43ce84(0xbc),TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x27323a,_0x1c0835){const _0x528f43=a221_0x43ce84,_0x5671f4=resolve(_0x1c0835??findProjectRootDirectory()),_0x5d00a8=DOT_DIR+_0x528f43(0xc4),_0x33c613=_0x5d00a8+'/'+_0x27323a;return{'projectRoot':_0x5671f4,'appCode':_0x27323a,'sqlWorkspaceRoot':_0x5d00a8,'sqlRoot':_0x33c613,'sqlRootDir':resolve(_0x5671f4,DOT_DIR,_0x528f43(0xc0),_0x27323a),'lockFilePath':resolve(_0x5671f4,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x5671f4,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(_0x9d4e63,_0x3c2ab8){const _0x13c2ef=a222_0x2833,_0x5983a1=_0x9d4e63();while(!![]){try{const _0x48ca52=-parseInt(_0x13c2ef(0x13f))/0x1+-parseInt(_0x13c2ef(0x130))/0x2*(-parseInt(_0x13c2ef(0x133))/0x3)+parseInt(_0x13c2ef(0x131))/0x4+-parseInt(_0x13c2ef(0x13c))/0x5+-parseInt(_0x13c2ef(0x137))/0x6*(parseInt(_0x13c2ef(0x132))/0x7)+parseInt(_0x13c2ef(0x129))/0x8+parseInt(_0x13c2ef(0x12d))/0x9;if(_0x48ca52===_0x3c2ab8)break;else _0x5983a1['push'](_0x5983a1['shift']());}catch(_0x162571){_0x5983a1['push'](_0x5983a1['shift']());}}}(a222_0x5af5,0x985b2));function a222_0x2833(_0x206118,_0x57d0a6){_0x206118=_0x206118-0x123;const _0x5af5b5=a222_0x5af5();let _0x28336d=_0x5af5b5[_0x206118];return _0x28336d;}import{readdir,stat}from'node:fs/promises';function a222_0x5af5(){const _0x4f9cfe=['.xml','test','replace','64926zCFASi','sql','code','split','dbId','6005665qgZyOd','filter','isDirectory','1027236RsiJuP','dbName','sqlName','name','slice','length','path','mybatisXml','sqlCode','2959368pcVfYH','.sql','sqlRootDir','push','19745226JZriHP','indexOf','mode','114854aEhSGp','1248136dURNCC','721pQMNOm','57pMBQkm'];a222_0x5af5=function(){return _0x4f9cfe;};return a222_0x5af5();}import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0xbcfa31){const _0x3f87db=a222_0x2833;if(_0xbcfa31===_0x3f87db(0x12a))return _0x3f87db(0x138);if(_0xbcfa31===_0x3f87db(0x134))return _0x3f87db(0x127);return undefined;}async function scanSqlFilesRecursively(_0x104dcf,_0x5c1e57){const _0x37506a=a222_0x2833,_0x29e07c=[];try{const _0x18cd9c=await readdir(_0x104dcf,{'withFileTypes':!![]});for(const _0x130798 of _0x18cd9c){const _0xf674d9=join(_0x104dcf,_0x130798[_0x37506a(0x123)]);if(_0x130798[_0x37506a(0x13e)]()){_0x29e07c[_0x37506a(0x12c)](...await scanSqlFilesRecursively(_0xf674d9,_0x5c1e57));continue;}if(!_0x130798['isFile']())continue;const _0x362970=extname(_0x130798[_0x37506a(0x123)])['toLowerCase'](),_0x18ae16=extensionToMode(_0x362970);if(!_0x18ae16)continue;const _0x5b1364=relative(_0x5c1e57,_0xf674d9)[_0x37506a(0x136)](/\\/g,'/'),_0x1d46d0=_0x5b1364[_0x37506a(0x13a)]('/')[_0x37506a(0x13d)](Boolean),_0x583d33=parseSqlPath(_0x1d46d0,_0x130798[_0x37506a(0x123)],_0x362970);if(!_0x583d33)continue;_0x29e07c[_0x37506a(0x12c)]({'sqlCode':_0x583d33[_0x37506a(0x128)],'sqlName':_0x583d33['sqlName'],'dbDirectory':_0x1d46d0[0x0],'filePath':_0xf674d9,'relativePath':_0x5b1364,'lockKey':_0x583d33[_0x37506a(0x128)],'mode':_0x18ae16});}}catch(_0x260fd5){if(_0x260fd5[_0x37506a(0x139)]!=='ENOENT')throw _0x260fd5;}return _0x29e07c;}export async function scanLocalSqlQueries(_0x57f899){const _0x1b4be2=a222_0x2833;return scanSqlFilesRecursively(_0x57f899[_0x1b4be2(0x12b)],_0x57f899[_0x1b4be2(0x12b)]);}export function resolveLocalSqlFilePath(_0x3af655,_0x24cb29,_0x503863){const _0x8560b8=a222_0x2833,_0x32f105=_0x503863?.[_0x8560b8(0x126)]||(_0x503863?.['sqlName']||_0x503863?.[_0x8560b8(0x140)]?buildSqlRelativePath(_0x24cb29,_0x503863?.[_0x8560b8(0x141)],_0x503863?.['dbName'],_0x503863?.[_0x8560b8(0x12f)]||_0x8560b8(0x138),_0x503863?.[_0x8560b8(0x13b)]):buildDefaultSqlFileName(_0x24cb29,_0x503863?.['mode']||_0x8560b8(0x138)));return join(_0x3af655[_0x8560b8(0x12b)],_0x32f105);}export async function directoryExists(_0x59c2d){const _0x32d8d4=a222_0x2833;try{const _0x2c7e64=await stat(_0x59c2d);return _0x2c7e64[_0x32d8d4(0x13e)]();}catch{return![];}}function parseSqlPath(_0x5cbb32,_0x56c9a8,_0x37b308){const _0x470100=a222_0x2833,_0x5daabf=_0x56c9a8[_0x470100(0x124)](0x0,-_0x37b308[_0x470100(0x125)]);if(_0x5cbb32[_0x470100(0x125)]<0x2)return null;const _0x3d1ef8=_0x5daabf[_0x470100(0x12e)]('_');if(_0x3d1ef8<=0x0||_0x3d1ef8>=_0x5daabf[_0x470100(0x125)]-0x1)return null;const _0x368567=_0x5daabf[_0x470100(0x124)](0x0,_0x3d1ef8);if(!isLikelySqlCode(_0x368567))return null;return{'sqlCode':_0x368567,'sqlName':_0x5daabf[_0x470100(0x124)](_0x3d1ef8+0x1)};}function isLikelySqlCode(_0x14e065){const _0x276074=a222_0x2833;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x276074(0x135)](_0x14e065);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2e22fd,_0x3697ae){const _0x499bbc=a223_0x2373,_0x492ad5=_0x2e22fd();while(!![]){try{const _0x4ec42b=-parseInt(_0x499bbc(0x1f3))/0x1+-parseInt(_0x499bbc(0x1f0))/0x2+parseInt(_0x499bbc(0x1e7))/0x3+-parseInt(_0x499bbc(0x1e8))/0x4*(parseInt(_0x499bbc(0x1ea))/0x5)+-parseInt(_0x499bbc(0x1ee))/0x6*(parseInt(_0x499bbc(0x1ef))/0x7)+parseInt(_0x499bbc(0x1f1))/0x8+parseInt(_0x499bbc(0x1ed))/0x9;if(_0x4ec42b===_0x3697ae)break;else _0x492ad5['push'](_0x492ad5['shift']());}catch(_0x440a62){_0x492ad5['push'](_0x492ad5['shift']());}}}(a223_0x1c00,0x6ffea));import{readFile}from'node:fs/promises';import a223_0x472864 from'node:crypto';export function computeSqlContentHash(_0x2f199d){const _0x2b3788=a223_0x2373;return a223_0x472864['createHash'](_0x2b3788(0x1ec))['update'](_0x2f199d)[_0x2b3788(0x1eb)](_0x2b3788(0x1f2));}function a223_0x2373(_0x4f5d02,_0x3a96e7){_0x4f5d02=_0x4f5d02-0x1e7;const _0x1c00ed=a223_0x1c00();let _0x2373e0=_0x1c00ed[_0x4f5d02];return _0x2373e0;}function a223_0x1c00(){const _0x1d3f1d=['hex','877458WqiuwY','795582KOlAZt','377252YSxFCv','utf8','5LHwcIm','digest','md5','4811166HSxatx','70350dmkWsd','63MpmYye','351586FFXFbB','7296408vnRWZf'];a223_0x1c00=function(){return _0x1d3f1d;};return a223_0x1c00();}export async function computeSqlFileHash(_0x25c93f){const _0x55c13a=a223_0x2373,_0x2e847d=await readFile(_0x25c93f,_0x55c13a(0x1e9));return computeSqlContentHash(_0x2e847d);}
|
|
@@ -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(_0x3d16cf,_0xb363e){const _0x3e3089=a224_0x4c37,_0x903bb6=_0x3d16cf();while(!![]){try{const _0x11b0b4=parseInt(_0x3e3089(0x144))/0x1*(-parseInt(_0x3e3089(0x148))/0x2)+-parseInt(_0x3e3089(0x149))/0x3+parseInt(_0x3e3089(0x14e))/0x4*(-parseInt(_0x3e3089(0x13a))/0x5)+-parseInt(_0x3e3089(0x14f))/0x6*(-parseInt(_0x3e3089(0x14b))/0x7)+parseInt(_0x3e3089(0x13d))/0x8*(parseInt(_0x3e3089(0x147))/0x9)+parseInt(_0x3e3089(0x142))/0xa+parseInt(_0x3e3089(0x141))/0xb*(parseInt(_0x3e3089(0x140))/0xc);if(_0x11b0b4===_0xb363e)break;else _0x903bb6['push'](_0x903bb6['shift']());}catch(_0x51eadb){_0x903bb6['push'](_0x903bb6['shift']());}}}(a224_0x3511,0xb1ab2));import{mkdir,readFile,writeFile}from'node:fs/promises';function a224_0x3511(){const _0x479ae0=['code','108hIUNTK','196801fAephC','11249120IYiHTU','apps','290617LegTBw','sqlRoot','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','45270hCEwuw','4FKRtEk','3576993LUxrIG',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','14orhYnG','utf8','\x22\x20vs\x20lock\x20\x22','3376QVYeWJ','2510490OvwTxt','4045HifFMf','lastSync','parse','1688UqwxlS','sqls'];a224_0x3511=function(){return _0x479ae0;};return a224_0x3511();}function a224_0x4c37(_0x2c646e,_0x3c9519){_0x2c646e=_0x2c646e-0x13a;const _0x35115b=a224_0x3511();let _0x4c37cd=_0x35115b[_0x2c646e];return _0x4c37cd;}import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x1bef08,_0x19bce0,_0x2d9c26,_0x1416b4){const _0x2c936b=a224_0x4c37,_0x87d98f=_0x1bef08??createEmptySqlLock();let _0x4560f5=_0x87d98f['apps'][_0x19bce0];if(!_0x4560f5)return _0x4560f5={'sqlRoot':_0x2d9c26,'lastSync':'','sqls':{}},_0x87d98f[_0x2c936b(0x143)][_0x19bce0]=_0x4560f5,{'lockData':_0x87d98f,'appLock':_0x4560f5};if(!_0x4560f5[_0x2c936b(0x145)])_0x4560f5['sqlRoot']=_0x2d9c26;else{if(_0x4560f5[_0x2c936b(0x145)]!==_0x2d9c26)throw new Error(_0x1416b4+_0x2c936b(0x14a)+_0x2d9c26+_0x2c936b(0x14d)+_0x4560f5['sqlRoot']+'\x22.\x20'+_0x2c936b(0x146));}return!_0x4560f5[_0x2c936b(0x13e)]&&(_0x4560f5[_0x2c936b(0x13e)]={}),!_0x4560f5[_0x2c936b(0x13b)]&&(_0x4560f5[_0x2c936b(0x13b)]=''),{'lockData':_0x87d98f,'appLock':_0x4560f5};}export async function readSqlLockFile(_0x2dd8e0){const _0x1de1b4=a224_0x4c37;try{const _0x43d845=await readFile(_0x2dd8e0,'utf8');return JSON[_0x1de1b4(0x13c)](_0x43d845);}catch(_0x22f5e9){if(_0x22f5e9[_0x1de1b4(0x13f)]==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x22f5e9));}}export async function writeSqlLockFile(_0xd460dc,_0x25520d){const _0x50fd4d=a224_0x4c37;await mkdir(dirname(_0xd460dc),{'recursive':!![]}),await writeFile(_0xd460dc,JSON['stringify'](_0x25520d,null,0x2),_0x50fd4d(0x14c));}
|
|
@@ -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(_0x4f02f5,_0x5cf768){const _0x16899e=a226_0x27d7,_0x54c7f5=_0x4f02f5();while(!![]){try{const _0x1fa409=-parseInt(_0x16899e(0x1cb))/0x1*(parseInt(_0x16899e(0x1d1))/0x2)+parseInt(_0x16899e(0x1ce))/0x3*(parseInt(_0x16899e(0x1d8))/0x4)+-parseInt(_0x16899e(0x1dd))/0x5+-parseInt(_0x16899e(0x1d2))/0x6*(-parseInt(_0x16899e(0x1d6))/0x7)+parseInt(_0x16899e(0x1cd))/0x8*(parseInt(_0x16899e(0x1d5))/0x9)+-parseInt(_0x16899e(0x1d3))/0xa+parseInt(_0x16899e(0x1d4))/0xb*(parseInt(_0x16899e(0x1cc))/0xc);if(_0x1fa409===_0x5cf768)break;else _0x54c7f5['push'](_0x54c7f5['shift']());}catch(_0x8c9a58){_0x54c7f5['push'](_0x54c7f5['shift']());}}}(a226_0x49b8,0x97b20));export function detectSqlMode(_0x3cdcc7){const _0xd15e18=a226_0x27d7,_0x5ad706=_0x3cdcc7[_0xd15e18(0x1dc)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x5ad706))return _0xd15e18(0x1d9);return _0xd15e18(0x1d7);}export function getSqlFileExtension(_0x4fa562){const _0x25b814=a226_0x27d7;return _0x4fa562===_0x25b814(0x1d9)?_0x25b814(0x1db):_0x25b814(0x1d0);}export function buildDefaultSqlFileName(_0x46833d,_0x18f1b3){return''+_0x46833d+getSqlFileExtension(_0x18f1b3);}function a226_0x49b8(){const _0xc9a4bc=['unknown-sql','.sql','716322OydJwK','39954tUgkDW','3131420TTWeHl','3387538QYiMsx','9387099HiWPCd','749kAnmlu','sql','12hxWwEw','mybatisXml','replace','.xml','trimStart','5826165oyRRrX','2cTykMi','12DOXnfo','8IzqrFF','752559uYiHuZ'];a226_0x49b8=function(){return _0xc9a4bc;};return a226_0x49b8();}function a226_0x27d7(_0x4e31f9,_0xb51612){_0x4e31f9=_0x4e31f9-0x1cb;const _0x49b86b=a226_0x49b8();let _0x27d735=_0x49b86b[_0x4e31f9];return _0x27d735;}export function sanitizeSqlPathSegment(_0x4cb363,_0x712c25){const _0x4e1c61=a226_0x27d7,_0x30039d=String(_0x4cb363??'')['trim'](),_0x494d94=_0x30039d[_0x4e1c61(0x1da)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')['replace'](/\s+/g,'-')['replace'](/-+/g,'-')[_0x4e1c61(0x1da)](/^\.+/,'')[_0x4e1c61(0x1da)](/\.+$/,'')[_0x4e1c61(0x1da)](/^-+/,'')['replace'](/-+$/,'');return _0x494d94||_0x712c25;}export function buildDbDirectoryName(_0x41b9e7,_0x96d31){return sanitizeSqlPathSegment(_0x41b9e7,_0x96d31!=null?'db-'+_0x96d31:'unknown-db');}export function buildSqlRelativePath(_0x102984,_0xbca553,_0x4970eb,_0x3a456b,_0x1fd635){const _0x5bd999=a226_0x27d7,_0x47a5cd=buildDbDirectoryName(_0x4970eb,_0x1fd635),_0x1033e3=sanitizeSqlPathSegment(_0x102984,_0x5bd999(0x1cf)),_0x35b705=sanitizeSqlPathSegment(_0xbca553,_0x1033e3);return _0x47a5cd+'/'+_0x1033e3+'_'+_0x35b705+getSqlFileExtension(_0x3a456b);}
|