Update enums to be all caps (#12372)

- Make custom domain public (remove from lab)
- Use ALL_CAPS definition for enums
This commit is contained in:
Félix Malfait
2025-05-29 14:08:36 +02:00
committed by GitHub
parent 76d0be7f81
commit 4485e8e3db
165 changed files with 845 additions and 847 deletions

View File

@ -19,21 +19,21 @@ export const exceptionHandlerModuleFactory = async (
const driverType = twentyConfigService.get('EXCEPTION_HANDLER_DRIVER');
switch (driverType) {
case ExceptionHandlerDriver.Console: {
case ExceptionHandlerDriver.CONSOLE: {
return {
type: ExceptionHandlerDriver.Console,
type: ExceptionHandlerDriver.CONSOLE,
};
}
case ExceptionHandlerDriver.Sentry: {
case ExceptionHandlerDriver.SENTRY: {
return {
type: ExceptionHandlerDriver.Sentry,
type: ExceptionHandlerDriver.SENTRY,
options: {
environment: twentyConfigService.get('SENTRY_ENVIRONMENT'),
release: twentyConfigService.get('APP_VERSION'),
dsn: twentyConfigService.get('SENTRY_DSN') ?? '',
serverInstance: adapterHost.httpAdapter?.getInstance(),
debug:
twentyConfigService.get('NODE_ENV') === NodeEnvironment.development,
twentyConfigService.get('NODE_ENV') === NodeEnvironment.DEVELOPMENT,
},
};
}

View File

@ -22,7 +22,7 @@ export class ExceptionHandlerModule extends ConfigurableModuleClass {
const provider = {
provide: EXCEPTION_HANDLER_DRIVER,
useValue:
options.type === ExceptionHandlerDriver.Console
options.type === ExceptionHandlerDriver.CONSOLE
? new ExceptionHandlerConsoleDriver()
: new ExceptionHandlerSentryDriver(),
};
@ -45,7 +45,7 @@ export class ExceptionHandlerModule extends ConfigurableModuleClass {
return null;
}
return config.type === ExceptionHandlerDriver.Console
return config.type === ExceptionHandlerDriver.CONSOLE
? new ExceptionHandlerConsoleDriver()
: new ExceptionHandlerSentryDriver();
},

View File

@ -1,12 +1,12 @@
import { Router } from 'express';
export enum ExceptionHandlerDriver {
Sentry = 'sentry',
Console = 'console',
SENTRY = 'SENTRY',
CONSOLE = 'CONSOLE',
}
export interface ExceptionHandlerSentryDriverFactoryOptions {
type: ExceptionHandlerDriver.Sentry;
type: ExceptionHandlerDriver.SENTRY;
options: {
environment?: string;
release?: string;
@ -17,7 +17,7 @@ export interface ExceptionHandlerSentryDriverFactoryOptions {
}
export interface ExceptionHandlerDriverFactoryOptions {
type: ExceptionHandlerDriver.Console;
type: ExceptionHandlerDriver.CONSOLE;
}
export type ExceptionHandlerModuleOptions =