@@ -10,7 +10,8 @@ import {
1010 DatabaseConfiguration ,
1111 DatabaseConfigurationValidationGroup ,
1212} from './model/DatabaseConfiguration' ;
13- import { EnvironmentConfig , ENV_VARIABLE_NAMES } from './model/EnvironmentConfig' ;
13+ import { ENV_VARIABLE_NAMES , EnvironmentConfig } from './model/EnvironmentConfig' ;
14+ import { PuppeteerConfiguration } from './model/PuppeteerConfiguration' ;
1415
1516export class StaticSettings {
1617 private static service : StaticSettings = new StaticSettings ( ) ;
@@ -27,7 +28,7 @@ export class StaticSettings {
2728 constructor ( ) {
2829 this . config = this . loadConfigFile ( ) ;
2930
30- this . envConfig = this . loadEnvironmentVariables ( ) ;
31+ this . envConfig = StaticSettings . loadEnvironmentVariables ( ) ;
3132 this . databaseConfig = this . loadDatabaseConfig ( ) ;
3233 }
3334
@@ -45,7 +46,7 @@ export class StaticSettings {
4546 /**
4647 * Returns the encryption secret for the database.
4748 *
48- * @returns Encrytion secret.
49+ * @returns Encryption secret.
4950 */
5051 getDatabaseSecret ( ) : string {
5152 return this . databaseConfig . secret ;
@@ -58,6 +59,13 @@ export class StaticSettings {
5859 return this . databaseConfig ;
5960 }
6061
62+ /**
63+ * @returns Configuration for the puppeteer instance. Can be `undefined`.
64+ */
65+ getPuppeteerConfiguration ( ) : PuppeteerConfiguration | undefined {
66+ return this . config . puppeteer ;
67+ }
68+
6169 /**
6270 * Returns the value of the `sessionTimeout` setting.
6371 *
@@ -166,12 +174,12 @@ export class StaticSettings {
166174 * @returns Valid configuration extracted from the environment variables.
167175 * @throws `StartUpException` - If not all required environment variables were provided.
168176 */
169- private loadEnvironmentVariables ( ) : EnvironmentConfig {
177+ private static loadEnvironmentVariables ( ) : EnvironmentConfig {
170178 const envConfig = plainToClass ( EnvironmentConfig , process . env , {
171179 excludeExtraneousValues : true ,
172180 } ) ;
173181
174- this . assertEnvNoErrors ( validateSync ( envConfig ) ) ;
182+ StaticSettings . assertEnvNoErrors ( validateSync ( envConfig ) ) ;
175183
176184 return envConfig ;
177185 }
@@ -182,7 +190,7 @@ export class StaticSettings {
182190 * @param errors Array containing validation errors from class-validator (or empty).
183191 * @throws `StartUpException` - If `errors` is not empty.
184192 */
185- private assertEnvNoErrors ( errors : ValidationError [ ] ) {
193+ private static assertEnvNoErrors ( errors : ValidationError [ ] ) {
186194 if ( errors . length === 0 ) {
187195 return ;
188196 }
0 commit comments