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

@ -1,7 +1,7 @@
import { DynamicModule, Global } from '@nestjs/common';
import { CAPTCHA_DRIVER } from 'src/engine/core-modules/captcha/constants/captcha-driver.constants';
import { CaptchaService } from 'src/engine/core-modules/captcha/captcha.service';
import { CAPTCHA_DRIVER } from 'src/engine/core-modules/captcha/constants/captcha-driver.constants';
import { GoogleRecaptchaDriver } from 'src/engine/core-modules/captcha/drivers/google-recaptcha.driver';
import { TurnstileDriver } from 'src/engine/core-modules/captcha/drivers/turnstile.driver';
import {
@ -23,9 +23,9 @@ export class CaptchaModule {
}
switch (config.type) {
case CaptchaDriverType.GoogleRecaptcha:
case CaptchaDriverType.GOOGLE_RECAPTCHA:
return new GoogleRecaptchaDriver(config.options);
case CaptchaDriverType.Turnstile:
case CaptchaDriverType.TURNSTILE:
return new TurnstileDriver(config.options);
default:
return;

View File

@ -2,8 +2,8 @@ import { FactoryProvider, ModuleMetadata } from '@nestjs/common';
import { registerEnumType } from '@nestjs/graphql';
export enum CaptchaDriverType {
GoogleRecaptcha = 'google-recaptcha',
Turnstile = 'turnstile',
GOOGLE_RECAPTCHA = 'GOOGLE_RECAPTCHA',
TURNSTILE = 'TURNSTILE',
}
registerEnumType(CaptchaDriverType, {
@ -16,12 +16,12 @@ export type CaptchaDriverOptions = {
};
export interface GoogleRecaptchaDriverFactoryOptions {
type: CaptchaDriverType.GoogleRecaptcha;
type: CaptchaDriverType.GOOGLE_RECAPTCHA;
options: CaptchaDriverOptions;
}
export interface TurnstileDriverFactoryOptions {
type: CaptchaDriverType.Turnstile;
type: CaptchaDriverType.TURNSTILE;
options: CaptchaDriverOptions;
}