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:
+4
-4
@@ -15,13 +15,13 @@ export const serverlessModuleFactory = async (
|
||||
const options = { fileStorageService };
|
||||
|
||||
switch (driverType) {
|
||||
case ServerlessDriverType.Local: {
|
||||
case ServerlessDriverType.LOCAL: {
|
||||
return {
|
||||
type: ServerlessDriverType.Local,
|
||||
type: ServerlessDriverType.LOCAL,
|
||||
options,
|
||||
};
|
||||
}
|
||||
case ServerlessDriverType.Lambda: {
|
||||
case ServerlessDriverType.LAMBDA: {
|
||||
const region = twentyConfigService.get('SERVERLESS_LAMBDA_REGION');
|
||||
const accessKeyId = twentyConfigService.get(
|
||||
'SERVERLESS_LAMBDA_ACCESS_KEY_ID',
|
||||
@@ -36,7 +36,7 @@ export const serverlessModuleFactory = async (
|
||||
);
|
||||
|
||||
return {
|
||||
type: ServerlessDriverType.Lambda,
|
||||
type: ServerlessDriverType.LAMBDA,
|
||||
options: {
|
||||
...options,
|
||||
credentials: accessKeyId
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import { FactoryProvider, ModuleMetadata } from '@nestjs/common';
|
||||
|
||||
import { LocalDriverOptions } from 'src/engine/core-modules/serverless/drivers/local.driver';
|
||||
import { LambdaDriverOptions } from 'src/engine/core-modules/serverless/drivers/lambda.driver';
|
||||
import { LocalDriverOptions } from 'src/engine/core-modules/serverless/drivers/local.driver';
|
||||
|
||||
export enum ServerlessDriverType {
|
||||
Lambda = 'lambda',
|
||||
Local = 'local',
|
||||
LAMBDA = 'LAMBDA',
|
||||
LOCAL = 'LOCAL',
|
||||
}
|
||||
|
||||
export interface LocalDriverFactoryOptions {
|
||||
type: ServerlessDriverType.Local;
|
||||
type: ServerlessDriverType.LOCAL;
|
||||
options: LocalDriverOptions;
|
||||
}
|
||||
|
||||
export interface LambdaDriverFactoryOptions {
|
||||
type: ServerlessDriverType.Lambda;
|
||||
type: ServerlessDriverType.LAMBDA;
|
||||
options: LambdaDriverOptions;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DynamicModule, Global } from '@nestjs/common';
|
||||
|
||||
import { AddPackagesCommand } from 'src/engine/core-modules/serverless/commands/add-packages.command';
|
||||
import { LambdaDriver } from 'src/engine/core-modules/serverless/drivers/lambda.driver';
|
||||
import { LocalDriver } from 'src/engine/core-modules/serverless/drivers/local.driver';
|
||||
import { SERVERLESS_DRIVER } from 'src/engine/core-modules/serverless/serverless.constants';
|
||||
@@ -8,7 +9,6 @@ import {
|
||||
ServerlessModuleAsyncOptions,
|
||||
} from 'src/engine/core-modules/serverless/serverless.interface';
|
||||
import { ServerlessService } from 'src/engine/core-modules/serverless/serverless.service';
|
||||
import { AddPackagesCommand } from 'src/engine/core-modules/serverless/commands/add-packages.command';
|
||||
|
||||
@Global()
|
||||
export class ServerlessModule {
|
||||
@@ -19,7 +19,7 @@ export class ServerlessModule {
|
||||
useFactory: async (...args: any[]) => {
|
||||
const config = await options.useFactory(...args);
|
||||
|
||||
return config?.type === ServerlessDriverType.Local
|
||||
return config?.type === ServerlessDriverType.LOCAL
|
||||
? new LocalDriver(config.options)
|
||||
: new LambdaDriver(config.options);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user