@elsikora/commitizen-plugin-commitlint-ai 2.0.0-dev.1 → 2.0.0
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/README.md +71 -58
- package/dist/cjs/application/constant/config-file-directory.constant.d.ts +0 -1
- package/dist/cjs/application/constant/config-module-name.constant.d.ts +0 -1
- package/dist/cjs/application/constant/index.d.ts +2 -3
- package/dist/cjs/application/index.d.ts +2 -3
- package/dist/cjs/application/interface/cli-interface-service-select-options.interface.d.ts +0 -1
- package/dist/cjs/application/interface/cli-interface-service.interface.d.ts +1 -2
- package/dist/cjs/application/interface/command-service.interface.d.ts +0 -1
- package/dist/cjs/application/interface/commit-repository.interface.d.ts +1 -2
- package/dist/cjs/application/interface/commit-validator.interface.d.ts +2 -3
- package/dist/cjs/application/interface/config-service.interface.d.ts +2 -3
- package/dist/cjs/application/interface/config.interface.d.ts +2 -3
- package/dist/cjs/application/interface/file-system-service.interface.d.ts +0 -1
- package/dist/cjs/application/interface/index.d.ts +9 -10
- package/dist/cjs/application/interface/llm-service.interface.d.ts +2 -3
- package/dist/cjs/application/use-case/configure-llm.use-case.d.ts +11 -11
- package/dist/cjs/application/use-case/configure-llm.use-case.js +25 -19
- package/dist/cjs/application/use-case/configure-llm.use-case.js.map +1 -1
- package/dist/cjs/application/use-case/generate-commit-message.use-case.d.ts +8 -9
- package/dist/cjs/application/use-case/generate-commit-message.use-case.js +5 -5
- package/dist/cjs/application/use-case/index.d.ts +4 -5
- package/dist/cjs/application/use-case/manual-commit.use-case.d.ts +5 -6
- package/dist/cjs/application/use-case/manual-commit.use-case.js +4 -2
- package/dist/cjs/application/use-case/manual-commit.use-case.js.map +1 -1
- package/dist/cjs/application/use-case/validate-commit-message.use-case.d.ts +11 -12
- package/dist/cjs/application/use-case/validate-commit-message.use-case.js +9 -8
- package/dist/cjs/application/use-case/validate-commit-message.use-case.js.map +1 -1
- package/dist/cjs/domain/constant/index.d.ts +1 -2
- package/dist/cjs/domain/constant/numeric.constant.d.ts +0 -1
- package/dist/cjs/domain/entity/commit-message.entity.d.ts +19 -7
- package/dist/cjs/domain/entity/commit-message.entity.js +19 -4
- package/dist/cjs/domain/entity/commit-message.entity.js.map +1 -1
- package/dist/cjs/domain/entity/index.d.ts +2 -3
- package/dist/cjs/domain/entity/llm-configuration.entity.d.ts +25 -18
- package/dist/cjs/domain/entity/llm-configuration.entity.js +27 -16
- package/dist/cjs/domain/entity/llm-configuration.entity.js.map +1 -1
- package/dist/cjs/domain/enum/anthropic-model.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/aws-bedrock-model.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/azure-openai-model.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/commit-mode.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/google-model.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/index.d.ts +9 -10
- package/dist/cjs/domain/enum/llm-provider.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/log-level.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/ollama-model.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/openai-model.enum.d.ts +0 -1
- package/dist/cjs/domain/index.d.ts +3 -4
- package/dist/cjs/domain/value-object/api-key.value-object.d.ts +5 -4
- package/dist/cjs/domain/value-object/api-key.value-object.js +5 -3
- package/dist/cjs/domain/value-object/api-key.value-object.js.map +1 -1
- package/dist/cjs/domain/value-object/commit-body.value-object.d.ts +7 -1
- package/dist/cjs/domain/value-object/commit-body.value-object.js +7 -0
- package/dist/cjs/domain/value-object/commit-body.value-object.js.map +1 -1
- package/dist/cjs/domain/value-object/commit-header.value-object.d.ts +6 -1
- package/dist/cjs/domain/value-object/commit-header.value-object.js +6 -0
- package/dist/cjs/domain/value-object/commit-header.value-object.js.map +1 -1
- package/dist/cjs/domain/value-object/index.d.ts +3 -4
- package/dist/cjs/index.d.ts +15 -4
- package/dist/cjs/index.js +17 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.d.ts +15 -16
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.js +13 -13
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.js.map +1 -1
- package/dist/cjs/infrastructure/commit-validator/index.d.ts +1 -2
- package/dist/cjs/infrastructure/di/container.d.ts +1 -2
- package/dist/cjs/infrastructure/di/container.js +1 -1
- package/dist/cjs/infrastructure/di/index.d.ts +1 -2
- package/dist/cjs/infrastructure/git/git-commit.repository.d.ts +9 -10
- package/dist/cjs/infrastructure/git/git-commit.repository.js +6 -6
- package/dist/cjs/infrastructure/git/index.d.ts +1 -2
- package/dist/cjs/infrastructure/index.d.ts +4 -5
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.d.ts +14 -15
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.js +25 -12
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.js.map +1 -1
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.d.ts +23 -24
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.js +44 -35
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.js.map +1 -1
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.d.ts +16 -17
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.js +29 -16
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.js.map +1 -1
- package/dist/cjs/infrastructure/llm/google-llm.service.d.ts +16 -17
- package/dist/cjs/infrastructure/llm/google-llm.service.js +27 -14
- package/dist/cjs/infrastructure/llm/google-llm.service.js.map +1 -1
- package/dist/cjs/infrastructure/llm/index.d.ts +6 -7
- package/dist/cjs/infrastructure/llm/ollama-llm.service.d.ts +16 -17
- package/dist/cjs/infrastructure/llm/ollama-llm.service.js +39 -21
- package/dist/cjs/infrastructure/llm/ollama-llm.service.js.map +1 -1
- package/dist/cjs/infrastructure/llm/openai-llm.service.d.ts +16 -17
- package/dist/cjs/infrastructure/llm/openai-llm.service.js +27 -14
- package/dist/cjs/infrastructure/llm/openai-llm.service.js.map +1 -1
- package/dist/cjs/infrastructure/service/cosmic-config.service.d.ts +20 -19
- package/dist/cjs/infrastructure/service/cosmic-config.service.js +17 -15
- package/dist/cjs/infrastructure/service/cosmic-config.service.js.map +1 -1
- package/dist/cjs/infrastructure/service/index.d.ts +4 -5
- package/dist/cjs/infrastructure/service/node-command.service.d.ts +14 -13
- package/dist/cjs/infrastructure/service/node-command.service.js +12 -10
- package/dist/cjs/infrastructure/service/node-command.service.js.map +1 -1
- package/dist/cjs/infrastructure/service/node-file-system.service.d.ts +22 -23
- package/dist/cjs/infrastructure/service/node-file-system.service.js +21 -21
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.d.ts +39 -37
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.js +37 -34
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.js.map +1 -1
- package/dist/cjs/presentation/commitizen.adapter.d.ts +7 -3
- package/dist/cjs/presentation/commitizen.adapter.js +23 -11
- package/dist/cjs/presentation/commitizen.adapter.js.map +1 -1
- package/dist/cjs/presentation/index.d.ts +1 -2
- package/dist/esm/application/constant/config-file-directory.constant.d.ts +0 -1
- package/dist/esm/application/constant/config-module-name.constant.d.ts +0 -1
- package/dist/esm/application/constant/index.d.ts +2 -3
- package/dist/esm/application/index.d.ts +2 -3
- package/dist/esm/application/interface/cli-interface-service-select-options.interface.d.ts +0 -1
- package/dist/esm/application/interface/cli-interface-service.interface.d.ts +1 -2
- package/dist/esm/application/interface/command-service.interface.d.ts +0 -1
- package/dist/esm/application/interface/commit-repository.interface.d.ts +1 -2
- package/dist/esm/application/interface/commit-validator.interface.d.ts +2 -3
- package/dist/esm/application/interface/config-service.interface.d.ts +2 -3
- package/dist/esm/application/interface/config.interface.d.ts +2 -3
- package/dist/esm/application/interface/file-system-service.interface.d.ts +0 -1
- package/dist/esm/application/interface/index.d.ts +9 -10
- package/dist/esm/application/interface/llm-service.interface.d.ts +2 -3
- package/dist/esm/application/use-case/configure-llm.use-case.d.ts +11 -11
- package/dist/esm/application/use-case/configure-llm.use-case.js +25 -19
- package/dist/esm/application/use-case/configure-llm.use-case.js.map +1 -1
- package/dist/esm/application/use-case/generate-commit-message.use-case.d.ts +8 -9
- package/dist/esm/application/use-case/generate-commit-message.use-case.js +5 -5
- package/dist/esm/application/use-case/index.d.ts +4 -5
- package/dist/esm/application/use-case/manual-commit.use-case.d.ts +5 -6
- package/dist/esm/application/use-case/manual-commit.use-case.js +4 -2
- package/dist/esm/application/use-case/manual-commit.use-case.js.map +1 -1
- package/dist/esm/application/use-case/validate-commit-message.use-case.d.ts +11 -12
- package/dist/esm/application/use-case/validate-commit-message.use-case.js +9 -8
- package/dist/esm/application/use-case/validate-commit-message.use-case.js.map +1 -1
- package/dist/esm/domain/constant/index.d.ts +1 -2
- package/dist/esm/domain/constant/numeric.constant.d.ts +0 -1
- package/dist/esm/domain/entity/commit-message.entity.d.ts +19 -7
- package/dist/esm/domain/entity/commit-message.entity.js +19 -4
- package/dist/esm/domain/entity/commit-message.entity.js.map +1 -1
- package/dist/esm/domain/entity/index.d.ts +2 -3
- package/dist/esm/domain/entity/llm-configuration.entity.d.ts +25 -18
- package/dist/esm/domain/entity/llm-configuration.entity.js +27 -16
- package/dist/esm/domain/entity/llm-configuration.entity.js.map +1 -1
- package/dist/esm/domain/enum/anthropic-model.enum.d.ts +0 -1
- package/dist/esm/domain/enum/aws-bedrock-model.enum.d.ts +0 -1
- package/dist/esm/domain/enum/azure-openai-model.enum.d.ts +0 -1
- package/dist/esm/domain/enum/commit-mode.enum.d.ts +0 -1
- package/dist/esm/domain/enum/google-model.enum.d.ts +0 -1
- package/dist/esm/domain/enum/index.d.ts +9 -10
- package/dist/esm/domain/enum/llm-provider.enum.d.ts +0 -1
- package/dist/esm/domain/enum/log-level.enum.d.ts +0 -1
- package/dist/esm/domain/enum/ollama-model.enum.d.ts +0 -1
- package/dist/esm/domain/enum/openai-model.enum.d.ts +0 -1
- package/dist/esm/domain/index.d.ts +3 -4
- package/dist/esm/domain/value-object/api-key.value-object.d.ts +5 -4
- package/dist/esm/domain/value-object/api-key.value-object.js +5 -3
- package/dist/esm/domain/value-object/api-key.value-object.js.map +1 -1
- package/dist/esm/domain/value-object/commit-body.value-object.d.ts +7 -1
- package/dist/esm/domain/value-object/commit-body.value-object.js +7 -0
- package/dist/esm/domain/value-object/commit-body.value-object.js.map +1 -1
- package/dist/esm/domain/value-object/commit-header.value-object.d.ts +6 -1
- package/dist/esm/domain/value-object/commit-header.value-object.js +6 -0
- package/dist/esm/domain/value-object/commit-header.value-object.js.map +1 -1
- package/dist/esm/domain/value-object/index.d.ts +3 -4
- package/dist/esm/index.d.ts +15 -4
- package/dist/esm/index.js +15 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.d.ts +15 -16
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.js +13 -13
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.js.map +1 -1
- package/dist/esm/infrastructure/commit-validator/index.d.ts +1 -2
- package/dist/esm/infrastructure/di/container.d.ts +1 -2
- package/dist/esm/infrastructure/di/container.js +1 -1
- package/dist/esm/infrastructure/di/index.d.ts +1 -2
- package/dist/esm/infrastructure/git/git-commit.repository.d.ts +9 -10
- package/dist/esm/infrastructure/git/git-commit.repository.js +6 -6
- package/dist/esm/infrastructure/git/index.d.ts +1 -2
- package/dist/esm/infrastructure/index.d.ts +4 -5
- package/dist/esm/infrastructure/llm/anthropic-llm.service.d.ts +14 -15
- package/dist/esm/infrastructure/llm/anthropic-llm.service.js +25 -12
- package/dist/esm/infrastructure/llm/anthropic-llm.service.js.map +1 -1
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.d.ts +23 -24
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.js +37 -28
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.js.map +1 -1
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.d.ts +16 -17
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.js +29 -16
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.js.map +1 -1
- package/dist/esm/infrastructure/llm/google-llm.service.d.ts +16 -17
- package/dist/esm/infrastructure/llm/google-llm.service.js +27 -14
- package/dist/esm/infrastructure/llm/google-llm.service.js.map +1 -1
- package/dist/esm/infrastructure/llm/index.d.ts +6 -7
- package/dist/esm/infrastructure/llm/ollama-llm.service.d.ts +16 -17
- package/dist/esm/infrastructure/llm/ollama-llm.service.js +39 -21
- package/dist/esm/infrastructure/llm/ollama-llm.service.js.map +1 -1
- package/dist/esm/infrastructure/llm/openai-llm.service.d.ts +16 -17
- package/dist/esm/infrastructure/llm/openai-llm.service.js +27 -14
- package/dist/esm/infrastructure/llm/openai-llm.service.js.map +1 -1
- package/dist/esm/infrastructure/service/cosmic-config.service.d.ts +20 -19
- package/dist/esm/infrastructure/service/cosmic-config.service.js +17 -15
- package/dist/esm/infrastructure/service/cosmic-config.service.js.map +1 -1
- package/dist/esm/infrastructure/service/index.d.ts +4 -5
- package/dist/esm/infrastructure/service/node-command.service.d.ts +14 -13
- package/dist/esm/infrastructure/service/node-command.service.js +12 -10
- package/dist/esm/infrastructure/service/node-command.service.js.map +1 -1
- package/dist/esm/infrastructure/service/node-file-system.service.d.ts +22 -23
- package/dist/esm/infrastructure/service/node-file-system.service.js +21 -21
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.d.ts +39 -37
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.js +37 -34
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.js.map +1 -1
- package/dist/esm/package.json +19 -0
- package/dist/esm/presentation/commitizen.adapter.d.ts +7 -3
- package/dist/esm/presentation/commitizen.adapter.js +23 -11
- package/dist/esm/presentation/commitizen.adapter.js.map +1 -1
- package/dist/esm/presentation/index.d.ts +1 -2
- package/package.json +11 -3
- package/dist/cjs/application/constant/config-file-directory.constant.d.ts.map +0 -1
- package/dist/cjs/application/constant/config-module-name.constant.d.ts.map +0 -1
- package/dist/cjs/application/constant/index.d.ts.map +0 -1
- package/dist/cjs/application/index.d.ts.map +0 -1
- package/dist/cjs/application/interface/cli-interface-service-select-options.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/cli-interface-service.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/command-service.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/commit-repository.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/commit-validator.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/config-service.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/config.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/file-system-service.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/index.d.ts.map +0 -1
- package/dist/cjs/application/interface/llm-service.interface.d.ts.map +0 -1
- package/dist/cjs/application/use-case/configure-llm.use-case.d.ts.map +0 -1
- package/dist/cjs/application/use-case/generate-commit-message.use-case.d.ts.map +0 -1
- package/dist/cjs/application/use-case/index.d.ts.map +0 -1
- package/dist/cjs/application/use-case/manual-commit.use-case.d.ts.map +0 -1
- package/dist/cjs/application/use-case/validate-commit-message.use-case.d.ts.map +0 -1
- package/dist/cjs/domain/constant/index.d.ts.map +0 -1
- package/dist/cjs/domain/constant/numeric.constant.d.ts.map +0 -1
- package/dist/cjs/domain/entity/commit-message.entity.d.ts.map +0 -1
- package/dist/cjs/domain/entity/index.d.ts.map +0 -1
- package/dist/cjs/domain/entity/llm-configuration.entity.d.ts.map +0 -1
- package/dist/cjs/domain/enum/anthropic-model.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/aws-bedrock-model.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/azure-openai-model.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/commit-mode.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/google-model.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/index.d.ts.map +0 -1
- package/dist/cjs/domain/enum/llm-provider.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/log-level.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/ollama-model.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/openai-model.enum.d.ts.map +0 -1
- package/dist/cjs/domain/index.d.ts.map +0 -1
- package/dist/cjs/domain/value-object/api-key.value-object.d.ts.map +0 -1
- package/dist/cjs/domain/value-object/commit-body.value-object.d.ts.map +0 -1
- package/dist/cjs/domain/value-object/commit-header.value-object.d.ts.map +0 -1
- package/dist/cjs/domain/value-object/index.d.ts.map +0 -1
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/commit-validator/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/di/container.d.ts.map +0 -1
- package/dist/cjs/infrastructure/di/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/git/git-commit.repository.d.ts.map +0 -1
- package/dist/cjs/infrastructure/git/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/google-llm.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/ollama-llm.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/openai-llm.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/service/cosmic-config.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/service/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/service/node-command.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/service/node-file-system.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.d.ts.map +0 -1
- package/dist/cjs/presentation/commitizen.adapter.d.ts.map +0 -1
- package/dist/cjs/presentation/index.d.ts.map +0 -1
- package/dist/esm/application/constant/config-file-directory.constant.d.ts.map +0 -1
- package/dist/esm/application/constant/config-module-name.constant.d.ts.map +0 -1
- package/dist/esm/application/constant/index.d.ts.map +0 -1
- package/dist/esm/application/index.d.ts.map +0 -1
- package/dist/esm/application/interface/cli-interface-service-select-options.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/cli-interface-service.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/command-service.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/commit-repository.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/commit-validator.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/config-service.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/config.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/file-system-service.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/index.d.ts.map +0 -1
- package/dist/esm/application/interface/llm-service.interface.d.ts.map +0 -1
- package/dist/esm/application/use-case/configure-llm.use-case.d.ts.map +0 -1
- package/dist/esm/application/use-case/generate-commit-message.use-case.d.ts.map +0 -1
- package/dist/esm/application/use-case/index.d.ts.map +0 -1
- package/dist/esm/application/use-case/manual-commit.use-case.d.ts.map +0 -1
- package/dist/esm/application/use-case/validate-commit-message.use-case.d.ts.map +0 -1
- package/dist/esm/domain/constant/index.d.ts.map +0 -1
- package/dist/esm/domain/constant/numeric.constant.d.ts.map +0 -1
- package/dist/esm/domain/entity/commit-message.entity.d.ts.map +0 -1
- package/dist/esm/domain/entity/index.d.ts.map +0 -1
- package/dist/esm/domain/entity/llm-configuration.entity.d.ts.map +0 -1
- package/dist/esm/domain/enum/anthropic-model.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/aws-bedrock-model.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/azure-openai-model.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/commit-mode.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/google-model.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/index.d.ts.map +0 -1
- package/dist/esm/domain/enum/llm-provider.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/log-level.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/ollama-model.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/openai-model.enum.d.ts.map +0 -1
- package/dist/esm/domain/index.d.ts.map +0 -1
- package/dist/esm/domain/value-object/api-key.value-object.d.ts.map +0 -1
- package/dist/esm/domain/value-object/commit-body.value-object.d.ts.map +0 -1
- package/dist/esm/domain/value-object/commit-header.value-object.d.ts.map +0 -1
- package/dist/esm/domain/value-object/index.d.ts.map +0 -1
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/commit-validator/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/di/container.d.ts.map +0 -1
- package/dist/esm/infrastructure/di/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/git/git-commit.repository.d.ts.map +0 -1
- package/dist/esm/infrastructure/git/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/anthropic-llm.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/google-llm.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/ollama-llm.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/openai-llm.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/service/cosmic-config.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/service/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/service/node-command.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/service/node-file-system.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.d.ts.map +0 -1
- package/dist/esm/presentation/commitizen.adapter.d.ts.map +0 -1
- package/dist/esm/presentation/index.d.ts.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ICliInterfaceService } from
|
|
2
|
-
import type { ICommandService } from
|
|
1
|
+
import type { ICliInterfaceService } from '../../application/interface/cli-interface-service.interface';
|
|
2
|
+
import type { ICommandService } from '../../application/interface/command-service.interface';
|
|
3
3
|
/**
|
|
4
4
|
* Implementation of the command service using Node.js child_process.
|
|
5
5
|
* Provides functionality to execute shell commands.
|
|
@@ -12,33 +12,34 @@ export declare class NodeCommandService implements ICommandService {
|
|
|
12
12
|
* Allows for async/await usage of command execution.
|
|
13
13
|
*/
|
|
14
14
|
private readonly EXEC_ASYNC;
|
|
15
|
+
/**
|
|
16
|
+
* @param {ICliInterfaceService} cliInterfaceService - The CLI interface service for user interactions
|
|
17
|
+
*/
|
|
15
18
|
constructor(cliInterfaceService: ICliInterfaceService);
|
|
16
19
|
/**
|
|
17
20
|
* Executes a shell command.
|
|
18
|
-
* @param command - The shell command to execute
|
|
19
|
-
* @returns Promise that resolves when the command completes successfully
|
|
21
|
+
* @param {string} command - The shell command to execute
|
|
22
|
+
* @returns {Promise<void>} Promise that resolves when the command completes successfully
|
|
20
23
|
* @throws Will throw an error if the command execution fails, except for npm install which offers retry options
|
|
21
24
|
*/
|
|
22
25
|
execute(command: string): Promise<void>;
|
|
23
26
|
/**
|
|
24
27
|
* Execute a command and return its output
|
|
25
|
-
* @param command - The command to execute
|
|
26
|
-
* @returns Promise that resolves to the command output
|
|
28
|
+
* @param {string} command - The command to execute
|
|
29
|
+
* @returns {Promise<string>} Promise that resolves to the command output
|
|
27
30
|
*/
|
|
28
31
|
executeWithOutput(command: string): Promise<string>;
|
|
29
32
|
/**
|
|
30
|
-
*
|
|
31
|
-
* @param command - The original npm command that failed
|
|
32
|
-
* @param error - Error npm object
|
|
33
|
-
* @returns void
|
|
33
|
+
* Format and parse npm error to readable format
|
|
34
|
+
* @param {string} command - The original npm command that failed
|
|
35
|
+
* @param {INodeError} error - Error npm object
|
|
34
36
|
*/
|
|
35
37
|
private formatAndParseNpmError;
|
|
36
38
|
/**
|
|
37
39
|
* Handles npm install command failures by offering retry options to the user.
|
|
38
|
-
* @param originalCommand - The original npm command that failed
|
|
39
|
-
* @returns Promise that resolves when the chosen action completes
|
|
40
|
+
* @param {string} originalCommand - The original npm command that failed
|
|
41
|
+
* @returns {Promise<void>} Promise that resolves when the chosen action completes
|
|
40
42
|
* @throws Will throw an error if the user chooses to cancel or if retried command still fails
|
|
41
43
|
*/
|
|
42
44
|
private handleNpmInstallFailure;
|
|
43
45
|
}
|
|
44
|
-
//# sourceMappingURL=node-command.service.d.ts.map
|
|
@@ -16,13 +16,16 @@ class NodeCommandService {
|
|
|
16
16
|
* Allows for async/await usage of command execution.
|
|
17
17
|
*/
|
|
18
18
|
EXEC_ASYNC = node_util.promisify(node_child_process.exec);
|
|
19
|
+
/**
|
|
20
|
+
* @param {ICliInterfaceService} cliInterfaceService - The CLI interface service for user interactions
|
|
21
|
+
*/
|
|
19
22
|
constructor(cliInterfaceService) {
|
|
20
23
|
this.CLI_INTERFACE_SERVICE = cliInterfaceService;
|
|
21
24
|
}
|
|
22
25
|
/**
|
|
23
26
|
* Executes a shell command.
|
|
24
|
-
* @param command - The shell command to execute
|
|
25
|
-
* @returns Promise that resolves when the command completes successfully
|
|
27
|
+
* @param {string} command - The shell command to execute
|
|
28
|
+
* @returns {Promise<void>} Promise that resolves when the command completes successfully
|
|
26
29
|
* @throws Will throw an error if the command execution fails, except for npm install which offers retry options
|
|
27
30
|
*/
|
|
28
31
|
async execute(command) {
|
|
@@ -43,8 +46,8 @@ class NodeCommandService {
|
|
|
43
46
|
}
|
|
44
47
|
/**
|
|
45
48
|
* Execute a command and return its output
|
|
46
|
-
* @param command - The command to execute
|
|
47
|
-
* @returns Promise that resolves to the command output
|
|
49
|
+
* @param {string} command - The command to execute
|
|
50
|
+
* @returns {Promise<string>} Promise that resolves to the command output
|
|
48
51
|
*/
|
|
49
52
|
async executeWithOutput(command) {
|
|
50
53
|
try {
|
|
@@ -57,10 +60,9 @@ class NodeCommandService {
|
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
/**
|
|
60
|
-
*
|
|
61
|
-
* @param command - The original npm command that failed
|
|
62
|
-
* @param error - Error npm object
|
|
63
|
-
* @returns void
|
|
63
|
+
* Format and parse npm error to readable format
|
|
64
|
+
* @param {string} command - The original npm command that failed
|
|
65
|
+
* @param {INodeError} error - Error npm object
|
|
64
66
|
*/
|
|
65
67
|
formatAndParseNpmError(command, error) {
|
|
66
68
|
// Форматируем и выводим ошибку
|
|
@@ -112,8 +114,8 @@ class NodeCommandService {
|
|
|
112
114
|
}
|
|
113
115
|
/**
|
|
114
116
|
* Handles npm install command failures by offering retry options to the user.
|
|
115
|
-
* @param originalCommand - The original npm command that failed
|
|
116
|
-
* @returns Promise that resolves when the chosen action completes
|
|
117
|
+
* @param {string} originalCommand - The original npm command that failed
|
|
118
|
+
* @returns {Promise<void>} Promise that resolves when the chosen action completes
|
|
117
119
|
* @throws Will throw an error if the user chooses to cancel or if retried command still fails
|
|
118
120
|
*/
|
|
119
121
|
async handleNpmInstallFailure(originalCommand) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-command.service.js","sources":["../../../../../src/infrastructure/service/node-command.service.ts"],"sourcesContent":[null],"names":["promisify","exec"],"mappings":";;;;;;AAkBA;;;AAGG;MACU,kBAAkB,CAAA;;AAErB,IAAA,qBAAqB;AAE9B;;;AAGG;AACc,IAAA,UAAU,GAAuEA,mBAAS,CAACC,uBAAI,CAAC;AAEjH,IAAA,WAAA,CAAY,mBAAyC,EAAA;AACpD,QAAA,IAAI,CAAC,qBAAqB,GAAG,mBAAmB;;AAGjD;;;;;AAKG;IACH,MAAM,OAAO,CAAC,OAAe,EAAA;AAC5B,QAAA,IAAI;AACH,YAAA,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;;QAC7B,OAAO,KAAK,EAAE;;AAEf,YAAA,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE;AAC7K,gBAAA,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,KAAmB,CAAC;AACzD,gBAAA,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC;;iBACrC;;AAEN,gBAAA,MAAM,KAAK;;;;AAKd;;;;AAIG;IACH,MAAM,iBAAiB,CAAC,OAAe,EAAA;AACtC,QAAA,IAAI;YACH,MAAM,EAAE,MAAM,EAAE,GAAuB,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;AAErE,YAAA,OAAO,MAAM,CAAC,IAAI,EAAE;;QACnB,OAAO,KAAK,EAAE;YACf,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAA8B,2BAAA,EAAA,OAAO,CAAE,CAAA,EAAE,KAAK,CAAC;AAEtF,YAAA,MAAM,KAAK;;;AAIb
|
|
1
|
+
{"version":3,"file":"node-command.service.js","sources":["../../../../../src/infrastructure/service/node-command.service.ts"],"sourcesContent":[null],"names":["promisify","exec"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IFileSystemService } from
|
|
1
|
+
import type { IFileSystemService } from '../../application/interface/file-system-service.interface';
|
|
2
2
|
/**
|
|
3
3
|
* Implementation of the file system service using Node.js fs/promises API.
|
|
4
4
|
* Provides methods for managing files and directories.
|
|
@@ -6,58 +6,57 @@ import type { IFileSystemService } from "../../application/interface/file-system
|
|
|
6
6
|
export declare class NodeFileSystemService implements IFileSystemService {
|
|
7
7
|
/**
|
|
8
8
|
* Creates a directory at the specified path.
|
|
9
|
-
* @param directoryPath - The path to the directory to create
|
|
10
|
-
* @param options - Optional configuration for directory creation
|
|
11
|
-
* @param options.isRecursive - Whether to create parent directories if they don't exist
|
|
12
|
-
* @returns Promise that resolves when the directory is created
|
|
9
|
+
* @param {string} directoryPath - The path to the directory to create
|
|
10
|
+
* @param {{ isRecursive: boolean }} options - Optional configuration for directory creation
|
|
11
|
+
* @param {boolean} options.isRecursive - Whether to create parent directories if they don't exist
|
|
12
|
+
* @returns {Promise<void>} Promise that resolves when the directory is created
|
|
13
13
|
*/
|
|
14
14
|
createDirectory(directoryPath: string, options?: {
|
|
15
15
|
isRecursive: boolean;
|
|
16
16
|
}): Promise<void>;
|
|
17
17
|
/**
|
|
18
18
|
* Deletes a file at the specified path.
|
|
19
|
-
* @param filePath - The path to the file to delete
|
|
20
|
-
* @returns Promise that resolves when the file is deleted
|
|
19
|
+
* @param {string} filePath - The path to the file to delete
|
|
20
|
+
* @returns {Promise<void>} Promise that resolves when the file is deleted
|
|
21
21
|
*/
|
|
22
22
|
deleteFile(filePath: string): Promise<void>;
|
|
23
23
|
/**
|
|
24
24
|
* Gets the directory name from a file path.
|
|
25
|
-
* @param filePath
|
|
26
|
-
* @returns The directory name
|
|
25
|
+
* @param {string} filePath - The file path to extract the directory from
|
|
26
|
+
* @returns {string} The directory name
|
|
27
27
|
*/
|
|
28
28
|
getDirectoryNameFromFilePath(filePath: string): string;
|
|
29
29
|
/**
|
|
30
30
|
* Gets the extension from a file path.
|
|
31
|
-
* @param filePath
|
|
32
|
-
* @returns The file extension
|
|
31
|
+
* @param {string} filePath - The file path to extract the extension from
|
|
32
|
+
* @returns {string} The file extension
|
|
33
33
|
*/
|
|
34
34
|
getExtensionFromFilePath(filePath: string): string;
|
|
35
35
|
/**
|
|
36
36
|
* Checks if any of the provided paths exist and returns the first existing path.
|
|
37
|
-
* @param paths - Array of paths to check
|
|
38
|
-
* @returns Promise that resolves to the first existing path or undefined if none exist
|
|
37
|
+
* @param {Array<string>} paths - Array of paths to check
|
|
38
|
+
* @returns {Promise<string | undefined>} Promise that resolves to the first existing path or undefined if none exist
|
|
39
39
|
*/
|
|
40
40
|
isOneOfPathsExists(paths: Array<string>): Promise<string | undefined>;
|
|
41
41
|
/**
|
|
42
42
|
* Checks if a file or directory exists at the specified path.
|
|
43
|
-
* @param filePath - The path to check
|
|
44
|
-
* @returns Promise that resolves to true if the path exists, false otherwise
|
|
43
|
+
* @param {string} filePath - The path to check
|
|
44
|
+
* @returns {Promise<boolean>} Promise that resolves to true if the path exists, false otherwise
|
|
45
45
|
*/
|
|
46
46
|
isPathExists(filePath: string): Promise<boolean>;
|
|
47
47
|
/**
|
|
48
48
|
* Reads the contents of a file.
|
|
49
|
-
* @param filePath - The path to the file to read
|
|
50
|
-
* @param encoding - The encoding to use when reading the file, defaults to "utf8"
|
|
51
|
-
* @returns Promise that resolves to the file contents as a string
|
|
49
|
+
* @param {string} filePath - The path to the file to read
|
|
50
|
+
* @param {string} encoding - The encoding to use when reading the file, defaults to "utf8"
|
|
51
|
+
* @returns {Promise<string>} Promise that resolves to the file contents as a string
|
|
52
52
|
*/
|
|
53
53
|
readFile(filePath: string, encoding?: BufferEncoding): Promise<string>;
|
|
54
54
|
/**
|
|
55
55
|
* Writes content to a file, creating the file and parent directories if they don't exist.
|
|
56
|
-
* @param filePath - The path to the file to write
|
|
57
|
-
* @param content - The content to write to the file
|
|
58
|
-
* @param encoding - The encoding to use when writing the file, defaults to "utf8"
|
|
59
|
-
* @returns Promise that resolves when the file is written
|
|
56
|
+
* @param {string} filePath - The path to the file to write
|
|
57
|
+
* @param {string} content - The content to write to the file
|
|
58
|
+
* @param {string} encoding - The encoding to use when writing the file, defaults to "utf8"
|
|
59
|
+
* @returns {Promise<void>} Promise that resolves when the file is written
|
|
60
60
|
*/
|
|
61
61
|
writeFile(filePath: string, content: string, encoding?: BufferEncoding): Promise<void>;
|
|
62
62
|
}
|
|
63
|
-
//# sourceMappingURL=node-file-system.service.d.ts.map
|
|
@@ -10,10 +10,10 @@ var path = require('node:path');
|
|
|
10
10
|
class NodeFileSystemService {
|
|
11
11
|
/**
|
|
12
12
|
* Creates a directory at the specified path.
|
|
13
|
-
* @param directoryPath - The path to the directory to create
|
|
14
|
-
* @param options - Optional configuration for directory creation
|
|
15
|
-
* @param options.isRecursive - Whether to create parent directories if they don't exist
|
|
16
|
-
* @returns Promise that resolves when the directory is created
|
|
13
|
+
* @param {string} directoryPath - The path to the directory to create
|
|
14
|
+
* @param {{ isRecursive: boolean }} options - Optional configuration for directory creation
|
|
15
|
+
* @param {boolean} options.isRecursive - Whether to create parent directories if they don't exist
|
|
16
|
+
* @returns {Promise<void>} Promise that resolves when the directory is created
|
|
17
17
|
*/
|
|
18
18
|
async createDirectory(directoryPath, options) {
|
|
19
19
|
directoryPath = path.dirname(directoryPath);
|
|
@@ -22,32 +22,32 @@ class NodeFileSystemService {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Deletes a file at the specified path.
|
|
25
|
-
* @param filePath - The path to the file to delete
|
|
26
|
-
* @returns Promise that resolves when the file is deleted
|
|
25
|
+
* @param {string} filePath - The path to the file to delete
|
|
26
|
+
* @returns {Promise<void>} Promise that resolves when the file is deleted
|
|
27
27
|
*/
|
|
28
28
|
async deleteFile(filePath) {
|
|
29
29
|
await fs.unlink(filePath);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Gets the directory name from a file path.
|
|
33
|
-
* @param filePath
|
|
34
|
-
* @returns The directory name
|
|
33
|
+
* @param {string} filePath - The file path to extract the directory from
|
|
34
|
+
* @returns {string} The directory name
|
|
35
35
|
*/
|
|
36
36
|
getDirectoryNameFromFilePath(filePath) {
|
|
37
37
|
return path.dirname(filePath);
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Gets the extension from a file path.
|
|
41
|
-
* @param filePath
|
|
42
|
-
* @returns The file extension
|
|
41
|
+
* @param {string} filePath - The file path to extract the extension from
|
|
42
|
+
* @returns {string} The file extension
|
|
43
43
|
*/
|
|
44
44
|
getExtensionFromFilePath(filePath) {
|
|
45
45
|
return path.extname(filePath);
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Checks if any of the provided paths exist and returns the first existing path.
|
|
49
|
-
* @param paths - Array of paths to check
|
|
50
|
-
* @returns Promise that resolves to the first existing path or undefined if none exist
|
|
49
|
+
* @param {Array<string>} paths - Array of paths to check
|
|
50
|
+
* @returns {Promise<string | undefined>} Promise that resolves to the first existing path or undefined if none exist
|
|
51
51
|
*/
|
|
52
52
|
async isOneOfPathsExists(paths) {
|
|
53
53
|
let existingFilePath = undefined;
|
|
@@ -61,8 +61,8 @@ class NodeFileSystemService {
|
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Checks if a file or directory exists at the specified path.
|
|
64
|
-
* @param filePath - The path to check
|
|
65
|
-
* @returns Promise that resolves to true if the path exists, false otherwise
|
|
64
|
+
* @param {string} filePath - The path to check
|
|
65
|
+
* @returns {Promise<boolean>} Promise that resolves to true if the path exists, false otherwise
|
|
66
66
|
*/
|
|
67
67
|
async isPathExists(filePath) {
|
|
68
68
|
try {
|
|
@@ -75,9 +75,9 @@ class NodeFileSystemService {
|
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* Reads the contents of a file.
|
|
78
|
-
* @param filePath - The path to the file to read
|
|
79
|
-
* @param encoding - The encoding to use when reading the file, defaults to "utf8"
|
|
80
|
-
* @returns Promise that resolves to the file contents as a string
|
|
78
|
+
* @param {string} filePath - The path to the file to read
|
|
79
|
+
* @param {string} encoding - The encoding to use when reading the file, defaults to "utf8"
|
|
80
|
+
* @returns {Promise<string>} Promise that resolves to the file contents as a string
|
|
81
81
|
*/
|
|
82
82
|
// eslint-disable-next-line @elsikora/javascript/no-undef
|
|
83
83
|
async readFile(filePath, encoding = "utf8") {
|
|
@@ -85,10 +85,10 @@ class NodeFileSystemService {
|
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* Writes content to a file, creating the file and parent directories if they don't exist.
|
|
88
|
-
* @param filePath - The path to the file to write
|
|
89
|
-
* @param content - The content to write to the file
|
|
90
|
-
* @param encoding - The encoding to use when writing the file, defaults to "utf8"
|
|
91
|
-
* @returns Promise that resolves when the file is written
|
|
88
|
+
* @param {string} filePath - The path to the file to write
|
|
89
|
+
* @param {string} content - The content to write to the file
|
|
90
|
+
* @param {string} encoding - The encoding to use when writing the file, defaults to "utf8"
|
|
91
|
+
* @returns {Promise<void>} Promise that resolves when the file is written
|
|
92
92
|
*/
|
|
93
93
|
// eslint-disable-next-line @elsikora/javascript/no-undef
|
|
94
94
|
async writeFile(filePath, content, encoding = "utf8") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ICliInterfaceServiceSelectOptions } from
|
|
2
|
-
import type { ICliInterfaceService } from
|
|
1
|
+
import type { ICliInterfaceServiceSelectOptions } from '../../application/interface/cli-interface-service-select-options.interface';
|
|
2
|
+
import type { ICliInterfaceService } from '../../application/interface/cli-interface-service.interface';
|
|
3
3
|
/**
|
|
4
4
|
* Implementation of the CLI interface service using the prompts library.
|
|
5
5
|
* Provides methods for interacting with the user through the command line.
|
|
@@ -18,98 +18,100 @@ export declare class PromptsCliInterface implements ICliInterfaceService {
|
|
|
18
18
|
clear(): void;
|
|
19
19
|
/**
|
|
20
20
|
* Displays a confirmation prompt to the user.
|
|
21
|
-
* @param message - The message to display to the user
|
|
22
|
-
* @param isConfirmedByDefault - The default value for the confirmation, defaults to false
|
|
23
|
-
* @returns Promise that resolves to the user's response (true for confirmed, false for declined)
|
|
21
|
+
* @param {string} message - The message to display to the user
|
|
22
|
+
* @param {boolean} isConfirmedByDefault - The default value for the confirmation, defaults to false
|
|
23
|
+
* @returns {Promise<boolean>} Promise that resolves to the user's response (true for confirmed, false for declined)
|
|
24
24
|
*/
|
|
25
25
|
confirm(message: string, isConfirmedByDefault?: boolean): Promise<boolean>;
|
|
26
26
|
/**
|
|
27
27
|
* Displays an error message to the user.
|
|
28
|
-
* @param message - The error message to display
|
|
28
|
+
* @param {string} message - The error message to display
|
|
29
29
|
*/
|
|
30
30
|
error(message: string): void;
|
|
31
31
|
/**
|
|
32
32
|
* Displays a grouped multi-select prompt to the user.
|
|
33
|
-
* @param message - The message to display to the user
|
|
34
|
-
* @param options - Record of groups and their options
|
|
35
|
-
* @param isRequired - Whether a selection is required, defaults to false
|
|
36
|
-
* @param initialValues - Initial selected values
|
|
37
|
-
* @returns Promise that resolves to an array of selected values
|
|
33
|
+
* @param {string} message - The message to display to the user
|
|
34
|
+
* @param {Record<string, Array<ICliInterfaceServiceSelectOptions>>} options - Record of groups and their options
|
|
35
|
+
* @param {boolean} isRequired - Whether a selection is required, defaults to false
|
|
36
|
+
* @param {Array<string>} initialValues - Initial selected values
|
|
37
|
+
* @returns {Promise<Array<T>>} Promise that resolves to an array of selected values
|
|
38
|
+
* @template T - The type of the selected values
|
|
38
39
|
*/
|
|
39
40
|
groupMultiselect<T>(message: string, options: Record<string, Array<ICliInterfaceServiceSelectOptions>>, isRequired?: boolean, initialValues?: Array<string>): Promise<Array<T>>;
|
|
40
41
|
/**
|
|
41
42
|
* Handles and displays an error message with additional error details.
|
|
42
|
-
* @param message - The error message to display
|
|
43
|
-
* @param error - The error object or details
|
|
43
|
+
* @param {string} message - The error message to display
|
|
44
|
+
* @param {unknown} error - The error object or details
|
|
44
45
|
*/
|
|
45
46
|
handleError(message: string, error: unknown): void;
|
|
46
47
|
/**
|
|
47
48
|
* Displays an informational message to the user.
|
|
48
|
-
* @param message - The info message to display
|
|
49
|
+
* @param {string} message - The info message to display
|
|
49
50
|
*/
|
|
50
51
|
info(message: string): void;
|
|
51
52
|
/**
|
|
52
53
|
* Displays a standard message to the user.
|
|
53
|
-
* @param message - The message to display
|
|
54
|
+
* @param {string} message - The message to display
|
|
54
55
|
*/
|
|
55
56
|
log(message: string): void;
|
|
56
57
|
/**
|
|
57
58
|
* Displays a multi-select prompt to the user.
|
|
58
|
-
* @param message - The message to display to the user
|
|
59
|
-
* @param options - Array of options to select from
|
|
60
|
-
* @param isRequired - Whether a selection is required, defaults to false
|
|
61
|
-
* @param initialValues - Initial selected values
|
|
62
|
-
* @returns Promise that resolves to an array of selected values
|
|
59
|
+
* @param {string} message - The message to display to the user
|
|
60
|
+
* @param {Array<ICliInterfaceServiceSelectOptions>} options - Array of options to select from
|
|
61
|
+
* @param {boolean} isRequired - Whether a selection is required, defaults to false
|
|
62
|
+
* @param {Array<string>} initialValues - Initial selected values
|
|
63
|
+
* @returns {Promise<Array<T>>} Promise that resolves to an array of selected values
|
|
64
|
+
* @template T - The type of the selected values
|
|
63
65
|
*/
|
|
64
66
|
multiselect<T>(message: string, options: Array<ICliInterfaceServiceSelectOptions>, isRequired?: boolean, initialValues?: Array<string>): Promise<Array<T>>;
|
|
65
67
|
/**
|
|
66
68
|
* Displays a note to the user with a title and message.
|
|
67
|
-
* @param title - The title of the note
|
|
68
|
-
* @param message - The message content of the note
|
|
69
|
+
* @param {string} title - The title of the note
|
|
70
|
+
* @param {string} message - The message content of the note
|
|
69
71
|
*/
|
|
70
72
|
note(title: string, message: string): void;
|
|
71
73
|
/**
|
|
72
74
|
* Displays a single select prompt to the user.
|
|
73
|
-
* @param message - The message to display to the user
|
|
74
|
-
* @param options - Array of options to select from
|
|
75
|
-
* @param initialValue - Initial selected value
|
|
76
|
-
* @returns Promise that resolves to the selected value
|
|
75
|
+
* @param {string} message - The message to display to the user
|
|
76
|
+
* @param {Array<ICliInterfaceServiceSelectOptions>} options - Array of options to select from
|
|
77
|
+
* @param {string} initialValue - Initial selected value
|
|
78
|
+
* @returns {Promise<T>} Promise that resolves to the selected value
|
|
79
|
+
* @template T - The type of the selected value
|
|
77
80
|
*/
|
|
78
81
|
select<T>(message: string, options: Array<ICliInterfaceServiceSelectOptions>, initialValue?: string): Promise<T>;
|
|
79
82
|
/**
|
|
80
83
|
* Starts a spinner with the specified message.
|
|
81
84
|
* Stops any existing spinner first.
|
|
82
|
-
* @param message - The message to display while the spinner is active
|
|
85
|
+
* @param {string} message - The message to display while the spinner is active
|
|
83
86
|
*/
|
|
84
87
|
startSpinner(message: string): void;
|
|
85
88
|
/**
|
|
86
89
|
* Stops the current spinner with an optional completion message.
|
|
87
|
-
* @param message - Optional message to display when the spinner stops
|
|
90
|
+
* @param {string} message - Optional message to display when the spinner stops
|
|
88
91
|
*/
|
|
89
92
|
stopSpinner(message?: string): void;
|
|
90
93
|
/**
|
|
91
94
|
* Displays a success message to the user.
|
|
92
|
-
* @param message - The success message to display
|
|
95
|
+
* @param {string} message - The success message to display
|
|
93
96
|
*/
|
|
94
97
|
success(message: string): void;
|
|
95
98
|
/**
|
|
96
99
|
* Displays a text input prompt to the user.
|
|
97
|
-
* @param message - The message to display to the user
|
|
98
|
-
* @param
|
|
99
|
-
* @param initialValue - Optional initial value for the input field
|
|
100
|
-
* @param validate - Optional validation function for the input
|
|
101
|
-
* @returns Promise that resolves to the user's input text
|
|
100
|
+
* @param {string} message - The message to display to the user
|
|
101
|
+
* @param {string} _placeholder - Optional placeholder text for the input field (unused)
|
|
102
|
+
* @param {string} initialValue - Optional initial value for the input field
|
|
103
|
+
* @param {(value: string) => Error | string | undefined} validate - Optional validation function for the input
|
|
104
|
+
* @returns {Promise<string>} Promise that resolves to the user's input text
|
|
102
105
|
*/
|
|
103
106
|
text(message: string, _placeholder?: string, initialValue?: string, validate?: (value: string) => Error | string | undefined): Promise<string>;
|
|
104
107
|
/**
|
|
105
108
|
* Update the spinner message without stopping it.
|
|
106
|
-
* @param message - The new message to display
|
|
109
|
+
* @param {string} message - The new message to display
|
|
107
110
|
*/
|
|
108
111
|
updateSpinner(message: string): void;
|
|
109
112
|
/**
|
|
110
113
|
* Displays a warning message to the user.
|
|
111
|
-
* @param message - The warning message to display
|
|
114
|
+
* @param {string} message - The warning message to display
|
|
112
115
|
*/
|
|
113
116
|
warn(message: string): void;
|
|
114
117
|
}
|
|
115
|
-
//# sourceMappingURL=prompts-cli-interface.service.d.ts.map
|
|
@@ -27,9 +27,9 @@ class PromptsCliInterface {
|
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Displays a confirmation prompt to the user.
|
|
30
|
-
* @param message - The message to display to the user
|
|
31
|
-
* @param isConfirmedByDefault - The default value for the confirmation, defaults to false
|
|
32
|
-
* @returns Promise that resolves to the user's response (true for confirmed, false for declined)
|
|
30
|
+
* @param {string} message - The message to display to the user
|
|
31
|
+
* @param {boolean} isConfirmedByDefault - The default value for the confirmation, defaults to false
|
|
32
|
+
* @returns {Promise<boolean>} Promise that resolves to the user's response (true for confirmed, false for declined)
|
|
33
33
|
*/
|
|
34
34
|
async confirm(message, isConfirmedByDefault = false) {
|
|
35
35
|
try {
|
|
@@ -55,18 +55,19 @@ class PromptsCliInterface {
|
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Displays an error message to the user.
|
|
58
|
-
* @param message - The error message to display
|
|
58
|
+
* @param {string} message - The error message to display
|
|
59
59
|
*/
|
|
60
60
|
error(message) {
|
|
61
61
|
process.stderr.write(`${chalk.red(message)}\n`);
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Displays a grouped multi-select prompt to the user.
|
|
65
|
-
* @param message - The message to display to the user
|
|
66
|
-
* @param options - Record of groups and their options
|
|
67
|
-
* @param isRequired - Whether a selection is required, defaults to false
|
|
68
|
-
* @param initialValues - Initial selected values
|
|
69
|
-
* @returns Promise that resolves to an array of selected values
|
|
65
|
+
* @param {string} message - The message to display to the user
|
|
66
|
+
* @param {Record<string, Array<ICliInterfaceServiceSelectOptions>>} options - Record of groups and their options
|
|
67
|
+
* @param {boolean} isRequired - Whether a selection is required, defaults to false
|
|
68
|
+
* @param {Array<string>} initialValues - Initial selected values
|
|
69
|
+
* @returns {Promise<Array<T>>} Promise that resolves to an array of selected values
|
|
70
|
+
* @template T - The type of the selected values
|
|
70
71
|
*/
|
|
71
72
|
async groupMultiselect(message, options, isRequired = false, initialValues) {
|
|
72
73
|
// Convert options to a flat array with group prefixes
|
|
@@ -105,8 +106,8 @@ class PromptsCliInterface {
|
|
|
105
106
|
}
|
|
106
107
|
/**
|
|
107
108
|
* Handles and displays an error message with additional error details.
|
|
108
|
-
* @param message - The error message to display
|
|
109
|
-
* @param error - The error object or details
|
|
109
|
+
* @param {string} message - The error message to display
|
|
110
|
+
* @param {unknown} error - The error object or details
|
|
110
111
|
*/
|
|
111
112
|
handleError(message, error) {
|
|
112
113
|
process.stderr.write(`${chalk.red(message)}\n`);
|
|
@@ -114,25 +115,26 @@ class PromptsCliInterface {
|
|
|
114
115
|
}
|
|
115
116
|
/**
|
|
116
117
|
* Displays an informational message to the user.
|
|
117
|
-
* @param message - The info message to display
|
|
118
|
+
* @param {string} message - The info message to display
|
|
118
119
|
*/
|
|
119
120
|
info(message) {
|
|
120
121
|
process.stdout.write(`${chalk.blue(message)}\n`);
|
|
121
122
|
}
|
|
122
123
|
/**
|
|
123
124
|
* Displays a standard message to the user.
|
|
124
|
-
* @param message - The message to display
|
|
125
|
+
* @param {string} message - The message to display
|
|
125
126
|
*/
|
|
126
127
|
log(message) {
|
|
127
128
|
process.stdout.write(`${message}\n`);
|
|
128
129
|
}
|
|
129
130
|
/**
|
|
130
131
|
* Displays a multi-select prompt to the user.
|
|
131
|
-
* @param message - The message to display to the user
|
|
132
|
-
* @param options - Array of options to select from
|
|
133
|
-
* @param isRequired - Whether a selection is required, defaults to false
|
|
134
|
-
* @param initialValues - Initial selected values
|
|
135
|
-
* @returns Promise that resolves to an array of selected values
|
|
132
|
+
* @param {string} message - The message to display to the user
|
|
133
|
+
* @param {Array<ICliInterfaceServiceSelectOptions>} options - Array of options to select from
|
|
134
|
+
* @param {boolean} isRequired - Whether a selection is required, defaults to false
|
|
135
|
+
* @param {Array<string>} initialValues - Initial selected values
|
|
136
|
+
* @returns {Promise<Array<T>>} Promise that resolves to an array of selected values
|
|
137
|
+
* @template T - The type of the selected values
|
|
136
138
|
*/
|
|
137
139
|
async multiselect(message, options, isRequired = false, initialValues) {
|
|
138
140
|
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
@@ -165,8 +167,8 @@ class PromptsCliInterface {
|
|
|
165
167
|
}
|
|
166
168
|
/**
|
|
167
169
|
* Displays a note to the user with a title and message.
|
|
168
|
-
* @param title - The title of the note
|
|
169
|
-
* @param message - The message content of the note
|
|
170
|
+
* @param {string} title - The title of the note
|
|
171
|
+
* @param {string} message - The message content of the note
|
|
170
172
|
*/
|
|
171
173
|
note(title, message) {
|
|
172
174
|
const lines = message.split("\n");
|
|
@@ -195,10 +197,11 @@ class PromptsCliInterface {
|
|
|
195
197
|
}
|
|
196
198
|
/**
|
|
197
199
|
* Displays a single select prompt to the user.
|
|
198
|
-
* @param message - The message to display to the user
|
|
199
|
-
* @param options - Array of options to select from
|
|
200
|
-
* @param initialValue - Initial selected value
|
|
201
|
-
* @returns Promise that resolves to the selected value
|
|
200
|
+
* @param {string} message - The message to display to the user
|
|
201
|
+
* @param {Array<ICliInterfaceServiceSelectOptions>} options - Array of options to select from
|
|
202
|
+
* @param {string} initialValue - Initial selected value
|
|
203
|
+
* @returns {Promise<T>} Promise that resolves to the selected value
|
|
204
|
+
* @template T - The type of the selected value
|
|
202
205
|
*/
|
|
203
206
|
async select(message, options, initialValue) {
|
|
204
207
|
const choices = options.map((opt) => ({
|
|
@@ -228,7 +231,7 @@ class PromptsCliInterface {
|
|
|
228
231
|
/**
|
|
229
232
|
* Starts a spinner with the specified message.
|
|
230
233
|
* Stops any existing spinner first.
|
|
231
|
-
* @param message - The message to display while the spinner is active
|
|
234
|
+
* @param {string} message - The message to display while the spinner is active
|
|
232
235
|
*/
|
|
233
236
|
startSpinner(message) {
|
|
234
237
|
this.spinner.stop();
|
|
@@ -236,7 +239,7 @@ class PromptsCliInterface {
|
|
|
236
239
|
}
|
|
237
240
|
/**
|
|
238
241
|
* Stops the current spinner with an optional completion message.
|
|
239
|
-
* @param message - Optional message to display when the spinner stops
|
|
242
|
+
* @param {string} message - Optional message to display when the spinner stops
|
|
240
243
|
*/
|
|
241
244
|
stopSpinner(message) {
|
|
242
245
|
this.spinner.stop();
|
|
@@ -246,18 +249,18 @@ class PromptsCliInterface {
|
|
|
246
249
|
}
|
|
247
250
|
/**
|
|
248
251
|
* Displays a success message to the user.
|
|
249
|
-
* @param message - The success message to display
|
|
252
|
+
* @param {string} message - The success message to display
|
|
250
253
|
*/
|
|
251
254
|
success(message) {
|
|
252
255
|
process.stdout.write(`${chalk.green(message)}\n`);
|
|
253
256
|
}
|
|
254
257
|
/**
|
|
255
258
|
* Displays a text input prompt to the user.
|
|
256
|
-
* @param message - The message to display to the user
|
|
257
|
-
* @param
|
|
258
|
-
* @param initialValue - Optional initial value for the input field
|
|
259
|
-
* @param validate - Optional validation function for the input
|
|
260
|
-
* @returns Promise that resolves to the user's input text
|
|
259
|
+
* @param {string} message - The message to display to the user
|
|
260
|
+
* @param {string} _placeholder - Optional placeholder text for the input field (unused)
|
|
261
|
+
* @param {string} initialValue - Optional initial value for the input field
|
|
262
|
+
* @param {(value: string) => Error | string | undefined} validate - Optional validation function for the input
|
|
263
|
+
* @returns {Promise<string>} Promise that resolves to the user's input text
|
|
261
264
|
*/
|
|
262
265
|
async text(message, _placeholder, initialValue, validate) {
|
|
263
266
|
// Convert the validate function to match prompts' expected format
|
|
@@ -295,7 +298,7 @@ class PromptsCliInterface {
|
|
|
295
298
|
}
|
|
296
299
|
/**
|
|
297
300
|
* Update the spinner message without stopping it.
|
|
298
|
-
* @param message - The new message to display
|
|
301
|
+
* @param {string} message - The new message to display
|
|
299
302
|
*/
|
|
300
303
|
updateSpinner(message) {
|
|
301
304
|
if (this.spinner?.isSpinning) {
|
|
@@ -304,7 +307,7 @@ class PromptsCliInterface {
|
|
|
304
307
|
}
|
|
305
308
|
/**
|
|
306
309
|
* Displays a warning message to the user.
|
|
307
|
-
* @param message - The warning message to display
|
|
310
|
+
* @param {string} message - The warning message to display
|
|
308
311
|
*/
|
|
309
312
|
warn(message) {
|
|
310
313
|
process.stdout.write(`${chalk.yellow(message)}\n`);
|