@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
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a182_0x4b0e59=a182_0x2257;(function(_0x37801e,_0x478602){const _0x115116=a182_0x2257,_0x57ecd8=_0x37801e();while(!![]){try{const _0x36051a=-parseInt(_0x115116(0xd7))/0x1*(parseInt(_0x115116(0xde))/0x2)+parseInt(_0x115116(0xcc))/0x3*(parseInt(_0x115116(0xfd))/0x4)+-parseInt(_0x115116(0xe6))/0x5+parseInt(_0x115116(0xf8))/0x6*(parseInt(_0x115116(0xf5))/0x7)+-parseInt(_0x115116(0xc6))/0x8+-parseInt(_0x115116(0xd5))/0x9+-parseInt(_0x115116(0xdd))/0xa*(-parseInt(_0x115116(0xd3))/0xb);if(_0x36051a===_0x478602)break;else _0x57ecd8['push'](_0x57ecd8['shift']());}catch(_0x3792fb){_0x57ecd8['push'](_0x57ecd8['shift']());}}}(a182_0x50f4,0xd151d));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';function a182_0x50f4(){const _0x113a7f=['9585783ITdkou','sqls','1021SPWjoL','high-risk-write','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','appCode','bool','POST','17383570clakNV','1214qSCDVk','dbName','relativePath','Local\x20directory\x20\x22','\x20pushed,\x20','mode','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','hash','5852585IHOiJu','\x22\x20for\x20sqlCode\x20','validation','remoteId','\x20skipped,\x20','get','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','set','lockFilePath','join','dbId','length','sqlCode','entries','sqlRootDir','7NntJAH','filter','lastSync','3447966KSbAxq','filePath','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','push','exec','3548CxVIKF','No\x20local\x20SQL\x20files\x20found.','/smartapi/custom/updateUserCustomSql','message','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','Local\x20SQL\x20not\x20found:\x20','catch','sql','dbDirectory','sqlcode','projectRoot','sqlRoot','has','force','2277656PjifdM','utf8','toISOString','sqlName','\x20SQL\x20file(s)','str','5697zGuYOh','No\x20database\x20matches\x20local\x20directory\x20\x22','unchanged','boolean','Push\x20complete:\x20','version','path','11wQRjNV','Would\x20push\x20'];a182_0x50f4=function(){return _0x113a7f;};return a182_0x50f4();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x260a19,_0x309e27,_0x49c3c){const _0x3a398b=a182_0x2257,_0x4f2178=await scanLocalSqlQueries(_0x260a19),_0x1b7f4a=new Map();for(const _0x11e931 of _0x4f2178){if(_0x49c3c&&_0x11e931['sqlCode']!==_0x49c3c)continue;const _0x40880a=_0x1b7f4a[_0x3a398b(0xeb)](_0x11e931[_0x3a398b(0xf2)])??[];_0x40880a['push'](_0x11e931),_0x1b7f4a[_0x3a398b(0xed)](_0x11e931[_0x3a398b(0xf2)],_0x40880a);}if(_0x49c3c&&!_0x1b7f4a[_0x3a398b(0xc4)](_0x49c3c))throw CliErrors[_0x3a398b(0xe8)](_0x3a398b(0xbd)+_0x49c3c);const _0x5b19d6=[];for(const [_0x1104cc,_0x51288a]of _0x1b7f4a[_0x3a398b(0xf3)]()){if(_0x51288a[_0x3a398b(0xf1)]===0x1){_0x5b19d6[_0x3a398b(0xfb)](_0x51288a[0x0]);continue;}const _0x186ab3=_0x309e27[_0x3a398b(0xd6)][_0x1104cc],_0x503120=_0x186ab3?.[_0x3a398b(0xd2)],_0xc3ff38=_0x503120?_0x51288a[_0x3a398b(0xf6)](_0x27023c=>_0x27023c['relativePath']!==_0x503120):_0x51288a;if(_0x186ab3&&_0xc3ff38[_0x3a398b(0xf1)]===0x1){_0x5b19d6[_0x3a398b(0xfb)](_0xc3ff38[0x0]);continue;}throw CliErrors[_0x3a398b(0xe8)](_0x3a398b(0xec)+_0x1104cc+_0x3a398b(0xbc));}return _0x5b19d6;}export const sqlPush={'service':a182_0x4b0e59(0xbf),'command':'push','description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a182_0x4b0e59(0xd8),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a182_0x4b0e59(0xc5),'type':a182_0x4b0e59(0xcf),'description':a182_0x4b0e59(0xe4)}],async 'dryRun'(_0x5e1cde){const _0x247999=a182_0x4b0e59,_0x536ff7=loadSqlProjectConfig(_0x5e1cde[_0x247999(0xda)]),_0x2f5323=await readSqlLockFile(_0x536ff7['lockFilePath']),{appLock:_0x411566}=ensureSqlLockScope(_0x2f5323??createEmptySqlLock(),_0x5e1cde[_0x247999(0xda)],_0x536ff7['sqlRoot'],_0x247999(0xfb)),_0x4ad585=await getTargetSqlQueries(_0x536ff7,_0x411566,_0x5e1cde[_0x247999(0xcb)](_0x247999(0xc1))||undefined),_0x4303a7=[];for(const _0x3919e7 of _0x4ad585){const _0xf4f62=await computeSqlFileHash(_0x3919e7['filePath']),_0x4b8a67=_0x411566[_0x247999(0xd6)][_0x3919e7['sqlCode']],_0x1ae536=!!_0x4b8a67&&(_0x4b8a67[_0x247999(0xd2)]!==_0x3919e7['relativePath']||!!_0x3919e7[_0x247999(0xc9)]&&_0x4b8a67[_0x247999(0xc9)]!==_0x3919e7[_0x247999(0xc9)]);if(!_0x5e1cde[_0x247999(0xdb)](_0x247999(0xc5))&&_0x4b8a67&&_0x4b8a67[_0x247999(0xe5)]===_0xf4f62&&!_0x1ae536)continue;_0x4303a7[_0x247999(0xfb)](_0x3919e7['sqlCode']);}return{'method':_0x247999(0xdc),'url':_0x247999(0xff),'body':{'sqlCodes':_0x4303a7,'appCode':_0x5e1cde[_0x247999(0xda)]},'description':_0x247999(0xd4)+_0x4303a7[_0x247999(0xf1)]+_0x247999(0xca)};},async 'execute'(_0xf96b87){const _0x4b277a=a182_0x4b0e59,_0x5c6b21=loadSqlProjectConfig(_0xf96b87[_0x4b277a(0xda)]),_0x7c0d8d=await readSqlLockFile(_0x5c6b21[_0x4b277a(0xee)]),{lockData:_0x1924da,appLock:_0x19c9b1}=ensureSqlLockScope(_0x7c0d8d??createEmptySqlLock(),_0xf96b87[_0x4b277a(0xda)],_0x5c6b21[_0x4b277a(0xc3)],'push'),_0x20ce2d=await getTargetSqlQueries(_0x5c6b21,_0x19c9b1,_0xf96b87[_0x4b277a(0xcb)](_0x4b277a(0xc1))||undefined);if(_0x20ce2d[_0x4b277a(0xf1)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x4b277a(0xfe)};const _0x11f6b5=[],_0x3906c2=[],_0x2afe27=[];for(const _0x4c6c54 of _0x20ce2d){const _0x3b746c=_0x19c9b1['sqls'][_0x4c6c54[_0x4b277a(0xf2)]];if(!_0x3b746c){_0x2afe27[_0x4b277a(0xfb)]({'sqlCode':_0x4c6c54[_0x4b277a(0xf2)],'error':_0x4b277a(0xfa)});continue;}try{const _0x9bf37a=await computeSqlFileHash(_0x4c6c54[_0x4b277a(0xf9)]),_0x167279=_0x3b746c[_0x4b277a(0xd2)]!==_0x4c6c54[_0x4b277a(0xe0)]||!!_0x4c6c54[_0x4b277a(0xc9)]&&_0x3b746c['sqlName']!==_0x4c6c54[_0x4b277a(0xc9)];if(!_0xf96b87[_0x4b277a(0xdb)](_0x4b277a(0xc5))&&_0x3b746c[_0x4b277a(0xe5)]===_0x9bf37a&&!_0x167279){_0x3906c2['push']({'sqlCode':_0x4c6c54['sqlCode'],'reason':_0x4b277a(0xce)});continue;}if(_0x3b746c[_0x4b277a(0xd1)]==null){_0x2afe27['push']({'sqlCode':_0x4c6c54[_0x4b277a(0xf2)],'error':_0x4b277a(0xd9)});continue;}const _0x5175e3=await readFile(_0x4c6c54[_0x4b277a(0xf9)],_0x4b277a(0xc7)),_0x2cf2a8=stripLocalSqlMetadata(_0x5175e3,_0x4c6c54[_0x4b277a(0xe3)]),_0x572d00=_0x4c6c54['sqlName']||_0x3b746c['sqlName'],_0x61fa22=await resolveTargetDbBinding(_0xf96b87['appCode'],_0x4c6c54,_0x3b746c),_0x3af253=await updateSqlQuery({'id':_0x3b746c[_0x4b277a(0xe9)],'appCode':_0xf96b87[_0x4b277a(0xda)],'sqlCode':_0x4c6c54[_0x4b277a(0xf2)],'sqlName':_0x572d00,'dbId':_0x61fa22[_0x4b277a(0xf0)],'version':_0x3b746c['version'],'sqlContent':_0x2cf2a8,'sqlConfig':_0x3b746c['sqlConfig']??undefined}),_0x4da9a6=_0x3af253[_0x4b277a(0xf0)]?await getDbName(_0xf96b87[_0x4b277a(0xda)],Number(_0x3af253['dbId']))[_0x4b277a(0xbe)](()=>_0x61fa22[_0x4b277a(0xdf)]):_0x61fa22[_0x4b277a(0xdf)];_0x19c9b1[_0x4b277a(0xd6)][_0x4c6c54[_0x4b277a(0xf2)]]={...buildSqlLockEntry(_0x3af253,_0x2cf2a8,_0x9bf37a,{'dbName':_0x4da9a6}),'path':_0x4c6c54['relativePath'],'mode':_0x3b746c[_0x4b277a(0xe3)]},await archivePreviousSqlFileIfNeeded(_0x5c6b21,_0x3b746c['path'],_0x4c6c54[_0x4b277a(0xe0)]),_0x11f6b5[_0x4b277a(0xfb)]({'sqlCode':_0x4c6c54['sqlCode'],'remoteId':_0x3b746c[_0x4b277a(0xe9)]});}catch(_0x3ce15d){_0x2afe27[_0x4b277a(0xfb)]({'sqlCode':_0x4c6c54['sqlCode'],'error':_0x3ce15d instanceof Error?_0x3ce15d[_0x4b277a(0x100)]:String(_0x3ce15d)});}}return _0x19c9b1[_0x4b277a(0xf7)]=new Date()['toISOString'](),await writeSqlLockFile(_0x5c6b21['lockFilePath'],_0x1924da),{'ok':_0x2afe27[_0x4b277a(0xf1)]===0x0,'data':{'pushed':_0x11f6b5,'skipped':_0x3906c2,'failed':_0x2afe27},'message':_0x4b277a(0xd0)+_0x11f6b5[_0x4b277a(0xf1)]+_0x4b277a(0xe2)+_0x3906c2['length']+_0x4b277a(0xea)+_0x2afe27['length']+'\x20failed'};}};function a182_0x2257(_0x228d06,_0x526f68){_0x228d06=_0x228d06-0xbc;const _0x50f4e8=a182_0x50f4();let _0x225740=_0x50f4e8[_0x228d06];return _0x225740;}async function archivePreviousSqlFileIfNeeded(_0x3d8a1f,_0x474b52,_0x4f56db){const _0x24f11a=a182_0x4b0e59;if(!_0x474b52||_0x474b52===_0x4f56db)return;const _0x3dceb0=join(_0x3d8a1f[_0x24f11a(0xf4)],_0x474b52);if(!await fileExists(_0x3dceb0))return;const _0x489ffd=await moveToTrash(_0x3d8a1f[_0x24f11a(0xc2)],_0x3d8a1f['trashDir'],_0x3dceb0);await cleanupEmptyDirectories(dirname(_0x3dceb0),_0x3d8a1f[_0x24f11a(0xf4)]),void _0x489ffd;}async function moveToTrash(_0xb1735d,_0x37d34f,_0x1b69f6){const _0xbe87f2=a182_0x4b0e59,_0x29768e=new Date()[_0xbe87f2(0xc8)]()['replace'](/[:.]/g,'-'),_0xd315ac=relative(_0xb1735d,_0x1b69f6),_0x3a7553=join(_0x37d34f,_0x29768e,_0xd315ac);return await mkdir(dirname(_0x3a7553),{'recursive':!![]}),await rename(_0x1b69f6,_0x3a7553),_0x3a7553;}async function cleanupEmptyDirectories(_0x50ce66,_0x423efd){let _0xa3d128=resolve(_0x50ce66);const _0x1e82de=resolve(_0x423efd);while(_0xa3d128['startsWith'](''+_0x1e82de+sep)||_0xa3d128===_0x1e82de){if(_0xa3d128===_0x1e82de)return;try{const _0x53e7b1=await readdir(_0xa3d128);if(_0x53e7b1['length']>0x0)return;await rmdir(_0xa3d128);}catch{return;}_0xa3d128=dirname(_0xa3d128);}}async function resolveTargetDbBinding(_0x2b9884,_0x4028fd,_0x286131){const _0x43cd64=a182_0x4b0e59,_0x4fa8d4=_0x4028fd[_0x43cd64(0xc0)];if(!_0x4fa8d4)return{'dbId':_0x286131[_0x43cd64(0xf0)],'dbName':_0x286131[_0x43cd64(0xdf)]};const _0x346f1e=buildDbDirectoryName(_0x286131[_0x43cd64(0xdf)],_0x286131[_0x43cd64(0xf0)]);if(_0x4fa8d4===_0x346f1e)return{'dbId':_0x286131[_0x43cd64(0xf0)],'dbName':_0x286131[_0x43cd64(0xdf)]};const _0x542aef=parseExplicitDbDirectory(_0x4fa8d4);if(_0x542aef!=null)return{'dbId':_0x542aef,'dbName':await getDbName(_0x2b9884,_0x542aef)[_0x43cd64(0xbe)](()=>undefined)};const _0x327d0e=await listDatabases(_0x2b9884),_0x402a20=_0x327d0e[_0x43cd64(0xf6)](_0x5e9d94=>buildDbDirectoryName(_0x5e9d94[_0x43cd64(0xdf)],_0x5e9d94[_0x43cd64(0xf0)])===_0x4fa8d4);if(_0x402a20['length']===0x1)return{'dbId':_0x402a20[0x0]['dbId'],'dbName':_0x402a20[0x0]['dbName']};if(_0x402a20[_0x43cd64(0xf1)]===0x0)throw CliErrors[_0x43cd64(0xe8)](_0x43cd64(0xcd)+_0x4fa8d4+_0x43cd64(0xe7)+_0x4028fd[_0x43cd64(0xf2)]+'.');const _0x3347d5=_0x402a20['map'](_0x568144=>_0x568144[_0x43cd64(0xdf)]+'\x20('+_0x568144[_0x43cd64(0xf0)]+')')[_0x43cd64(0xef)](',\x20');throw CliErrors[_0x43cd64(0xe8)](_0x43cd64(0xe1)+_0x4fa8d4+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x4028fd[_0x43cd64(0xf2)]+':\x20'+_0x3347d5);}function parseExplicitDbDirectory(_0x3b71a1){const _0x250c0f=a182_0x4b0e59,_0x477450=/^db-(\d+)$/[_0x250c0f(0xfc)](_0x3b71a1);if(!_0x477450)return null;const _0x58c47f=Number(_0x477450[0x1]);return Number['isFinite'](_0x58c47f)&&_0x58c47f>0x0?_0x58c47f:null;}
|
|
1
|
+
const a182_0x4f2219=a182_0x210a;(function(_0x51b039,_0x221b5c){const _0x469f58=a182_0x210a,_0x2dd351=_0x51b039();while(!![]){try{const _0x34fe32=parseInt(_0x469f58(0x1e1))/0x1+parseInt(_0x469f58(0x1ef))/0x2+parseInt(_0x469f58(0x1de))/0x3+parseInt(_0x469f58(0x1fd))/0x4+parseInt(_0x469f58(0x1f9))/0x5*(parseInt(_0x469f58(0x1f3))/0x6)+-parseInt(_0x469f58(0x1dc))/0x7+-parseInt(_0x469f58(0x1dd))/0x8;if(_0x34fe32===_0x221b5c)break;else _0x2dd351['push'](_0x2dd351['shift']());}catch(_0x508fe0){_0x2dd351['push'](_0x2dd351['shift']());}}}(a182_0x22ac,0x57c15));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a182_0x22ac(){const _0x2ed6b8=['missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sqls','\x22\x20for\x20sqlCode\x20','push','No\x20local\x20SQL\x20files\x20found.','toISOString','\x20SQL\x20file(s)','276732JPygif','filePath','\x20failed','lockFilePath','110226ZAsJcS','get','path','replace','relativePath','filter','15FZoJKe','Local\x20directory\x20\x22','sqlRoot','bool','1490956nRobkE','catch','map','\x20skipped,\x20','startsWith','sql','Push\x20local\x20SQL\x20files\x20to\x20remote','version','No\x20database\x20matches\x20local\x20directory\x20\x22','sqlcode','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','dbName','projectRoot','join','dbDirectory','sqlCode','force','dbId','entries','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','isFinite','exec','str','POST','high-risk-write','length','remoteId','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','/smartapi/custom/updateUserCustomSql','2517578UeGiOQ','4919088RhjmfM','514881XugPVJ','set','has','596140nzlAON','hash','validation','mode','lastSync','sqlName','appCode'];a182_0x22ac=function(){return _0x2ed6b8;};return a182_0x22ac();}function a182_0x210a(_0x840197,_0x4c99e0){_0x840197=_0x840197-0x1c1;const _0x22acee=a182_0x22ac();let _0x210a2f=_0x22acee[_0x840197];return _0x210a2f;}import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0xcde06c,_0x2d62bc,_0x33f371){const _0x5cc710=a182_0x210a,_0x380904=await scanLocalSqlQueries(_0xcde06c),_0x423b83=new Map();for(const _0x13a312 of _0x380904){if(_0x33f371&&_0x13a312[_0x5cc710(0x1ce)]!==_0x33f371)continue;const _0x3821ef=_0x423b83[_0x5cc710(0x1f4)](_0x13a312[_0x5cc710(0x1ce)])??[];_0x3821ef[_0x5cc710(0x1eb)](_0x13a312),_0x423b83[_0x5cc710(0x1df)](_0x13a312['sqlCode'],_0x3821ef);}if(_0x33f371&&!_0x423b83[_0x5cc710(0x1e0)](_0x33f371))throw CliErrors[_0x5cc710(0x1e3)]('Local\x20SQL\x20not\x20found:\x20'+_0x33f371);const _0x5db945=[];for(const [_0x10288b,_0x1bb3ef]of _0x423b83[_0x5cc710(0x1d1)]()){if(_0x1bb3ef[_0x5cc710(0x1d8)]===0x1){_0x5db945[_0x5cc710(0x1eb)](_0x1bb3ef[0x0]);continue;}const _0xd353c4=_0x2d62bc[_0x5cc710(0x1e9)][_0x10288b],_0x3060dd=_0xd353c4?.[_0x5cc710(0x1f5)],_0x2fabb0=_0x3060dd?_0x1bb3ef[_0x5cc710(0x1f8)](_0x274b8d=>_0x274b8d[_0x5cc710(0x1f7)]!==_0x3060dd):_0x1bb3ef;if(_0xd353c4&&_0x2fabb0[_0x5cc710(0x1d8)]===0x1){_0x5db945[_0x5cc710(0x1eb)](_0x2fabb0[0x0]);continue;}throw CliErrors[_0x5cc710(0x1e3)](_0x5cc710(0x1d2)+_0x10288b+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x5db945;}export const sqlPush={'service':a182_0x4f2219(0x1c4),'command':a182_0x4f2219(0x1eb),'description':a182_0x4f2219(0x1c5),'risk':a182_0x4f2219(0x1d7),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a182_0x4f2219(0x1cf),'type':'boolean','description':a182_0x4f2219(0x1c9)}],async 'dryRun'(_0x58c411){const _0x69d1b2=a182_0x4f2219,_0x5cf90f=loadSqlProjectConfig(_0x58c411['appCode']),_0x53b167=await readSqlLockFile(_0x5cf90f[_0x69d1b2(0x1f2)]),{appLock:_0x5513cc}=ensureSqlLockScope(_0x53b167??createEmptySqlLock(),_0x58c411[_0x69d1b2(0x1e7)],_0x5cf90f['sqlRoot'],'push'),_0x2a6d61=await getTargetSqlQueries(_0x5cf90f,_0x5513cc,_0x58c411[_0x69d1b2(0x1d5)](_0x69d1b2(0x1c8))||undefined),_0x2e1f85=[];for(const _0x24b27a of _0x2a6d61){const _0x1ff7cc=await computeSqlFileHash(_0x24b27a[_0x69d1b2(0x1f0)]),_0x1cf9b4=_0x5513cc['sqls'][_0x24b27a['sqlCode']],_0x3d1bfe=!!_0x1cf9b4&&(_0x1cf9b4[_0x69d1b2(0x1f5)]!==_0x24b27a[_0x69d1b2(0x1f7)]||!!_0x24b27a[_0x69d1b2(0x1e6)]&&_0x1cf9b4[_0x69d1b2(0x1e6)]!==_0x24b27a['sqlName']);if(!_0x58c411[_0x69d1b2(0x1fc)](_0x69d1b2(0x1cf))&&_0x1cf9b4&&_0x1cf9b4[_0x69d1b2(0x1e2)]===_0x1ff7cc&&!_0x3d1bfe)continue;_0x2e1f85[_0x69d1b2(0x1eb)](_0x24b27a[_0x69d1b2(0x1ce)]);}return{'method':_0x69d1b2(0x1d6),'url':_0x69d1b2(0x1db),'body':{'sqlCodes':_0x2e1f85,'appCode':_0x58c411[_0x69d1b2(0x1e7)]},'description':'Would\x20push\x20'+_0x2e1f85[_0x69d1b2(0x1d8)]+_0x69d1b2(0x1ee)};},async 'execute'(_0x5320c1){const _0x24790e=a182_0x4f2219,_0x41a561=loadSqlProjectConfig(_0x5320c1[_0x24790e(0x1e7)]),_0x2efb6a=await readSqlLockFile(_0x41a561[_0x24790e(0x1f2)]),{lockData:_0x29c507,appLock:_0x31eb36}=ensureSqlLockScope(_0x2efb6a??createEmptySqlLock(),_0x5320c1['appCode'],_0x41a561[_0x24790e(0x1fb)],'push'),_0x59f9d8=await getTargetSqlQueries(_0x41a561,_0x31eb36,_0x5320c1[_0x24790e(0x1d5)](_0x24790e(0x1c8))||undefined);if(_0x59f9d8[_0x24790e(0x1d8)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x24790e(0x1ec)};const _0x4051bf=[],_0x1929ba=[],_0x32aa36=[];for(const _0x227b6f of _0x59f9d8){const _0x457869=_0x31eb36['sqls'][_0x227b6f[_0x24790e(0x1ce)]];if(!_0x457869){_0x32aa36['push']({'sqlCode':_0x227b6f['sqlCode'],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x44d859=await computeSqlFileHash(_0x227b6f[_0x24790e(0x1f0)]),_0x16b22a=_0x457869[_0x24790e(0x1f5)]!==_0x227b6f[_0x24790e(0x1f7)]||!!_0x227b6f[_0x24790e(0x1e6)]&&_0x457869[_0x24790e(0x1e6)]!==_0x227b6f[_0x24790e(0x1e6)];if(!_0x5320c1[_0x24790e(0x1fc)](_0x24790e(0x1cf))&&_0x457869[_0x24790e(0x1e2)]===_0x44d859&&!_0x16b22a){_0x1929ba[_0x24790e(0x1eb)]({'sqlCode':_0x227b6f[_0x24790e(0x1ce)],'reason':'unchanged'});continue;}if(_0x457869[_0x24790e(0x1c6)]==null){_0x32aa36[_0x24790e(0x1eb)]({'sqlCode':_0x227b6f['sqlCode'],'error':_0x24790e(0x1e8)});continue;}const _0x1622bd=await readFile(_0x227b6f[_0x24790e(0x1f0)],'utf8'),_0x49e104=stripLocalSqlMetadata(_0x1622bd,_0x227b6f[_0x24790e(0x1e4)]),_0x43328f=_0x227b6f[_0x24790e(0x1e6)]||_0x457869['sqlName'],_0xb32c58=await resolveTargetDbBinding(_0x5320c1[_0x24790e(0x1e7)],_0x227b6f,_0x457869),_0x328490=await updateSqlQuery({'id':_0x457869[_0x24790e(0x1d9)],'appCode':_0x5320c1[_0x24790e(0x1e7)],'sqlCode':_0x227b6f['sqlCode'],'sqlName':_0x43328f,'dbId':_0xb32c58['dbId'],'version':_0x457869[_0x24790e(0x1c6)],'sqlContent':_0x49e104,'sqlConfig':_0x457869['sqlConfig']??undefined}),_0x43abf7=_0x328490[_0x24790e(0x1d0)]?await getDbName(_0x5320c1[_0x24790e(0x1e7)],Number(_0x328490[_0x24790e(0x1d0)]))[_0x24790e(0x1fe)](()=>_0xb32c58[_0x24790e(0x1ca)]):_0xb32c58['dbName'];_0x31eb36['sqls'][_0x227b6f[_0x24790e(0x1ce)]]={...buildSqlLockEntry(_0x328490,_0x49e104,_0x44d859,{'dbName':_0x43abf7}),'path':_0x227b6f[_0x24790e(0x1f7)],'mode':_0x457869[_0x24790e(0x1e4)]},await archivePreviousSqlFileIfNeeded(_0x41a561,_0x457869[_0x24790e(0x1f5)],_0x227b6f[_0x24790e(0x1f7)]),_0x4051bf[_0x24790e(0x1eb)]({'sqlCode':_0x227b6f[_0x24790e(0x1ce)],'remoteId':_0x457869[_0x24790e(0x1d9)]});}catch(_0x190f64){_0x32aa36['push']({'sqlCode':_0x227b6f[_0x24790e(0x1ce)],'error':_0x190f64 instanceof Error?_0x190f64['message']:String(_0x190f64)});}}return _0x31eb36[_0x24790e(0x1e5)]=new Date()[_0x24790e(0x1ed)](),await writeSqlLockFile(_0x41a561[_0x24790e(0x1f2)],_0x29c507),{'ok':_0x32aa36['length']===0x0,'data':{'pushed':_0x4051bf,'skipped':_0x1929ba,'failed':_0x32aa36},'message':'Push\x20complete:\x20'+_0x4051bf['length']+'\x20pushed,\x20'+_0x1929ba[_0x24790e(0x1d8)]+_0x24790e(0x1c2)+_0x32aa36['length']+_0x24790e(0x1f1)};}};async function archivePreviousSqlFileIfNeeded(_0x259b58,_0x561b17,_0x2e9fd2){const _0x1e64a3=a182_0x4f2219;if(!_0x561b17||_0x561b17===_0x2e9fd2)return;const _0x3184ca=join(_0x259b58['sqlRootDir'],_0x561b17);if(!await fileExists(_0x3184ca))return;const _0x27ed2e=await moveToTrash(_0x259b58[_0x1e64a3(0x1cb)],_0x259b58['trashDir'],_0x3184ca);await cleanupEmptyDirectories(dirname(_0x3184ca),_0x259b58['sqlRootDir']),void _0x27ed2e;}async function moveToTrash(_0x47d122,_0x422b6e,_0x1b0977){const _0x570c00=a182_0x4f2219,_0x44696b=new Date()[_0x570c00(0x1ed)]()[_0x570c00(0x1f6)](/[:.]/g,'-'),_0x146393=relative(_0x47d122,_0x1b0977),_0x45c2e3=join(_0x422b6e,_0x44696b,_0x146393);return await mkdir(dirname(_0x45c2e3),{'recursive':!![]}),await rename(_0x1b0977,_0x45c2e3),_0x45c2e3;}async function cleanupEmptyDirectories(_0x34f659,_0x458779){const _0x490270=a182_0x4f2219;let _0x425889=resolve(_0x34f659);const _0x15f70d=resolve(_0x458779);while(_0x425889[_0x490270(0x1c3)](''+_0x15f70d+sep)||_0x425889===_0x15f70d){if(_0x425889===_0x15f70d)return;try{const _0x561dc1=await readdir(_0x425889);if(_0x561dc1[_0x490270(0x1d8)]>0x0)return;await rmdir(_0x425889);}catch{return;}_0x425889=dirname(_0x425889);}}async function resolveTargetDbBinding(_0x2e91f8,_0x135176,_0x2ece2c){const _0x411d13=a182_0x4f2219,_0x13ea93=_0x135176[_0x411d13(0x1cd)];if(!_0x13ea93)return{'dbId':_0x2ece2c['dbId'],'dbName':_0x2ece2c[_0x411d13(0x1ca)]};const _0x4057c0=buildDbDirectoryName(_0x2ece2c[_0x411d13(0x1ca)],_0x2ece2c['dbId']);if(_0x13ea93===_0x4057c0)return{'dbId':_0x2ece2c[_0x411d13(0x1d0)],'dbName':_0x2ece2c[_0x411d13(0x1ca)]};const _0x2dfbbb=parseExplicitDbDirectory(_0x13ea93);if(_0x2dfbbb!=null)return{'dbId':_0x2dfbbb,'dbName':await getDbName(_0x2e91f8,_0x2dfbbb)['catch'](()=>undefined)};const _0x4a5760=await listDatabases(_0x2e91f8),_0x5646df=_0x4a5760[_0x411d13(0x1f8)](_0x5c0253=>buildDbDirectoryName(_0x5c0253['dbName'],_0x5c0253['dbId'])===_0x13ea93);if(_0x5646df[_0x411d13(0x1d8)]===0x1)return{'dbId':_0x5646df[0x0][_0x411d13(0x1d0)],'dbName':_0x5646df[0x0][_0x411d13(0x1ca)]};if(_0x5646df['length']===0x0)throw CliErrors['validation'](_0x411d13(0x1c7)+_0x13ea93+_0x411d13(0x1ea)+_0x135176[_0x411d13(0x1ce)]+'.');const _0x589524=_0x5646df[_0x411d13(0x1c1)](_0x123463=>_0x123463[_0x411d13(0x1ca)]+'\x20('+_0x123463[_0x411d13(0x1d0)]+')')[_0x411d13(0x1cc)](',\x20');throw CliErrors['validation'](_0x411d13(0x1fa)+_0x13ea93+_0x411d13(0x1da)+_0x135176[_0x411d13(0x1ce)]+':\x20'+_0x589524);}function parseExplicitDbDirectory(_0xea33ca){const _0x48cc0f=a182_0x4f2219,_0x15d23e=/^db-(\d+)$/[_0x48cc0f(0x1d4)](_0xea33ca);if(!_0x15d23e)return null;const _0x52fef9=Number(_0x15d23e[0x1]);return Number[_0x48cc0f(0x1d3)](_0x52fef9)&&_0x52fef9>0x0?_0x52fef9:null;}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sql 子命令共享:本地 SQL 同步体系的共用工具。
|
|
3
|
+
*/
|
|
4
|
+
import type { SqlQuery } from "../../core/api-client.js";
|
|
5
|
+
import type { SqlLocalMode, SqlLockEntry, SqlLockFile, SqlLockScope } from "../../core/sql-sync/types.js";
|
|
6
|
+
export declare const SQL_LOCAL_REL_DIR = ".rabetbase/sql";
|
|
7
|
+
export declare function buildSqlLockEntry(sql: SqlQuery, sqlContent: string, hash: string, options?: {
|
|
8
|
+
dbName?: string;
|
|
9
|
+
}): SqlLockEntry;
|
|
10
|
+
export declare function cloneSqlLockData(lockData: SqlLockFile): SqlLockFile;
|
|
11
|
+
export declare function ensureRemoteSqlContent(sql: SqlQuery): string;
|
|
12
|
+
export declare function buildLocalSqlFileContent(sql: Pick<SqlQuery, "sqlCode" | "sqlName" | "dbId">, rawContent: string, options?: {
|
|
13
|
+
dbName?: string;
|
|
14
|
+
mode?: SqlLocalMode;
|
|
15
|
+
syncedAt?: string;
|
|
16
|
+
description?: string | null | undefined;
|
|
17
|
+
}): string;
|
|
18
|
+
export declare function stripLocalSqlMetadata(content: string, mode: SqlLocalMode): string;
|
|
19
|
+
export declare function resolveSqlMode(sqlContent: string, lockEntry?: SqlLockEntry): SqlLocalMode;
|
|
20
|
+
export declare function resolveSqlFileName(sqlCode: string, sqlContent: string, lockEntry?: SqlLockEntry): string;
|
|
21
|
+
export declare function resolveSqlLocalDir(projectRoot: string, appCode: string): string;
|
|
22
|
+
export declare function confirmForceOverwrite(message: string): Promise<boolean>;
|
|
23
|
+
export declare function findSqlLockScope(lockData: SqlLockFile, appCode: string): SqlLockScope | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a183_0x2e4175=a183_0x57a5;(function(_0x44e841,_0x5e7096){const _0x15cdc6=a183_0x57a5,_0xacfd7e=_0x44e841();while(!![]){try{const _0x6415cf=parseInt(_0x15cdc6(0x141))/0x1*(-parseInt(_0x15cdc6(0x151))/0x2)+-parseInt(_0x15cdc6(0x14e))/0x3*(-parseInt(_0x15cdc6(0x145))/0x4)+-parseInt(_0x15cdc6(0x126))/0x5+-parseInt(_0x15cdc6(0x128))/0x6+parseInt(_0x15cdc6(0x137))/0x7+parseInt(_0x15cdc6(0x12f))/0x8+-parseInt(_0x15cdc6(0x13a))/0x9*(parseInt(_0x15cdc6(0x14b))/0xa);if(_0x6415cf===_0x5e7096)break;else _0xacfd7e['push'](_0xacfd7e['shift']());}catch(_0x4a024b){_0xacfd7e['push'](_0xacfd7e['shift']());}}}(a183_0x262f,0x366de));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a183_0x2e4175(0x14f);function a183_0x262f(){const _0x4c354f=['length','apps','451375kmSMSs','yes','100926RXKJUW','version','endsWith','\x20-->','map','test','dbId','1783504LJWBpo','toLowerCase','mode','path','filter','split','replace','syncedAt','1371405bokhaL','entries','question','1093689giVJAW','mybatisXml','stderr','lastSync','sqlName','push','description','31609pUhAwL','join','sqlContent','--\x20@lovrabet.','69364ibLxJW','<!--\x20@lovrabet.','\x20[y/N]\x20','close','sqlCode','sqlConfig','10mEefDy','sqls','trimStart','33FjMqIh','.rabetbase/sql','stdin','10jzJSFX','dbName','sqlRoot','trim','includes'];a183_0x262f=function(){return _0x4c354f;};return a183_0x262f();}export function buildSqlLockEntry(_0x54d34c,_0x516871,_0x301676,_0x741c1a){const _0x59946a=a183_0x2e4175,_0x47ab0e=detectSqlMode(_0x516871);return{'path':buildSqlRelativePath(_0x54d34c['sqlCode'],_0x54d34c[_0x59946a(0x13e)],_0x741c1a?.[_0x59946a(0x152)],_0x47ab0e,_0x54d34c[_0x59946a(0x12e)]),'hash':_0x301676,'remoteId':_0x54d34c['id'],'version':_0x54d34c[_0x59946a(0x129)],'dbId':Number(_0x54d34c[_0x59946a(0x12e)]),'dbName':_0x741c1a?.['dbName'],'sqlName':_0x54d34c[_0x59946a(0x13e)],'sqlConfig':_0x54d34c[_0x59946a(0x14a)]??undefined,'mode':_0x47ab0e};}export function cloneSqlLockData(_0x4ecc17){const _0x25ea08=a183_0x2e4175;return{'apps':Object['fromEntries'](Object[_0x25ea08(0x138)](_0x4ecc17[_0x25ea08(0x125)])[_0x25ea08(0x12c)](([_0x527990,_0x1db374])=>[_0x527990,{'sqlRoot':_0x1db374[_0x25ea08(0x153)],'lastSync':_0x1db374[_0x25ea08(0x13d)],'sqls':{..._0x1db374[_0x25ea08(0x14c)]}}]))};}function a183_0x57a5(_0x36c923,_0x58e23a){_0x36c923=_0x36c923-0x122;const _0x262f79=a183_0x262f();let _0x57a508=_0x262f79[_0x36c923];return _0x57a508;}export function ensureRemoteSqlContent(_0x1d878d){const _0x44862a=a183_0x2e4175;return _0x1d878d[_0x44862a(0x143)]??'';}export function buildLocalSqlFileContent(_0x2ae1ae,_0x999873,_0x38c142){const _0x30b0c0=a183_0x2e4175,_0xd74b46=_0x38c142?.[_0x30b0c0(0x131)]??detectSqlMode(_0x999873),_0x343032=stripLocalSqlMetadata(_0x999873,_0xd74b46)['trim'](),_0x28dfab=[...buildMetadataHeaderLines({'sqlCode':_0x2ae1ae[_0x30b0c0(0x149)],'sqlName':_0x2ae1ae['sqlName'],'dbId':_0x2ae1ae['dbId'],'dbName':_0x38c142?.[_0x30b0c0(0x152)],'mode':_0xd74b46,'syncedAt':_0x38c142?.[_0x30b0c0(0x136)],'description':_0x38c142?.[_0x30b0c0(0x140)]},_0xd74b46),'',_0x343032],_0x50ce8c=_0x28dfab[_0x30b0c0(0x142)]('\x0a');return _0x50ce8c[_0x30b0c0(0x12a)]('\x0a')?_0x50ce8c:_0x50ce8c+'\x0a';}export function stripLocalSqlMetadata(_0x43604e,_0x23af62){const _0x3a6569=a183_0x2e4175,_0x457c0d=_0x43604e[_0x3a6569(0x135)](/\r\n/g,'\x0a')[_0x3a6569(0x134)]('\x0a'),_0x45e410=[];let _0x41c063=0x0;if(_0x23af62===_0x3a6569(0x13b))while(_0x41c063<_0x457c0d['length']){const _0x35f7f1=_0x457c0d[_0x41c063]??'';if(/^\s*<!--\s*@lovrabet\./[_0x3a6569(0x12d)](_0x35f7f1)){_0x41c063++;continue;}if(_0x35f7f1[_0x3a6569(0x122)]()===''&&_0x41c063>0x0){_0x41c063++;continue;}break;}else while(_0x41c063<_0x457c0d[_0x3a6569(0x124)]){const _0x3d8124=_0x457c0d[_0x41c063]??'';if(/^\s*--\s*@lovrabet\./[_0x3a6569(0x12d)](_0x3d8124)){_0x41c063++;continue;}if(_0x3d8124[_0x3a6569(0x122)]()===''&&_0x41c063>0x0){_0x41c063++;continue;}break;}for(;_0x41c063<_0x457c0d['length'];_0x41c063++){_0x45e410[_0x3a6569(0x13f)](_0x457c0d[_0x41c063]);}return _0x45e410[_0x3a6569(0x142)]('\x0a')[_0x3a6569(0x14d)]();}export function resolveSqlMode(_0x2a9bbe,_0x46c766){const _0x3b1df1=a183_0x2e4175;if(_0x46c766?.[_0x3b1df1(0x131)])return _0x46c766[_0x3b1df1(0x131)];return detectSqlMode(_0x2a9bbe);}export function resolveSqlFileName(_0x527bcd,_0x95c4ed,_0x48cd9c){const _0x891112=a183_0x2e4175;if(_0x48cd9c?.[_0x891112(0x132)])return _0x48cd9c['path'];if(_0x48cd9c?.[_0x891112(0x13e)]||_0x48cd9c?.[_0x891112(0x152)])return buildSqlRelativePath(_0x527bcd,_0x48cd9c?.[_0x891112(0x13e)],_0x48cd9c?.[_0x891112(0x152)],resolveSqlMode(_0x95c4ed,_0x48cd9c),_0x48cd9c?.['dbId']);return buildDefaultSqlFileName(_0x527bcd,resolveSqlMode(_0x95c4ed,_0x48cd9c));}export function resolveSqlLocalDir(_0x58e61f,_0x23a9f8){return join(_0x58e61f,SQL_LOCAL_REL_DIR,_0x23a9f8);}export async function confirmForceOverwrite(_0xe3b738){const _0x2a408b=a183_0x2e4175,_0x512a97=createInterface({'input':process[_0x2a408b(0x150)],'output':process[_0x2a408b(0x13c)]}),_0x18b9e9=await new Promise(_0x4ce16d=>{const _0x1e0d4b=_0x2a408b;_0x512a97[_0x1e0d4b(0x139)](_0xe3b738+_0x1e0d4b(0x147),_0x4ce16d);});return _0x512a97[_0x2a408b(0x148)](),['y',_0x2a408b(0x127)][_0x2a408b(0x123)](_0x18b9e9[_0x2a408b(0x122)]()[_0x2a408b(0x130)]());}export function findSqlLockScope(_0x4c400c,_0x243279){const _0x4b5dbd=a183_0x2e4175;return _0x4c400c[_0x4b5dbd(0x125)][_0x243279];}function buildMetadataHeaderLines(_0x4052af,_0x460a69){const _0x25d163=a183_0x2e4175,_0x52c34e=[[_0x25d163(0x149),_0x4052af[_0x25d163(0x149)]],[_0x25d163(0x13e),_0x4052af['sqlName']],[_0x25d163(0x12e),_0x4052af[_0x25d163(0x12e)]],[_0x25d163(0x152),_0x4052af['dbName']],[_0x25d163(0x131),_0x4052af[_0x25d163(0x131)]],[_0x25d163(0x136),_0x4052af['syncedAt']],[_0x25d163(0x140),_0x4052af[_0x25d163(0x140)]]];if(_0x460a69===_0x25d163(0x13b))return _0x52c34e[_0x25d163(0x133)](([,_0x299150])=>_0x299150!==undefined&&_0x299150!==null&&String(_0x299150)[_0x25d163(0x122)]()!=='')[_0x25d163(0x12c)](([_0x128d28,_0x588682])=>_0x25d163(0x146)+_0x128d28+':\x20'+String(_0x588682)+_0x25d163(0x12b));return _0x52c34e[_0x25d163(0x133)](([,_0x23c842])=>_0x23c842!==undefined&&_0x23c842!==null&&String(_0x23c842)[_0x25d163(0x122)]()!=='')[_0x25d163(0x12c)](([_0x14da49,_0x4c2b3e])=>_0x25d163(0x144)+_0x14da49+':\x20'+String(_0x4c2b3e));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a184_0x44a983=a184_0x17da;(function(_0x5d5c81,_0x5cc645){const _0x173c13=a184_0x17da,_0x3d4dd9=_0x5d5c81();while(!![]){try{const _0x41a0fc=-parseInt(_0x173c13(0xc8))/0x1*(parseInt(_0x173c13(0xc0))/0x2)+parseInt(_0x173c13(0xce))/0x3*(-parseInt(_0x173c13(0xbc))/0x4)+parseInt(_0x173c13(0xd2))/0x5+-parseInt(_0x173c13(0xcd))/0x6*(-parseInt(_0x173c13(0xb9))/0x7)+-parseInt(_0x173c13(0xb7))/0x8*(parseInt(_0x173c13(0xb2))/0x9)+parseInt(_0x173c13(0xc1))/0xa*(-parseInt(_0x173c13(0xbd))/0xb)+parseInt(_0x173c13(0xb0))/0xc*(parseInt(_0x173c13(0xb4))/0xd);if(_0x41a0fc===_0x5cc645)break;else _0x3d4dd9['push'](_0x3d4dd9['shift']());}catch(_0xa95b56){_0x3d4dd9['push'](_0x3d4dd9['shift']());}}}(a184_0x2916,0xb4629));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a184_0x17da(_0x1762bc,_0x37cfce){_0x1762bc=_0x1762bc-0xad;const _0x2916f3=a184_0x2916();let _0x17da7a=_0x2916f3[_0x1762bc];return _0x17da7a;}function a184_0x2916(){const _0x1ca0c4=['279862IliNWz','840540ytFdEC','paging','filePath','sqls','relativePath','lockFilePath','push','10xPsjcD','map','path','\x20added,\x20','\x20remote-only','403380ByGejH','847221IendIf','\x20modified,\x20','totalCount','appCode','6652050KwJtre','tableData','status','\x20missing,\x20','12WQlNJg','has','837HLHUaI','sqlName','32168929kmXwnL','length','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','61816yFdjAI','sql','42ynapvL','read','lockKey','12pAVMVc','66NaTfaD','sqlRoot','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'];a184_0x2916=function(){return _0x1ca0c4;};return a184_0x2916();}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x29cead){const _0x293a92=a184_0x17da,_0x772c22=[];let _0x36e4d8=0x1;while(!![]){const _0x425fe5=await listSqlQueries(_0x29cead,{'currentPage':_0x36e4d8,'pageSize':PAGE_SIZE}),_0x58ab27=_0x425fe5[_0x293a92(0xad)]??[];_0x772c22[_0x293a92(0xc7)](..._0x58ab27[_0x293a92(0xc9)](_0x23ed54=>_0x23ed54['sqlCode']));if(_0x58ab27[_0x293a92(0xb5)]===0x0)break;const _0x5862bf=_0x425fe5[_0x293a92(0xc2)]?.[_0x293a92(0xd0)];if(_0x5862bf!=null?_0x772c22[_0x293a92(0xb5)]>=_0x5862bf:_0x58ab27[_0x293a92(0xb5)]<PAGE_SIZE)break;_0x36e4d8++;}return _0x772c22;}export const sqlStatus={'service':a184_0x44a983(0xb8),'command':a184_0x44a983(0xae),'description':a184_0x44a983(0xb6),'risk':a184_0x44a983(0xba),'flags':[{'name':'remote','type':'boolean','description':a184_0x44a983(0xbf)}],async 'execute'(_0x47fe32){const _0x3fe851=a184_0x44a983,_0x4ff82c=loadSqlProjectConfig(_0x47fe32[_0x3fe851(0xd1)]),_0x477d34=await readSqlLockFile(_0x4ff82c[_0x3fe851(0xc6)]),{appLock:_0x1614c0}=ensureSqlLockScope(_0x477d34??createEmptySqlLock(),_0x4ff82c[_0x3fe851(0xd1)],_0x4ff82c[_0x3fe851(0xbe)],_0x3fe851(0xae)),_0x30c17a=await scanLocalSqlQueries(_0x4ff82c),_0x1fa882=[],_0x2bf253=[],_0x4a88a7=[],_0x2e9bb9=[],_0x33228f=new Set(_0x30c17a[_0x3fe851(0xc9)](_0x5d80f6=>_0x5d80f6['lockKey']));for(const _0x113425 of _0x30c17a){const _0x17c000=await computeSqlFileHash(_0x113425[_0x3fe851(0xc3)]),_0x59f0df=_0x1614c0[_0x3fe851(0xc4)][_0x113425['lockKey']],_0x2086f7=!!_0x59f0df&&_0x59f0df[_0x3fe851(0xca)]!==_0x113425[_0x3fe851(0xc5)],_0x233848=!!_0x59f0df&&!!_0x113425[_0x3fe851(0xb3)]&&_0x59f0df['sqlName']!==_0x113425[_0x3fe851(0xb3)];if(!_0x59f0df)_0x1fa882[_0x3fe851(0xc7)](_0x113425[_0x3fe851(0xbb)]);else _0x59f0df['hash']!==_0x17c000||_0x2086f7||_0x233848?_0x2bf253[_0x3fe851(0xc7)](_0x113425[_0x3fe851(0xbb)]):_0x4a88a7['push'](_0x113425[_0x3fe851(0xbb)]);}for(const _0x475bbd of Object['keys'](_0x1614c0['sqls'])){!_0x33228f[_0x3fe851(0xb1)](_0x475bbd)&&_0x2e9bb9[_0x3fe851(0xc7)](_0x475bbd);}const _0x5abd72=[];if(_0x47fe32['bool']('remote')){const _0x1739e9=await fetchAllSqlCodes(_0x47fe32['appCode']);for(const _0x454eea of _0x1739e9){!_0x33228f[_0x3fe851(0xb1)](_0x454eea)&&!_0x1614c0[_0x3fe851(0xc4)][_0x454eea]&&_0x5abd72[_0x3fe851(0xc7)](_0x454eea);}}const _0x269c6e=_0x1fa882[_0x3fe851(0xb5)]===0x0&&_0x2bf253['length']===0x0&&_0x2e9bb9['length']===0x0&&_0x5abd72['length']===0x0;return{'ok':!![],'data':{'added':_0x1fa882,'modified':_0x2bf253,'missing':_0x2e9bb9,'unchanged':_0x4a88a7,'remoteOnly':_0x5abd72},'message':_0x269c6e?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x1fa882[_0x3fe851(0xb5)]+_0x3fe851(0xcb)+_0x2bf253[_0x3fe851(0xb5)]+_0x3fe851(0xcf)+_0x2e9bb9[_0x3fe851(0xb5)]+_0x3fe851(0xaf)+_0x4a88a7[_0x3fe851(0xb5)]+'\x20unchanged'+(_0x5abd72['length']>0x0?',\x20'+_0x5abd72['length']+_0x3fe851(0xcc):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a185_0x36a4c4=a185_0x22e6;(function(_0x1dcbaf,_0x58ecaf){const _0x2b101b=a185_0x22e6,_0x29eded=_0x1dcbaf();while(!![]){try{const _0x14150b=-parseInt(_0x2b101b(0xa4))/0x1+parseInt(_0x2b101b(0x9c))/0x2*(-parseInt(_0x2b101b(0xb9))/0x3)+parseInt(_0x2b101b(0x9e))/0x4+parseInt(_0x2b101b(0x8a))/0x5*(parseInt(_0x2b101b(0xb8))/0x6)+parseInt(_0x2b101b(0x84))/0x7*(parseInt(_0x2b101b(0x80))/0x8)+-parseInt(_0x2b101b(0x8b))/0x9*(parseInt(_0x2b101b(0xbd))/0xa)+parseInt(_0x2b101b(0xa0))/0xb;if(_0x14150b===_0x58ecaf)break;else _0x29eded['push'](_0x29eded['shift']());}catch(_0x4775a5){_0x29eded['push'](_0x29eded['shift']());}}}(a185_0xfe77,0x6a70c));function a185_0xfe77(){const _0xd19d50=['Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','3327540BsQsNx','flagMissing','2178913GUrbWl','map','Provide\x20--file\x20or\x20--sql','tableName','164017zlFxBm','isArray','joinAudit','fields','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','columnNames','indexes','SQL\x20schema\x20validation','sqlType','primary','push','dataset','toLowerCase','pkField','reason','tables','trim','Dataset\x20\x22','isDangerous','columns','2040xBvksk','18mpGbIg','validation','dbtableConfig','file','8621990oTTNVo','type','flatMap','parameters','index_name','--check-indexes\x20requires\x20--schemas.','str','message','check-indexes','sql','208TGVkgz','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','index_columns','string','67655MVociN','unshift','\x22\x20not\x20found\x20in\x20any\x20dataset','cwd','boolean','filter','7510TxSppW','9RZHcrE','size','split','name','appCode','from','isSelectOnly','Table\x20\x22','read','indexName','find','\x22\x20not\x20found\x20or\x20not\x20accessible','schemas','File\x20not\x20found:\x20','length','valid','schema:','109914xJkZKj'];a185_0xfe77=function(){return _0xd19d50;};return a185_0xfe77();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';function a185_0x22e6(_0x1f1435,_0x3a31fd){_0x1f1435=_0x1f1435-0x7c;const _0xfe7775=a185_0xfe77();let _0x22e6b9=_0xfe7775[_0x1f1435];return _0x22e6b9;}export const sqlValidate={'service':a185_0x36a4c4(0x7f),'command':'validate','description':a185_0x36a4c4(0xa8),'risk':a185_0x36a4c4(0x93),'flags':[{'name':a185_0x36a4c4(0xbc),'type':a185_0x36a4c4(0x83),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':'sql','type':a185_0x36a4c4(0x83),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a185_0x36a4c4(0x97),'type':a185_0x36a4c4(0x83),'description':a185_0x36a4c4(0x9d)},{'name':'check-indexes','type':a185_0x36a4c4(0x88),'description':a185_0x36a4c4(0x81)}],async 'execute'(_0x516a0c){const _0x7f0730=a185_0x36a4c4,_0x4a98f6=_0x516a0c[_0x7f0730(0x7c)]('file'),_0x3329b7=_0x516a0c['str'](_0x7f0730(0x7f)),_0x176c47=_0x516a0c['str']('schemas'),_0x30582f=_0x516a0c['bool'](_0x7f0730(0x7e));if(!_0x4a98f6&&!_0x3329b7)throw CliErrors[_0x7f0730(0x9f)](_0x7f0730(0xbc),_0x7f0730(0xa2));if(_0x30582f&&!_0x176c47)throw CliErrors[_0x7f0730(0xba)](_0x7f0730(0xc2));let _0x3a2053;if(_0x4a98f6){const _0x81f0d5=resolve(process[_0x7f0730(0x87)](),_0x4a98f6);if(!existsSync(_0x81f0d5))throw CliErrors[_0x7f0730(0xba)](_0x7f0730(0x98)+_0x81f0d5);_0x3a2053=readFileSync(_0x81f0d5,'utf-8');}else _0x3a2053=_0x3329b7;const _0x44e8fe=validateSql(_0x3a2053),_0x218e4e={'valid':_0x44e8fe[_0x7f0730(0x9a)],'sqlType':_0x44e8fe[_0x7f0730(0xac)][_0x7f0730(0xbe)],'isSelectOnly':_0x44e8fe[_0x7f0730(0xac)][_0x7f0730(0x91)],'isDangerous':_0x44e8fe[_0x7f0730(0xac)][_0x7f0730(0xb6)],'tables':_0x44e8fe[_0x7f0730(0xb3)],'parameters':_0x44e8fe[_0x7f0730(0xc0)],'message':_0x44e8fe[_0x7f0730(0x7d)]};_0x44e8fe['sqlType'][_0x7f0730(0xb2)]&&(_0x218e4e['reason']=_0x44e8fe[_0x7f0730(0xac)][_0x7f0730(0xb2)]);if(_0x176c47&&_0x44e8fe[_0x7f0730(0x9a)]){const _0x456430=_0x176c47[_0x7f0730(0x8d)](',')[_0x7f0730(0xa1)](_0x321b93=>_0x321b93[_0x7f0730(0xb4)]())['filter'](Boolean),_0x26e841=[],_0x3a8d6d=[],_0x200a0f=filterDbTableBackedDatasets(await listDatasets(_0x516a0c[_0x7f0730(0x8f)])),_0x355fdb=new Map(_0x200a0f[_0x7f0730(0xa1)](_0x39b35c=>[_0x39b35c['dbtableConfig']?.[_0x7f0730(0xa3)]?.[_0x7f0730(0xb0)](),_0x39b35c]));for(const _0x2989f2 of _0x44e8fe[_0x7f0730(0xb3)]){const _0xe3293e=_0x355fdb['get'](_0x2989f2[_0x7f0730(0xb0)]());!_0xe3293e&&_0x26e841[_0x7f0730(0xae)](_0x7f0730(0x92)+_0x2989f2+_0x7f0730(0x86));}for(const _0x499346 of _0x456430){let _0x2f7eab;try{_0x2f7eab=await getDatasetDetail(_0x499346);}catch{_0x26e841[_0x7f0730(0xae)](_0x7f0730(0xb5)+_0x499346+_0x7f0730(0x96));continue;}assertDatasetIsDbTableBacked(_0x2f7eab,_0x7f0730(0xab));const _0x211025=Array[_0x7f0730(0xa5)](_0x2f7eab[_0x7f0730(0xa7)])?_0x2f7eab[_0x7f0730(0xa7)]:[],_0x2ec91d=new Set(_0x211025['map'](_0x3469c4=>_0x3469c4[_0x7f0730(0x8e)]?.['toLowerCase']())),_0x4b2c59=_0x2f7eab[_0x7f0730(0xbb)]?.[_0x7f0730(0xa3)]||_0x2f7eab[_0x7f0730(0xa3)]||_0x499346;_0x218e4e[_0x7f0730(0x9b)+_0x4b2c59]={'code':_0x499346,'tableName':_0x4b2c59,'fieldCount':_0x2ec91d[_0x7f0730(0x8c)],'fields':Array[_0x7f0730(0x90)](_0x2ec91d)};if(_0x30582f){const _0x413d1e=normalizeDatasetIndexes(_0x2f7eab);_0x3a8d6d[_0x7f0730(0xae)]({'tableName':_0x4b2c59,..._0x413d1e});}}_0x26e841[_0x7f0730(0x99)]>0x0&&(_0x218e4e['schemaWarnings']=_0x26e841),_0x30582f&&(_0x218e4e[_0x7f0730(0xa6)]=auditSqlJoinIndexes(_0x3a2053,_0x3a8d6d));}return{'ok':_0x44e8fe['valid'],'data':_0x218e4e,'message':_0x44e8fe['message']};}};function normalizeDatasetIndexes(_0x40ef41){const _0x56b08e=a185_0x36a4c4,_0x43afaa=Array['isArray'](_0x40ef41?.[_0x56b08e(0xaf)]?.[_0x56b08e(0xaa)])?_0x40ef41[_0x56b08e(0xaf)][_0x56b08e(0xaa)]:Array['isArray'](_0x40ef41?.[_0x56b08e(0xaa)])?_0x40ef41[_0x56b08e(0xaa)]:[],_0x4c85cb=_0x43afaa[_0x56b08e(0xbf)](_0x523483=>{const _0x2d2b7c=_0x56b08e,_0x440e88=Array['isArray'](_0x523483?.['index_columns'])?_0x523483[_0x2d2b7c(0x82)]:Array['isArray'](_0x523483?.[_0x2d2b7c(0xa9)])?_0x523483[_0x2d2b7c(0xa9)]:Array['isArray'](_0x523483?.[_0x2d2b7c(0xb7)])?_0x523483[_0x2d2b7c(0xb7)]:[],_0x14bb8f=_0x440e88['filter'](_0x40e1b5=>typeof _0x40e1b5===_0x2d2b7c(0x83))[_0x2d2b7c(0xa1)](_0x21ffff=>_0x21ffff[_0x2d2b7c(0xb4)]())[_0x2d2b7c(0x89)](Boolean);if(_0x14bb8f['length']===0x0)return[];const _0x20efaa=[_0x523483?.[_0x2d2b7c(0x94)],_0x523483?.[_0x2d2b7c(0xc1)],_0x523483?.[_0x2d2b7c(0x8e)]][_0x2d2b7c(0x95)](_0x5e3baf=>typeof _0x5e3baf===_0x2d2b7c(0x83)&&_0x5e3baf['trim']()),_0x4119d6=[_0x523483?.['index_type'],_0x523483?.[_0x2d2b7c(0xbe)]][_0x2d2b7c(0x95)](_0xc95c78=>typeof _0xc95c78===_0x2d2b7c(0x83)&&_0xc95c78[_0x2d2b7c(0xb4)]());return[{..._0x20efaa?{'name':_0x20efaa[_0x2d2b7c(0xb4)]()}:{},..._0x4119d6?{'type':_0x4119d6['trim']()}:{},'columns':_0x14bb8f}];}),_0x280f08=[..._0x4c85cb],_0x520faf=typeof _0x40ef41?.[_0x56b08e(0xbb)]?.[_0x56b08e(0xb1)]===_0x56b08e(0x83)?_0x40ef41[_0x56b08e(0xbb)]['pkField'][_0x56b08e(0x8d)](',')[_0x56b08e(0xa1)](_0x3acf3c=>_0x3acf3c[_0x56b08e(0xb4)]())['filter'](Boolean):[];return _0x520faf[_0x56b08e(0x99)]>0x0&&_0x280f08[_0x56b08e(0x85)]({'type':_0x56b08e(0xad),'columns':_0x520faf}),{'indexes':_0x280f08,'metadataAvailable':_0x4c85cb[_0x56b08e(0x99)]>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x6929ec,_0x34ebc9){const _0x2ec3c0=a186_0x58cf,_0x2eb276=_0x6929ec();while(!![]){try{const _0x3d3dd8=-parseInt(_0x2ec3c0(0x195))/0x1*(parseInt(_0x2ec3c0(0x196))/0x2)+-parseInt(_0x2ec3c0(0x190))/0x3*(-parseInt(_0x2ec3c0(0x198))/0x4)+-parseInt(_0x2ec3c0(0x199))/0x5*(-parseInt(_0x2ec3c0(0x193))/0x6)+parseInt(_0x2ec3c0(0x197))/0x7+-parseInt(_0x2ec3c0(0x194))/0x8*(parseInt(_0x2ec3c0(0x191))/0x9)+-parseInt(_0x2ec3c0(0x19a))/0xa*(-parseInt(_0x2ec3c0(0x192))/0xb)+parseInt(_0x2ec3c0(0x19b))/0xc;if(_0x3d3dd8===_0x34ebc9)break;else _0x2eb276['push'](_0x2eb276['shift']());}catch(_0x4e4ae6){_0x2eb276['push'](_0x2eb276['shift']());}}}(a186_0x1724,0x7ff28));function a186_0x1724(){const _0x4ebe45=['857046ImjnuB','3594448rkzcQW','47kmQypL','44390fCyzKi','2867445dMmvNL','80DqHtWQ','5RrQKcP','32720xjLUZp','14471748YtazWN','7302TCOCwI','9pbOVVv','704tUAxNJ'];a186_0x1724=function(){return _0x4ebe45;};return a186_0x1724();}function a186_0x58cf(_0x180549,_0x54c195){_0x180549=_0x180549-0x190;const _0x172470=a186_0x1724();let _0x58cf59=_0x172470[_0x180549];return _0x58cf59;}import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a187_0xe03b(){const _0x26cdfb=['137929CgAoXK','trim','2916684GhQbpy','task','4112920lvNsyi','228539tznGwX','compress','2qiqema','isTerminal','appCode','570619RgPlKg','read','2475402LsNfbt','172tMcZTS','5kWNXTf','str',',\x20received\x20','apiError','taskId','770wFNPlV','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','10869FAdoQO','flagMissing','task-id'];a187_0xe03b=function(){return _0x26cdfb;};return a187_0xe03b();}const a187_0x3c6b0c=a187_0x5997;(function(_0x509537,_0x151656){const _0x385e17=a187_0x5997,_0x4d18dc=_0x509537();while(!![]){try{const _0x8cde6e=-parseInt(_0x385e17(0x85))/0x1*(-parseInt(_0x385e17(0x87))/0x2)+parseInt(_0x385e17(0x7d))/0x3*(-parseInt(_0x385e17(0x75))/0x4)+-parseInt(_0x385e17(0x76))/0x5*(-parseInt(_0x385e17(0x74))/0x6)+parseInt(_0x385e17(0x72))/0x7+parseInt(_0x385e17(0x84))/0x8+parseInt(_0x385e17(0x82))/0x9+parseInt(_0x385e17(0x7b))/0xa*(-parseInt(_0x385e17(0x80))/0xb);if(_0x8cde6e===_0x151656)break;else _0x4d18dc['push'](_0x4d18dc['shift']());}catch(_0x548964){_0x4d18dc['push'](_0x4d18dc['shift']());}}}(a187_0xe03b,0x6b4e2));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';function a187_0x5997(_0x12c904,_0x581d2b){_0x12c904=_0x12c904-0x70;const _0xe03bdb=a187_0xe03b();let _0x59970d=_0xe03bdb[_0x12c904];return _0x59970d;}import{CliErrors}from'../../errors.js';export const taskStatus={'service':a187_0x3c6b0c(0x83),'command':'status','description':'Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','risk':a187_0x3c6b0c(0x73),'defaultOutputFormat':a187_0x3c6b0c(0x86),'structuredErrors':!![],'flags':[{'name':a187_0x3c6b0c(0x7f),'type':'string','required':!![],'description':'Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x95e035){const _0x127765=a187_0x3c6b0c;if(!_0x95e035[_0x127765(0x77)](_0x127765(0x7f))[_0x127765(0x81)]())throw CliErrors[_0x127765(0x7e)](_0x127765(0x7f));},async 'execute'(_0x4511b4){const _0x174676=a187_0x3c6b0c,_0x47cc32=_0x4511b4[_0x174676(0x77)](_0x174676(0x7f))[_0x174676(0x81)](),_0x29a3bd=normalizeAsyncTask(await getAsyncTaskStatus(_0x47cc32,_0x4511b4['appCode'],_0x4511b4['cookie']));if(_0x29a3bd[_0x174676(0x7a)]!==_0x47cc32)throw CliErrors[_0x174676(0x79)](_0x174676(0x7c)+_0x47cc32+_0x174676(0x78)+_0x29a3bd['taskId']+'.');const _0x3dadcb=buildAsyncTaskStatusCommand(_0x29a3bd[_0x174676(0x7a)],_0x4511b4[_0x174676(0x71)]);return{'ok':!![],'message':asyncTaskMessage(_0x29a3bd),'data':{'appCode':_0x4511b4[_0x174676(0x71)],..._0x29a3bd,'query':_0x29a3bd[_0x174676(0x70)]?null:{'command':_0x3dadcb}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3b892c,_0x256c17){const _0x2cc612=a188_0x581d,_0x223d42=_0x3b892c();while(!![]){try{const _0x26ddcb=-parseInt(_0x2cc612(0xe1))/0x1*(parseInt(_0x2cc612(0xd8))/0x2)+parseInt(_0x2cc612(0xd9))/0x3+parseInt(_0x2cc612(0xda))/0x4+-parseInt(_0x2cc612(0xdd))/0x5*(parseInt(_0x2cc612(0xdc))/0x6)+parseInt(_0x2cc612(0xdf))/0x7+parseInt(_0x2cc612(0xde))/0x8*(-parseInt(_0x2cc612(0xdb))/0x9)+parseInt(_0x2cc612(0xe0))/0xa;if(_0x26ddcb===_0x256c17)break;else _0x223d42['push'](_0x223d42['shift']());}catch(_0x1c7a27){_0x223d42['push'](_0x223d42['shift']());}}}(a188_0x16ff,0xdb614));function a188_0x16ff(){const _0x5e5bde=['17949150HwEkuT','228815DVcfSB','4tBFhuI','1591719bPTecB','5694368JeMYRS','9FtYjSL','21534SuJptk','2260krfYxo','8389624hsTaza','1946427QEweGI'];a188_0x16ff=function(){return _0x5e5bde;};return a188_0x16ff();}function a188_0x581d(_0x158dff,_0x472df3){_0x158dff=_0x158dff-0xd8;const _0x16ff17=a188_0x16ff();let _0x581d45=_0x16ff17[_0x158dff];return _0x581d45;}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a189_0x2614c3=a189_0x387b;function a189_0x387b(_0x10b2ac,_0x1fdca2){_0x10b2ac=_0x10b2ac-0xf1;const _0x2c31af=a189_0x2c31();let _0x387b7b=_0x2c31af[_0x10b2ac];return _0x387b7b;}(function(_0x24e50b,_0xdb8a09){const _0x4c2611=a189_0x387b,_0xbca1b7=_0x24e50b();while(!![]){try{const _0x26e395=-parseInt(_0x4c2611(0xf4))/0x1*(-parseInt(_0x4c2611(0xf2))/0x2)+-parseInt(_0x4c2611(0xf9))/0x3*(-parseInt(_0x4c2611(0xfd))/0x4)+-parseInt(_0x4c2611(0x105))/0x5*(-parseInt(_0x4c2611(0x101))/0x6)+-parseInt(_0x4c2611(0x103))/0x7*(parseInt(_0x4c2611(0xfa))/0x8)+-parseInt(_0x4c2611(0xff))/0x9+-parseInt(_0x4c2611(0xf5))/0xa+parseInt(_0x4c2611(0xf8))/0xb;if(_0x26e395===_0xdb8a09)break;else _0xbca1b7['push'](_0xbca1b7['shift']());}catch(_0x5a3b31){_0xbca1b7['push'](_0xbca1b7['shift']());}}}(a189_0x2c31,0xa9fb3));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a189_0x2c31(){const _0x20000f=['450udzvJe','16uYhHEn','read','flagMissing','3908TKvNkQ','str','11724417ReIdIC','\x20tenant\x20member(s)','5786538gEABdY','string','3410015LVFHBC','tenant-code','5zBzDnB','trim','2340334pXwtqW','length','1oycvwM','11770400SjWezW','Exact\x20tenant\x20code','members-list','20560606bTojfa'];a189_0x2c31=function(){return _0x20000f;};return a189_0x2c31();}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':'tenant','command':a189_0x2614c3(0xf7),'description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':a189_0x2614c3(0xfb),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a189_0x2614c3(0x104),'type':a189_0x2614c3(0x102),'required':!![],'description':a189_0x2614c3(0xf6)}],async 'validate'(_0x21475f){const _0x13d1c2=a189_0x2614c3;if(!_0x21475f[_0x13d1c2(0xfe)](_0x13d1c2(0x104))[_0x13d1c2(0xf1)]())throw CliErrors[_0x13d1c2(0xfc)](_0x13d1c2(0x104),'Pass\x20--tenant-code\x20<code>.');},async 'execute'(_0x2645b1){const _0x37e101=a189_0x2614c3,_0x3797a4=_0x2645b1[_0x37e101(0xfe)](_0x37e101(0x104))[_0x37e101(0xf1)](),_0x4d1706=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x3797a4,_0x4d1706);const _0x40fa0c=projectTenantMembers(await listTenantDirectoryMembers(_0x3797a4));return{'ok':!![],'data':{'tenantCode':_0x3797a4,'items':_0x40fa0c,'totalCount':_0x40fa0c[_0x37e101(0xf3)]},'message':'Found\x20'+_0x40fa0c[_0x37e101(0xf3)]+_0x37e101(0x100)};}};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TenantDirectoryMember, TenantMembership } from "../../core/api-client.js";
|
|
2
|
+
export interface TenantMemberProjection {
|
|
3
|
+
userId: number;
|
|
4
|
+
username: string | null;
|
|
5
|
+
displayName: string | null;
|
|
6
|
+
role: "ADMIN" | "MEMBER";
|
|
7
|
+
status: string | null;
|
|
8
|
+
}
|
|
9
|
+
export declare function projectTenantMembers(members: TenantDirectoryMember[]): TenantMemberProjection[];
|
|
10
|
+
export declare function assertTenantAccessible(tenantCode: string, memberships: TenantMembership[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5e31e3,_0x5349af){const _0x5e9564=a190_0x4f8e,_0x2aada4=_0x5e31e3();while(!![]){try{const _0x2c5557=-parseInt(_0x5e9564(0x20e))/0x1+parseInt(_0x5e9564(0x1fc))/0x2+-parseInt(_0x5e9564(0x205))/0x3*(parseInt(_0x5e9564(0x206))/0x4)+parseInt(_0x5e9564(0x209))/0x5+parseInt(_0x5e9564(0x1f7))/0x6*(parseInt(_0x5e9564(0x200))/0x7)+-parseInt(_0x5e9564(0x1fa))/0x8*(parseInt(_0x5e9564(0x1f6))/0x9)+parseInt(_0x5e9564(0x1f5))/0xa;if(_0x2c5557===_0x5349af)break;else _0x2aada4['push'](_0x2aada4['shift']());}catch(_0x29864f){_0x2aada4['push'](_0x2aada4['shift']());}}}(a190_0x36fd,0x56258));function a190_0x36fd(){const _0xcb5282=['username','1925705DkskAo','nickname','ADMIN','status','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','523036Mftbzm','sort','5981380CgCdfi','9TvjxDb','6ojurnP','get','Tenant\x20\x22','1481752NbtaKM','userId','212076ufBoFf','trim','set','tenantCode','540897UqTagk','MEMBER','some','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','validation','3eDaEdt','421908TgVNhB','adminFlag'];a190_0x36fd=function(){return _0xcb5282;};return a190_0x36fd();}import{CliErrors}from'../../errors.js';function a190_0x4f8e(_0x3561c8,_0x403d4f){_0x3561c8=_0x3561c8-0x1f4;const _0x36fd0c=a190_0x36fd();let _0x4f8e5c=_0x36fd0c[_0x3561c8];return _0x4f8e5c;}function textOrNull(_0x57e8dc){const _0x287390=a190_0x4f8e,_0xb55348=_0x57e8dc?.[_0x287390(0x1fd)]();return _0xb55348?_0xb55348:null;}export function projectTenantMembers(_0x347b6e){const _0x5e65b3=a190_0x4f8e,_0x197752=new Map();for(const _0x4ae902 of _0x347b6e){const _0x5b96f6=Number(_0x4ae902[_0x5e65b3(0x1fb)]);if(!Number['isFinite'](_0x5b96f6)||_0x5b96f6<=0x0)continue;const _0x4d984a={'userId':_0x5b96f6,'username':textOrNull(_0x4ae902[_0x5e65b3(0x208)]),'displayName':textOrNull(_0x4ae902[_0x5e65b3(0x20a)]),'role':_0x4ae902[_0x5e65b3(0x207)]===!![]?_0x5e65b3(0x20b):_0x5e65b3(0x201),'status':textOrNull(_0x4ae902['status'])},_0x120aa6=_0x197752[_0x5e65b3(0x1f8)](_0x5b96f6);if(!_0x120aa6){_0x197752[_0x5e65b3(0x1fe)](_0x5b96f6,_0x4d984a);continue;}_0x120aa6[_0x5e65b3(0x208)]??=_0x4d984a[_0x5e65b3(0x208)],_0x120aa6['displayName']??=_0x4d984a['displayName'],_0x120aa6[_0x5e65b3(0x20c)]??=_0x4d984a[_0x5e65b3(0x20c)];if(_0x4d984a['role']===_0x5e65b3(0x20b))_0x120aa6['role']=_0x5e65b3(0x20b);}return[..._0x197752['values']()][_0x5e65b3(0x1f4)]((_0x283cd9,_0x1574be)=>_0x283cd9[_0x5e65b3(0x1fb)]-_0x1574be['userId']);}export function assertTenantAccessible(_0x523305,_0x24b599){const _0x103ae3=a190_0x4f8e;if(_0x24b599[_0x103ae3(0x202)](_0x43c89c=>_0x43c89c[_0x103ae3(0x1ff)]===_0x523305))return;throw CliErrors[_0x103ae3(0x204)](_0x103ae3(0x1f9)+_0x523305+_0x103ae3(0x20d),_0x103ae3(0x203));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a191_0x318e(_0x55bcbf,_0x18f29b){_0x55bcbf=_0x55bcbf-0x193;const _0x29b153=a191_0x29b1();let _0x318e2d=_0x29b153[_0x55bcbf];return _0x318e2d;}const a191_0x49711a=a191_0x318e;(function(_0x149c9e,_0x3a3234){const _0x566823=a191_0x318e,_0x59ea53=_0x149c9e();while(!![]){try{const _0x59ca07=parseInt(_0x566823(0x198))/0x1+parseInt(_0x566823(0x193))/0x2+parseInt(_0x566823(0x19a))/0x3+parseInt(_0x566823(0x1a1))/0x4+-parseInt(_0x566823(0x19e))/0x5*(parseInt(_0x566823(0x194))/0x6)+-parseInt(_0x566823(0x197))/0x7+-parseInt(_0x566823(0x199))/0x8*(parseInt(_0x566823(0x196))/0x9);if(_0x59ca07===_0x3a3234)break;else _0x59ea53['push'](_0x59ea53['shift']());}catch(_0x599dc4){_0x59ea53['push'](_0x59ea53['shift']());}}}(a191_0x29b1,0xc9bc1));function a191_0x29b1(){const _0xa9fd41=['add','name','workspace\x20add','1779595qiQMqy','write','workspace','1816560EFPJWY','713564WIOaiF','12jYcmZC','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','1332RdPcHQ','6879173dnfzxu','1419499DZjGsq','18328HXPbdP','1888587niTRWh'];a191_0x29b1=function(){return _0xa9fd41;};return a191_0x29b1();}import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a191_0x49711a(0x1a0),'command':a191_0x49711a(0x19b),'description':a191_0x49711a(0x195),'risk':a191_0x49711a(0x19f),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a191_0x49711a(0x19c),'description':'App\x20profile\x20name','required':!![]}],'flags':buildAppAddFlags(),'validate':_0x1aa8ec=>validateAppName(_0x1aa8ec,'workspace\x20add'),'execute':_0x2633d0=>runAppAdd(_0x2633d0,a191_0x49711a(0x19d))};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace commands configure the current directory only.
|
|
3
|
+
*
|
|
4
|
+
* This is the business-facing replacement for app init/use style commands:
|
|
5
|
+
* rabetbase workspace init --appcode <code>
|
|
6
|
+
* rabetbase workspace use --app <name>
|
|
7
|
+
*/
|
|
8
|
+
import type { CommandDefinition } from "../../framework/types.js";
|
|
9
|
+
declare const WORKSPACE_USAGE = "rabetbase workspace <init|use> --app <name> [--appcode <code>]";
|
|
10
|
+
export declare const workspaceDefinitions: CommandDefinition[];
|
|
11
|
+
export { WORKSPACE_USAGE };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a192_0x5f134a=a192_0x474e;(function(_0x4646c5,_0x2d2f2f){const _0x1d1158=a192_0x474e,_0x2f1dab=_0x4646c5();while(!![]){try{const _0x3e4e50=-parseInt(_0x1d1158(0x123))/0x1+-parseInt(_0x1d1158(0x140))/0x2+-parseInt(_0x1d1158(0x141))/0x3*(-parseInt(_0x1d1158(0x153))/0x4)+parseInt(_0x1d1158(0x150))/0x5*(-parseInt(_0x1d1158(0x13d))/0x6)+parseInt(_0x1d1158(0x133))/0x7+parseInt(_0x1d1158(0x146))/0x8*(parseInt(_0x1d1158(0x128))/0x9)+parseInt(_0x1d1158(0x12f))/0xa;if(_0x3e4e50===_0x2d2f2f)break;else _0x2f1dab['push'](_0x2f1dab['shift']());}catch(_0x435635){_0x2f1dab['push'](_0x2f1dab['shift']());}}}(a192_0x3bd2,0x7502a));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';function a192_0x3bd2(){const _0x410d01=['926423oIvidt','string','Invalid\x20appcode:\x20','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','apiDir','2365452OQmwDz','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','\x20workspace\x20use\x20--app\x20<name>`.','env','\x20--appcode\x20<code>`.',').\x20Config:\x20','270810TWMxRf','workspace','defaultApp','format','5444593XNoDOH','Locale\x20for\x20this\x20workspace\x20app\x20profile','Workspace\x20','apps','str','number','App\x20\x22','Missing\x20workspace\x20app\x20selector.','workspace.','pageSize','6lhittD','appcode','globalConfig','1102618arpblA','2464512QjTzYj','locale','trim','Use\x20`','object','24VDePwX','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','init','Initialize\x20the\x20current\x20workspace\x20app\x20binding','write','length','riskLevel','validation','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','2289310kFyLgb','.\x20Credentials:\x20not\x20written.','app','4dYNyUL','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','updated','join','initialized'];a192_0x3bd2=function(){return _0x410d01;};return a192_0x3bd2();}function a192_0x474e(_0x59d37b,_0x4cff19){_0x59d37b=_0x59d37b-0x123;const _0x3bd2d2=a192_0x3bd2();let _0x474ea3=_0x3bd2d2[_0x59d37b];return _0x474ea3;}import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a192_0x5f134a(0x129),SAFE_PROFILE_KEYS=[a192_0x5f134a(0x13e),a192_0x5f134a(0x12c),a192_0x5f134a(0x127),a192_0x5f134a(0x132),a192_0x5f134a(0x13c),a192_0x5f134a(0x14d),a192_0x5f134a(0x142)],workspaceFlags=[{'name':a192_0x5f134a(0x152),'type':a192_0x5f134a(0x124),'description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':'appcode','type':a192_0x5f134a(0x124),'description':a192_0x5f134a(0x126)},{'name':a192_0x5f134a(0x12c),'type':'string','description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':a192_0x5f134a(0x127),'type':a192_0x5f134a(0x124),'description':a192_0x5f134a(0x12a)},{'name':'defaultFormat','type':a192_0x5f134a(0x124),'description':a192_0x5f134a(0x14f),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a192_0x5f134a(0x13c),'type':a192_0x5f134a(0x138),'description':'Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'},{'name':'riskLevel','type':'string','description':a192_0x5f134a(0x147),'enum':[...RISK_LEVEL_VALUES]},{'name':a192_0x5f134a(0x142),'type':a192_0x5f134a(0x124),'description':a192_0x5f134a(0x134)}];function isRecord(_0x3a98b7){const _0x3b8e87=a192_0x5f134a;return!!_0x3a98b7&&typeof _0x3a98b7===_0x3b8e87(0x145)&&!Array['isArray'](_0x3a98b7);}function assertValidAppcode(_0x207201){const _0x5ccf2c=a192_0x5f134a,{valid:_0xf7b47d,message:_0x27ecc9}=validateAppcode(_0x207201);if(!_0xf7b47d)throw CliErrors[_0x5ccf2c(0x14e)](_0x5ccf2c(0x125)+_0x207201,_0x27ecc9);}function sanitizeProfile(_0x12af99){if(!isRecord(_0x12af99))return{};const _0x30b090={};for(const _0x663311 of SAFE_PROFILE_KEYS){if(_0x12af99[_0x663311]!==undefined)_0x30b090[_0x663311]=_0x12af99[_0x663311];}return _0x30b090;}function cloneProfile(_0x55e59f){return isRecord(_0x55e59f)?{..._0x55e59f}:{};}function collectWorkspaceProfileOverrides(_0x24433){const _0x1da741=a192_0x5f134a,_0x301489={},_0x42d2af=_0x24433['str'](_0x1da741(0x12c)),_0x1c79ee=_0x24433['str']('apiDir'),_0x43056f=_0x24433[_0x1da741(0x137)]('defaultFormat'),_0x102e6f=_0x24433['flag'](_0x1da741(0x13c)),_0x1d9ccd=_0x24433[_0x1da741(0x137)](_0x1da741(0x14d)),_0x45940f=_0x24433[_0x1da741(0x137)]('locale');if(_0x42d2af)_0x301489[_0x1da741(0x12c)]=_0x42d2af;if(_0x1c79ee)_0x301489['apiDir']=_0x1c79ee;if(_0x43056f)_0x301489[_0x1da741(0x132)]=_0x43056f;if(_0x102e6f!==undefined&&_0x102e6f!=='')_0x301489[_0x1da741(0x13c)]=Number(_0x102e6f);if(_0x1d9ccd)_0x301489[_0x1da741(0x14d)]=_0x1d9ccd;if(_0x45940f)_0x301489[_0x1da741(0x142)]=_0x45940f;return _0x301489;}async function validateWorkspaceArgs(_0x248a00){const _0x6bbc41=a192_0x5f134a,_0x38d65c=_0x248a00[_0x6bbc41(0x137)]('app')[_0x6bbc41(0x143)](),_0x2c96fd=_0x248a00[_0x6bbc41(0x137)](_0x6bbc41(0x13e))[_0x6bbc41(0x143)]();if(!_0x38d65c&&!_0x2c96fd)throw CliErrors['validation'](_0x6bbc41(0x13a),_0x6bbc41(0x144)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x6bbc41(0x12b));if(_0x2c96fd)assertValidAppcode(_0x2c96fd);}function resolveKnownApps(){const _0x2d61cc=a192_0x5f134a,{config:_0x57ed07,layers:_0xa672e2}=readRawConfigWithLayers(),_0x4a5e58=isRecord(_0x57ed07[_0x2d61cc(0x136)])?_0x57ed07[_0x2d61cc(0x136)]:{},_0x2c790a=isRecord(_0xa672e2[_0x2d61cc(0x13f)][_0x2d61cc(0x136)])?_0xa672e2['globalConfig'][_0x2d61cc(0x136)]:{};return{..._0x2c790a,..._0x4a5e58};}async function configureWorkspace(_0x2fc2df,_0xcd9ce){const _0x3441c6=a192_0x5f134a,_0x22e5d1=_0x2fc2df[_0x3441c6(0x137)]('app')[_0x3441c6(0x143)](),_0x4a3ff1=_0x2fc2df[_0x3441c6(0x137)](_0x3441c6(0x13e))[_0x3441c6(0x143)](),_0x2fa76e=_0x22e5d1||_0x4a3ff1;if(!_0x2fa76e)throw CliErrors[_0x3441c6(0x14e)](_0x3441c6(0x13a),_0x3441c6(0x144)+CLI_BIN_NAME+_0x3441c6(0x154)+CLI_BIN_NAME+_0x3441c6(0x12b));if(_0x4a3ff1)assertValidAppcode(_0x4a3ff1);const _0x58a4a5=resolveWriteConfigPath('project'),_0x11b40e=readConfigFile(_0x58a4a5),_0x1b82b3=resolveKnownApps(),_0xd6f41b=isRecord(_0x11b40e[_0x3441c6(0x136)])?{..._0x11b40e[_0x3441c6(0x136)]}:{},_0x3c83e8=cloneProfile(_0xd6f41b[_0x2fa76e]),_0x487424=sanitizeProfile(_0x1b82b3[_0x2fa76e]),_0x3c6a61=_0x4a3ff1?{}:_0x487424,_0x54d0ea=_0x4a3ff1||_0x3c6a61['appcode'];if(!_0x54d0ea){const _0x47ee30=Object['keys'](_0x1b82b3),_0x1953c2=_0x47ee30[_0x3441c6(0x14c)]===0x0?_0x3441c6(0x144)+CLI_BIN_NAME+'\x20workspace\x20'+_0xcd9ce+'\x20--app\x20'+_0x2fa76e+_0x3441c6(0x12d):_0x3441c6(0x148)+_0x47ee30[_0x3441c6(0x156)](',\x20');throw CliErrors[_0x3441c6(0x14e)](_0x3441c6(0x139)+_0x2fa76e+'\x22\x20not\x20found.',_0x1953c2);}assertValidAppcode(String(_0x54d0ea));const _0x32fd2d={..._0x3c6a61,..._0x3c83e8,'appcode':String(_0x54d0ea),...collectWorkspaceProfileOverrides(_0x2fc2df)};return _0xd6f41b[_0x2fa76e]=_0x32fd2d,_0x11b40e[_0x3441c6(0x136)]=_0xd6f41b,_0x11b40e[_0x3441c6(0x131)]=_0x2fa76e,delete _0x11b40e[_0x3441c6(0x13e)],delete _0x11b40e[_0x3441c6(0x152)],_0x32fd2d[_0x3441c6(0x12c)]&&(_0x11b40e[_0x3441c6(0x12c)]=_0x32fd2d['env']),writeConfigFile(_0x58a4a5,_0x11b40e),{'ok':!![],'message':_0x3441c6(0x135)+(_0xcd9ce===_0x3441c6(0x149)?_0x3441c6(0x157):_0x3441c6(0x155))+':\x20'+_0x2fa76e+'\x20(appcode:\x20'+_0x32fd2d[_0x3441c6(0x13e)]+_0x3441c6(0x12e)+_0x58a4a5+_0x3441c6(0x151),'data':{'operation':_0x3441c6(0x13b)+_0xcd9ce,'configPath':_0x58a4a5,'app':_0x2fa76e,'appcode':_0x32fd2d['appcode'],'env':_0x32fd2d['env']??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':'workspace','command':a192_0x5f134a(0x149),'description':a192_0x5f134a(0x14a),'risk':a192_0x5f134a(0x14b),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x38878e=>configureWorkspace(_0x38878e,a192_0x5f134a(0x149))},workspaceUseDefinition={'service':a192_0x5f134a(0x130),'command':'use','description':'Switch\x20the\x20current\x20workspace\x20app\x20binding','risk':a192_0x5f134a(0x14b),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x2b6cd1=>configureWorkspace(_0x2b6cd1,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a193_0xf81f8=a193_0x3057;(function(_0x255aec,_0x150c4d){const _0xdfd436=a193_0x3057,_0x18e414=_0x255aec();while(!![]){try{const _0x226317=parseInt(_0xdfd436(0xa8))/0x1*(-parseInt(_0xdfd436(0xa2))/0x2)+parseInt(_0xdfd436(0xa9))/0x3+-parseInt(_0xdfd436(0xaa))/0x4*(parseInt(_0xdfd436(0xa5))/0x5)+parseInt(_0xdfd436(0x9f))/0x6+parseInt(_0xdfd436(0x9d))/0x7+parseInt(_0xdfd436(0xa6))/0x8+parseInt(_0xdfd436(0xa7))/0x9*(-parseInt(_0xdfd436(0xa1))/0xa);if(_0x226317===_0x150c4d)break;else _0x18e414['push'](_0x18e414['shift']());}catch(_0x555819){_0x18e414['push'](_0x18e414['shift']());}}}(a193_0x1c37,0x78b84));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a193_0xf81f8(0xa0),'command':'remove','description':'Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','risk':a193_0xf81f8(0xa4),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a193_0xf81f8(0xab),'description':a193_0xf81f8(0x9e),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0xe4cc4f=>validateAppName(_0xe4cc4f,a193_0xf81f8(0xa3)),'execute':_0x1e3b89=>runAppRemove(_0x1e3b89,'workspace\x20remove')};function a193_0x3057(_0x4c0e2d,_0x5b7b7b){_0x4c0e2d=_0x4c0e2d-0x9d;const _0x1c3726=a193_0x1c37();let _0x30570b=_0x1c3726[_0x4c0e2d];return _0x30570b;}function a193_0x1c37(){const _0x89dc89=['workspace','10oNqzSh','8pzCNks','workspace\x20remove','write','5880SvpIBI','5689312QxTErY','14689629nsfRBN','179969hCaKGV','2414868YOxcpG','908FXwKYB','name','5274500BkSrJj','App\x20profile\x20name\x20to\x20remove','5063142XaQtPe'];a193_0x1c37=function(){return _0x89dc89;};return a193_0x1c37();}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { FlagDef } from "../framework/types.js";
|
|
2
|
+
export { DEFAULT_CONFIG_VALUES } from "../constant/defaults.js";
|
|
3
|
+
export declare const PROJECT_CREATE_INHERITABLE_KEYS: readonly ["cookie", "accessKey", "locale", "format", "riskLevel"];
|
|
4
|
+
export interface ConfigMetadataFields {
|
|
5
|
+
version?: string;
|
|
6
|
+
createdAt?: string;
|
|
7
|
+
migratedAt?: string;
|
|
8
|
+
migratedFrom?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const TOP_LEVEL_CONFIG_KEYS: Set<string>;
|
|
11
|
+
export declare const CONFIG_ENUM_VALUES: Record<string, string[]>;
|
|
12
|
+
export declare function formatConfigKeyList(keys: Iterable<string>): string;
|
|
13
|
+
export declare function getTopLevelConfigKeyList(): string[];
|
|
14
|
+
export declare function isTopLevelConfigKey(key: string): boolean;
|
|
15
|
+
export declare function getTopLevelConfigKeySummary(): string;
|
|
16
|
+
export declare function getConfigCommandKeyDescription(): string;
|
|
17
|
+
export declare const APP_PROFILE_FLAG_KEY_MAP: Record<string, string>;
|
|
18
|
+
export declare function getAppProfileFlagDefs(): FlagDef[];
|
|
19
|
+
export declare function collectAppProfileOverrides(getFlagValue: (name: string) => string): Record<string, any>;
|
|
20
|
+
export declare function buildAppProfileListFields(profile: Record<string, any>): Record<string, unknown>;
|
|
21
|
+
export declare function buildAppDoctorFields(profile: Record<string, any>, effective: {
|
|
22
|
+
env: string;
|
|
23
|
+
apiDir: string;
|
|
24
|
+
cookie?: string;
|
|
25
|
+
accessKey?: string;
|
|
26
|
+
}): {
|
|
27
|
+
env: {
|
|
28
|
+
value: string;
|
|
29
|
+
source: "app" | "inherit";
|
|
30
|
+
};
|
|
31
|
+
apiDir: {
|
|
32
|
+
value: string;
|
|
33
|
+
source: "app" | "inherit";
|
|
34
|
+
};
|
|
35
|
+
cookie: {
|
|
36
|
+
value?: string;
|
|
37
|
+
source: "app" | "inherit";
|
|
38
|
+
};
|
|
39
|
+
accessKey: {
|
|
40
|
+
value?: string;
|
|
41
|
+
source: "app" | "inherit";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export declare function buildCanonicalAppConfig(appCodes: string[], env?: string): Record<string, any>;
|
|
45
|
+
export declare function buildCanonicalProjectConfig(base: Record<string, unknown>, options: {
|
|
46
|
+
appCodes?: string[];
|
|
47
|
+
env?: string;
|
|
48
|
+
metadata?: ConfigMetadataFields;
|
|
49
|
+
}): Record<string, any>;
|
|
50
|
+
export declare function normalizeLocale(value: string): "zh-CN" | "en-US" | null;
|