@lovrabet/rabetbase-cli 2.3.16-beta.4 → 2.3.16-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.d.ts +9 -0
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.d.ts +2 -0
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +8 -0
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.d.ts +13 -0
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.d.ts +25 -0
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.d.ts +2 -0
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.d.ts +1 -0
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.d.ts +51 -0
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.d.ts +1 -0
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.d.ts +5 -0
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.d.ts +1 -0
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.d.ts +12 -0
- package/lib/cli-flags.js +1 -1
- package/lib/cli.d.ts +2 -0
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.d.ts +2 -0
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.d.ts +2 -0
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.d.ts +2 -0
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.d.ts +2 -0
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.d.ts +18 -0
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.d.ts +5 -0
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.d.ts +10 -0
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.d.ts +2 -0
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.d.ts +11 -0
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.d.ts +46 -0
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.d.ts +2 -0
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.d.ts +2 -0
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.d.ts +2 -0
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.d.ts +2 -0
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.d.ts +2 -0
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.d.ts +105 -0
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.d.ts +2 -0
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.d.ts +4 -0
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.d.ts +2 -0
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.d.ts +2 -0
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.d.ts +5 -0
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.d.ts +2 -0
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.d.ts +2 -0
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.d.ts +2 -0
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.d.ts +2 -0
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.d.ts +8 -0
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.d.ts +2 -0
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.d.ts +2 -0
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.d.ts +2 -0
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.d.ts +2 -0
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.d.ts +17 -0
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.d.ts +17 -0
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.d.ts +11 -0
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.d.ts +12 -0
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.d.ts +26 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.d.ts +6 -0
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.d.ts +13 -0
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.d.ts +5 -0
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.d.ts +5 -0
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.d.ts +5 -0
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.d.ts +5 -0
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.d.ts +16 -0
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.d.ts +7 -0
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.d.ts +7 -0
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.d.ts +8 -0
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.d.ts +33 -0
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.d.ts +18 -0
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.d.ts +11 -0
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.d.ts +2 -0
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.d.ts +2 -0
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.d.ts +26 -0
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.d.ts +27 -0
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.d.ts +3 -0
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.d.ts +2 -0
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.d.ts +2 -0
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.d.ts +2 -0
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.d.ts +2 -0
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.d.ts +2 -0
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.d.ts +2 -0
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.d.ts +128 -0
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.d.ts +2 -0
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.d.ts +53 -0
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.d.ts +17 -0
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.d.ts +2 -0
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.d.ts +30 -0
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.d.ts +2 -0
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.d.ts +2 -0
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.d.ts +2 -0
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.d.ts +2 -0
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.d.ts +2 -0
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.d.ts +2 -0
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.d.ts +2 -0
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.d.ts +2 -0
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.d.ts +5 -0
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.d.ts +2 -0
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.d.ts +15 -0
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.d.ts +2 -0
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.d.ts +2 -0
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.d.ts +2 -0
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.d.ts +2 -0
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.d.ts +2 -0
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.d.ts +11 -0
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.d.ts +2 -0
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.d.ts +23 -0
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.d.ts +2 -0
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.d.ts +32 -0
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.d.ts +2 -0
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.d.ts +2 -0
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.d.ts +2 -0
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.d.ts +2 -0
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.d.ts +2 -0
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.d.ts +33 -0
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.d.ts +2 -0
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.d.ts +5 -0
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.d.ts +2 -0
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.d.ts +2 -0
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.d.ts +3 -0
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.d.ts +2 -0
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.d.ts +2 -0
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.d.ts +2 -0
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.d.ts +17 -0
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.d.ts +2 -0
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.d.ts +2 -0
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.d.ts +2 -0
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.d.ts +2 -0
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.d.ts +27 -0
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.d.ts +51 -0
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.d.ts +12 -0
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.d.ts +12 -0
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.d.ts +10 -0
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.d.ts +12 -0
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.d.ts +28 -0
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.d.ts +69 -0
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.d.ts +17 -0
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.d.ts +7 -0
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/types.d.ts +162 -0
- package/lib/commands/menu/shared/update-core.d.ts +11 -0
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.d.ts +6 -0
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.d.ts +2 -0
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.d.ts +2 -0
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.d.ts +2 -0
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.d.ts +2 -0
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.d.ts +2 -0
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.d.ts +2 -0
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.d.ts +2 -0
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.d.ts +2 -0
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.d.ts +2 -0
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.d.ts +2 -0
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.d.ts +2 -0
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.d.ts +105 -0
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.d.ts +2 -0
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.d.ts +2 -0
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.d.ts +2 -0
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.d.ts +2 -0
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.d.ts +2 -0
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.d.ts +2 -0
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.d.ts +2 -0
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.d.ts +2 -0
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.d.ts +74 -0
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.d.ts +7 -0
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.d.ts +1 -0
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.d.ts +6 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.d.ts +9 -0
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.d.ts +4 -0
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.d.ts +1 -0
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.d.ts +1 -0
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.d.ts +1 -0
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.d.ts +2 -0
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.d.ts +1 -0
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.d.ts +66 -0
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.d.ts +2 -0
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.d.ts +2 -0
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.d.ts +2 -0
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.d.ts +2 -0
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.d.ts +2 -0
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.d.ts +107 -0
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.d.ts +2 -0
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.d.ts +2 -0
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.d.ts +2 -0
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.d.ts +2 -0
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.d.ts +2 -0
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.d.ts +5 -0
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.d.ts +10 -0
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.d.ts +5 -0
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.d.ts +2 -0
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.d.ts +2 -0
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.d.ts +5 -0
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.d.ts +2 -0
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.d.ts +5 -0
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.d.ts +5 -0
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.d.ts +23 -0
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.d.ts +5 -0
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.d.ts +2 -0
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.d.ts +2 -0
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.d.ts +2 -0
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.d.ts +2 -0
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.d.ts +2 -0
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.d.ts +10 -0
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/workspace/add.d.ts +6 -0
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.d.ts +11 -0
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.d.ts +6 -0
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.d.ts +50 -0
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.d.ts +1 -0
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.d.ts +34 -0
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.d.ts +10 -0
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.d.ts +14 -0
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.d.ts +11 -0
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.d.ts +1 -0
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.d.ts +5 -0
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.d.ts +1 -0
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.d.ts +36 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.d.ts +5 -0
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.d.ts +61 -0
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +102 -0
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.d.ts +31 -0
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +1018 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.d.ts +8 -0
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.d.ts +28 -0
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.d.ts +7 -0
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.d.ts +25 -0
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/types.d.ts +92 -0
- package/lib/core/bff/utils.d.ts +25 -0
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.d.ts +43 -0
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.d.ts +6 -0
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.d.ts +4 -0
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.d.ts +8 -0
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/types.d.ts +22 -0
- package/lib/core/sql-index-auditor.d.ts +33 -0
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.d.ts +7 -0
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.d.ts +7 -0
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.d.ts +5 -0
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.d.ts +14 -0
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/types.d.ts +43 -0
- package/lib/core/sql-sync/utils.d.ts +10 -0
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.d.ts +34 -0
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.d.ts +3 -0
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.d.ts +2 -0
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.d.ts +9 -0
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.d.ts +3 -0
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.d.ts +3 -0
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.d.ts +4 -0
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.d.ts +11 -0
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.d.ts +15 -0
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.d.ts +2 -0
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.d.ts +14 -0
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.d.ts +36 -0
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.d.ts +3 -0
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.d.ts +63 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -0
- package/lib/generated/build-info.js +1 -1
- package/lib/help.d.ts +1 -0
- package/lib/help.js +1 -1
- package/lib/runtime/confirmation.d.ts +4 -0
- package/lib/runtime/confirmation.js +1 -0
- package/lib/runtime/event.d.ts +5 -0
- package/lib/runtime/event.js +1 -0
- package/lib/runtime/index.d.ts +7 -0
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/queue.d.ts +5 -0
- package/lib/runtime/queue.js +1 -0
- package/lib/runtime/resolve.d.ts +8 -0
- package/lib/runtime/resolve.js +1 -0
- package/lib/runtime/types.d.ts +50 -0
- package/lib/runtime/types.js +1 -0
- package/lib/skills/main.d.ts +41 -0
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +99 -0
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.d.ts +44 -0
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.d.ts +12 -0
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.d.ts +8 -0
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.d.ts +6 -0
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.d.ts +3 -0
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.d.ts +17 -0
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.d.ts +26 -0
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/types/index.d.ts +93 -0
- package/lib/utils/ai_config.d.ts +47 -0
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.d.ts +1 -0
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.d.ts +42 -0
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.d.ts +23 -0
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.d.ts +37 -0
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.d.ts +9 -0
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.d.ts +42 -0
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.d.ts +1 -0
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.d.ts +30 -0
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.d.ts +25 -0
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.d.ts +80 -0
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.d.ts +30 -0
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.d.ts +7 -0
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.d.ts +62 -0
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.d.ts +15 -0
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.d.ts +21 -0
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.d.ts +38 -0
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.d.ts +1 -0
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.d.ts +55 -0
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.d.ts +10 -0
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.d.ts +1 -0
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.d.ts +1 -0
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.d.ts +6 -0
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +9 -1
|
@@ -0,0 +1,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_0x3e9421=a227_0x560e;(function(_0x230cba,_0x465a09){const _0x93b8db=a227_0x560e,_0xf9c357=_0x230cba();while(!![]){try{const _0x68b54d=parseInt(_0x93b8db(0x113))/0x1+parseInt(_0x93b8db(0x15b))/0x2*(parseInt(_0x93b8db(0x144))/0x3)+parseInt(_0x93b8db(0x109))/0x4*(-parseInt(_0x93b8db(0x11e))/0x5)+parseInt(_0x93b8db(0x15c))/0x6+-parseInt(_0x93b8db(0x145))/0x7*(-parseInt(_0x93b8db(0x142))/0x8)+parseInt(_0x93b8db(0x11f))/0x9+-parseInt(_0x93b8db(0x10f))/0xa;if(_0x68b54d===_0x465a09)break;else _0xf9c357['push'](_0xf9c357['shift']());}catch(_0x18170c){_0xf9c357['push'](_0xf9c357['shift']());}}}(a227_0x213f,0x6ec74));const MYBATIS_OUTER_TAGS=new Map([['select','SELECT'],[a227_0x3e9421(0x120),'INSERT'],[a227_0x3e9421(0x154),'UPDATE'],[a227_0x3e9421(0x14a),'DELETE']]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a227_0x3e9421(0x132),a227_0x3e9421(0x159),'choose',a227_0x3e9421(0x122),a227_0x3e9421(0x13d),a227_0x3e9421(0x158),a227_0x3e9421(0x108),'bind',a227_0x3e9421(0x153),'property']),MYBATIS_BRANCH_TAGS=new Set(['if',a227_0x3e9421(0x159),a227_0x3e9421(0x14f),'when',a227_0x3e9421(0x13d)]);export const MYBATIS_DYNAMIC_START_MARKER=a227_0x3e9421(0x10c);export const MYBATIS_DYNAMIC_END_MARKER=a227_0x3e9421(0x146);export const MYBATIS_INCLUDE_MARKER=a227_0x3e9421(0x14d);const UNRESOLVED_SQL_FRAGMENT=a227_0x3e9421(0x15d),MYBATIS_OUTER_TAG_PATTERN=new RegExp('^<\x5cs*(?:'+[...MYBATIS_OUTER_TAGS[a227_0x3e9421(0x127)]()][a227_0x3e9421(0x125)]('|')+a227_0x3e9421(0x129),'i');function a227_0x213f(){const _0x4b0be5=['Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','DDL','mybatisXml','where','\x20with\x20parameters:\x20','Unterminated\x20MyBatis\x20XML\x20tag.','includes','test','<!--','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','replaceAll','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','property','statementType','otherwise','UPDATE','push','Unterminated\x20XML\x20comment.','DELETE','1464KTKuWF','replace','2038263TPHFZp','14147pkwAJS','__RABETBASE_MYBATIS_DYNAMIC_END__','\x20query\x20targeting\x20','match','parseInt','delete','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.',''','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','get','choose','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','length','indexOf','include','update','has','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','SELECT','trim','foreach','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','2oSXygi','5136360jraFcy','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','Invalid\x20XML\x20entity\x20reference.','UNKNOWN','pop','Unable\x20to\x20detect\x20SQL\x20type.\x20','sql','fromCodePoint','add','<![CDATA[','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','set','62120SgucYs','reason','toUpperCase','__RABETBASE_MYBATIS_DYNAMIC_START__',']]>','rawName','22938000vMBtGC','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','-->','659103tkBbvU','&','string','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','split','<','exec','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','isDangerous','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','type','110XgGeAY','4723029mLMTUV','insert','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','when','error','startsWith','join','unknown\x20table(s)','keys','INSERT',')\x5cb','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','slice','outer','matchAll','tagName'];a227_0x213f=function(){return _0x4b0be5;};return a227_0x213f();}function a227_0x560e(_0x42594,_0x172f8d){_0x42594=_0x42594-0x100;const _0x213fda=a227_0x213f();let _0x560e42=_0x213fda[_0x42594];return _0x560e42;}export function normalizeSqlForStaticAnalysis(_0x39f26d){const _0x5f47d3=a227_0x3e9421,_0x107a00=typeof _0x39f26d===_0x5f47d3(0x115)?_0x39f26d:'';if(!startsWithMybatisStatementWrapper(_0x107a00))return{'sql':_0x107a00,'mode':_0x5f47d3(0x103)};let _0x2ece38=0x0,_0x1a609d='',_0x4df4b5,_0x53a038=![],_0x4c397d=![];const _0x415ed3=[];while(_0x2ece38<_0x107a00[_0x5f47d3(0x151)]){if(_0x107a00['startsWith'](_0x5f47d3(0x137),_0x2ece38)){const _0x1d26e1=_0x107a00['indexOf'](_0x5f47d3(0x112),_0x2ece38+0x4);if(_0x1d26e1<0x0)return invalidMybatisSource(_0x5f47d3(0x140));_0x1a609d+='\x20',_0x2ece38=_0x1d26e1+0x3;continue;}if(_0x107a00[_0x5f47d3(0x124)](_0x5f47d3(0x106),_0x2ece38)){if(!_0x53a038||_0x4c397d)return invalidMybatisSource(_0x5f47d3(0x150));const _0x3b93ab=_0x107a00['indexOf'](_0x5f47d3(0x10d),_0x2ece38+0x9);if(_0x3b93ab<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x1a609d+=_0x107a00[_0x5f47d3(0x12b)](_0x2ece38+0x9,_0x3b93ab),_0x2ece38=_0x3b93ab+0x3;continue;}if(_0x107a00[_0x5f47d3(0x124)]('<?',_0x2ece38)){if(_0x53a038)return invalidMybatisSource(_0x5f47d3(0x12a));const _0x314fbd=_0x107a00[_0x5f47d3(0x152)]('?>',_0x2ece38+0x2);if(_0x314fbd<0x0)return invalidMybatisSource('Unterminated\x20XML\x20declaration.');_0x1a609d+='\x20',_0x2ece38=_0x314fbd+0x2;continue;}if(_0x107a00[_0x2ece38]!=='<'){const _0x326472=_0x107a00[_0x5f47d3(0x152)]('<',_0x2ece38),_0xa1c0fa=_0x326472<0x0?_0x107a00[_0x5f47d3(0x151)]:_0x326472,_0xfdc8fd=_0x107a00[_0x5f47d3(0x12b)](_0x2ece38,_0xa1c0fa);if((!_0x53a038||_0x4c397d)&&_0xfdc8fd[_0x5f47d3(0x158)]())return invalidMybatisSource('SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');if(_0x53a038&&!_0x4c397d){const _0x58560d=decodeXmlEntities(_0xfdc8fd);if(_0x58560d===null)return invalidMybatisSource(_0x5f47d3(0x15e));_0x1a609d+=_0x58560d;}else _0x1a609d+='\x20';_0x2ece38=_0xa1c0fa;continue;}const _0x15f0db=findXmlTagEnd(_0x107a00,_0x2ece38);if(_0x15f0db<0x0)return invalidMybatisSource(_0x5f47d3(0x134));const _0x552a2c=_0x107a00['slice'](_0x2ece38,_0x15f0db+0x1),_0x26e142=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/['exec'](_0x552a2c);if(!_0x26e142)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20tag.');const _0x4ca10d=_0x26e142[0x1]==='/',_0x2ae7d2=_0x26e142[0x2]??'',_0x349fba=_0x2ae7d2['toLowerCase'](),_0x37fc3d=_0x26e142[0x3]??'',_0xfd099c=_0x26e142[0x4]==='/',_0x1b459c=MYBATIS_OUTER_TAGS[_0x5f47d3(0x14e)](_0x349fba);if(!_0x1b459c&&!MYBATIS_DYNAMIC_TAGS['has'](_0x349fba))return invalidMybatisSource('Unsupported\x20MyBatis\x20XML\x20tag:\x20<'+_0x349fba+'>.');if(!_0x1b459c&&_0x2ae7d2!==_0x349fba)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<'+_0x2ae7d2+'>.');if(_0x4ca10d){if(_0x37fc3d[_0x5f47d3(0x158)]()||_0xfd099c)return invalidMybatisSource(_0x5f47d3(0x156)+_0x2ae7d2+'>.');const _0x54a2ab=_0x415ed3['at'](-0x1);if(!_0x54a2ab||(_0x54a2ab[_0x5f47d3(0x12c)]?_0x54a2ab[_0x5f47d3(0x12e)]!==_0x349fba:_0x54a2ab[_0x5f47d3(0x10e)]!==_0x2ae7d2))return invalidMybatisSource(_0x5f47d3(0x15a)+_0x2ae7d2+'>.');_0x415ed3[_0x5f47d3(0x101)]();if(_0x54a2ab[_0x5f47d3(0x12c)])_0x4c397d=!![];_0x1a609d+=MYBATIS_BRANCH_TAGS['has'](_0x349fba)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x37fc3d))return invalidMybatisSource(_0x5f47d3(0x12f)+_0x2ae7d2+'>.');if(_0x349fba===_0x5f47d3(0x13b)&&(!_0xfd099c||_0x415ed3['at'](-0x1)?.[_0x5f47d3(0x12e)]!==_0x5f47d3(0x153)))return invalidMybatisSource(_0x5f47d3(0x138));if(_0x1b459c){if(_0x53a038||_0x415ed3['length']>0x0)return invalidMybatisSource(_0x5f47d3(0x116));_0x53a038=!![],_0x4c397d=_0xfd099c,_0x4df4b5=_0x1b459c;}else{if(!_0x53a038||_0x4c397d)return invalidMybatisSource(_0x5f47d3(0x11a)+_0x2ae7d2+'>.');}_0x1a609d+=_0x349fba===_0x5f47d3(0x132)?'\x20WHERE\x20':_0x349fba===_0x5f47d3(0x108)?'\x20SET\x20':_0x349fba==='include'?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS['has'](_0x349fba)&&!_0xfd099c?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0xfd099c&&_0x415ed3[_0x5f47d3(0x13f)]({'rawName':_0x2ae7d2,'tagName':_0x349fba,'outer':!!_0x1b459c});}_0x2ece38=_0x15f0db+0x1;}if(_0x415ed3[_0x5f47d3(0x151)]>0x0)return invalidMybatisSource(_0x5f47d3(0x111)+_0x415ed3['at'](-0x1)?.[_0x5f47d3(0x10e)]+'>.');if(!_0x53a038||!_0x4c397d)return invalidMybatisSource(_0x5f47d3(0x14b));return{'sql':_0x1a609d['trim'](),'mode':'mybatisXml',..._0x4df4b5?{'statementType':_0x4df4b5}:{}};}function hasWellFormedXmlAttributes(_0x4d10aa){const _0x3af75d=a227_0x3e9421;let _0x49edd0=0x0;const _0x20cf77=new Set();while(_0x49edd0<_0x4d10aa[_0x3af75d(0x151)]){while(_0x49edd0<_0x4d10aa[_0x3af75d(0x151)]&&/\s/[_0x3af75d(0x136)](_0x4d10aa[_0x49edd0]??''))_0x49edd0+=0x1;if(_0x49edd0>=_0x4d10aa[_0x3af75d(0x151)])return!![];const _0x3416ad=/^[A-Za-z_:][\w:.-]*/[_0x3af75d(0x119)](_0x4d10aa[_0x3af75d(0x12b)](_0x49edd0)),_0x3627ab=_0x3416ad?.[0x0];if(!_0x3627ab||_0x20cf77[_0x3af75d(0x155)](_0x3627ab))return![];_0x20cf77[_0x3af75d(0x105)](_0x3627ab),_0x49edd0+=_0x3627ab[_0x3af75d(0x151)];while(_0x49edd0<_0x4d10aa[_0x3af75d(0x151)]&&/\s/[_0x3af75d(0x136)](_0x4d10aa[_0x49edd0]??''))_0x49edd0+=0x1;if(_0x4d10aa[_0x49edd0]!=='=')return![];_0x49edd0+=0x1;while(_0x49edd0<_0x4d10aa[_0x3af75d(0x151)]&&/\s/[_0x3af75d(0x136)](_0x4d10aa[_0x49edd0]??''))_0x49edd0+=0x1;const _0x35af19=_0x4d10aa[_0x49edd0];if(_0x35af19!=='\x22'&&_0x35af19!=='\x27')return![];_0x49edd0+=0x1;const _0x54f0f9=_0x4d10aa[_0x3af75d(0x152)](_0x35af19,_0x49edd0);if(_0x54f0f9<0x0)return![];if(decodeXmlEntities(_0x4d10aa[_0x3af75d(0x12b)](_0x49edd0,_0x54f0f9))===null)return![];_0x49edd0=_0x54f0f9+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0xc23a4a){const _0x9d8813=a227_0x3e9421;let _0x144ddf=0x0;const _0x5e644a=()=>{const _0x167278=a227_0x560e;while(_0x144ddf<_0xc23a4a[_0x167278(0x151)]&&/\s/[_0x167278(0x136)](_0xc23a4a[_0x144ddf]??''))_0x144ddf+=0x1;};_0x5e644a();while(_0x144ddf<_0xc23a4a[_0x9d8813(0x151)]){if(_0xc23a4a[_0x9d8813(0x124)]('<!--',_0x144ddf)){const _0x2ae536=_0xc23a4a[_0x9d8813(0x152)](_0x9d8813(0x112),_0x144ddf+0x4);if(_0x2ae536<0x0)return!![];_0x144ddf=_0x2ae536+0x3,_0x5e644a();continue;}if(_0xc23a4a[_0x9d8813(0x124)]('<?',_0x144ddf)){const _0x1daf6=_0xc23a4a[_0x9d8813(0x152)]('?>',_0x144ddf+0x2);if(_0x1daf6<0x0)return!![];_0x144ddf=_0x1daf6+0x2,_0x5e644a();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN['test'](_0xc23a4a[_0x9d8813(0x12b)](_0x144ddf));}function invalidMybatisSource(_0x3b096f){const _0x1b2831=a227_0x3e9421;return{'sql':'','mode':_0x1b2831(0x131),'error':_0x3b096f};}function findXmlTagEnd(_0x3dd3c3,_0x37157c){const _0x3f440b=a227_0x3e9421;let _0x5e2be8;for(let _0x715fbe=_0x37157c+0x1;_0x715fbe<_0x3dd3c3[_0x3f440b(0x151)];_0x715fbe+=0x1){const _0x43bb5d=_0x3dd3c3[_0x715fbe];if(_0x5e2be8){if(_0x43bb5d===_0x5e2be8)_0x5e2be8=undefined;continue;}if(_0x43bb5d==='\x22'||_0x43bb5d==='\x27'){_0x5e2be8=_0x43bb5d;continue;}if(_0x43bb5d==='>')return _0x715fbe;}return-0x1;}function decodeXmlEntities(_0x33b543){const _0x28d1c7=a227_0x3e9421;let _0x2d7cce=![];const _0x4702c6=_0x33b543[_0x28d1c7(0x143)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x523200=>{const _0x4e42b5=_0x28d1c7;if(_0x523200===_0x4e42b5(0x118))return'<';if(_0x523200==='>')return'>';if(_0x523200==='"')return'\x22';if(_0x523200===_0x4e42b5(0x14c))return'\x27';if(_0x523200===_0x4e42b5(0x114))return'&';const _0x43fb36=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x4e42b5(0x119)](_0x523200);if(_0x43fb36){const _0xcbbd78=_0x43fb36[0x1],_0x2ad136=_0x43fb36[0x2],_0x141579=Number[_0x4e42b5(0x149)](_0xcbbd78??_0x2ad136??'',_0xcbbd78?0x10:0xa);if(isValidXmlCharacter(_0x141579))return String[_0x4e42b5(0x104)](_0x141579);}return _0x2d7cce=!![],'';});return _0x2d7cce?null:_0x4702c6;}function isValidXmlCharacter(_0x19cbca){return _0x19cbca===0x9||_0x19cbca===0xa||_0x19cbca===0xd||_0x19cbca>=0x20&&_0x19cbca<=0xd7ff||_0x19cbca>=0xe000&&_0x19cbca<=0xfffd||_0x19cbca>=0x10000&&_0x19cbca<=0x10ffff;}export function detectSqlType(_0x499201){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x499201));}function detectNormalizedSqlType(_0x48d4e8){const _0x2250c4=a227_0x3e9421;if(_0x48d4e8[_0x2250c4(0x123)])return{'type':_0x2250c4(0x100),'isSelectOnly':![],'isDangerous':![],'reason':_0x48d4e8['error']};if(!_0x48d4e8[_0x2250c4(0x103)][_0x2250c4(0x158)]())return{'type':_0x2250c4(0x100),'isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0x528f86=stripStaticAnalysisMarkers(_0x48d4e8['sql'])['replace'](/#\{[^}]*\}/g,'?')[_0x2250c4(0x143)](/\$\{[^}]*\}/g,'?')[_0x2250c4(0x143)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x2250c4(0x143)](/\/\*[\s\S]*?\*\//g,'')[_0x2250c4(0x158)](),_0x304527=_0x528f86[_0x2250c4(0x117)]('\x0a');let _0x27d544='';for(const _0x17dd56 of _0x304527){const _0x570dda=_0x17dd56['trim']();if(!_0x570dda||_0x570dda[_0x2250c4(0x124)]('--')||_0x570dda[_0x2250c4(0x124)]('/*'))continue;_0x27d544=_0x570dda;break;}const _0x440a5a=_0x27d544[_0x2250c4(0x10b)](),_0x3c5bec=_0x48d4e8[_0x2250c4(0x13c)],_0x347937=maskSqlTextForBlockedKeywordScan(_0x528f86),_0x4c151e=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x2250c4(0x136)](_0x347937);if(_0x3c5bec===_0x2250c4(0x157)||!_0x3c5bec&&(_0x440a5a[_0x2250c4(0x124)]('SELECT')||_0x440a5a[_0x2250c4(0x124)]('WITH'))){const _0x392872=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x2250c4(0x136)](_0x528f86);return{'type':_0x2250c4(0x157),'isSelectOnly':!_0x392872,'isDangerous':_0x392872,'reason':_0x392872?_0x2250c4(0x11c):undefined};}if(_0x3c5bec==='INSERT'||!_0x3c5bec&&_0x440a5a[_0x2250c4(0x124)]('INSERT'))return{'type':_0x2250c4(0x128),'isSelectOnly':![],'isDangerous':_0x4c151e,'reason':_0x4c151e?_0x2250c4(0x110):undefined};if(_0x3c5bec===_0x2250c4(0x13e)||!_0x3c5bec&&_0x440a5a[_0x2250c4(0x124)](_0x2250c4(0x13e)))return{'type':_0x2250c4(0x13e),'isSelectOnly':![],'isDangerous':_0x4c151e,'reason':_0x4c151e?_0x2250c4(0x110):undefined};if(_0x3c5bec===_0x2250c4(0x141)||!_0x3c5bec&&_0x440a5a[_0x2250c4(0x124)](_0x2250c4(0x141)))return{'type':_0x2250c4(0x141),'isSelectOnly':![],'isDangerous':!![],'reason':_0x2250c4(0x13a)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i['test'](_0x440a5a))return{'type':_0x2250c4(0x130),'isSelectOnly':![],'isDangerous':!![],'reason':_0x2250c4(0x121)};return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x2dee57){const _0x1db751=a227_0x3e9421;return _0x2dee57[_0x1db751(0x139)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x1db751(0x139)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x1db751(0x139)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x3d866b){const _0x335947=a227_0x3e9421;return _0x3d866b[_0x335947(0x143)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x335947(0x143)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x335947(0x143)](/`(?:``|\\.|[^`])*`/g,'\x20')['replace'](/--.*$/gm,'\x20')[_0x335947(0x143)](/#.*$/gm,'\x20')['replace'](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x596076){const _0x29ea83=a227_0x3e9421,_0x2d505e=_0x596076['replace'](/#\{[^}]*\}/g,'?')[_0x29ea83(0x143)](/\$\{[^}]*\}/g,'?')[_0x29ea83(0x143)](/'[^']*'/g,'\x27\x27')[_0x29ea83(0x143)](/--.*$/gm,'')[_0x29ea83(0x143)](/\/\*[\s\S]*?\*\//g,''),_0x19b16f=[],_0x178889=_0x2d505e['match'](/FROM\s+([^\s,)(]+)/i);addTable(_0x19b16f,_0x178889?.[0x1]);for(const _0x16450c of _0x2d505e[_0x29ea83(0x12d)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x19b16f,_0x16450c[0x1]);}const _0x14a071=_0x2d505e[_0x29ea83(0x148)](/INTO\s+([^\s(]+)/i);addTable(_0x19b16f,_0x14a071?.[0x1]);const _0x18c969=_0x2d505e[_0x29ea83(0x148)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x19b16f,_0x18c969?.[0x1]),_0x19b16f;}function addTable(_0x2c7043,_0x4e3451){const _0xf91597=a227_0x3e9421,_0x525c84=_0x4e3451?.[_0xf91597(0x143)](/[`"]/g,'');_0x525c84&&_0x525c84!==UNRESOLVED_SQL_FRAGMENT&&!_0x2c7043[_0xf91597(0x135)](_0x525c84)&&_0x2c7043[_0xf91597(0x13f)](_0x525c84);}function extractParameters(_0x1d459b){const _0x4713bf=a227_0x3e9421,_0x7762d9=new Set();for(const _0xd6451e of _0x1d459b[_0x4713bf(0x12d)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0xd6451e[0x1])_0x7762d9[_0x4713bf(0x105)](_0xd6451e[0x1]);}return Array['from'](_0x7762d9);}export function validateSql(_0x2733cf){const _0x320395=a227_0x3e9421,_0x54eaac=normalizeSqlForStaticAnalysis(_0x2733cf),_0x21893f=detectNormalizedSqlType(_0x54eaac),_0x3a8d81=stripStaticAnalysisMarkers(_0x54eaac[_0x320395(0x103)]),_0x3b23bf=_0x54eaac[_0x320395(0x123)]?[]:extractTables(_0x3a8d81),_0x54b72=_0x54eaac[_0x320395(0x123)]?[]:extractParameters(_0x3a8d81);if(_0x21893f[_0x320395(0x11b)])return{'valid':![],'sqlType':_0x21893f,'tables':_0x3b23bf,'parameters':_0x54b72,'message':_0x21893f[_0x320395(0x10a)]||_0x21893f[_0x320395(0x11d)]+_0x320395(0x107)};if(_0x21893f['type']===_0x320395(0x100))return{'valid':![],'sqlType':_0x21893f,'tables':_0x3b23bf,'parameters':_0x54b72,'message':_0x54eaac[_0x320395(0x123)]?_0x320395(0x102)+_0x54eaac[_0x320395(0x123)]:'Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.'};return{'valid':!![],'sqlType':_0x21893f,'tables':_0x3b23bf,'parameters':_0x54b72,'message':_0x21893f[_0x320395(0x11d)]+_0x320395(0x147)+(_0x3b23bf[_0x320395(0x151)]?_0x3b23bf[_0x320395(0x125)](',\x20'):_0x320395(0x126))+(_0x54b72[_0x320395(0x151)]?_0x320395(0x133)+_0x54b72['join'](',\x20'):'')};}
|
package/lib/errors.d.ts
ADDED
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a228_0x9fa4b=a228_0x4b1b;(function(_0x3ca4c2,_0x475782){const _0xbfdedb=a228_0x4b1b,_0x5a4696=_0x3ca4c2();while(!![]){try{const _0x51edbc=parseInt(_0xbfdedb(0x115))/0x1*(-parseInt(_0xbfdedb(0x10e))/0x2)+-parseInt(_0xbfdedb(0x108))/0x3*(parseInt(_0xbfdedb(0x119))/0x4)+-parseInt(_0xbfdedb(0x10a))/0x5+-parseInt(_0xbfdedb(0x10d))/0x6*(parseInt(_0xbfdedb(0x117))/0x7)+-parseInt(_0xbfdedb(0x113))/0x8+-parseInt(_0xbfdedb(0x116))/0x9*(parseInt(_0xbfdedb(0x112))/0xa)+parseInt(_0xbfdedb(0x114))/0xb*(parseInt(_0xbfdedb(0x10f))/0xc);if(_0x51edbc===_0x475782)break;else _0x5a4696['push'](_0x5a4696['shift']());}catch(_0x1dbe30){_0x5a4696['push'](_0x5a4696['shift']());}}}(a228_0x2f1b,0xdd0c8));function a228_0x2f1b(){const _0x2ecf27=['\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.','290985kfJdvj','\x20auth`\x20to\x20login\x20first.','Run\x20`','19950JFsMWB','6NZYGGj','15165348eZkMxJ','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','Set\x20appcode\x20via\x20`','230qdbvJo','10345184LpXlZZ','55cotNHe','511153PNGMbi','313686IAVCfV','210WdNzRk','\x0a\x20\x20\x20\x20\x20\x20\x20','29996raijiL','join','651oMGOSA'];a228_0x2f1b=function(){return _0x2ecf27;};return a228_0x2f1b();}import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';function a228_0x4b1b(_0xb7890b,_0x50974a){_0xb7890b=_0xb7890b-0x107;const _0x2f1b8c=a228_0x2f1b();let _0x4b1bae=_0x2f1b8c[_0xb7890b];return _0x4b1bae;}export{CliError};export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a228_0x9fa4b(0x10c)+CLI_BIN_NAME+a228_0x9fa4b(0x10b),'configMissingHint':[a228_0x9fa4b(0x111)+CLI_BIN_NAME+'\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','Tip:\x20`'+CLI_BIN_NAME+a228_0x9fa4b(0x109)][a228_0x9fa4b(0x107)](a228_0x9fa4b(0x118)),'notInProjectHint':a228_0x9fa4b(0x110)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2679f7,_0x147f48){const _0x4d6186=a229_0x2996,_0x596223=_0x2679f7();while(!![]){try{const _0x4ce9a9=-parseInt(_0x4d6186(0x1cb))/0x1+parseInt(_0x4d6186(0x1c8))/0x2*(parseInt(_0x4d6186(0x1c2))/0x3)+-parseInt(_0x4d6186(0x1c6))/0x4*(parseInt(_0x4d6186(0x1c1))/0x5)+-parseInt(_0x4d6186(0x1bf))/0x6*(-parseInt(_0x4d6186(0x1c3))/0x7)+-parseInt(_0x4d6186(0x1c9))/0x8*(-parseInt(_0x4d6186(0x1ca))/0x9)+-parseInt(_0x4d6186(0x1c5))/0xa+parseInt(_0x4d6186(0x1c4))/0xb*(-parseInt(_0x4d6186(0x1c0))/0xc);if(_0x4ce9a9===_0x147f48)break;else _0x596223['push'](_0x596223['shift']());}catch(_0x1ee8d1){_0x596223['push'](_0x596223['shift']());}}}(a229_0x4728,0x25180));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a229_0x5b3443}from'@lovrabet/cli-framework';import{EXPLICIT_YES_FLAG_DESCRIPTION,requiresExplicitYes}from'../framework/explicit-yes.js';function a229_0x2996(_0x325294,_0x52a140){_0x325294=_0x325294-0x1bf;const _0x472860=a229_0x4728();let _0x2996bc=_0x472860[_0x325294];return _0x2996bc;}export function buildAllFlags(_0x4ea788){const _0x345638=a229_0x2996,_0x4b2627=a229_0x5b3443(_0x4ea788,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});if(!requiresExplicitYes(_0x4ea788))return _0x4b2627;return _0x4b2627[_0x345638(0x1c7)](_0x398266=>_0x398266[_0x345638(0x1cc)]==='yes'?{..._0x398266,'description':EXPLICIT_YES_FLAG_DESCRIPTION}:_0x398266);}function a229_0x4728(){const _0xdaa7b0=['12hDZtHM','3339hytdsL','63943gTSemn','915440hqSiuW','8OdyxwK','map','144214nMvhnv','72PXSQPG','196065ksexGL','149027BCueNa','name','1590GJoxEi','12HzIWBT','531445AjYfdE'];a229_0x4728=function(){return _0xdaa7b0;};return a229_0x4728();}
|
|
@@ -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(_0x5961f3,_0x449284){var _0x2cc1e9=a230_0x5766,_0x3537f8=_0x5961f3();while(!![]){try{var _0xcf46fd=parseInt(_0x2cc1e9(0x163))/0x1*(parseInt(_0x2cc1e9(0x167))/0x2)+parseInt(_0x2cc1e9(0x16c))/0x3+parseInt(_0x2cc1e9(0x15d))/0x4*(parseInt(_0x2cc1e9(0x16b))/0x5)+parseInt(_0x2cc1e9(0x15e))/0x6*(parseInt(_0x2cc1e9(0x160))/0x7)+parseInt(_0x2cc1e9(0x169))/0x8+parseInt(_0x2cc1e9(0x161))/0x9+-parseInt(_0x2cc1e9(0x15f))/0xa*(parseInt(_0x2cc1e9(0x165))/0xb);if(_0xcf46fd===_0x449284)break;else _0x3537f8['push'](_0x3537f8['shift']());}catch(_0x199d6e){_0x3537f8['push'](_0x3537f8['shift']());}}}(a230_0x53dd,0x5e081));import{resolveOutputConfig}from'@lovrabet/cli-framework';function a230_0x5766(_0x4a393b,_0x3f0cbe){_0x4a393b=_0x4a393b-0x15d;var _0x53dd28=a230_0x53dd();var _0x576622=_0x53dd28[_0x4a393b];return _0x576622;}function a230_0x53dd(){var _0x30bf66=['10YXxcWv','287LMrWSZ','3427281HFXctH','structuredErrors','1642EPXKJE','defaultFormat','21242540ZKtHOW','flags','122FtikFC','def','779624LaVjgY','compress','330EGJJnD','1134282qpZnSR','38476lEaWTR','106086tvjZdO'];a230_0x53dd=function(){return _0x30bf66;};return a230_0x53dd();}export function usesStructuredErrorOutput(_0x5ac2f6){var _0x2b8673=a230_0x5766;return _0x5ac2f6?.[_0x2b8673(0x162)]===!![];}export function resolveErrorOutputFormat(_0x347bf9){var _0x25ed86=a230_0x5766;if(!_0x347bf9[_0x25ed86(0x168)])return _0x347bf9[_0x25ed86(0x164)]??_0x25ed86(0x16a);return resolveOutputConfig({'flags':_0x347bf9[_0x25ed86(0x166)]??{},'def':_0x347bf9['def'],'configDefault':_0x347bf9[_0x25ed86(0x164)]})['format'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a231_0x16a6(_0x32f931,_0x5c6bf1){_0x32f931=_0x32f931-0x13b;const _0x31d452=a231_0x31d4();let _0x16a656=_0x31d452[_0x32f931];return _0x16a656;}function a231_0x31d4(){const _0x30e6a5=['kb\x20delete','6401930RIdlMA','5751431OeeIXt','144388LrXsry','kb\x20create','menu\x20external-link-update','menu\x20regroup-start','399EJFOdm','1042085afwiBP','has','284635YMXlMM','menu\x20delete','11jkfNOk','command','Required\x20for\x20execution\x20after\x20reviewing\x20the\x20--dry-run\x20plan','8VXcFIt','24kihGRb','41166LzoQZg','24148jDQiRf'];a231_0x31d4=function(){return _0x30e6a5;};return a231_0x31d4();}const a231_0x2c1a0e=a231_0x16a6;(function(_0xae6c0e,_0x1d69b1){const _0x15d247=a231_0x16a6,_0x311811=_0xae6c0e();while(!![]){try{const _0x52225f=parseInt(_0x15d247(0x14d))/0x1+-parseInt(_0x15d247(0x146))/0x2+parseInt(_0x15d247(0x14a))/0x3*(-parseInt(_0x15d247(0x142))/0x4)+parseInt(_0x15d247(0x14b))/0x5*(parseInt(_0x15d247(0x140))/0x6)+-parseInt(_0x15d247(0x145))/0x7*(-parseInt(_0x15d247(0x13f))/0x8)+parseInt(_0x15d247(0x141))/0x9+parseInt(_0x15d247(0x144))/0xa*(-parseInt(_0x15d247(0x13c))/0xb);if(_0x52225f===_0x1d69b1)break;else _0x311811['push'](_0x311811['shift']());}catch(_0xc3780b){_0x311811['push'](_0x311811['shift']());}}}(a231_0x31d4,0x68c92));const EXPLICIT_YES_COMMANDS=new Set([a231_0x2c1a0e(0x148),a231_0x2c1a0e(0x13b),a231_0x2c1a0e(0x149),a231_0x2c1a0e(0x147),'kb\x20update',a231_0x2c1a0e(0x143)]);export const EXPLICIT_YES_FLAG_DESCRIPTION=a231_0x2c1a0e(0x13e);export function requiresExplicitYes(_0x2f7bcc){const _0x5c94c5=a231_0x2c1a0e;return EXPLICIT_YES_COMMANDS[_0x5c94c5(0x14c)](_0x2f7bcc['service']+'\x20'+_0x2f7bcc[_0x5c94c5(0x13d)]);}
|
|
@@ -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_0x20d3(){const _0x575dee=['852NlWkck','1109SyoKwH','176248sEWHav','6pySPow','540Sbrpec','413466KuuBAc','252889lxcncj','3091bWytMC','256516IQpfHR','4130UaljWA','1325440gcVUJP','117mwWRvS','8sjwqoD'];a232_0x20d3=function(){return _0x575dee;};return a232_0x20d3();}(function(_0x184f11,_0x252525){const _0x58d02c=a232_0x1093,_0x4aedc3=_0x184f11();while(!![]){try{const _0x1ae1ff=parseInt(_0x58d02c(0x191))/0x1*(parseInt(_0x58d02c(0x190))/0x2)+-parseInt(_0x58d02c(0x188))/0x3+parseInt(_0x58d02c(0x18f))/0x4*(-parseInt(_0x58d02c(0x18d))/0x5)+-parseInt(_0x58d02c(0x193))/0x6*(-parseInt(_0x58d02c(0x189))/0x7)+-parseInt(_0x58d02c(0x192))/0x8*(parseInt(_0x58d02c(0x18e))/0x9)+parseInt(_0x58d02c(0x18c))/0xa*(-parseInt(_0x58d02c(0x18a))/0xb)+-parseInt(_0x58d02c(0x187))/0xc*(-parseInt(_0x58d02c(0x18b))/0xd);if(_0x1ae1ff===_0x252525)break;else _0x4aedc3['push'](_0x4aedc3['shift']());}catch(_0x6b313){_0x4aedc3['push'](_0x4aedc3['shift']());}}}(a232_0x20d3,0x4f99f));import{createFlagHelpers}from'@lovrabet/cli-framework';function a232_0x1093(_0x729d47,_0x2a1c70){_0x729d47=_0x729d47-0x187;const _0x20d388=a232_0x20d3();let _0x10935f=_0x20d388[_0x729d47];return _0x10935f;}import{CliErrors}from'../errors.js';const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers['parseFlags'];export const validateFlags=helpers['validateFlags'];
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a233_0x585872=a233_0x2dc9;(function(_0x6fa739,_0x4c2cdb){const _0x2ac323=a233_0x2dc9,_0x21b915=_0x6fa739();while(!![]){try{const _0x3cec0a=-parseInt(_0x2ac323(0x74))/0x1+-parseInt(_0x2ac323(0x7a))/0x2*(parseInt(_0x2ac323(0x7b))/0x3)+-parseInt(_0x2ac323(0x6f))/0x4+-parseInt(_0x2ac323(0x70))/0x5*(parseInt(_0x2ac323(0x75))/0x6)+-parseInt(_0x2ac323(0x77))/0x7*(parseInt(_0x2ac323(0x76))/0x8)+-parseInt(_0x2ac323(0x7c))/0x9+parseInt(_0x2ac323(0x73))/0xa*(parseInt(_0x2ac323(0x72))/0xb);if(_0x3cec0a===_0x4c2cdb)break;else _0x21b915['push'](_0x21b915['shift']());}catch(_0x1924d6){_0x21b915['push'](_0x21b915['shift']());}}}(a233_0x48fa,0x8d5e6));import{createHelpGenerators}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{requiresExplicitYes}from'../framework/explicit-yes.js';function a233_0x2dc9(_0x4171b1,_0x33c5b9){_0x4171b1=_0x4171b1-0x6e;const _0x48fa65=a233_0x48fa();let _0x2dc908=_0x48fa65[_0x4171b1];return _0x2dc908;}const generators=createHelpGenerators({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'globalFlags':GLOBAL_FLAGS,'serviceRegistry':serviceRegistry,'getServiceEntry':getServiceEntry,'getServiceDefinitions':_0x476eff=>serviceGroups['get'](_0x476eff),'buildAllFlags':buildAllFlags,'appPrerequisiteText':a233_0x585872(0x6e)+CLI_BIN_NAME+a233_0x585872(0x7f),'serviceUsageSuffix':a233_0x585872(0x71)});export function generateCommandHelp(_0x3a31ee){const _0x336eac=a233_0x585872,_0x47a26f=generators[_0x336eac(0x79)](_0x3a31ee);if(!requiresExplicitYes(_0x3a31ee))return _0x47a26f;return _0x47a26f['replace']('Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.',_0x336eac(0x7e));}export const generateServiceHelp=generators[a233_0x585872(0x7d)];function a233_0x48fa(){const _0x57216c=['447904amjRlq','5wcBTHO','\x20[args]\x20[flags]','803NNmSCJ','349510KMuXGh','739730fYBNkj','1536096YPrmEG','19376FNVcHI','322NpySCM','generateFullHelp','generateCommandHelp','122AFEmKS','33447fQwpUq','658386BYPcmH','generateServiceHelp','Requires\x20explicit\x20--yes\x20for\x20execution;\x20use\x20--dry-run\x20to\x20preview.','\x20workspace\x20init`\x20or\x20--appcode).','Requires\x20appcode\x20(set\x20via\x20`'];a233_0x48fa=function(){return _0x57216c;};return a233_0x48fa();}export const generateFullHelp=generators[a233_0x585872(0x78)];
|
|
@@ -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(_0x4618b2,_0x51cedb){var _0x451414=a234_0x3295,_0x1bb00e=_0x4618b2();while(!![]){try{var _0x1ceac2=parseInt(_0x451414(0x195))/0x1+-parseInt(_0x451414(0x18d))/0x2+parseInt(_0x451414(0x191))/0x3*(-parseInt(_0x451414(0x193))/0x4)+parseInt(_0x451414(0x192))/0x5+parseInt(_0x451414(0x18f))/0x6*(parseInt(_0x451414(0x18e))/0x7)+parseInt(_0x451414(0x190))/0x8+-parseInt(_0x451414(0x194))/0x9;if(_0x1ceac2===_0x51cedb)break;else _0x1bb00e['push'](_0x1bb00e['shift']());}catch(_0x2f188f){_0x1bb00e['push'](_0x1bb00e['shift']());}}}(a234_0x1198,0xa65c2));function a234_0x3295(_0x22b4ed,_0x5ce2da){_0x22b4ed=_0x22b4ed-0x18d;var _0x11983a=a234_0x1198();var _0x3295bb=_0x11983a[_0x22b4ed];return _0x3295bb;}export{runCommand}from'../framework/runner.js';export{parseFlags,validateFlags}from'../framework/flags.js';export{formatOutput}from'../framework/output.js';export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'../framework/help.js';export{extractList,extractPaging}from'../framework/response.js';export{riskLevelOrder}from'../framework/types.js';function a234_0x1198(){var _0x14731a=['3925881EJvhdp','1245YvONTS','1165818psfWPX','8085560rgRsLh','6aPqZrD','8204040HgQTzY','2029581XiybyL','976125vviBhR','4raEiZG'];a234_0x1198=function(){return _0x14731a;};return a234_0x1198();}
|
|
@@ -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 a235_0x32fc(_0x431bb6,_0x9e0392){_0x431bb6=_0x431bb6-0x135;const _0x15cf14=a235_0x15cf();let _0x32fc86=_0x15cf14[_0x431bb6];return _0x32fc86;}(function(_0x142cee,_0x6c33a1){const _0x214cbf=a235_0x32fc,_0x4de543=_0x142cee();while(!![]){try{const _0x3beb26=-parseInt(_0x214cbf(0x14e))/0x1+parseInt(_0x214cbf(0x13b))/0x2+-parseInt(_0x214cbf(0x135))/0x3+-parseInt(_0x214cbf(0x14a))/0x4*(parseInt(_0x214cbf(0x13f))/0x5)+parseInt(_0x214cbf(0x143))/0x6*(-parseInt(_0x214cbf(0x14c))/0x7)+parseInt(_0x214cbf(0x147))/0x8+parseInt(_0x214cbf(0x137))/0x9;if(_0x3beb26===_0x6c33a1)break;else _0x4de543['push'](_0x4de543['shift']());}catch(_0x462686){_0x4de543['push'](_0x4de543['shift']());}}}(a235_0x15cf,0x5ec6c));function a235_0x15cf(){const _0xd0d60c=['18KMhJfw','json','command','error','4830376yXijeP','validation','hint','8EhVOic','message','1538467utuHEH','code','62964KaLHDA','format','stdout','1478910RYvaxM','update','7038234hBQygJ','risk','stringify','pretty','1029668oTboqx','endsWith','jq:\x20','write','742940aVPGkV','url','data','_notice'];a235_0x15cf=function(){return _0xd0d60c;};return a235_0x15cf();}import{createFormatOutput,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliError,CliErrors}from'../errors.js';import{applyJqFilter}from'../utils/apply-jq-filter.js';const baseFormatOutput=createFormatOutput({'cliErrors':CliErrors,'jqBinaryResolverOptions':{'bundledJqPaths':resolveBundledJqPaths()}});export function formatOutput(_0x29268e,_0x171f68){const _0x36ca75=a235_0x32fc,_0x87987b=_0x29268e[_0x36ca75(0x142)],{_notice:_0x26fa0e,..._0x5f5650}=_0x29268e;void _0x26fa0e,baseFormatOutput(_0x5f5650,_0x171f68),_0x171f68['format']===_0x36ca75(0x13a)&&printPrettyNotice(_0x87987b);}export function formatCliError(_0x2f347f,_0x42cbec){const _0x22044b=a235_0x32fc;if(_0x42cbec['format']===_0x22044b(0x13a))return![];const _0x13c961=_0x2f347f[_0x22044b(0x141)],_0x127fd7={'ok':![],'command':_0x42cbec[_0x22044b(0x145)],'risk':_0x42cbec[_0x22044b(0x138)],'data':_0x13c961??null,'error':{'code':_0x2f347f['code'],'message':_0x2f347f['message'],..._0x2f347f[_0x22044b(0x149)]?{'hint':_0x2f347f['hint']}:{}}},_0x5048c4=_0x42cbec[_0x22044b(0x14f)]===_0x22044b(0x144)?JSON[_0x22044b(0x139)](_0x127fd7,null,0x2):JSON[_0x22044b(0x139)](_0x127fd7);let _0x2c106c=_0x5048c4;if(_0x42cbec['jqFilter']?.['trim']())try{_0x2c106c=applyJqFilter(_0x5048c4,_0x42cbec['jqFilter']);}catch(_0x3df6d4){const _0x4c93c2=_0x3df6d4 instanceof CliError?_0x3df6d4:CliErrors[_0x22044b(0x148)](_0x22044b(0x13d)+(_0x3df6d4 instanceof Error?_0x3df6d4[_0x22044b(0x14b)]:String(_0x3df6d4))),_0x4804a3={..._0x127fd7,'error':{'code':_0x4c93c2[_0x22044b(0x14d)],'message':_0x4c93c2['message'],..._0x4c93c2[_0x22044b(0x149)]?{'hint':_0x4c93c2[_0x22044b(0x149)]}:{},'cause':_0x127fd7[_0x22044b(0x146)]}};_0x2c106c=_0x42cbec[_0x22044b(0x14f)]===_0x22044b(0x144)?JSON['stringify'](_0x4804a3,null,0x2):JSON[_0x22044b(0x139)](_0x4804a3);}return process[_0x22044b(0x150)][_0x22044b(0x13e)](_0x2c106c[_0x22044b(0x13c)]('\x0a')?_0x2c106c:_0x2c106c+'\x0a'),!![];}function printPrettyNotice(_0x47b34a){const _0xf87335=a235_0x32fc;if(!_0x47b34a?.[_0xf87335(0x136)])return;console[_0xf87335(0x146)](_0x47b34a[_0xf87335(0x136)][_0xf87335(0x14b)]+'\x20('+_0x47b34a[_0xf87335(0x136)][_0xf87335(0x140)]+')');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a236_0x23a0(_0x28b8de,_0x4dc4f8){_0x28b8de=_0x28b8de-0x108;var _0x33a8ad=a236_0x33a8();var _0x23a04a=_0x33a8ad[_0x28b8de];return _0x23a04a;}(function(_0x421778,_0x5ec3ea){var _0x15f5ca=a236_0x23a0,_0xabd6c4=_0x421778();while(!![]){try{var _0x14b9ed=parseInt(_0x15f5ca(0x108))/0x1+-parseInt(_0x15f5ca(0x10a))/0x2*(-parseInt(_0x15f5ca(0x111))/0x3)+-parseInt(_0x15f5ca(0x10d))/0x4+parseInt(_0x15f5ca(0x110))/0x5*(parseInt(_0x15f5ca(0x10e))/0x6)+parseInt(_0x15f5ca(0x10c))/0x7+parseInt(_0x15f5ca(0x10b))/0x8*(parseInt(_0x15f5ca(0x109))/0x9)+-parseInt(_0x15f5ca(0x10f))/0xa;if(_0x14b9ed===_0x5ec3ea)break;else _0xabd6c4['push'](_0xabd6c4['shift']());}catch(_0x1cab06){_0xabd6c4['push'](_0xabd6c4['shift']());}}}(a236_0x33a8,0xae8e0));export{extractList,extractPaging}from'@lovrabet/cli-framework';function a236_0x33a8(){var _0x45df74=['4984068lUNMnC','30RpAbiV','757280NXtDNB','53855JTHIKy','22425fmuNNA','225389DBCZSm','2856177hKFwpX','92kkFsBr','16yBojGV','5452447rGajcX'];a236_0x33a8=function(){return _0x45df74;};return a236_0x33a8();}
|
|
@@ -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(_0x55032e,_0xd20800){const _0x488aa6=a237_0x5eb4,_0x4c0705=_0x55032e();while(!![]){try{const _0x22a426=-parseInt(_0x488aa6(0x134))/0x1*(-parseInt(_0x488aa6(0x138))/0x2)+-parseInt(_0x488aa6(0x12b))/0x3+parseInt(_0x488aa6(0x127))/0x4+-parseInt(_0x488aa6(0x135))/0x5+parseInt(_0x488aa6(0x139))/0x6*(parseInt(_0x488aa6(0x129))/0x7)+-parseInt(_0x488aa6(0x123))/0x8*(parseInt(_0x488aa6(0x12a))/0x9)+parseInt(_0x488aa6(0x130))/0xa;if(_0x22a426===_0xd20800)break;else _0x4c0705['push'](_0x4c0705['shift']());}catch(_0x348d48){_0x4c0705['push'](_0x4c0705['shift']());}}}(a237_0x52eb,0x6db1e));import{CliErrors}from'../errors.js';import{resolveAlias,listAliases}from'../core/alias-resolver.js';function a237_0x52eb(){const _0x15301b=['flags','alias','length','13574hWGIwG','2590635OAshRu','join','code','62juzBdO','1035948DYjRZB','string','type','1136LKjXMi','Unknown\x20alias\x20\x22','validation','.\x20Run\x20`','337184vYyTUz','`\x20requires\x20either\x20--code\x20or\x20--alias.','7dagoUH','7047zLpmRm','1003710CCgjQd','Available\x20aliases:\x20','name','some','\x20api\x20pull`\x20first.','7354450TuYIjk'];a237_0x52eb=function(){return _0x15301b;};return a237_0x52eb();}function a237_0x5eb4(_0x62ddc6,_0x1ee83f){_0x62ddc6=_0x62ddc6-0x122;const _0x52eba7=a237_0x52eb();let _0x5eb401=_0x52eba7[_0x62ddc6];return _0x5eb401;}import{CLI_BIN_NAME}from'../constant/cli.js';export function resolveAliasToCode(_0x2cb057,_0x391a29,_0x279719,_0x402ae4){const _0x7f6ff8=a237_0x5eb4,_0x513f35=_0x2cb057[_0x7f6ff8(0x131)][_0x7f6ff8(0x12e)](_0x55274c=>_0x55274c[_0x7f6ff8(0x12d)]===_0x7f6ff8(0x137)&&_0x55274c[_0x7f6ff8(0x122)]===_0x7f6ff8(0x13a)),_0x4c5cc7=_0x2cb057['flags'][_0x7f6ff8(0x12e)](_0x2c0924=>_0x2c0924['name']===_0x7f6ff8(0x132)&&_0x2c0924[_0x7f6ff8(0x122)]===_0x7f6ff8(0x13a));if(!_0x513f35||!_0x4c5cc7)return;const _0x405706=_0x391a29['code']?String(_0x391a29['code']):'',_0x518894=_0x391a29[_0x7f6ff8(0x132)]?String(_0x391a29['alias']):'';if(!_0x405706&&!_0x518894)throw CliErrors[_0x7f6ff8(0x125)]('`'+_0x402ae4+_0x7f6ff8(0x128));if(_0x518894&&!_0x405706){const _0x68f1db=resolveAlias(_0x279719,_0x518894);if(!_0x68f1db){const _0x2e5414=listAliases(_0x279719)['map'](_0x6e4069=>_0x6e4069[_0x7f6ff8(0x132)]),_0x3ac714=_0x2e5414[_0x7f6ff8(0x133)]?_0x7f6ff8(0x12c)+_0x2e5414[_0x7f6ff8(0x136)](',\x20'):'No\x20api.ts\x20found\x20in\x20'+_0x279719+_0x7f6ff8(0x126)+CLI_BIN_NAME+_0x7f6ff8(0x12f);throw CliErrors[_0x7f6ff8(0x125)](_0x7f6ff8(0x124)+_0x518894+'\x22.\x20'+_0x3ac714);}_0x391a29['code']=_0x68f1db;}}
|
|
@@ -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(_0x11a7e4,_0x224342){const _0x2ccfff=a238_0x3dc9,_0x1c5142=_0x11a7e4();while(!![]){try{const _0x328156=parseInt(_0x2ccfff(0x146))/0x1+parseInt(_0x2ccfff(0x117))/0x2*(parseInt(_0x2ccfff(0x141))/0x3)+parseInt(_0x2ccfff(0x143))/0x4*(-parseInt(_0x2ccfff(0x145))/0x5)+parseInt(_0x2ccfff(0x130))/0x6*(-parseInt(_0x2ccfff(0x123))/0x7)+-parseInt(_0x2ccfff(0x14f))/0x8+parseInt(_0x2ccfff(0x15a))/0x9*(parseInt(_0x2ccfff(0x127))/0xa)+-parseInt(_0x2ccfff(0x11f))/0xb;if(_0x328156===_0x224342)break;else _0x1c5142['push'](_0x1c5142['shift']());}catch(_0x97556d){_0x1c5142['push'](_0x1c5142['shift']());}}}(a238_0x5004,0xe992c));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';function a238_0x5004(){const _0x4dc1bb=['hint','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','5222bnUBXK','object','resolve','Current\x20resolved\x20appcode\x20is\x20\x22','hasFormat','Set\x20appcode\x20via\x20`','appCode','replace','3081474MHdbDU','update','No\x20appcode\x20is\x20resolved\x20from\x20--appcode,\x20project\x20config,\x20or\x20global\x20config.','has','1330574rhJGhT','isNonInteractive','pretty','High-risk\x20operation\x20`','3922260nunSzE','command','appcode','mergedCli','defaultApp','format','all','_notice','riskLevel','24nckGiI','some','configMissing','RABETBASE_APPCODE','production','name','value','catch','\x20\x20\x20Continue?\x20[y/N]\x20','../core/api-client.js','../constant/env.js','verbose','`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.','cancelled','requiresAppCode','explicitAppName','resolveAppCode','723mpLxDB','cookie','566096zKxSeO','confirmHighRisk','10VaHMHA','1447892QyKnYY','selectedAppName','filter','doctor','toUpperCase','meowKey','trim','rejectedFlags','authRequired','7788760iCqXwH','pageSize','defaultVerbose','string','resolveCookie','service','required','validation','rawFlags','../constant/domain.js','execute','27hCCoEm','none','apiDir','LOVRABET_APPCODE','formatOutput'];a238_0x5004=function(){return _0x4dc1bb;};return a238_0x5004();}import{getApiDomain}from'../constant/domain.js';import{CLI_BIN_NAME,GLOBAL_FLAGS,PIPELINE_FLAG_NAMES}from'../constant/cli.js';import{DEFAULT_API_DIR}from'../constant/paths.js';import{isNonInteractive as a238_0x580684}from'../utils/is-non-interactive.js';import{resolveAliasToCode}from'../framework/runner-alias.js';import{resolveLatestUpdateNotice}from'../utils/update-notice.js';function stringFlag(_0x18400e){const _0x29bb9f=a238_0x3dc9;return typeof _0x18400e===_0x29bb9f(0x152)&&_0x18400e[_0x29bb9f(0x14c)]()?_0x18400e[_0x29bb9f(0x14c)]():undefined;}function resolveEnvAppCode(){const _0x261f1a=a238_0x3dc9,_0x38735e=stringFlag(process.env.RABETBASE_APPCODE);if(_0x38735e)return{'name':_0x261f1a(0x133),'value':_0x38735e};const _0x48f9b8=stringFlag(process.env.LOVRABET_APPCODE);if(_0x48f9b8)return{'name':_0x261f1a(0x15d),'value':_0x48f9b8};return undefined;}function hasExplicitAppCode(_0x48e00a,_0x2f91df){const _0xcd340c=a238_0x3dc9;return!!(stringFlag(_0x48e00a['appcode'])||stringFlag(_0x2f91df[_0xcd340c(0x129)]));}function assertEnvAppCodeNotIgnored(_0x31f1f5,_0x593f13,_0x314423){const _0x59e22d=a238_0x3dc9;if(!_0x593f13||_0x314423||_0x31f1f5===_0x593f13[_0x59e22d(0x136)])return;const _0x54fd14=_0x31f1f5?_0x59e22d(0x11a)+_0x31f1f5+'\x22.':_0x59e22d(0x121);throw CliErrors[_0x59e22d(0x156)](_0x593f13['name']+'='+_0x593f13[_0x59e22d(0x136)]+'\x20is\x20not\x20used\x20as\x20appcode\x20automatically.\x20'+_0x54fd14+'\x20'+('To\x20use\x20this\x20environment\x20variable,\x20pass\x20--appcode\x20\x22$'+_0x593f13[_0x59e22d(0x135)]+'\x22.'));}export function createPipelineEnv(_0x5c498f,_0x578e84,_0x1d95e2=[]){const _0x1c3646=a238_0x3dc9;return{'rawFlags':_0x578e84,'args':_0x1d95e2,'resolveAppCode':()=>_0x5c498f[_0x1c3646(0x11d)],'resolveCookie':()=>_0x5c498f[_0x1c3646(0x142)]||getCookie(),'resolveApiDomain':()=>getApiDomain(),'isNonInteractive':a238_0x580684(_0x578e84),'defaultFormat':_0x5c498f[_0x1c3646(0x12c)],'defaultPageSize':_0x5c498f[_0x1c3646(0x150)],'defaultVerbose':_0x5c498f[_0x1c3646(0x13b)],'apiDir':_0x5c498f[_0x1c3646(0x15c)],'riskLevel':_0x5c498f[_0x1c3646(0x12f)],'selectedAppName':_0x5c498f[_0x1c3646(0x13f)],'mergedCli':{'defaultApp':_0x5c498f[_0x1c3646(0x12b)],'currentApp':_0x5c498f['currentApp'],'appCode':_0x5c498f[_0x1c3646(0x11d)],'apps':_0x5c498f['apps']}};}export function createRabetbaseRunnerAdapter(_0xd28cf1={}){const _0x4e7ac7=a238_0x3dc9;return{'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS[_0x4e7ac7(0x148)](_0x522152=>PIPELINE_FLAG_NAMES[_0x4e7ac7(0x122)](_0x522152['name']))['map'](({name:_0x3a149d,type:_0x101cb2,description:_0x3cabdb})=>({'name':_0x3a149d,'type':_0x101cb2,'description':_0x3cabdb})),'formatOutput':_0xd28cf1[_0x4e7ac7(0x114)]??formatOutput,'getCommandLabel'(_0x4d1578){const _0x4a80f7=_0x4e7ac7;return CLI_BIN_NAME+'\x20'+_0x4d1578[_0x4a80f7(0x154)]+'\x20'+_0x4d1578[_0x4a80f7(0x128)];},'riskPolicy':{'skipWhenDryRun':!![],'createError'(_0x126df2){const _0x531f29=_0x4e7ac7;return CliErrors[_0x531f29(0x156)](_0x126df2);}},async 'prepare'(_0x1037a6,_0x48b088,_0x1e6f98,_0x80ed19){const _0x5bf69f=_0x4e7ac7,_0x4c1b15=_0x48b088[_0x5bf69f(0x15c)]||DEFAULT_API_DIR;resolveAliasToCode(_0x1037a6,_0x1e6f98,_0x4c1b15,_0x80ed19);const _0x179873=resolveCommandAuthMode(_0x1037a6);let _0x575aeb='';if(_0x179873!==_0x5bf69f(0x15b)){_0x575aeb=_0x48b088[_0x5bf69f(0x153)]()||'';if(!_0x575aeb){if(_0x179873===_0x5bf69f(0x155))throw CliErrors[_0x5bf69f(0x14e)]();}else{const {setActiveCookie:_0x4d1b46}=await import(_0x5bf69f(0x139));_0x4d1b46(_0x575aeb);}}const _0x338a88=_0x48b088[_0x5bf69f(0x140)]()??'';if(_0x1037a6[_0x5bf69f(0x13e)]!==![]){assertEnvAppCodeNotIgnored(_0x338a88,resolveEnvAppCode(),hasExplicitAppCode(_0x1e6f98,_0x48b088[_0x5bf69f(0x157)]));if(!_0x338a88)throw CliErrors[_0x5bf69f(0x132)](_0x5bf69f(0x11c)+CLI_BIN_NAME+_0x5bf69f(0x116));}return{'defaults':{'booleans':{'verbose':_0x48b088[_0x5bf69f(0x151)]},'numbers':{'pagesize':_0x48b088['defaultPageSize']}},'extras':{'appCode':_0x338a88,'cookie':_0x575aeb,'apiDomain':_0x48b088['resolveApiDomain'](),'apiDir':_0x4c1b15,'selectedAppName':_0x48b088[_0x5bf69f(0x147)],'mergedCli':_0x48b088[_0x5bf69f(0x12a)]}};},'confirmHighRisk':_0xd28cf1[_0x4e7ac7(0x144)]??(async({env:_0x1547c5,commandLabel:_0x2c1079})=>{const _0x3ee40c=_0x4e7ac7;if(_0x1547c5[_0x3ee40c(0x124)])throw CliErrors[_0x3ee40c(0x156)](_0x3ee40c(0x126)+_0x2c1079+_0x3ee40c(0x13c));await requireConfirmationPrompt({'lines':['⚠\x20\x20High-risk\x20operation:\x20'+_0x2c1079,_0x3ee40c(0x138)],'createCancelledError':_0x48b5a3=>CliErrors[_0x3ee40c(0x13d)](_0x48b5a3)});}),async 'finalize'(){await clearRabetbaseCommandState();}};}const terminalRunnerAdapter=createRabetbaseRunnerAdapter();async function clearRabetbaseCommandState(){const _0x570389=a238_0x3dc9,{clearActiveCookie:_0x5249d6}=await import(_0x570389(0x139));_0x5249d6();}function a238_0x3dc9(_0x2285d5,_0x2e29c4){_0x2285d5=_0x2285d5-0x114;const _0x500479=a238_0x5004();let _0x3dc9b5=_0x500479[_0x2285d5];return _0x3dc9b5;}export async function finalizeRabetbaseRuntimeState(){const _0xbe4ab1=a238_0x3dc9;try{await clearRabetbaseCommandState();}finally{const [{initDomains:_0x5eb1a0},{initEnv:_0x108d1b}]=await Promise[_0xbe4ab1(0x12d)]([import(_0xbe4ab1(0x158)),import(_0xbe4ab1(0x13a))]);_0x5eb1a0(),_0x108d1b(_0xbe4ab1(0x134));}}export async function runCommand(_0x5e6e74,_0x7c4b59,_0x35b617=terminalRunnerAdapter){const _0x3b4e1b=a238_0x3dc9;assertRejectedFlags(_0x5e6e74,_0x7c4b59[_0x3b4e1b(0x157)]),await runCommandWithAdapter(shouldAttachUpdateNotice(_0x5e6e74)?withUpdateNotice(_0x5e6e74):_0x5e6e74,_0x7c4b59,_0x35b617);}function assertRejectedFlags(_0x1c6a61,_0xad7c6b){const _0x848424=a238_0x3dc9;for(const _0x48c9fc of _0x1c6a61[_0x848424(0x14d)]??[]){const _0x38cf54=GLOBAL_FLAGS['find'](_0x59a455=>_0x59a455[_0x848424(0x135)]===_0x48c9fc[_0x848424(0x135)]),_0x3335df=new Set([_0x48c9fc['name'],toCamelCase(_0x48c9fc[_0x848424(0x135)]),_0x38cf54?.[_0x848424(0x14b)]]),_0x2509a7=[..._0x3335df][_0x848424(0x131)](_0xb38e61=>{if(!_0xb38e61)return![];const _0x31ea51=_0xad7c6b[_0xb38e61];return _0x31ea51!==undefined&&_0x31ea51!==null&&_0x31ea51!==![];});if(_0x2509a7)throw CliErrors[_0x848424(0x156)](_0x48c9fc['message'],_0x48c9fc[_0x848424(0x115)]);}}function toCamelCase(_0x1bf838){const _0x572872=a238_0x3dc9;return _0x1bf838[_0x572872(0x11e)](/-([a-z])/g,(_0x2732db,_0xbb2531)=>_0xbb2531[_0x572872(0x14a)]());}function shouldAttachUpdateNotice(_0x20bfc6){const _0x3672dc=a238_0x3dc9;if(_0x20bfc6[_0x3672dc(0x11b)]===![])return![];return![_0x3672dc(0x120),'schema',_0x3672dc(0x149)]['includes'](_0x20bfc6[_0x3672dc(0x154)]);}function withUpdateNotice(_0x2725d1){return{..._0x2725d1,async 'execute'(_0x93898){const _0x42a598=a238_0x3dc9,_0x558a92=shouldResolveUpdateNotice(_0x93898)?resolveLatestUpdateNotice()[_0x42a598(0x137)](()=>null):Promise[_0x42a598(0x119)](null),_0x134c57=await _0x2725d1[_0x42a598(0x159)](_0x93898);return attachUpdateNotice(_0x134c57,await _0x558a92);}};}function shouldResolveUpdateNotice(_0x394352){const _0x4af4df=a238_0x3dc9;return _0x394352[_0x4af4df(0x12c)]===_0x4af4df(0x125)&&!_0x394352['nonInteractive'];}function attachUpdateNotice(_0x26b96d,_0xbb88f){const _0x1f1b4f=a238_0x3dc9;if(!_0xbb88f||!_0x26b96d||typeof _0x26b96d!==_0x1f1b4f(0x118))return _0x26b96d;const _0x3c8ff5=_0x26b96d,_0x57d717=typeof _0x3c8ff5[_0x1f1b4f(0x12e)]==='object'&&_0x3c8ff5['_notice']!==null?_0x3c8ff5[_0x1f1b4f(0x12e)]:{};return{..._0x3c8ff5,'_notice':{..._0x57d717,'update':_0xbb88f}};}
|
|
@@ -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(_0x5bca3d,_0x587bb9){const _0x274695=a239_0x4c7b,_0x34f2a4=_0x5bca3d();while(!![]){try{const _0x4f9f77=parseInt(_0x274695(0x1e1))/0x1+-parseInt(_0x274695(0x1e2))/0x2+-parseInt(_0x274695(0x1dd))/0x3*(-parseInt(_0x274695(0x1e8))/0x4)+-parseInt(_0x274695(0x1e6))/0x5*(parseInt(_0x274695(0x1e7))/0x6)+-parseInt(_0x274695(0x1df))/0x7*(parseInt(_0x274695(0x1e4))/0x8)+-parseInt(_0x274695(0x1e3))/0x9+parseInt(_0x274695(0x1e5))/0xa*(parseInt(_0x274695(0x1de))/0xb);if(_0x4f9f77===_0x587bb9)break;else _0x34f2a4['push'](_0x34f2a4['shift']());}catch(_0x3cf4b8){_0x34f2a4['push'](_0x34f2a4['shift']());}}}(a239_0x5752,0x39607));function a239_0x4c7b(_0x22910d,_0x5cf363){_0x22910d=_0x22910d-0x1dd;const _0x575225=a239_0x5752();let _0x4c7b71=_0x575225[_0x22910d];return _0x4c7b71;}import{buildSchemaPayload as a239_0x307588}from'@lovrabet/cli-framework';function a239_0x5752(){const _0x42b4f8=['33qwLwmm','538736TkUxzl','112511WzBzSC','../commands/registry.js','371880ZJPpsq','699026flvmPY','2566215rzkDBR','16ajWvmz','160tBmXtp','5VOYeBS','2685768Trcdpj','70524GVfZHN'];a239_0x5752=function(){return _0x42b4f8;};return a239_0x5752();}import{buildAllFlags}from'../framework/build-all-flags.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{getCliVersion}from'../utils/version.js';export async function buildSchemaPayload(){const _0xef7f02=a239_0x4c7b,{serviceRegistry:_0x193e5c,findDefinition:_0xb8a031}=await import(_0xef7f02(0x1e0));return a239_0x307588({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'cliVersion':getCliVersion(),'gitCommit':process.env.GIT_COMMIT??'','globalFlags':GLOBAL_FLAGS,'serviceRegistry':_0x193e5c,'buildAllFlags':buildAllFlags,'findDefinition':_0xb8a031});}
|