|
1 | 1 | import { Inject, Injectable } from '@nestjs/common'; |
2 | | -import { getRepository } from 'typeorm'; |
3 | | -import AbstractUseCase from '../../../common/abstract-use.case.js'; |
4 | | -import { IGlobalDatabaseContext } from '../../../common/application/global-database-context.interface.js'; |
5 | | -import { BaseType } from '../../../common/data-injection.tokens.js'; |
6 | 2 | import { |
7 | 3 | getDataAccessObject, |
8 | 4 | isRedisConnectionUrl, |
9 | 5 | } from '@rocketadmin/shared-code/dist/src/data-access-layer/shared/create-data-access-object.js'; |
| 6 | +import { ConnectionTypesEnum } from '@rocketadmin/shared-code/dist/src/shared/enums/connection-types-enum.js'; |
| 7 | +import { getRepository } from 'typeorm'; |
| 8 | +import AbstractUseCase from '../../../common/abstract-use.case.js'; |
| 9 | +import { IGlobalDatabaseContext } from '../../../common/application/global-database-context.interface.js'; |
| 10 | +import { BaseType } from '../../../common/data-injection.tokens.js'; |
10 | 11 | import { Messages } from '../../../exceptions/text/messages.js'; |
11 | 12 | import { processExceptionMessage } from '../../../exceptions/utils/process-exception-message.js'; |
12 | | -import { isConnectionTypeAgent, slackPostMessage } from '../../../helpers/index.js'; |
13 | 13 | import { Encryptor } from '../../../helpers/encryption/encryptor.js'; |
| 14 | +import { isConnectionTypeAgent, slackPostMessage } from '../../../helpers/index.js'; |
| 15 | +import { CreateConnectionDs } from '../application/data-structures/create-connection.ds.js'; |
14 | 16 | import { TestConnectionResultDs } from '../application/data-structures/test-connection-result.ds.js'; |
15 | 17 | import { UpdateConnectionDs } from '../application/data-structures/update-connection.ds.js'; |
16 | 18 | import { ConnectionEntity } from '../connection.entity.js'; |
17 | 19 | import { isHostAllowed } from '../utils/is-host-allowed.js'; |
18 | | -import { ITestConnection } from './use-cases.interfaces.js'; |
19 | 20 | import { processAWSConnection } from '../utils/process-aws-connection.util.js'; |
20 | | -import { CreateConnectionDs } from '../application/data-structures/create-connection.ds.js'; |
21 | | -import { ConnectionTypesEnum } from '@rocketadmin/shared-code/dist/src/data-access-layer/shared/enums/connection-types-enum.js'; |
| 21 | +import { ITestConnection } from './use-cases.interfaces.js'; |
22 | 22 |
|
23 | 23 | @Injectable() |
24 | 24 | export class TestConnectionUseCase |
@@ -129,7 +129,11 @@ export class TestConnectionUseCase |
129 | 129 | }; |
130 | 130 | } |
131 | 131 | } else { |
132 | | - if (!connectionData.password && !isConnectionTypeAgent(connectionData.type) && !isRedisConnectionUrl(connectionData.host)) { |
| 132 | + if ( |
| 133 | + !connectionData.password && |
| 134 | + !isConnectionTypeAgent(connectionData.type) && |
| 135 | + !isRedisConnectionUrl(connectionData.host) |
| 136 | + ) { |
133 | 137 | return { |
134 | 138 | result: false, |
135 | 139 | message: Messages.PASSWORD_MISSING, |
|
0 commit comments