* Read deployment config with decrypted credentials (internal use)
(provider: ProviderType)
| 190 | * Read deployment config with decrypted credentials (internal use) |
| 191 | */ |
| 192 | private async readConfig(provider: ProviderType): Promise<DeploymentConfig> { |
| 193 | const internalService = new ItemsService<DeploymentConfig>('directus_deployments', { |
| 194 | knex: this.knex, |
| 195 | schema: this.schema, |
| 196 | accountability: null, |
| 197 | }); |
| 198 | |
| 199 | const results = await internalService.readByQuery({ |
| 200 | filter: { provider: { _eq: provider } }, |
| 201 | limit: 1, |
| 202 | }); |
| 203 | |
| 204 | if (!results || results.length === 0) { |
| 205 | throw new Error(`Deployment config for "${provider}" not found`); |
| 206 | } |
| 207 | |
| 208 | return results[0]!; |
| 209 | } |
| 210 | |
| 211 | /** |
| 212 | * Get webhook config for a provider |
no test coverage detected