@lovrabet/rabetbase-cli 2.3.16-beta.4 → 2.3.16-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.d.ts +9 -0
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.d.ts +2 -0
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +8 -0
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.d.ts +13 -0
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.d.ts +25 -0
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.d.ts +2 -0
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.d.ts +1 -0
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.d.ts +51 -0
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.d.ts +1 -0
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.d.ts +5 -0
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.d.ts +1 -0
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.d.ts +12 -0
- package/lib/cli-flags.js +1 -1
- package/lib/cli.d.ts +2 -0
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.d.ts +2 -0
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.d.ts +2 -0
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.d.ts +2 -0
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.d.ts +2 -0
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.d.ts +18 -0
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.d.ts +5 -0
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.d.ts +10 -0
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.d.ts +2 -0
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.d.ts +11 -0
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.d.ts +46 -0
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.d.ts +2 -0
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.d.ts +2 -0
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.d.ts +2 -0
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.d.ts +2 -0
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.d.ts +2 -0
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.d.ts +105 -0
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.d.ts +2 -0
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.d.ts +4 -0
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.d.ts +2 -0
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.d.ts +2 -0
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.d.ts +5 -0
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.d.ts +2 -0
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.d.ts +2 -0
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.d.ts +2 -0
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.d.ts +2 -0
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.d.ts +8 -0
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.d.ts +2 -0
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.d.ts +2 -0
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.d.ts +2 -0
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.d.ts +2 -0
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.d.ts +17 -0
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.d.ts +17 -0
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.d.ts +11 -0
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.d.ts +12 -0
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.d.ts +26 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.d.ts +6 -0
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.d.ts +13 -0
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.d.ts +5 -0
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.d.ts +5 -0
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.d.ts +5 -0
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.d.ts +5 -0
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.d.ts +16 -0
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.d.ts +7 -0
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.d.ts +7 -0
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.d.ts +8 -0
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.d.ts +33 -0
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.d.ts +18 -0
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.d.ts +11 -0
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.d.ts +2 -0
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.d.ts +2 -0
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.d.ts +26 -0
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.d.ts +27 -0
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.d.ts +3 -0
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.d.ts +2 -0
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.d.ts +2 -0
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.d.ts +2 -0
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.d.ts +2 -0
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.d.ts +2 -0
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.d.ts +2 -0
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.d.ts +128 -0
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.d.ts +2 -0
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.d.ts +53 -0
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.d.ts +17 -0
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.d.ts +2 -0
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.d.ts +30 -0
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.d.ts +2 -0
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.d.ts +2 -0
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.d.ts +2 -0
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.d.ts +2 -0
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.d.ts +2 -0
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.d.ts +2 -0
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.d.ts +2 -0
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.d.ts +2 -0
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.d.ts +5 -0
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.d.ts +2 -0
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.d.ts +15 -0
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.d.ts +2 -0
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.d.ts +2 -0
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.d.ts +2 -0
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.d.ts +2 -0
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.d.ts +2 -0
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.d.ts +11 -0
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.d.ts +2 -0
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.d.ts +23 -0
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.d.ts +2 -0
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.d.ts +32 -0
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.d.ts +2 -0
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.d.ts +2 -0
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.d.ts +2 -0
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.d.ts +2 -0
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.d.ts +2 -0
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.d.ts +33 -0
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.d.ts +2 -0
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.d.ts +5 -0
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.d.ts +2 -0
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.d.ts +2 -0
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.d.ts +3 -0
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.d.ts +2 -0
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.d.ts +2 -0
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.d.ts +2 -0
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.d.ts +17 -0
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.d.ts +2 -0
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.d.ts +2 -0
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.d.ts +2 -0
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.d.ts +2 -0
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.d.ts +27 -0
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.d.ts +51 -0
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.d.ts +12 -0
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.d.ts +12 -0
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.d.ts +10 -0
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.d.ts +12 -0
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.d.ts +28 -0
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.d.ts +69 -0
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.d.ts +17 -0
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.d.ts +7 -0
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/types.d.ts +162 -0
- package/lib/commands/menu/shared/update-core.d.ts +11 -0
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.d.ts +6 -0
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.d.ts +2 -0
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.d.ts +2 -0
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.d.ts +2 -0
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.d.ts +2 -0
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.d.ts +2 -0
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.d.ts +2 -0
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.d.ts +2 -0
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.d.ts +2 -0
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.d.ts +2 -0
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.d.ts +2 -0
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.d.ts +2 -0
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.d.ts +105 -0
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.d.ts +2 -0
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.d.ts +2 -0
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.d.ts +2 -0
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.d.ts +2 -0
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.d.ts +2 -0
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.d.ts +2 -0
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.d.ts +2 -0
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.d.ts +2 -0
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.d.ts +74 -0
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.d.ts +7 -0
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.d.ts +1 -0
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.d.ts +6 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.d.ts +9 -0
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.d.ts +4 -0
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.d.ts +1 -0
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.d.ts +1 -0
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.d.ts +1 -0
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.d.ts +2 -0
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.d.ts +1 -0
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.d.ts +66 -0
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.d.ts +2 -0
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.d.ts +2 -0
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.d.ts +2 -0
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.d.ts +2 -0
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.d.ts +2 -0
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.d.ts +107 -0
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.d.ts +2 -0
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.d.ts +2 -0
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.d.ts +2 -0
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.d.ts +2 -0
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.d.ts +2 -0
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.d.ts +5 -0
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.d.ts +10 -0
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.d.ts +5 -0
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.d.ts +2 -0
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.d.ts +2 -0
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.d.ts +5 -0
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.d.ts +2 -0
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.d.ts +5 -0
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.d.ts +5 -0
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.d.ts +23 -0
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.d.ts +5 -0
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.d.ts +2 -0
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.d.ts +2 -0
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.d.ts +2 -0
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.d.ts +2 -0
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.d.ts +2 -0
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.d.ts +10 -0
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/workspace/add.d.ts +6 -0
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.d.ts +11 -0
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.d.ts +6 -0
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.d.ts +50 -0
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.d.ts +1 -0
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.d.ts +34 -0
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.d.ts +10 -0
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.d.ts +14 -0
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.d.ts +11 -0
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.d.ts +1 -0
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.d.ts +5 -0
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.d.ts +1 -0
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.d.ts +36 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.d.ts +5 -0
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.d.ts +61 -0
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +102 -0
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.d.ts +31 -0
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +1018 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.d.ts +8 -0
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.d.ts +28 -0
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.d.ts +7 -0
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.d.ts +25 -0
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/types.d.ts +92 -0
- package/lib/core/bff/utils.d.ts +25 -0
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.d.ts +43 -0
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.d.ts +6 -0
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.d.ts +4 -0
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.d.ts +8 -0
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/types.d.ts +22 -0
- package/lib/core/sql-index-auditor.d.ts +33 -0
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.d.ts +7 -0
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.d.ts +7 -0
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.d.ts +5 -0
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.d.ts +14 -0
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/types.d.ts +43 -0
- package/lib/core/sql-sync/utils.d.ts +10 -0
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.d.ts +34 -0
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.d.ts +3 -0
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.d.ts +2 -0
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.d.ts +9 -0
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.d.ts +3 -0
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.d.ts +3 -0
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.d.ts +4 -0
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.d.ts +11 -0
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.d.ts +15 -0
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.d.ts +2 -0
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.d.ts +14 -0
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.d.ts +36 -0
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.d.ts +3 -0
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.d.ts +63 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -0
- package/lib/generated/build-info.js +1 -1
- package/lib/help.d.ts +1 -0
- package/lib/help.js +1 -1
- package/lib/runtime/confirmation.d.ts +4 -0
- package/lib/runtime/confirmation.js +1 -0
- package/lib/runtime/event.d.ts +5 -0
- package/lib/runtime/event.js +1 -0
- package/lib/runtime/index.d.ts +7 -0
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/queue.d.ts +5 -0
- package/lib/runtime/queue.js +1 -0
- package/lib/runtime/resolve.d.ts +8 -0
- package/lib/runtime/resolve.js +1 -0
- package/lib/runtime/types.d.ts +50 -0
- package/lib/runtime/types.js +1 -0
- package/lib/skills/main.d.ts +41 -0
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +99 -0
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.d.ts +44 -0
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.d.ts +12 -0
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.d.ts +8 -0
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.d.ts +6 -0
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.d.ts +3 -0
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.d.ts +17 -0
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.d.ts +26 -0
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/types/index.d.ts +93 -0
- package/lib/utils/ai_config.d.ts +47 -0
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.d.ts +1 -0
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.d.ts +42 -0
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.d.ts +23 -0
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.d.ts +37 -0
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.d.ts +9 -0
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.d.ts +42 -0
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.d.ts +1 -0
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.d.ts +30 -0
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.d.ts +25 -0
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.d.ts +80 -0
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.d.ts +30 -0
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.d.ts +7 -0
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.d.ts +62 -0
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.d.ts +15 -0
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.d.ts +21 -0
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.d.ts +38 -0
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.d.ts +1 -0
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.d.ts +55 -0
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.d.ts +10 -0
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.d.ts +1 -0
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.d.ts +1 -0
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.d.ts +6 -0
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +9 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQL 内容校验(轻量级)
|
|
3
|
+
*
|
|
4
|
+
* 集成在 SQL 创建与推送管线中作为前置校验步骤。
|
|
5
|
+
* DELETE / DDL 语句被阻止自动保存——须用户手动在平台操作。
|
|
6
|
+
* 从 lovrabet-dataset-mcp 的 sql-parser.ts 提取核心逻辑,无外部依赖。
|
|
7
|
+
*/
|
|
8
|
+
export interface SqlTypeInfo {
|
|
9
|
+
type: "SELECT" | "INSERT" | "UPDATE" | "DELETE" | "DDL" | "UNKNOWN";
|
|
10
|
+
isSelectOnly: boolean;
|
|
11
|
+
isDangerous: boolean;
|
|
12
|
+
reason?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SqlValidation {
|
|
15
|
+
valid: boolean;
|
|
16
|
+
sqlType: SqlTypeInfo;
|
|
17
|
+
tables: string[];
|
|
18
|
+
parameters: string[];
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
21
|
+
type SqlStatementType = "SELECT" | "INSERT" | "UPDATE" | "DELETE";
|
|
22
|
+
export interface SqlStaticAnalysisSource {
|
|
23
|
+
sql: string;
|
|
24
|
+
mode: "sql" | "mybatisXml";
|
|
25
|
+
statementType?: SqlStatementType;
|
|
26
|
+
error?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const MYBATIS_DYNAMIC_START_MARKER = "__RABETBASE_MYBATIS_DYNAMIC_START__";
|
|
29
|
+
export declare const MYBATIS_DYNAMIC_END_MARKER = "__RABETBASE_MYBATIS_DYNAMIC_END__";
|
|
30
|
+
export declare const MYBATIS_INCLUDE_MARKER = "__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__";
|
|
31
|
+
export declare function normalizeSqlForStaticAnalysis(sqlContent: string): SqlStaticAnalysisSource;
|
|
32
|
+
export declare function detectSqlType(sqlContent: string): SqlTypeInfo;
|
|
33
|
+
export declare function validateSql(sqlContent: string): SqlValidation;
|
|
34
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a227_0x377610=a227_0x5739;(function(_0x43c208,_0x1fbd3b){const _0x4572b2=a227_0x5739,_0x10eba2=_0x43c208();while(!![]){try{const _0xdf8e62=-parseInt(_0x4572b2(0x16e))/0x1*(-parseInt(_0x4572b2(0x161))/0x2)+-parseInt(_0x4572b2(0x15f))/0x3*(-parseInt(_0x4572b2(0x14b))/0x4)+parseInt(_0x4572b2(0x131))/0x5+-parseInt(_0x4572b2(0x143))/0x6*(-parseInt(_0x4572b2(0x17d))/0x7)+parseInt(_0x4572b2(0x165))/0x8*(parseInt(_0x4572b2(0x171))/0x9)+-parseInt(_0x4572b2(0x181))/0xa*(parseInt(_0x4572b2(0x182))/0xb)+-parseInt(_0x4572b2(0x183))/0xc*(parseInt(_0x4572b2(0x130))/0xd);if(_0xdf8e62===_0x1fbd3b)break;else _0x10eba2['push'](_0x10eba2['shift']());}catch(_0x1bdaf8){_0x10eba2['push'](_0x10eba2['shift']());}}}(a227_0xc9fb,0xe2565));function a227_0x5739(_0x3cb1b7,_0x483042){_0x3cb1b7=_0x3cb1b7-0x12c;const _0xc9fbc8=a227_0xc9fb();let _0x57399d=_0xc9fbc8[_0x3cb1b7];return _0x57399d;}const MYBATIS_OUTER_TAGS=new Map([['select',a227_0x377610(0x139)],['insert',a227_0x377610(0x13e)],[a227_0x377610(0x162),'UPDATE'],[a227_0x377610(0x13b),a227_0x377610(0x14e)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a227_0x377610(0x16d),'foreach','choose',a227_0x377610(0x156),a227_0x377610(0x17c),a227_0x377610(0x136),a227_0x377610(0x152),a227_0x377610(0x142),'include',a227_0x377610(0x178)]),MYBATIS_BRANCH_TAGS=new Set(['if',a227_0x377610(0x16a),a227_0x377610(0x170),a227_0x377610(0x156),a227_0x377610(0x17c)]);export const MYBATIS_DYNAMIC_START_MARKER=a227_0x377610(0x137);export const MYBATIS_DYNAMIC_END_MARKER=a227_0x377610(0x12d);export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT='__RABETBASE_UNRESOLVED_SQL_FRAGMENT__',MYBATIS_OUTER_TAG_PATTERN=new RegExp(a227_0x377610(0x16c)+[...MYBATIS_OUTER_TAGS[a227_0x377610(0x150)]()][a227_0x377610(0x160)]('|')+a227_0x377610(0x167),'i');export function normalizeSqlForStaticAnalysis(_0x46552e){const _0x6e8ae=a227_0x377610,_0x2ab94f=typeof _0x46552e===_0x6e8ae(0x164)?_0x46552e:'';if(!startsWithMybatisStatementWrapper(_0x2ab94f))return{'sql':_0x2ab94f,'mode':_0x6e8ae(0x155)};let _0x248716=0x0,_0x42ebc9='',_0x20efa2,_0x93d5f5=![],_0x5ce42f=![];const _0xeb658f=[];while(_0x248716<_0x2ab94f[_0x6e8ae(0x185)]){if(_0x2ab94f['startsWith'](_0x6e8ae(0x18a),_0x248716)){const _0x5ebb4d=_0x2ab94f[_0x6e8ae(0x166)](_0x6e8ae(0x17b),_0x248716+0x4);if(_0x5ebb4d<0x0)return invalidMybatisSource(_0x6e8ae(0x17a));_0x42ebc9+='\x20',_0x248716=_0x5ebb4d+0x3;continue;}if(_0x2ab94f['startsWith']('<,_0x248716+0x9);if(_0x307a9e<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x42ebc9+=_0x2ab94f[_0x6e8ae(0x18d)](_0x248716+0x9,_0x307a9e),_0x248716=_0x307a9e+0x3;continue;}if(_0x2ab94f[_0x6e8ae(0x180)]('<?',_0x248716)){if(_0x93d5f5)return invalidMybatisSource(_0x6e8ae(0x13a));const _0x209b5c=_0x2ab94f[_0x6e8ae(0x166)]('?>',_0x248716+0x2);if(_0x209b5c<0x0)return invalidMybatisSource(_0x6e8ae(0x18b));_0x42ebc9+='\x20',_0x248716=_0x209b5c+0x2;continue;}if(_0x2ab94f[_0x248716]!=='<'){const _0x4a83a2=_0x2ab94f['indexOf']('<',_0x248716),_0x331e93=_0x4a83a2<0x0?_0x2ab94f['length']:_0x4a83a2,_0xe1a33a=_0x2ab94f[_0x6e8ae(0x18d)](_0x248716,_0x331e93);if((!_0x93d5f5||_0x5ce42f)&&_0xe1a33a[_0x6e8ae(0x136)]())return invalidMybatisSource(_0x6e8ae(0x13d));if(_0x93d5f5&&!_0x5ce42f){const _0x59e0d0=decodeXmlEntities(_0xe1a33a);if(_0x59e0d0===null)return invalidMybatisSource(_0x6e8ae(0x15c));_0x42ebc9+=_0x59e0d0;}else _0x42ebc9+='\x20';_0x248716=_0x331e93;continue;}const _0x2f1bdc=findXmlTagEnd(_0x2ab94f,_0x248716);if(_0x2f1bdc<0x0)return invalidMybatisSource(_0x6e8ae(0x134));const _0x445e02=_0x2ab94f['slice'](_0x248716,_0x2f1bdc+0x1),_0x351d63=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x6e8ae(0x138)](_0x445e02);if(!_0x351d63)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20tag.');const _0x3fc614=_0x351d63[0x1]==='/',_0x3bd511=_0x351d63[0x2]??'',_0x509560=_0x3bd511['toLowerCase'](),_0x379031=_0x351d63[0x3]??'',_0x1465d1=_0x351d63[0x4]==='/',_0x109764=MYBATIS_OUTER_TAGS[_0x6e8ae(0x177)](_0x509560);if(!_0x109764&&!MYBATIS_DYNAMIC_TAGS[_0x6e8ae(0x146)](_0x509560))return invalidMybatisSource(_0x6e8ae(0x188)+_0x509560+'>.');if(!_0x109764&&_0x3bd511!==_0x509560)return invalidMybatisSource(_0x6e8ae(0x189)+_0x3bd511+'>.');if(_0x3fc614){if(_0x379031[_0x6e8ae(0x136)]()||_0x1465d1)return invalidMybatisSource(_0x6e8ae(0x163)+_0x3bd511+'>.');const _0xa405c6=_0xeb658f['at'](-0x1);if(!_0xa405c6||(_0xa405c6[_0x6e8ae(0x15d)]?_0xa405c6['tagName']!==_0x509560:_0xa405c6['rawName']!==_0x3bd511))return invalidMybatisSource(_0x6e8ae(0x13c)+_0x3bd511+'>.');_0xeb658f[_0x6e8ae(0x174)]();if(_0xa405c6['outer'])_0x5ce42f=!![];_0x42ebc9+=MYBATIS_BRANCH_TAGS['has'](_0x509560)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x379031))return invalidMybatisSource(_0x6e8ae(0x186)+_0x3bd511+'>.');if(_0x509560===_0x6e8ae(0x178)&&(!_0x1465d1||_0xeb658f['at'](-0x1)?.['tagName']!==_0x6e8ae(0x140)))return invalidMybatisSource(_0x6e8ae(0x176));if(_0x109764){if(_0x93d5f5||_0xeb658f['length']>0x0)return invalidMybatisSource('Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.');_0x93d5f5=!![],_0x5ce42f=_0x1465d1,_0x20efa2=_0x109764;}else{if(!_0x93d5f5||_0x5ce42f)return invalidMybatisSource(_0x6e8ae(0x14a)+_0x3bd511+'>.');}_0x42ebc9+=_0x509560===_0x6e8ae(0x16d)?_0x6e8ae(0x12e):_0x509560===_0x6e8ae(0x152)?_0x6e8ae(0x154):_0x509560==='include'?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS['has'](_0x509560)&&!_0x1465d1?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x1465d1&&_0xeb658f[_0x6e8ae(0x132)]({'rawName':_0x3bd511,'tagName':_0x509560,'outer':!!_0x109764});}_0x248716=_0x2f1bdc+0x1;}if(_0xeb658f[_0x6e8ae(0x185)]>0x0)return invalidMybatisSource(_0x6e8ae(0x159)+_0xeb658f['at'](-0x1)?.[_0x6e8ae(0x168)]+'>.');if(!_0x93d5f5||!_0x5ce42f)return invalidMybatisSource(_0x6e8ae(0x187));return{'sql':_0x42ebc9['trim'](),'mode':_0x6e8ae(0x153),..._0x20efa2?{'statementType':_0x20efa2}:{}};}function hasWellFormedXmlAttributes(_0x366c91){const _0x2a3fd1=a227_0x377610;let _0x362cfd=0x0;const _0xa00e09=new Set();while(_0x362cfd<_0x366c91['length']){while(_0x362cfd<_0x366c91[_0x2a3fd1(0x185)]&&/\s/[_0x2a3fd1(0x135)](_0x366c91[_0x362cfd]??''))_0x362cfd+=0x1;if(_0x362cfd>=_0x366c91['length'])return!![];const _0x58c553=/^[A-Za-z_:][\w:.-]*/[_0x2a3fd1(0x138)](_0x366c91[_0x2a3fd1(0x18d)](_0x362cfd)),_0x336a64=_0x58c553?.[0x0];if(!_0x336a64||_0xa00e09[_0x2a3fd1(0x146)](_0x336a64))return![];_0xa00e09[_0x2a3fd1(0x18c)](_0x336a64),_0x362cfd+=_0x336a64[_0x2a3fd1(0x185)];while(_0x362cfd<_0x366c91[_0x2a3fd1(0x185)]&&/\s/['test'](_0x366c91[_0x362cfd]??''))_0x362cfd+=0x1;if(_0x366c91[_0x362cfd]!=='=')return![];_0x362cfd+=0x1;while(_0x362cfd<_0x366c91['length']&&/\s/[_0x2a3fd1(0x135)](_0x366c91[_0x362cfd]??''))_0x362cfd+=0x1;const _0x5b56a4=_0x366c91[_0x362cfd];if(_0x5b56a4!=='\x22'&&_0x5b56a4!=='\x27')return![];_0x362cfd+=0x1;const _0x40be4d=_0x366c91['indexOf'](_0x5b56a4,_0x362cfd);if(_0x40be4d<0x0)return![];if(decodeXmlEntities(_0x366c91[_0x2a3fd1(0x18d)](_0x362cfd,_0x40be4d))===null)return![];_0x362cfd=_0x40be4d+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x411a20){const _0x46c59f=a227_0x377610;let _0x278f86=0x0;const _0x3673ff=()=>{while(_0x278f86<_0x411a20['length']&&/\s/['test'](_0x411a20[_0x278f86]??''))_0x278f86+=0x1;};_0x3673ff();while(_0x278f86<_0x411a20['length']){if(_0x411a20[_0x46c59f(0x180)](_0x46c59f(0x18a),_0x278f86)){const _0x205faf=_0x411a20['indexOf'](_0x46c59f(0x17b),_0x278f86+0x4);if(_0x205faf<0x0)return!![];_0x278f86=_0x205faf+0x3,_0x3673ff();continue;}if(_0x411a20[_0x46c59f(0x180)]('<?',_0x278f86)){const _0x373d07=_0x411a20[_0x46c59f(0x166)]('?>',_0x278f86+0x2);if(_0x373d07<0x0)return!![];_0x278f86=_0x373d07+0x2,_0x3673ff();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x46c59f(0x135)](_0x411a20[_0x46c59f(0x18d)](_0x278f86));}function invalidMybatisSource(_0x4194aa){return{'sql':'','mode':'mybatisXml','error':_0x4194aa};}function findXmlTagEnd(_0xccbaee,_0x47e914){const _0x5ba80f=a227_0x377610;let _0x599ff9;for(let _0x5f12cd=_0x47e914+0x1;_0x5f12cd<_0xccbaee[_0x5ba80f(0x185)];_0x5f12cd+=0x1){const _0x4b0c4e=_0xccbaee[_0x5f12cd];if(_0x599ff9){if(_0x4b0c4e===_0x599ff9)_0x599ff9=undefined;continue;}if(_0x4b0c4e==='\x22'||_0x4b0c4e==='\x27'){_0x599ff9=_0x4b0c4e;continue;}if(_0x4b0c4e==='>')return _0x5f12cd;}return-0x1;}function decodeXmlEntities(_0x3e4377){let _0x389f24=![];const _0x542bef=_0x3e4377['replace'](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x26fad6=>{const _0x1db77d=a227_0x5739;if(_0x26fad6===_0x1db77d(0x15b))return'<';if(_0x26fad6===_0x1db77d(0x145))return'>';if(_0x26fad6==='"')return'\x22';if(_0x26fad6===''')return'\x27';if(_0x26fad6==='&')return'&';const _0x4e8a59=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x1db77d(0x138)](_0x26fad6);if(_0x4e8a59){const _0x140c15=_0x4e8a59[0x1],_0x30a602=_0x4e8a59[0x2],_0x2f1a22=Number[_0x1db77d(0x18e)](_0x140c15??_0x30a602??'',_0x140c15?0x10:0xa);if(isValidXmlCharacter(_0x2f1a22))return String[_0x1db77d(0x148)](_0x2f1a22);}return _0x389f24=!![],'';});return _0x389f24?null:_0x542bef;}function isValidXmlCharacter(_0x2317df){return _0x2317df===0x9||_0x2317df===0xa||_0x2317df===0xd||_0x2317df>=0x20&&_0x2317df<=0xd7ff||_0x2317df>=0xe000&&_0x2317df<=0xfffd||_0x2317df>=0x10000&&_0x2317df<=0x10ffff;}export function detectSqlType(_0x1a2c01){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x1a2c01));}function detectNormalizedSqlType(_0x31d10d){const _0x40b12c=a227_0x377610;if(_0x31d10d[_0x40b12c(0x12c)])return{'type':_0x40b12c(0x18f),'isSelectOnly':![],'isDangerous':![],'reason':_0x31d10d[_0x40b12c(0x12c)]};if(!_0x31d10d[_0x40b12c(0x155)][_0x40b12c(0x136)]())return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x40b12c(0x13f)};const _0x4addc6=stripStaticAnalysisMarkers(_0x31d10d['sql'])['replace'](/#\{[^}]*\}/g,'?')[_0x40b12c(0x144)](/\$\{[^}]*\}/g,'?')[_0x40b12c(0x144)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x40b12c(0x144)](/\/\*[\s\S]*?\*\//g,'')[_0x40b12c(0x136)](),_0x160e4b=_0x4addc6[_0x40b12c(0x169)]('\x0a');let _0x1d3e23='';for(const _0x440586 of _0x160e4b){const _0x4fb335=_0x440586[_0x40b12c(0x136)]();if(!_0x4fb335||_0x4fb335[_0x40b12c(0x180)]('--')||_0x4fb335[_0x40b12c(0x180)]('/*'))continue;_0x1d3e23=_0x4fb335;break;}const _0x1bab6d=_0x1d3e23[_0x40b12c(0x179)](),_0x2e1209=_0x31d10d[_0x40b12c(0x15e)],_0x59e3e6=maskSqlTextForBlockedKeywordScan(_0x4addc6),_0x2f33cd=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x40b12c(0x135)](_0x59e3e6);if(_0x2e1209===_0x40b12c(0x139)||!_0x2e1209&&(_0x1bab6d[_0x40b12c(0x180)]('SELECT')||_0x1bab6d[_0x40b12c(0x180)](_0x40b12c(0x14c)))){const _0x403dcd=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x40b12c(0x135)](_0x4addc6);return{'type':_0x40b12c(0x139),'isSelectOnly':!_0x403dcd,'isDangerous':_0x403dcd,'reason':_0x403dcd?_0x40b12c(0x173):undefined};}if(_0x2e1209===_0x40b12c(0x13e)||!_0x2e1209&&_0x1bab6d[_0x40b12c(0x180)](_0x40b12c(0x13e)))return{'type':'INSERT','isSelectOnly':![],'isDangerous':_0x2f33cd,'reason':_0x2f33cd?_0x40b12c(0x190):undefined};if(_0x2e1209===_0x40b12c(0x14f)||!_0x2e1209&&_0x1bab6d[_0x40b12c(0x180)](_0x40b12c(0x14f)))return{'type':_0x40b12c(0x14f),'isSelectOnly':![],'isDangerous':_0x2f33cd,'reason':_0x2f33cd?_0x40b12c(0x190):undefined};if(_0x2e1209===_0x40b12c(0x14e)||!_0x2e1209&&_0x1bab6d[_0x40b12c(0x180)](_0x40b12c(0x14e)))return{'type':_0x40b12c(0x14e),'isSelectOnly':![],'isDangerous':!![],'reason':_0x40b12c(0x15a)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i['test'](_0x1bab6d))return{'type':_0x40b12c(0x151),'isSelectOnly':![],'isDangerous':!![],'reason':_0x40b12c(0x12f)};return{'type':_0x40b12c(0x18f),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x41636f){const _0x249f9a=a227_0x377610;return _0x41636f[_0x249f9a(0x147)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x249f9a(0x147)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x249f9a(0x147)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x5051a5){const _0x2d8503=a227_0x377610;return _0x5051a5[_0x2d8503(0x144)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x2d8503(0x144)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x2d8503(0x144)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x2d8503(0x144)](/--.*$/gm,'\x20')[_0x2d8503(0x144)](/#.*$/gm,'\x20')[_0x2d8503(0x144)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x5678e8){const _0x401c9b=a227_0x377610,_0x562a79=_0x5678e8[_0x401c9b(0x144)](/#\{[^}]*\}/g,'?')[_0x401c9b(0x144)](/\$\{[^}]*\}/g,'?')[_0x401c9b(0x144)](/'[^']*'/g,'\x27\x27')[_0x401c9b(0x144)](/--.*$/gm,'')[_0x401c9b(0x144)](/\/\*[\s\S]*?\*\//g,''),_0x112930=[],_0x870eea=_0x562a79[_0x401c9b(0x17e)](/FROM\s+([^\s,)(]+)/i);addTable(_0x112930,_0x870eea?.[0x1]);for(const _0x1b80d4 of _0x562a79[_0x401c9b(0x157)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x112930,_0x1b80d4[0x1]);}const _0xd28396=_0x562a79[_0x401c9b(0x17e)](/INTO\s+([^\s(]+)/i);addTable(_0x112930,_0xd28396?.[0x1]);const _0x13a580=_0x562a79[_0x401c9b(0x17e)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x112930,_0x13a580?.[0x1]),_0x112930;}function addTable(_0x3a4026,_0x3675ad){const _0x3898a7=a227_0x377610,_0x5d353e=_0x3675ad?.[_0x3898a7(0x144)](/[`"]/g,'');_0x5d353e&&_0x5d353e!==UNRESOLVED_SQL_FRAGMENT&&!_0x3a4026[_0x3898a7(0x17f)](_0x5d353e)&&_0x3a4026[_0x3898a7(0x132)](_0x5d353e);}function a227_0xc9fb(){const _0x260c9f=['add','slice','parseInt','UNKNOWN','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','error','__RABETBASE_MYBATIS_DYNAMIC_END__','\x20WHERE\x20','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','595673VXJOCW','1108885xggOke','push','\x20query\x20targeting\x20','Unterminated\x20MyBatis\x20XML\x20tag.','test','trim','__RABETBASE_MYBATIS_DYNAMIC_START__','exec','SELECT','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','delete','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','INSERT','SQL\x20content\x20is\x20empty','include','\x20with\x20parameters:\x20','bind','18144pCfeGR','replace','>','has','replaceAll','fromCodePoint','reason','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','4NosoAZ','WITH','type','DELETE','UPDATE','keys','DDL','set','mybatisXml','\x20SET\x20','sql','when','matchAll','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','<','Invalid\x20XML\x20entity\x20reference.','outer','statementType','1630881VRnkKH','join','405556IneukM','update','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','string','16ldkyMW','indexOf',')\x5cb','rawName','split','foreach','unknown\x20table(s)','^<\x5cs*(?:','where','4LbgOwb',']]>','choose','1890657RygPbR','from','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','pop','isDangerous','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','get','property','toUpperCase','Unterminated\x20XML\x20comment.','-->','otherwise','1379Guubkq','match','includes','startsWith','20ZZWZJY','8907206fNXtHm','12gxjqhM','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','length','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','<!--','Unterminated\x20XML\x20declaration.'];a227_0xc9fb=function(){return _0x260c9f;};return a227_0xc9fb();}function extractParameters(_0x52415c){const _0x3ed9bd=a227_0x377610,_0x3eabe4=new Set();for(const _0x20c1dc of _0x52415c[_0x3ed9bd(0x157)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x20c1dc[0x1])_0x3eabe4[_0x3ed9bd(0x18c)](_0x20c1dc[0x1]);}return Array[_0x3ed9bd(0x172)](_0x3eabe4);}export function validateSql(_0x12d61f){const _0x5bbeff=a227_0x377610,_0x51e1d9=normalizeSqlForStaticAnalysis(_0x12d61f),_0x11693f=detectNormalizedSqlType(_0x51e1d9),_0x523d76=stripStaticAnalysisMarkers(_0x51e1d9[_0x5bbeff(0x155)]),_0x2ec484=_0x51e1d9[_0x5bbeff(0x12c)]?[]:extractTables(_0x523d76),_0x7140f2=_0x51e1d9['error']?[]:extractParameters(_0x523d76);if(_0x11693f[_0x5bbeff(0x175)])return{'valid':![],'sqlType':_0x11693f,'tables':_0x2ec484,'parameters':_0x7140f2,'message':_0x11693f[_0x5bbeff(0x149)]||_0x11693f[_0x5bbeff(0x14d)]+'\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.'};if(_0x11693f[_0x5bbeff(0x14d)]===_0x5bbeff(0x18f))return{'valid':![],'sqlType':_0x11693f,'tables':_0x2ec484,'parameters':_0x7140f2,'message':_0x51e1d9[_0x5bbeff(0x12c)]?'Unable\x20to\x20detect\x20SQL\x20type.\x20'+_0x51e1d9[_0x5bbeff(0x12c)]:_0x5bbeff(0x158)};return{'valid':!![],'sqlType':_0x11693f,'tables':_0x2ec484,'parameters':_0x7140f2,'message':_0x11693f['type']+_0x5bbeff(0x133)+(_0x2ec484[_0x5bbeff(0x185)]?_0x2ec484[_0x5bbeff(0x160)](',\x20'):_0x5bbeff(0x16b))+(_0x7140f2[_0x5bbeff(0x185)]?_0x5bbeff(0x141)+_0x7140f2[_0x5bbeff(0x160)](',\x20'):'')};}
|
|
1
|
+
const a227_0x492ce4=a227_0x2c20;(function(_0x306490,_0x3e901b){const _0x53dc87=a227_0x2c20,_0x27ec1a=_0x306490();while(!![]){try{const _0x1e86d8=-parseInt(_0x53dc87(0x1a9))/0x1*(parseInt(_0x53dc87(0x1ae))/0x2)+parseInt(_0x53dc87(0x1be))/0x3*(parseInt(_0x53dc87(0x178))/0x4)+-parseInt(_0x53dc87(0x1a4))/0x5*(parseInt(_0x53dc87(0x18d))/0x6)+-parseInt(_0x53dc87(0x170))/0x7*(parseInt(_0x53dc87(0x1af))/0x8)+parseInt(_0x53dc87(0x1b0))/0x9+-parseInt(_0x53dc87(0x166))/0xa+parseInt(_0x53dc87(0x19f))/0xb;if(_0x1e86d8===_0x3e901b)break;else _0x27ec1a['push'](_0x27ec1a['shift']());}catch(_0x2b9e2d){_0x27ec1a['push'](_0x27ec1a['shift']());}}}(a227_0x3545,0x29650));const MYBATIS_OUTER_TAGS=new Map([['select',a227_0x492ce4(0x1b6)],['insert',a227_0x492ce4(0x1ad)],[a227_0x492ce4(0x1a0),a227_0x492ce4(0x181)],['delete',a227_0x492ce4(0x197)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if','where','foreach',a227_0x492ce4(0x1c6),a227_0x492ce4(0x1c8),a227_0x492ce4(0x19b),a227_0x492ce4(0x1ba),a227_0x492ce4(0x19e),a227_0x492ce4(0x18a),a227_0x492ce4(0x18b),a227_0x492ce4(0x1b4)]),MYBATIS_BRANCH_TAGS=new Set(['if',a227_0x492ce4(0x194),a227_0x492ce4(0x1c6),a227_0x492ce4(0x1c8),a227_0x492ce4(0x19b)]);export const MYBATIS_DYNAMIC_START_MARKER=a227_0x492ce4(0x16d);function a227_0x3545(){const _0x20e639=['indexOf','DELETE','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','>','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','otherwise','startsWith','^<\x5cs*(?:','set','10390501jykTsF','update','exec','test','sql','23710aPgwKv','string','\x20query\x20targeting\x20','from','replaceAll','217561NLIZtt','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','<!--','\x20WHERE\x20','INSERT','2umCMbY','16OyerHx','347778QtFQUK','UNKNOWN','has','Invalid\x20XML\x20entity\x20reference.','property','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','SELECT',']]>','tagName','<![CDATA[','trim','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','split','84939brjseC',')\x5cb','__RABETBASE_MYBATIS_DYNAMIC_END__','Unable\x20to\x20detect\x20SQL\x20type.\x20','parseInt',''','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','Unterminated\x20XML\x20declaration.','choose','statementType','when','994530RiMzno','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','length','unknown\x20table(s)','matchAll','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','isDangerous','__RABETBASE_MYBATIS_DYNAMIC_START__','\x20with\x20parameters:\x20','replace','1140356mEVrCo','WITH','SQL\x20content\x20is\x20empty','DDL','rawName','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','Unterminated\x20CDATA\x20section.','add','4hfpbEU','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','push','toUpperCase','where','match','&','error','reason','UPDATE','type','get','-->','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','slice','join','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','bind','include','"','252bDNNeF','Unterminated\x20MyBatis\x20XML\x20tag.','Invalid\x20MyBatis\x20XML\x20tag.','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','Unterminated\x20XML\x20comment.','fromCodePoint','includes','foreach','outer'];a227_0x3545=function(){return _0x20e639;};return a227_0x3545();}export const MYBATIS_DYNAMIC_END_MARKER=a227_0x492ce4(0x1c0);export const MYBATIS_INCLUDE_MARKER=a227_0x492ce4(0x19a);const UNRESOLVED_SQL_FRAGMENT='__RABETBASE_UNRESOLVED_SQL_FRAGMENT__',MYBATIS_OUTER_TAG_PATTERN=new RegExp(a227_0x492ce4(0x19d)+[...MYBATIS_OUTER_TAGS['keys']()][a227_0x492ce4(0x187)]('|')+a227_0x492ce4(0x1bf),'i');export function normalizeSqlForStaticAnalysis(_0x5180c8){const _0x1c155a=a227_0x492ce4,_0x1facd3=typeof _0x5180c8===_0x1c155a(0x1a5)?_0x5180c8:'';if(!startsWithMybatisStatementWrapper(_0x1facd3))return{'sql':_0x1facd3,'mode':_0x1c155a(0x1a3)};let _0x49d8f0=0x0,_0x28797d='',_0x4acac6,_0x3fd766=![],_0x5c5bb1=![];const _0x4f49f3=[];while(_0x49d8f0<_0x1facd3[_0x1c155a(0x168)]){if(_0x1facd3[_0x1c155a(0x19c)](_0x1c155a(0x1ab),_0x49d8f0)){const _0x1254ae=_0x1facd3['indexOf'](_0x1c155a(0x184),_0x49d8f0+0x4);if(_0x1254ae<0x0)return invalidMybatisSource(_0x1c155a(0x191));_0x28797d+='\x20',_0x49d8f0=_0x1254ae+0x3;continue;}if(_0x1facd3[_0x1c155a(0x19c)](_0x1c155a(0x1b9),_0x49d8f0)){if(!_0x3fd766||_0x5c5bb1)return invalidMybatisSource('CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');const _0x197619=_0x1facd3[_0x1c155a(0x196)](_0x1c155a(0x1b7),_0x49d8f0+0x9);if(_0x197619<0x0)return invalidMybatisSource(_0x1c155a(0x176));_0x28797d+=_0x1facd3['slice'](_0x49d8f0+0x9,_0x197619),_0x49d8f0=_0x197619+0x3;continue;}if(_0x1facd3['startsWith']('<?',_0x49d8f0)){if(_0x3fd766)return invalidMybatisSource(_0x1c155a(0x1bc));const _0x54be37=_0x1facd3['indexOf']('?>',_0x49d8f0+0x2);if(_0x54be37<0x0)return invalidMybatisSource(_0x1c155a(0x1c5));_0x28797d+='\x20',_0x49d8f0=_0x54be37+0x2;continue;}if(_0x1facd3[_0x49d8f0]!=='<'){const _0x5afabe=_0x1facd3[_0x1c155a(0x196)]('<',_0x49d8f0),_0x1f2bf0=_0x5afabe<0x0?_0x1facd3[_0x1c155a(0x168)]:_0x5afabe,_0x40f80a=_0x1facd3[_0x1c155a(0x186)](_0x49d8f0,_0x1f2bf0);if((!_0x3fd766||_0x5c5bb1)&&_0x40f80a[_0x1c155a(0x1ba)]())return invalidMybatisSource('SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');if(_0x3fd766&&!_0x5c5bb1){const _0x52b8de=decodeXmlEntities(_0x40f80a);if(_0x52b8de===null)return invalidMybatisSource(_0x1c155a(0x1b3));_0x28797d+=_0x52b8de;}else _0x28797d+='\x20';_0x49d8f0=_0x1f2bf0;continue;}const _0xfa0fb4=findXmlTagEnd(_0x1facd3,_0x49d8f0);if(_0xfa0fb4<0x0)return invalidMybatisSource(_0x1c155a(0x18e));const _0x5008f3=_0x1facd3[_0x1c155a(0x186)](_0x49d8f0,_0xfa0fb4+0x1),_0x4fa6eb=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x1c155a(0x1a1)](_0x5008f3);if(!_0x4fa6eb)return invalidMybatisSource(_0x1c155a(0x18f));const _0x2d9e69=_0x4fa6eb[0x1]==='/',_0x550dbf=_0x4fa6eb[0x2]??'',_0x505afc=_0x550dbf['toLowerCase'](),_0x1bc81e=_0x4fa6eb[0x3]??'',_0x23fd4f=_0x4fa6eb[0x4]==='/',_0x24467c=MYBATIS_OUTER_TAGS[_0x1c155a(0x183)](_0x505afc);if(!_0x24467c&&!MYBATIS_DYNAMIC_TAGS['has'](_0x505afc))return invalidMybatisSource(_0x1c155a(0x1c4)+_0x505afc+'>.');if(!_0x24467c&&_0x550dbf!==_0x505afc)return invalidMybatisSource(_0x1c155a(0x1aa)+_0x550dbf+'>.');if(_0x2d9e69){if(_0x1bc81e[_0x1c155a(0x1ba)]()||_0x23fd4f)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x550dbf+'>.');const _0x126e68=_0x4f49f3['at'](-0x1);if(!_0x126e68||(_0x126e68[_0x1c155a(0x195)]?_0x126e68[_0x1c155a(0x1b8)]!==_0x505afc:_0x126e68[_0x1c155a(0x174)]!==_0x550dbf))return invalidMybatisSource(_0x1c155a(0x188)+_0x550dbf+'>.');_0x4f49f3['pop']();if(_0x126e68[_0x1c155a(0x195)])_0x5c5bb1=!![];_0x28797d+=MYBATIS_BRANCH_TAGS[_0x1c155a(0x1b2)](_0x505afc)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x1bc81e))return invalidMybatisSource(_0x1c155a(0x179)+_0x550dbf+'>.');if(_0x505afc===_0x1c155a(0x1b4)&&(!_0x23fd4f||_0x4f49f3['at'](-0x1)?.['tagName']!=='include'))return invalidMybatisSource(_0x1c155a(0x16b));if(_0x24467c){if(_0x3fd766||_0x4f49f3[_0x1c155a(0x168)]>0x0)return invalidMybatisSource('Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.');_0x3fd766=!![],_0x5c5bb1=_0x23fd4f,_0x4acac6=_0x24467c;}else{if(!_0x3fd766||_0x5c5bb1)return invalidMybatisSource(_0x1c155a(0x198)+_0x550dbf+'>.');}_0x28797d+=_0x505afc===_0x1c155a(0x17c)?_0x1c155a(0x1ac):_0x505afc===_0x1c155a(0x19e)?'\x20SET\x20':_0x505afc===_0x1c155a(0x18b)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x1c155a(0x1b2)](_0x505afc)&&!_0x23fd4f?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x23fd4f&&_0x4f49f3['push']({'rawName':_0x550dbf,'tagName':_0x505afc,'outer':!!_0x24467c});}_0x49d8f0=_0xfa0fb4+0x1;}if(_0x4f49f3[_0x1c155a(0x168)]>0x0)return invalidMybatisSource(_0x1c155a(0x185)+_0x4f49f3['at'](-0x1)?.['rawName']+'>.');if(!_0x3fd766||!_0x5c5bb1)return invalidMybatisSource(_0x1c155a(0x1bb));return{'sql':_0x28797d['trim'](),'mode':'mybatisXml',..._0x4acac6?{'statementType':_0x4acac6}:{}};}function hasWellFormedXmlAttributes(_0x42d9ec){const _0x2ca39a=a227_0x492ce4;let _0x3e995d=0x0;const _0x271679=new Set();while(_0x3e995d<_0x42d9ec[_0x2ca39a(0x168)]){while(_0x3e995d<_0x42d9ec[_0x2ca39a(0x168)]&&/\s/[_0x2ca39a(0x1a2)](_0x42d9ec[_0x3e995d]??''))_0x3e995d+=0x1;if(_0x3e995d>=_0x42d9ec[_0x2ca39a(0x168)])return!![];const _0x220035=/^[A-Za-z_:][\w:.-]*/[_0x2ca39a(0x1a1)](_0x42d9ec[_0x2ca39a(0x186)](_0x3e995d)),_0xc3a2ca=_0x220035?.[0x0];if(!_0xc3a2ca||_0x271679['has'](_0xc3a2ca))return![];_0x271679[_0x2ca39a(0x177)](_0xc3a2ca),_0x3e995d+=_0xc3a2ca[_0x2ca39a(0x168)];while(_0x3e995d<_0x42d9ec[_0x2ca39a(0x168)]&&/\s/['test'](_0x42d9ec[_0x3e995d]??''))_0x3e995d+=0x1;if(_0x42d9ec[_0x3e995d]!=='=')return![];_0x3e995d+=0x1;while(_0x3e995d<_0x42d9ec[_0x2ca39a(0x168)]&&/\s/[_0x2ca39a(0x1a2)](_0x42d9ec[_0x3e995d]??''))_0x3e995d+=0x1;const _0x304870=_0x42d9ec[_0x3e995d];if(_0x304870!=='\x22'&&_0x304870!=='\x27')return![];_0x3e995d+=0x1;const _0x2e9e17=_0x42d9ec['indexOf'](_0x304870,_0x3e995d);if(_0x2e9e17<0x0)return![];if(decodeXmlEntities(_0x42d9ec['slice'](_0x3e995d,_0x2e9e17))===null)return![];_0x3e995d=_0x2e9e17+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x4cd625){const _0xcdf511=a227_0x492ce4;let _0x167bbc=0x0;const _0x529020=()=>{const _0x3a8403=a227_0x2c20;while(_0x167bbc<_0x4cd625[_0x3a8403(0x168)]&&/\s/[_0x3a8403(0x1a2)](_0x4cd625[_0x167bbc]??''))_0x167bbc+=0x1;};_0x529020();while(_0x167bbc<_0x4cd625['length']){if(_0x4cd625[_0xcdf511(0x19c)]('<!--',_0x167bbc)){const _0x1b18c1=_0x4cd625[_0xcdf511(0x196)](_0xcdf511(0x184),_0x167bbc+0x4);if(_0x1b18c1<0x0)return!![];_0x167bbc=_0x1b18c1+0x3,_0x529020();continue;}if(_0x4cd625['startsWith']('<?',_0x167bbc)){const _0x36e188=_0x4cd625[_0xcdf511(0x196)]('?>',_0x167bbc+0x2);if(_0x36e188<0x0)return!![];_0x167bbc=_0x36e188+0x2,_0x529020();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0xcdf511(0x1a2)](_0x4cd625[_0xcdf511(0x186)](_0x167bbc));}function invalidMybatisSource(_0xeb19bc){return{'sql':'','mode':'mybatisXml','error':_0xeb19bc};}function findXmlTagEnd(_0x18b358,_0x1ef0ba){const _0x3acdcb=a227_0x492ce4;let _0x58e5aa;for(let _0xbb60d8=_0x1ef0ba+0x1;_0xbb60d8<_0x18b358[_0x3acdcb(0x168)];_0xbb60d8+=0x1){const _0x757f4a=_0x18b358[_0xbb60d8];if(_0x58e5aa){if(_0x757f4a===_0x58e5aa)_0x58e5aa=undefined;continue;}if(_0x757f4a==='\x22'||_0x757f4a==='\x27'){_0x58e5aa=_0x757f4a;continue;}if(_0x757f4a==='>')return _0xbb60d8;}return-0x1;}function a227_0x2c20(_0xe8ba6a,_0x53fada){_0xe8ba6a=_0xe8ba6a-0x166;const _0x3545e1=a227_0x3545();let _0x2c2084=_0x3545e1[_0xe8ba6a];return _0x2c2084;}function decodeXmlEntities(_0x122b29){let _0xc1e468=![];const _0xb12de4=_0x122b29['replace'](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x56fe39=>{const _0x4cd681=a227_0x2c20;if(_0x56fe39==='<')return'<';if(_0x56fe39===_0x4cd681(0x199))return'>';if(_0x56fe39===_0x4cd681(0x18c))return'\x22';if(_0x56fe39===_0x4cd681(0x1c3))return'\x27';if(_0x56fe39===_0x4cd681(0x17e))return'&';const _0x44acf7=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x4cd681(0x1a1)](_0x56fe39);if(_0x44acf7){const _0x27d646=_0x44acf7[0x1],_0x5d8524=_0x44acf7[0x2],_0x4d7e7d=Number[_0x4cd681(0x1c2)](_0x27d646??_0x5d8524??'',_0x27d646?0x10:0xa);if(isValidXmlCharacter(_0x4d7e7d))return String[_0x4cd681(0x192)](_0x4d7e7d);}return _0xc1e468=!![],'';});return _0xc1e468?null:_0xb12de4;}function isValidXmlCharacter(_0x41a218){return _0x41a218===0x9||_0x41a218===0xa||_0x41a218===0xd||_0x41a218>=0x20&&_0x41a218<=0xd7ff||_0x41a218>=0xe000&&_0x41a218<=0xfffd||_0x41a218>=0x10000&&_0x41a218<=0x10ffff;}export function detectSqlType(_0x3b5064){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x3b5064));}function detectNormalizedSqlType(_0x26f8d7){const _0x37ea11=a227_0x492ce4;if(_0x26f8d7[_0x37ea11(0x17f)])return{'type':_0x37ea11(0x1b1),'isSelectOnly':![],'isDangerous':![],'reason':_0x26f8d7[_0x37ea11(0x17f)]};if(!_0x26f8d7[_0x37ea11(0x1a3)][_0x37ea11(0x1ba)]())return{'type':_0x37ea11(0x1b1),'isSelectOnly':![],'isDangerous':![],'reason':_0x37ea11(0x172)};const _0x4d2ae6=stripStaticAnalysisMarkers(_0x26f8d7[_0x37ea11(0x1a3)])[_0x37ea11(0x16f)](/#\{[^}]*\}/g,'?')[_0x37ea11(0x16f)](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x37ea11(0x16f)](/\/\*[\s\S]*?\*\//g,'')[_0x37ea11(0x1ba)](),_0x88a180=_0x4d2ae6[_0x37ea11(0x1bd)]('\x0a');let _0x43045c='';for(const _0x316092 of _0x88a180){const _0x39188d=_0x316092['trim']();if(!_0x39188d||_0x39188d[_0x37ea11(0x19c)]('--')||_0x39188d['startsWith']('/*'))continue;_0x43045c=_0x39188d;break;}const _0x1f141d=_0x43045c[_0x37ea11(0x17b)](),_0x210f21=_0x26f8d7[_0x37ea11(0x1c7)],_0x3d4de5=maskSqlTextForBlockedKeywordScan(_0x4d2ae6),_0x23b3b7=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i['test'](_0x3d4de5);if(_0x210f21===_0x37ea11(0x1b6)||!_0x210f21&&(_0x1f141d[_0x37ea11(0x19c)](_0x37ea11(0x1b6))||_0x1f141d[_0x37ea11(0x19c)](_0x37ea11(0x171)))){const _0x4b2ee5=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x37ea11(0x1a2)](_0x4d2ae6);return{'type':'SELECT','isSelectOnly':!_0x4b2ee5,'isDangerous':_0x4b2ee5,'reason':_0x4b2ee5?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x210f21===_0x37ea11(0x1ad)||!_0x210f21&&_0x1f141d['startsWith'](_0x37ea11(0x1ad)))return{'type':'INSERT','isSelectOnly':![],'isDangerous':_0x23b3b7,'reason':_0x23b3b7?_0x37ea11(0x1b5):undefined};if(_0x210f21==='UPDATE'||!_0x210f21&&_0x1f141d[_0x37ea11(0x19c)](_0x37ea11(0x181)))return{'type':_0x37ea11(0x181),'isSelectOnly':![],'isDangerous':_0x23b3b7,'reason':_0x23b3b7?_0x37ea11(0x1b5):undefined};if(_0x210f21===_0x37ea11(0x197)||!_0x210f21&&_0x1f141d['startsWith'](_0x37ea11(0x197)))return{'type':'DELETE','isSelectOnly':![],'isDangerous':!![],'reason':_0x37ea11(0x167)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x37ea11(0x1a2)](_0x1f141d))return{'type':_0x37ea11(0x173),'isSelectOnly':![],'isDangerous':!![],'reason':_0x37ea11(0x190)};return{'type':_0x37ea11(0x1b1),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x21091e){const _0x542d89=a227_0x492ce4;return _0x21091e[_0x542d89(0x1a8)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x542d89(0x1a8)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x15ed67){const _0x5e7ae5=a227_0x492ce4;return _0x15ed67[_0x5e7ae5(0x16f)](/'(?:''|\\.|[^'])*'/g,'\x20')['replace'](/"(?:""|\\.|[^"])*"/g,'\x20')['replace'](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x5e7ae5(0x16f)](/--.*$/gm,'\x20')[_0x5e7ae5(0x16f)](/#.*$/gm,'\x20')['replace'](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x52fb23){const _0x136769=a227_0x492ce4,_0x3f1dd3=_0x52fb23[_0x136769(0x16f)](/#\{[^}]*\}/g,'?')[_0x136769(0x16f)](/\$\{[^}]*\}/g,'?')[_0x136769(0x16f)](/'[^']*'/g,'\x27\x27')[_0x136769(0x16f)](/--.*$/gm,'')[_0x136769(0x16f)](/\/\*[\s\S]*?\*\//g,''),_0xb2093d=[],_0xccc4bb=_0x3f1dd3['match'](/FROM\s+([^\s,)(]+)/i);addTable(_0xb2093d,_0xccc4bb?.[0x1]);for(const _0x2ef4fd of _0x3f1dd3['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0xb2093d,_0x2ef4fd[0x1]);}const _0x48161d=_0x3f1dd3[_0x136769(0x17d)](/INTO\s+([^\s(]+)/i);addTable(_0xb2093d,_0x48161d?.[0x1]);const _0x191f35=_0x3f1dd3[_0x136769(0x17d)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0xb2093d,_0x191f35?.[0x1]),_0xb2093d;}function addTable(_0x5c09dc,_0x1686b2){const _0x55647a=a227_0x492ce4,_0xfae982=_0x1686b2?.[_0x55647a(0x16f)](/[`"]/g,'');_0xfae982&&_0xfae982!==UNRESOLVED_SQL_FRAGMENT&&!_0x5c09dc[_0x55647a(0x193)](_0xfae982)&&_0x5c09dc[_0x55647a(0x17a)](_0xfae982);}function extractParameters(_0xd02ab2){const _0x531767=a227_0x492ce4,_0x27cef2=new Set();for(const _0x26ab32 of _0xd02ab2[_0x531767(0x16a)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x26ab32[0x1])_0x27cef2[_0x531767(0x177)](_0x26ab32[0x1]);}return Array[_0x531767(0x1a7)](_0x27cef2);}export function validateSql(_0x1a9ff0){const _0x2117e1=a227_0x492ce4,_0x2a8510=normalizeSqlForStaticAnalysis(_0x1a9ff0),_0x1ed543=detectNormalizedSqlType(_0x2a8510),_0x227abb=stripStaticAnalysisMarkers(_0x2a8510[_0x2117e1(0x1a3)]),_0x5708d6=_0x2a8510['error']?[]:extractTables(_0x227abb),_0xc0b285=_0x2a8510[_0x2117e1(0x17f)]?[]:extractParameters(_0x227abb);if(_0x1ed543[_0x2117e1(0x16c)])return{'valid':![],'sqlType':_0x1ed543,'tables':_0x5708d6,'parameters':_0xc0b285,'message':_0x1ed543[_0x2117e1(0x180)]||_0x1ed543['type']+_0x2117e1(0x175)};if(_0x1ed543[_0x2117e1(0x182)]===_0x2117e1(0x1b1))return{'valid':![],'sqlType':_0x1ed543,'tables':_0x5708d6,'parameters':_0xc0b285,'message':_0x2a8510[_0x2117e1(0x17f)]?_0x2117e1(0x1c1)+_0x2a8510[_0x2117e1(0x17f)]:_0x2117e1(0x189)};return{'valid':!![],'sqlType':_0x1ed543,'tables':_0x5708d6,'parameters':_0xc0b285,'message':_0x1ed543['type']+_0x2117e1(0x1a6)+(_0x5708d6[_0x2117e1(0x168)]?_0x5708d6[_0x2117e1(0x187)](',\x20'):_0x2117e1(0x169))+(_0xc0b285[_0x2117e1(0x168)]?_0x2117e1(0x16e)+_0xc0b285['join'](',\x20'):'')};}
|
package/lib/errors.d.ts
ADDED
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a228_0x2a2a70=a228_0x2baa;function a228_0x1e86(){const _0x366176=['5PLFgCT','5376924wQkiQi','1334755YHfBVf','338812uFtbGu','17920881xMXdWI','81836TkZhQb','\x0a\x20\x20\x20\x20\x20\x20\x20','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','Tip:\x20`','2956880GVcukm','Set\x20appcode\x20via\x20`','66nAQfaH','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','3001722oSuTZH','\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.'];a228_0x1e86=function(){return _0x366176;};return a228_0x1e86();}(function(_0x4a5b6d,_0x5461dd){const _0xdc2888=a228_0x2baa,_0x1d8f6c=_0x4a5b6d();while(!![]){try{const _0x31aa07=-parseInt(_0xdc2888(0x133))/0x1*(parseInt(_0xdc2888(0x136))/0x2)+-parseInt(_0xdc2888(0x12f))/0x3*(-parseInt(_0xdc2888(0x138))/0x4)+-parseInt(_0xdc2888(0x135))/0x5+-parseInt(_0xdc2888(0x131))/0x6+-parseInt(_0xdc2888(0x134))/0x7+parseInt(_0xdc2888(0x12d))/0x8+parseInt(_0xdc2888(0x137))/0x9;if(_0x31aa07===_0x5461dd)break;else _0x1d8f6c['push'](_0x1d8f6c['shift']());}catch(_0x3946d5){_0x1d8f6c['push'](_0x1d8f6c['shift']());}}}(a228_0x1e86,0x689e5));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';function a228_0x2baa(_0x504c56,_0x490dee){_0x504c56=_0x504c56-0x12a;const _0x1e864c=a228_0x1e86();let _0x2baa22=_0x1e864c[_0x504c56];return _0x2baa22;}export{CliError};export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':'Run\x20`'+CLI_BIN_NAME+'\x20auth`\x20to\x20login\x20first.','configMissingHint':[a228_0x2a2a70(0x12e)+CLI_BIN_NAME+a228_0x2a2a70(0x130),a228_0x2a2a70(0x12c)+CLI_BIN_NAME+a228_0x2a2a70(0x132)]['join'](a228_0x2a2a70(0x12a)),'notInProjectHint':a228_0x2a2a70(0x12b)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x36a564,_0x52a28b){const _0x6b271e=a229_0x4717,_0x535fc2=_0x36a564();while(!![]){try{const _0x3461c1=parseInt(_0x6b271e(0x1bb))/0x1+-parseInt(_0x6b271e(0x1bd))/0x2*(-parseInt(_0x6b271e(0x1b7))/0x3)+parseInt(_0x6b271e(0x1bc))/0x4*(-parseInt(_0x6b271e(0x1c2))/0x5)+parseInt(_0x6b271e(0x1be))/0x6*(-parseInt(_0x6b271e(0x1c1))/0x7)+parseInt(_0x6b271e(0x1ba))/0x8*(parseInt(_0x6b271e(0x1bf))/0x9)+parseInt(_0x6b271e(0x1b9))/0xa+parseInt(_0x6b271e(0x1c3))/0xb;if(_0x3461c1===_0x52a28b)break;else _0x535fc2['push'](_0x535fc2['shift']());}catch(_0x2deb7f){_0x535fc2['push'](_0x535fc2['shift']());}}}(a229_0x1e27,0xcfff9));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a229_0x11816a}from'@lovrabet/cli-framework';function a229_0x1e27(){const _0x499ebc=['1081528LbDFhY','461293BPrqfx','410460nsAMwv','3222DiQswP','6SKDWTl','45HpxhJv','yes','8790607ohyWFO','75wWUoBF','6920958TRDWJu','2439WkocZF','map','5708180jbSUck'];a229_0x1e27=function(){return _0x499ebc;};return a229_0x1e27();}import{EXPLICIT_YES_FLAG_DESCRIPTION,requiresExplicitYes}from'../framework/explicit-yes.js';function a229_0x4717(_0x3ecb3e,_0x573c35){_0x3ecb3e=_0x3ecb3e-0x1b7;const _0x1e27b3=a229_0x1e27();let _0x4717ff=_0x1e27b3[_0x3ecb3e];return _0x4717ff;}export function buildAllFlags(_0x3f77ed){const _0x184a11=a229_0x4717,_0x338f81=a229_0x11816a(_0x3f77ed,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});if(!requiresExplicitYes(_0x3f77ed))return _0x338f81;return _0x338f81[_0x184a11(0x1b8)](_0x2910e0=>_0x2910e0['name']===_0x184a11(0x1c0)?{..._0x2910e0,'description':EXPLICIT_YES_FLAG_DESCRIPTION}:_0x2910e0);}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CommandDefinition, OutputFormat } from "../framework/types.js";
|
|
2
|
+
export declare function usesStructuredErrorOutput(def: CommandDefinition | undefined): def is CommandDefinition & {
|
|
3
|
+
structuredErrors: true;
|
|
4
|
+
};
|
|
5
|
+
export declare function resolveErrorOutputFormat(currentCommand: {
|
|
6
|
+
def?: CommandDefinition;
|
|
7
|
+
flags?: Record<string, any>;
|
|
8
|
+
defaultFormat?: OutputFormat;
|
|
9
|
+
}): OutputFormat;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a230_0x22f7(_0xe2b0cd,_0x735b49){_0xe2b0cd=_0xe2b0cd-0x1da;var _0x237650=a230_0x2376();var _0x22f7ad=_0x237650[_0xe2b0cd];return _0x22f7ad;}(function(_0x23a351,_0xfe9dcb){var _0x36d297=a230_0x22f7,_0x1247e5=_0x23a351();while(!![]){try{var _0x58af4c=parseInt(_0x36d297(0x1df))/0x1+parseInt(_0x36d297(0x1e1))/0x2*(-parseInt(_0x36d297(0x1e4))/0x3)+parseInt(_0x36d297(0x1de))/0x4*(-parseInt(_0x36d297(0x1e8))/0x5)+parseInt(_0x36d297(0x1e3))/0x6*(-parseInt(_0x36d297(0x1e0))/0x7)+-parseInt(_0x36d297(0x1e6))/0x8*(-parseInt(_0x36d297(0x1db))/0x9)+-parseInt(_0x36d297(0x1e5))/0xa+parseInt(_0x36d297(0x1dd))/0xb;if(_0x58af4c===_0xfe9dcb)break;else _0x1247e5['push'](_0x1247e5['shift']());}catch(_0x3878a2){_0x1247e5['push'](_0x1247e5['shift']());}}}(a230_0x2376,0x7f913));import{resolveOutputConfig}from'@lovrabet/cli-framework';export function usesStructuredErrorOutput(_0x50f9ee){var _0x442e24=a230_0x22f7;return _0x50f9ee?.[_0x442e24(0x1e2)]===!![];}function a230_0x2376(){var _0x476aa6=['9iEecSo','defaultFormat','17183881FIrhHD','100sihteU','293276gshIPB','28GVYKTI','4uNgWII','structuredErrors','837498tLgXcQ','1534371JtTikT','2122200YDPRld','7037872PIIaiV','flags','83840nvTLES','def'];a230_0x2376=function(){return _0x476aa6;};return a230_0x2376();}export function resolveErrorOutputFormat(_0x108bdd){var _0xd6ebcd=a230_0x22f7;if(!_0x108bdd[_0xd6ebcd(0x1da)])return _0x108bdd[_0xd6ebcd(0x1dc)]??'compress';return resolveOutputConfig({'flags':_0x108bdd[_0xd6ebcd(0x1e7)]??{},'def':_0x108bdd['def'],'configDefault':_0x108bdd[_0xd6ebcd(0x1dc)]})['format'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a231_0x259d(){const _0x53fce4=['menu\x20external-link-update','900162LSxqfj','2225685DOIJiE','203991eHapwQ','369838YKmfhg','service','kb\x20update','kb\x20create','command','1935983zKIvfy','873148fvaTWM','has','260304MpsIme','kb\x20delete'];a231_0x259d=function(){return _0x53fce4;};return a231_0x259d();}const a231_0x3d6c83=a231_0x3eca;(function(_0x5b094b,_0x207e5f){const _0x2abfb3=a231_0x3eca,_0x36d005=_0x5b094b();while(!![]){try{const _0x577025=parseInt(_0x2abfb3(0x9f))/0x1+parseInt(_0x2abfb3(0x97))/0x2+-parseInt(_0x2abfb3(0x96))/0x3+parseInt(_0x2abfb3(0x9d))/0x4+-parseInt(_0x2abfb3(0x95))/0x5+-parseInt(_0x2abfb3(0x94))/0x6+parseInt(_0x2abfb3(0x9c))/0x7;if(_0x577025===_0x207e5f)break;else _0x36d005['push'](_0x36d005['shift']());}catch(_0x343988){_0x36d005['push'](_0x36d005['shift']());}}}(a231_0x259d,0x439b6));const EXPLICIT_YES_COMMANDS=new Set([a231_0x3d6c83(0x93),'menu\x20delete','menu\x20regroup-start',a231_0x3d6c83(0x9a),a231_0x3d6c83(0x99),a231_0x3d6c83(0xa0)]);export const EXPLICIT_YES_FLAG_DESCRIPTION='Required\x20for\x20execution\x20after\x20reviewing\x20the\x20--dry-run\x20plan';function a231_0x3eca(_0x3ff711,_0x206917){_0x3ff711=_0x3ff711-0x93;const _0x259dde=a231_0x259d();let _0x3eca22=_0x259dde[_0x3ff711];return _0x3eca22;}export function requiresExplicitYes(_0x1585fe){const _0x162723=a231_0x3d6c83;return EXPLICIT_YES_COMMANDS[_0x162723(0x9e)](_0x1585fe[_0x162723(0x98)]+'\x20'+_0x1585fe[_0x162723(0x9b)]);}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { ParsedFlags } from "@lovrabet/cli-framework";
|
|
2
|
+
export declare const parseFlags: (defs: import("@lovrabet/cli-framework").FlagDef[], rawFlags: Record<string, any>) => import("@lovrabet/cli-framework").ParsedFlags;
|
|
3
|
+
export declare const validateFlags: (defs: import("@lovrabet/cli-framework").FlagDef[], parsed: import("@lovrabet/cli-framework").ParsedFlags, commandLabel: string) => void;
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a232_0x4cd3(_0x2e22bc,_0x23216c){_0x2e22bc=_0x2e22bc-0x1e0;const _0x97b39b=a232_0x97b3();let _0x4cd318=_0x97b39b[_0x2e22bc];return _0x4cd318;}const a232_0x297204=a232_0x4cd3;(function(_0x17e775,_0x1b6fe1){const _0x15ca6c=a232_0x4cd3,_0x3f5a4c=_0x17e775();while(!![]){try{const _0x5a8656=-parseInt(_0x15ca6c(0x1ed))/0x1*(parseInt(_0x15ca6c(0x1e1))/0x2)+-parseInt(_0x15ca6c(0x1e7))/0x3*(parseInt(_0x15ca6c(0x1e3))/0x4)+-parseInt(_0x15ca6c(0x1e6))/0x5*(-parseInt(_0x15ca6c(0x1e2))/0x6)+-parseInt(_0x15ca6c(0x1e0))/0x7*(parseInt(_0x15ca6c(0x1e8))/0x8)+parseInt(_0x15ca6c(0x1e9))/0x9*(-parseInt(_0x15ca6c(0x1ec))/0xa)+-parseInt(_0x15ca6c(0x1e4))/0xb*(parseInt(_0x15ca6c(0x1eb))/0xc)+parseInt(_0x15ca6c(0x1ee))/0xd;if(_0x5a8656===_0x1b6fe1)break;else _0x3f5a4c['push'](_0x3f5a4c['shift']());}catch(_0x39f534){_0x3f5a4c['push'](_0x3f5a4c['shift']());}}}(a232_0x97b3,0xe5099));import{createFlagHelpers}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a232_0x97b3(){const _0x3bca44=['68727906JEfTIS','14HkdMsu','3525958gceRFG','13854bWprTz','684316lymtao','11XDAMKT','validateFlags','1465cBnRDk','6alElUb','1909216CqmNtC','126wniENQ','parseFlags','8851092cBiDal','1217950oFxBEp','1PYqHty'];a232_0x97b3=function(){return _0x3bca44;};return a232_0x97b3();}const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers[a232_0x297204(0x1ea)];export const validateFlags=helpers[a232_0x297204(0x1e5)];
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a233_0x3327(_0x473cfc,_0xa06728){_0x473cfc=_0x473cfc-0x1b9;const _0x4b5337=a233_0x4b53();let _0x3327a4=_0x4b5337[_0x473cfc];return _0x3327a4;}const a233_0x4017d9=a233_0x3327;(function(_0x226208,_0x40c450){const _0x33c053=a233_0x3327,_0x1376fb=_0x226208();while(!![]){try{const _0x21081f=-parseInt(_0x33c053(0x1b9))/0x1+parseInt(_0x33c053(0x1ba))/0x2+-parseInt(_0x33c053(0x1c6))/0x3*(parseInt(_0x33c053(0x1c5))/0x4)+-parseInt(_0x33c053(0x1c8))/0x5+parseInt(_0x33c053(0x1c2))/0x6*(-parseInt(_0x33c053(0x1c9))/0x7)+parseInt(_0x33c053(0x1c4))/0x8+-parseInt(_0x33c053(0x1be))/0x9*(-parseInt(_0x33c053(0x1c0))/0xa);if(_0x21081f===_0x40c450)break;else _0x1376fb['push'](_0x1376fb['shift']());}catch(_0x2b97bd){_0x1376fb['push'](_0x1376fb['shift']());}}}(a233_0x4b53,0xde05e));function a233_0x4b53(){const _0x3291d9=['\x20[args]\x20[flags]','get','5379858dalZof','replace','50naACHv','Requires\x20appcode\x20(set\x20via\x20`','8646594NZOFdZ','Requires\x20explicit\x20--yes\x20for\x20execution;\x20use\x20--dry-run\x20to\x20preview.','10723752eKFeKH','16xKwKyz','958611rfmmKl','generateServiceHelp','3647885BbqPwG','7wQzhDx','1167027hJsvtn','2391956NMDfrm','\x20workspace\x20init`\x20or\x20--appcode).'];a233_0x4b53=function(){return _0x3291d9;};return a233_0x4b53();}import{createHelpGenerators}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{requiresExplicitYes}from'../framework/explicit-yes.js';const generators=createHelpGenerators({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'globalFlags':GLOBAL_FLAGS,'serviceRegistry':serviceRegistry,'getServiceEntry':getServiceEntry,'getServiceDefinitions':_0x754de4=>serviceGroups[a233_0x4017d9(0x1bd)](_0x754de4),'buildAllFlags':buildAllFlags,'appPrerequisiteText':a233_0x4017d9(0x1c1)+CLI_BIN_NAME+a233_0x4017d9(0x1bb),'serviceUsageSuffix':a233_0x4017d9(0x1bc)});export function generateCommandHelp(_0x4b62e2){const _0x59bb8b=a233_0x4017d9,_0x2fb34a=generators['generateCommandHelp'](_0x4b62e2);if(!requiresExplicitYes(_0x4b62e2))return _0x2fb34a;return _0x2fb34a[_0x59bb8b(0x1bf)]('Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.',_0x59bb8b(0x1c3));}export const generateServiceHelp=generators[a233_0x4017d9(0x1c7)];export const generateFullHelp=generators['generateFullHelp'];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 声明式命令框架 —— 统一导出
|
|
3
|
+
*/
|
|
4
|
+
export type { Risk, FlagDef, CommandDefinition, CommandResult, DryRunResult, RuntimeContext, OutputFormat, OutputEnvelope, } from "../framework/types.js";
|
|
5
|
+
export { runCommand } from "../framework/runner.js";
|
|
6
|
+
export { parseFlags, validateFlags } from "../framework/flags.js";
|
|
7
|
+
export { formatOutput } from "../framework/output.js";
|
|
8
|
+
export { generateCommandHelp, generateServiceHelp, generateFullHelp, } from "../framework/help.js";
|
|
9
|
+
export { extractList, extractPaging } from "../framework/response.js";
|
|
10
|
+
export type { Paging, ListResponse } from "../framework/response.js";
|
|
11
|
+
export { riskLevelOrder } from "../framework/types.js";
|
package/lib/framework/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x32b495,_0x50457b){var _0x348581=a234_0x1611,_0x1c7762=_0x32b495();while(!![]){try{var _0x2ebb18=-parseInt(_0x348581(0x9a))/0x1*(parseInt(_0x348581(0x9d))/0x2)+parseInt(_0x348581(0x98))/0x3*(-parseInt(_0x348581(0xa1))/0x4)+parseInt(_0x348581(0x99))/0x5*(-parseInt(_0x348581(0x97))/0x6)+-parseInt(_0x348581(0x9e))/0x7+-parseInt(_0x348581(0x9b))/0x8+parseInt(_0x348581(0x9f))/0x9+parseInt(_0x348581(0xa0))/0xa*(parseInt(_0x348581(0x9c))/0xb);if(_0x2ebb18===_0x50457b)break;else _0x1c7762['push'](_0x1c7762['shift']());}catch(_0x16dc3f){_0x1c7762['push'](_0x1c7762['shift']());}}}(a234_0x4610,0xc04e8));export{runCommand}from'../framework/runner.js';function a234_0x4610(){var _0x26cde5=['429928GbKWMx','579078LEglwN','24pMBpEj','65zTUUNV','254764JjghfJ','8473112gTQnTQ','2111428vVfDvs','2KJBmRW','2199379mmmqvo','13132305XTfgji','160DLhNjH'];a234_0x4610=function(){return _0x26cde5;};return a234_0x4610();}export{parseFlags,validateFlags}from'../framework/flags.js';function a234_0x1611(_0xe361dc,_0x391f5){_0xe361dc=_0xe361dc-0x97;var _0x4610a4=a234_0x4610();var _0x161169=_0x4610a4[_0xe361dc];return _0x161169;}export{formatOutput}from'../framework/output.js';export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'../framework/help.js';export{extractList,extractPaging}from'../framework/response.js';export{riskLevelOrder}from'../framework/types.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CliError } from "../errors.js";
|
|
2
|
+
import type { CommandResultWithNotice, OutputFormat, Risk } from "../framework/types.js";
|
|
3
|
+
interface OutputOptions {
|
|
4
|
+
command: string;
|
|
5
|
+
risk: Risk;
|
|
6
|
+
format: OutputFormat;
|
|
7
|
+
dryRun?: boolean;
|
|
8
|
+
jqFilter?: string;
|
|
9
|
+
}
|
|
10
|
+
interface ErrorOutputOptions extends OutputOptions {
|
|
11
|
+
format: OutputFormat;
|
|
12
|
+
}
|
|
13
|
+
export declare function formatOutput<T>(result: CommandResultWithNotice<T>, options: OutputOptions): void;
|
|
14
|
+
export declare function formatCliError(error: CliError, options: ErrorOutputOptions): boolean;
|
|
15
|
+
export {};
|
package/lib/framework/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x43171d,_0x29e607){const _0x5ad467=a235_0x5d6d,_0x3044a5=_0x43171d();while(!![]){try{const _0xf8645f=-parseInt(_0x5ad467(0x12b))/0x1*(parseInt(_0x5ad467(0x133))/0x2)+parseInt(_0x5ad467(0x135))/0x3*(parseInt(_0x5ad467(0x134))/0x4)+-parseInt(_0x5ad467(0x142))/0x5*(-parseInt(_0x5ad467(0x13f))/0x6)+parseInt(_0x5ad467(0x13a))/0x7+-parseInt(_0x5ad467(0x140))/0x8+-parseInt(_0x5ad467(0x145))/0x9+parseInt(_0x5ad467(0x139))/0xa*(-parseInt(_0x5ad467(0x12c))/0xb);if(_0xf8645f===_0x29e607)break;else _0x3044a5['push'](_0x3044a5['shift']());}catch(_0xecad75){_0x3044a5['push'](_0x3044a5['shift']());}}}(a235_0x2579,0xb811d));function a235_0x5d6d(_0x30a2cd,_0x341b86){_0x30a2cd=_0x30a2cd-0x12b;const _0x25790c=a235_0x2579();let _0x5d6d88=_0x25790c[_0x30a2cd];return _0x5d6d88;}import{createFormatOutput,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a235_0x2579(){const _0x16d5bf=['stdout','endsWith','442330HcsEAs','815458VXJFyl','jqFilter','stringify','hint','url','4320588bSkLeb','1326504obNknD','risk','5ZgbxOS','message','json','3343302grtXwP','write','705803UbZzzk','77QLrXYJ','update','error','pretty','format','trim','code','2yXfRql','16244BbXAFm','1086bsSgWZ','_notice'];a235_0x2579=function(){return _0x16d5bf;};return a235_0x2579();}import{CliError,CliErrors}from'../errors.js';import{applyJqFilter}from'../utils/apply-jq-filter.js';const baseFormatOutput=createFormatOutput({'cliErrors':CliErrors,'jqBinaryResolverOptions':{'bundledJqPaths':resolveBundledJqPaths()}});export function formatOutput(_0xd22b08,_0x40fb7c){const _0x31d791=a235_0x5d6d,_0xe33d42=_0xd22b08[_0x31d791(0x136)],{_notice:_0x8bd63f,..._0x38d01d}=_0xd22b08;void _0x8bd63f,baseFormatOutput(_0x38d01d,_0x40fb7c),_0x40fb7c[_0x31d791(0x130)]===_0x31d791(0x12f)&&printPrettyNotice(_0xe33d42);}export function formatCliError(_0x25bf61,_0x1ee673){const _0x2d79f1=a235_0x5d6d;if(_0x1ee673[_0x2d79f1(0x130)]===_0x2d79f1(0x12f))return![];const _0x429d64=_0x25bf61['data'],_0x3c6042={'ok':![],'command':_0x1ee673['command'],'risk':_0x1ee673[_0x2d79f1(0x141)],'data':_0x429d64??null,'error':{'code':_0x25bf61[_0x2d79f1(0x132)],'message':_0x25bf61[_0x2d79f1(0x143)],..._0x25bf61[_0x2d79f1(0x13d)]?{'hint':_0x25bf61[_0x2d79f1(0x13d)]}:{}}},_0x4ff94e=_0x1ee673[_0x2d79f1(0x130)]===_0x2d79f1(0x144)?JSON[_0x2d79f1(0x13c)](_0x3c6042,null,0x2):JSON[_0x2d79f1(0x13c)](_0x3c6042);let _0x304e8f=_0x4ff94e;if(_0x1ee673[_0x2d79f1(0x13b)]?.[_0x2d79f1(0x131)]())try{_0x304e8f=applyJqFilter(_0x4ff94e,_0x1ee673[_0x2d79f1(0x13b)]);}catch(_0x45ffb4){const _0x5d1a22=_0x45ffb4 instanceof CliError?_0x45ffb4:CliErrors['validation']('jq:\x20'+(_0x45ffb4 instanceof Error?_0x45ffb4[_0x2d79f1(0x143)]:String(_0x45ffb4))),_0x4d8512={..._0x3c6042,'error':{'code':_0x5d1a22[_0x2d79f1(0x132)],'message':_0x5d1a22[_0x2d79f1(0x143)],..._0x5d1a22[_0x2d79f1(0x13d)]?{'hint':_0x5d1a22['hint']}:{},'cause':_0x3c6042[_0x2d79f1(0x12e)]}};_0x304e8f=_0x1ee673['format']===_0x2d79f1(0x144)?JSON[_0x2d79f1(0x13c)](_0x4d8512,null,0x2):JSON[_0x2d79f1(0x13c)](_0x4d8512);}return process[_0x2d79f1(0x137)][_0x2d79f1(0x146)](_0x304e8f[_0x2d79f1(0x138)]('\x0a')?_0x304e8f:_0x304e8f+'\x0a'),!![];}function printPrettyNotice(_0x146078){const _0x30a599=a235_0x5d6d;if(!_0x146078?.[_0x30a599(0x12d)])return;console[_0x30a599(0x12e)](_0x146078[_0x30a599(0x12d)][_0x30a599(0x143)]+'\x20('+_0x146078[_0x30a599(0x12d)][_0x30a599(0x13e)]+')');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a236_0x4d74(){var _0x47471a=['465114ZmQwKk','14sVkwGU','135IlmIEX','7213328oYTDSw','64970QleJan','1065570NIkIpY','8RcapJF','2514230FmhDdW','982374TcKpwh','2075285IWlQMG'];a236_0x4d74=function(){return _0x47471a;};return a236_0x4d74();}(function(_0x518d2e,_0xc6c645){var _0x3ac50d=a236_0x44ee,_0x5c2e1c=_0x518d2e();while(!![]){try{var _0x4e004f=parseInt(_0x3ac50d(0x151))/0x1+-parseInt(_0x3ac50d(0x153))/0x2+-parseInt(_0x3ac50d(0x154))/0x3*(-parseInt(_0x3ac50d(0x152))/0x4)+-parseInt(_0x3ac50d(0x14b))/0x5+parseInt(_0x3ac50d(0x14c))/0x6*(-parseInt(_0x3ac50d(0x14d))/0x7)+parseInt(_0x3ac50d(0x14f))/0x8+-parseInt(_0x3ac50d(0x14e))/0x9*(parseInt(_0x3ac50d(0x150))/0xa);if(_0x4e004f===_0xc6c645)break;else _0x5c2e1c['push'](_0x5c2e1c['shift']());}catch(_0x176b4a){_0x5c2e1c['push'](_0x5c2e1c['shift']());}}}(a236_0x4d74,0xaa48f));function a236_0x44ee(_0xe73f9b,_0x20c5c5){_0xe73f9b=_0xe73f9b-0x14b;var _0x4d7473=a236_0x4d74();var _0x44ee2a=_0x4d7473[_0xe73f9b];return _0x44ee2a;}export{extractList,extractPaging}from'@lovrabet/cli-framework';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CommandDefinition } from "../framework/types.js";
|
|
2
|
+
import type { ParsedFlags } from "@lovrabet/cli-framework";
|
|
3
|
+
/**
|
|
4
|
+
* 通用 --alias → --code 管线解析
|
|
5
|
+
*
|
|
6
|
+
* 当命令同时声明了 "code"(string)和 "alias"(string)两个 flag 时自动触发:
|
|
7
|
+
* 1. --code 与 --alias 至少传一个,否则报错
|
|
8
|
+
* 2. 同时传时以 --code 为准,不解析 --alias
|
|
9
|
+
* 3. 仅传 --alias 时从 apiDir/api.ts 解析并写入 flags.code
|
|
10
|
+
* 4. 命令层只读 ctx.str("code") 即可
|
|
11
|
+
*
|
|
12
|
+
* 未声明 alias flag 的命令不受影响。
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveAliasToCode(def: CommandDefinition, flags: ParsedFlags, apiDir: string, commandLabel: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a237_0x20e6(_0x147699,_0xe0aff4){_0x147699=_0x147699-0x6b;const _0xf946ff=a237_0xf946();let _0x20e606=_0xf946ff[_0x147699];return _0x20e606;}(function(_0x1ece07,_0x2e575b){const _0x15e3af=a237_0x20e6,_0x4e9ada=_0x1ece07();while(!![]){try{const _0x11edcd=-parseInt(_0x15e3af(0x75))/0x1*(parseInt(_0x15e3af(0x7e))/0x2)+-parseInt(_0x15e3af(0x7f))/0x3*(-parseInt(_0x15e3af(0x6d))/0x4)+-parseInt(_0x15e3af(0x7c))/0x5+parseInt(_0x15e3af(0x81))/0x6*(parseInt(_0x15e3af(0x76))/0x7)+parseInt(_0x15e3af(0x79))/0x8*(-parseInt(_0x15e3af(0x85))/0x9)+parseInt(_0x15e3af(0x6b))/0xa*(-parseInt(_0x15e3af(0x7b))/0xb)+parseInt(_0x15e3af(0x73))/0xc*(parseInt(_0x15e3af(0x84))/0xd);if(_0x11edcd===_0x2e575b)break;else _0x4e9ada['push'](_0x4e9ada['shift']());}catch(_0x4ff19b){_0x4e9ada['push'](_0x4e9ada['shift']());}}}(a237_0xf946,0xe572e));import{CliErrors}from'../errors.js';import{resolveAlias,listAliases}from'../core/alias-resolver.js';import{CLI_BIN_NAME}from'../constant/cli.js';export function resolveAliasToCode(_0x290c0f,_0x209389,_0xf1582f,_0x559f56){const _0x56fb7a=a237_0x20e6,_0x4a766e=_0x290c0f[_0x56fb7a(0x78)]['some'](_0x367fa1=>_0x367fa1[_0x56fb7a(0x74)]===_0x56fb7a(0x82)&&_0x367fa1['type']===_0x56fb7a(0x80)),_0x354900=_0x290c0f[_0x56fb7a(0x78)][_0x56fb7a(0x6e)](_0xbc4dd2=>_0xbc4dd2['name']==='alias'&&_0xbc4dd2['type']==='string');if(!_0x4a766e||!_0x354900)return;const _0x253747=_0x209389[_0x56fb7a(0x82)]?String(_0x209389[_0x56fb7a(0x82)]):'',_0x350549=_0x209389[_0x56fb7a(0x77)]?String(_0x209389[_0x56fb7a(0x77)]):'';if(!_0x253747&&!_0x350549)throw CliErrors[_0x56fb7a(0x7a)]('`'+_0x559f56+_0x56fb7a(0x6f));if(_0x350549&&!_0x253747){const _0x50f41f=resolveAlias(_0xf1582f,_0x350549);if(!_0x50f41f){const _0x209c76=listAliases(_0xf1582f)[_0x56fb7a(0x6c)](_0xb858fb=>_0xb858fb[_0x56fb7a(0x77)]),_0x31258c=_0x209c76[_0x56fb7a(0x83)]?_0x56fb7a(0x71)+_0x209c76[_0x56fb7a(0x72)](',\x20'):_0x56fb7a(0x7d)+_0xf1582f+'.\x20Run\x20`'+CLI_BIN_NAME+_0x56fb7a(0x70);throw CliErrors[_0x56fb7a(0x7a)]('Unknown\x20alias\x20\x22'+_0x350549+'\x22.\x20'+_0x31258c);}_0x209389[_0x56fb7a(0x82)]=_0x50f41f;}}function a237_0xf946(){const _0x5bf502=['922028GnGYfL','some','`\x20requires\x20either\x20--code\x20or\x20--alias.','\x20api\x20pull`\x20first.','Available\x20aliases:\x20','join','156oLnEXW','name','1bxZpxh','21qYYRSw','alias','flags','56kiWDky','validation','1283029IXgyTk','8384750oDqAZZ','No\x20api.ts\x20found\x20in\x20','2648702rXlmnG','9VeyEyM','string','2920716wLPZWn','code','length','3152227DswohC','102798FfdtqS','110teZVLH','map'];a237_0xf946=function(){return _0x5bf502;};return a237_0xf946();}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 声明式命令执行管线(Pipeline)
|
|
3
|
+
*
|
|
4
|
+
* 通用编排在 @lovrabet/cli-framework,rb 只保留平台相关准备逻辑:
|
|
5
|
+
* cookie、appCode、apiDir/alias 解析,以及高风险确认文案。
|
|
6
|
+
*/
|
|
7
|
+
import type { CommandDefinition, OutputFormat, MergedCliSnapshot, RuntimeContextExtras } from "../framework/types.js";
|
|
8
|
+
import type { Risk, RunnerAdapter } from "@lovrabet/cli-framework";
|
|
9
|
+
import type { buildConfigFromFlags } from "../context.js";
|
|
10
|
+
export interface PipelineEnv {
|
|
11
|
+
rawFlags: Record<string, any>;
|
|
12
|
+
/** 位置参数(cli.input.slice(2),wildcard 命令时含 command 名) */
|
|
13
|
+
args?: string[];
|
|
14
|
+
resolveAppCode: () => string | undefined;
|
|
15
|
+
resolveCookie: () => string;
|
|
16
|
+
resolveApiDomain: () => string;
|
|
17
|
+
isNonInteractive: boolean;
|
|
18
|
+
defaultFormat?: OutputFormat;
|
|
19
|
+
defaultPageSize?: number;
|
|
20
|
+
defaultVerbose?: boolean;
|
|
21
|
+
apiDir?: string;
|
|
22
|
+
riskLevel?: Risk;
|
|
23
|
+
selectedAppName?: string;
|
|
24
|
+
/** 与入口 buildConfigFromFlags 一致,供 app list 标注当前应用 */
|
|
25
|
+
mergedCli?: MergedCliSnapshot;
|
|
26
|
+
}
|
|
27
|
+
export declare function createPipelineEnv(cliConfig: ReturnType<typeof buildConfigFromFlags>, flags: Record<string, any>, args?: string[]): PipelineEnv;
|
|
28
|
+
export interface RabetbaseRunnerAdapterOptions {
|
|
29
|
+
formatOutput?: RunnerAdapter<PipelineEnv, RuntimeContextExtras>["formatOutput"];
|
|
30
|
+
confirmHighRisk?: RunnerAdapter<PipelineEnv, RuntimeContextExtras>["confirmHighRisk"];
|
|
31
|
+
}
|
|
32
|
+
/** 为终端或嵌入式调用创建同一条执行管线的 adapter。 */
|
|
33
|
+
export declare function createRabetbaseRunnerAdapter(options?: RabetbaseRunnerAdapterOptions): RunnerAdapter<PipelineEnv, RuntimeContextExtras>;
|
|
34
|
+
/** 清理长驻进程中的嵌入式调用可能留下的 cookie、域名和环境状态。 */
|
|
35
|
+
export declare function finalizeRabetbaseRuntimeState(): Promise<void>;
|
|
36
|
+
export declare function runCommand(def: CommandDefinition, env: PipelineEnv, adapter?: RunnerAdapter<PipelineEnv, RuntimeContextExtras>): Promise<void>;
|
package/lib/framework/runner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1442bd,_0x526cfc){const _0x360b47=a238_0x41f5,_0x196d14=_0x1442bd();while(!![]){try{const _0x26aa53=-parseInt(_0x360b47(0x152))/0x1*(parseInt(_0x360b47(0x149))/0x2)+-parseInt(_0x360b47(0x151))/0x3*(-parseInt(_0x360b47(0x148))/0x4)+parseInt(_0x360b47(0x12d))/0x5*(parseInt(_0x360b47(0x118))/0x6)+-parseInt(_0x360b47(0x12f))/0x7*(-parseInt(_0x360b47(0x123))/0x8)+-parseInt(_0x360b47(0x11b))/0x9+-parseInt(_0x360b47(0x134))/0xa+parseInt(_0x360b47(0x114))/0xb;if(_0x26aa53===_0x526cfc)break;else _0x196d14['push'](_0x196d14['shift']());}catch(_0x27651e){_0x196d14['push'](_0x196d14['shift']());}}}(a238_0x22ef,0x7fc7f));import{resolveCommandAuthMode,runCommandWithAdapter,requireConfirmationPrompt}from'@lovrabet/cli-framework';import{formatOutput}from'../framework/output.js';import{CliErrors}from'../errors.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{CLI_BIN_NAME,GLOBAL_FLAGS,PIPELINE_FLAG_NAMES}from'../constant/cli.js';function a238_0x22ef(){const _0x58f9d9=['includes','11672672ElAYzl','resolveCookie','update','production','834KJGaAD','doctor','configMissing','8986698vMYWvG','hasFormat','isNonInteractive','meowKey','replace','rawFlags','explicitAppName','cookie','72MuDpYP','selectedAppName','defaultApp','cancelled','filter','has','formatOutput','trim','find','nonInteractive','24755ZvTZTm','../core/api-client.js','681926FGBIPH','Set\x20appcode\x20via\x20`','schema','some','currentApp','6380520ceDQhv','No\x20appcode\x20is\x20resolved\x20from\x20--appcode,\x20project\x20config,\x20or\x20global\x20config.','apps','mergedCli','\x20is\x20not\x20used\x20as\x20appcode\x20automatically.\x20','string','`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.','LOVRABET_APPCODE','appcode','_notice','High-risk\x20operation\x20`','riskLevel','apiDir','Current\x20resolved\x20appcode\x20is\x20\x22','value','defaultVerbose','pretty','validation','requiresAppCode','name','1797912IfboFH','29536IYXyoY','appCode','none','../constant/env.js','message','resolveApiDomain','hint','service','3nPuWXB','62bawjhd','all','../constant/domain.js','To\x20use\x20this\x20environment\x20variable,\x20pass\x20--appcode\x20\x22$','required','verbose','authRequired','defaultPageSize','format','map','catch'];a238_0x22ef=function(){return _0x58f9d9;};return a238_0x22ef();}import{DEFAULT_API_DIR}from'../constant/paths.js';import{isNonInteractive as a238_0x5b038e}from'../utils/is-non-interactive.js';import{resolveAliasToCode}from'../framework/runner-alias.js';import{resolveLatestUpdateNotice}from'../utils/update-notice.js';function stringFlag(_0x2ac527){const _0x401d57=a238_0x41f5;return typeof _0x2ac527===_0x401d57(0x139)&&_0x2ac527[_0x401d57(0x12a)]()?_0x2ac527[_0x401d57(0x12a)]():undefined;}function resolveEnvAppCode(){const _0x14130a=a238_0x41f5,_0x4685fb=stringFlag(process.env.RABETBASE_APPCODE);if(_0x4685fb)return{'name':'RABETBASE_APPCODE','value':_0x4685fb};const _0x5f7702=stringFlag(process.env.LOVRABET_APPCODE);if(_0x5f7702)return{'name':_0x14130a(0x13b),'value':_0x5f7702};return undefined;}function hasExplicitAppCode(_0x19b1d4,_0x6cf503){const _0x48a71e=a238_0x41f5;return!!(stringFlag(_0x19b1d4[_0x48a71e(0x13c)])||stringFlag(_0x6cf503[_0x48a71e(0x13c)]));}function assertEnvAppCodeNotIgnored(_0x24db5e,_0xa3737e,_0x2e6797){const _0x4c979b=a238_0x41f5;if(!_0xa3737e||_0x2e6797||_0x24db5e===_0xa3737e[_0x4c979b(0x142)])return;const _0x3a48ee=_0x24db5e?_0x4c979b(0x141)+_0x24db5e+'\x22.':_0x4c979b(0x135);throw CliErrors[_0x4c979b(0x145)](_0xa3737e['name']+'='+_0xa3737e['value']+_0x4c979b(0x138)+_0x3a48ee+'\x20'+(_0x4c979b(0x155)+_0xa3737e[_0x4c979b(0x147)]+'\x22.'));}export function createPipelineEnv(_0x1d159a,_0x15edeb,_0x593597=[]){const _0x3de639=a238_0x41f5;return{'rawFlags':_0x15edeb,'args':_0x593597,'resolveAppCode':()=>_0x1d159a[_0x3de639(0x14a)],'resolveCookie':()=>_0x1d159a[_0x3de639(0x122)]||getCookie(),'resolveApiDomain':()=>getApiDomain(),'isNonInteractive':a238_0x5b038e(_0x15edeb),'defaultFormat':_0x1d159a['format'],'defaultPageSize':_0x1d159a['pageSize'],'defaultVerbose':_0x1d159a[_0x3de639(0x157)],'apiDir':_0x1d159a[_0x3de639(0x140)],'riskLevel':_0x1d159a[_0x3de639(0x13f)],'selectedAppName':_0x1d159a[_0x3de639(0x121)],'mergedCli':{'defaultApp':_0x1d159a[_0x3de639(0x125)],'currentApp':_0x1d159a[_0x3de639(0x133)],'appCode':_0x1d159a['appCode'],'apps':_0x1d159a[_0x3de639(0x136)]}};}export function createRabetbaseRunnerAdapter(_0x2f3620={}){const _0x500803=a238_0x41f5;return{'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS[_0x500803(0x127)](_0x3c60a5=>PIPELINE_FLAG_NAMES[_0x500803(0x128)](_0x3c60a5[_0x500803(0x147)]))[_0x500803(0x111)](({name:_0x2932b1,type:_0x5f5857,description:_0x266ff6})=>({'name':_0x2932b1,'type':_0x5f5857,'description':_0x266ff6})),'formatOutput':_0x2f3620[_0x500803(0x129)]??formatOutput,'getCommandLabel'(_0x5b4214){const _0x379943=_0x500803;return CLI_BIN_NAME+'\x20'+_0x5b4214[_0x379943(0x150)]+'\x20'+_0x5b4214['command'];},'riskPolicy':{'skipWhenDryRun':!![],'createError'(_0x1ee9ea){return CliErrors['validation'](_0x1ee9ea);}},async 'prepare'(_0xe73148,_0x5f2f74,_0x489c2b,_0xac7af8){const _0x25100f=_0x500803,_0x4c4af0=_0x5f2f74['apiDir']||DEFAULT_API_DIR;resolveAliasToCode(_0xe73148,_0x489c2b,_0x4c4af0,_0xac7af8);const _0x499b06=resolveCommandAuthMode(_0xe73148);let _0x3b1562='';if(_0x499b06!==_0x25100f(0x14b)){_0x3b1562=_0x5f2f74[_0x25100f(0x115)]()||'';if(!_0x3b1562){if(_0x499b06===_0x25100f(0x156))throw CliErrors[_0x25100f(0x158)]();}else{const {setActiveCookie:_0x50fed0}=await import(_0x25100f(0x12e));_0x50fed0(_0x3b1562);}}const _0x4cc08a=_0x5f2f74['resolveAppCode']()??'';if(_0xe73148[_0x25100f(0x146)]!==![]){assertEnvAppCodeNotIgnored(_0x4cc08a,resolveEnvAppCode(),hasExplicitAppCode(_0x489c2b,_0x5f2f74[_0x25100f(0x120)]));if(!_0x4cc08a)throw CliErrors[_0x25100f(0x11a)](_0x25100f(0x130)+CLI_BIN_NAME+'\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.');}return{'defaults':{'booleans':{'verbose':_0x5f2f74[_0x25100f(0x143)]},'numbers':{'pagesize':_0x5f2f74[_0x25100f(0x159)]}},'extras':{'appCode':_0x4cc08a,'cookie':_0x3b1562,'apiDomain':_0x5f2f74[_0x25100f(0x14e)](),'apiDir':_0x4c4af0,'selectedAppName':_0x5f2f74[_0x25100f(0x124)],'mergedCli':_0x5f2f74[_0x25100f(0x137)]}};},'confirmHighRisk':_0x2f3620['confirmHighRisk']??(async({env:_0x3415b2,commandLabel:_0x267b90})=>{const _0x39a996=_0x500803;if(_0x3415b2[_0x39a996(0x11d)])throw CliErrors['validation'](_0x39a996(0x13e)+_0x267b90+_0x39a996(0x13a));await requireConfirmationPrompt({'lines':['⚠\x20\x20High-risk\x20operation:\x20'+_0x267b90,'\x20\x20\x20Continue?\x20[y/N]\x20'],'createCancelledError':_0x16d182=>CliErrors[_0x39a996(0x126)](_0x16d182)});}),async 'finalize'(){await clearRabetbaseCommandState();}};}const terminalRunnerAdapter=createRabetbaseRunnerAdapter();function a238_0x41f5(_0xf7f1a1,_0x3aafba){_0xf7f1a1=_0xf7f1a1-0x110;const _0x22ef60=a238_0x22ef();let _0x41f592=_0x22ef60[_0xf7f1a1];return _0x41f592;}async function clearRabetbaseCommandState(){const _0x1a1b60=a238_0x41f5,{clearActiveCookie:_0x367a13}=await import(_0x1a1b60(0x12e));_0x367a13();}export async function finalizeRabetbaseRuntimeState(){const _0x298b9d=a238_0x41f5;try{await clearRabetbaseCommandState();}finally{const [{initDomains:_0x5290f0},{initEnv:_0x2c2fbd}]=await Promise[_0x298b9d(0x153)]([import(_0x298b9d(0x154)),import(_0x298b9d(0x14c))]);_0x5290f0(),_0x2c2fbd(_0x298b9d(0x117));}}export async function runCommand(_0x487dc6,_0x54a6fa,_0x4364ae=terminalRunnerAdapter){const _0x56372d=a238_0x41f5;assertRejectedFlags(_0x487dc6,_0x54a6fa[_0x56372d(0x120)]),await runCommandWithAdapter(shouldAttachUpdateNotice(_0x487dc6)?withUpdateNotice(_0x487dc6):_0x487dc6,_0x54a6fa,_0x4364ae);}function assertRejectedFlags(_0x165d49,_0x3aeae4){const _0x1eca05=a238_0x41f5;for(const _0x3fc169 of _0x165d49['rejectedFlags']??[]){const _0xf6a8e3=GLOBAL_FLAGS[_0x1eca05(0x12b)](_0x406dd1=>_0x406dd1[_0x1eca05(0x147)]===_0x3fc169[_0x1eca05(0x147)]),_0x381a33=new Set([_0x3fc169[_0x1eca05(0x147)],toCamelCase(_0x3fc169['name']),_0xf6a8e3?.[_0x1eca05(0x11e)]]),_0x532e18=[..._0x381a33][_0x1eca05(0x132)](_0x55008b=>{if(!_0x55008b)return![];const _0x5147bb=_0x3aeae4[_0x55008b];return _0x5147bb!==undefined&&_0x5147bb!==null&&_0x5147bb!==![];});if(_0x532e18)throw CliErrors[_0x1eca05(0x145)](_0x3fc169[_0x1eca05(0x14d)],_0x3fc169[_0x1eca05(0x14f)]);}}function toCamelCase(_0x30396d){const _0x4f94f5=a238_0x41f5;return _0x30396d[_0x4f94f5(0x11f)](/-([a-z])/g,(_0x5d5c17,_0x51fbc9)=>_0x51fbc9['toUpperCase']());}function shouldAttachUpdateNotice(_0x202562){const _0x19791b=a238_0x41f5;if(_0x202562[_0x19791b(0x11c)]===![])return![];return![_0x19791b(0x116),_0x19791b(0x131),_0x19791b(0x119)][_0x19791b(0x113)](_0x202562['service']);}function withUpdateNotice(_0x501fc4){return{..._0x501fc4,async 'execute'(_0x2ed87f){const _0x329661=a238_0x41f5,_0x2d765b=shouldResolveUpdateNotice(_0x2ed87f)?resolveLatestUpdateNotice()[_0x329661(0x112)](()=>null):Promise['resolve'](null),_0x58676a=await _0x501fc4['execute'](_0x2ed87f);return attachUpdateNotice(_0x58676a,await _0x2d765b);}};}function shouldResolveUpdateNotice(_0x1d9372){const _0x59fe3c=a238_0x41f5;return _0x1d9372[_0x59fe3c(0x110)]===_0x59fe3c(0x144)&&!_0x1d9372[_0x59fe3c(0x12c)];}function attachUpdateNotice(_0x21c4c6,_0x13e049){const _0x148f9e=a238_0x41f5;if(!_0x13e049||!_0x21c4c6||typeof _0x21c4c6!=='object')return _0x21c4c6;const _0x267a1d=_0x21c4c6,_0x5e5c8f=typeof _0x267a1d[_0x148f9e(0x13d)]==='object'&&_0x267a1d['_notice']!==null?_0x267a1d[_0x148f9e(0x13d)]:{};return{..._0x267a1d,'_notice':{..._0x5e5c8f,'update':_0x13e049}};}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type SerializedFlagPattern, type SerializedFlag, type SchemaCommandEntry, type SchemaServiceEntry, type SchemaPayload } from "@lovrabet/cli-framework";
|
|
2
|
+
export type { SerializedFlagPattern, SerializedFlag, SchemaCommandEntry, SchemaServiceEntry, SchemaPayload, };
|
|
3
|
+
export declare function buildSchemaPayload(): Promise<SchemaPayload>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x16a98d,_0x5341c9){const _0x2a61da=a239_0x599f,_0xf33e9d=_0x16a98d();while(!![]){try{const _0x335797=-parseInt(_0x2a61da(0x13b))/0x1*(parseInt(_0x2a61da(0x13e))/0x2)+-parseInt(_0x2a61da(0x141))/0x3+-parseInt(_0x2a61da(0x142))/0x4*(parseInt(_0x2a61da(0x13d))/0x5)+-parseInt(_0x2a61da(0x13c))/0x6+-parseInt(_0x2a61da(0x143))/0x7+-parseInt(_0x2a61da(0x13f))/0x8+parseInt(_0x2a61da(0x144))/0x9;if(_0x335797===_0x5341c9)break;else _0xf33e9d['push'](_0xf33e9d['shift']());}catch(_0x3cf07c){_0xf33e9d['push'](_0xf33e9d['shift']());}}}(a239_0x43de,0xb129b));import{buildSchemaPayload as a239_0x58927c}from'@lovrabet/cli-framework';function a239_0x599f(_0xff17b8,_0x189df7){_0xff17b8=_0xff17b8-0x13b;const _0x43de0c=a239_0x43de();let _0x599f9e=_0x43de0c[_0xff17b8];return _0x599f9e;}import{buildAllFlags}from'../framework/build-all-flags.js';function a239_0x43de(){const _0x2591a1=['4KQFJGP','4069506phZijK','51339582eYBimx','1ehNdDN','7993824CikREJ','6220555pfkPWn','442286ZqAgPD','6935960OuhyOd','../commands/registry.js','2198484iDrevU'];a239_0x43de=function(){return _0x2591a1;};return a239_0x43de();}import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{getCliVersion}from'../utils/version.js';export async function buildSchemaPayload(){const _0x14979e=a239_0x599f,{serviceRegistry:_0x31278f,findDefinition:_0x2dff3d}=await import(_0x14979e(0x140));return a239_0x58927c({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'cliVersion':getCliVersion(),'gitCommit':process.env.GIT_COMMIT??'','globalFlags':GLOBAL_FLAGS,'serviceRegistry':_0x31278f,'buildAllFlags':buildAllFlags,'findDefinition':_0x2dff3d});}
|