rename core-module environment to twenty-config (#11445)

closes https://github.com/twentyhq/core-team-issues/issues/759
This commit is contained in:
nitin
2025-04-09 17:41:26 +05:30
committed by GitHub
parent fe6d0241a8
commit bd3ec6d5e3
193 changed files with 1454 additions and 1422 deletions

View File

@ -1,17 +1,17 @@
import { fromNodeProviderChain } from '@aws-sdk/credential-providers';
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
import { FileStorageService } from 'src/engine/core-modules/file-storage/file-storage.service';
import {
ServerlessDriverType,
ServerlessModuleOptions,
} from 'src/engine/core-modules/serverless/serverless.interface';
import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
export const serverlessModuleFactory = async (
environmentService: EnvironmentService,
twentyConfigService: TwentyConfigService,
fileStorageService: FileStorageService,
): Promise<ServerlessModuleOptions> => {
const driverType = environmentService.get('SERVERLESS_TYPE');
const driverType = twentyConfigService.get('SERVERLESS_TYPE');
const options = { fileStorageService };
switch (driverType) {
@ -22,16 +22,16 @@ export const serverlessModuleFactory = async (
};
}
case ServerlessDriverType.Lambda: {
const region = environmentService.get('SERVERLESS_LAMBDA_REGION');
const accessKeyId = environmentService.get(
const region = twentyConfigService.get('SERVERLESS_LAMBDA_REGION');
const accessKeyId = twentyConfigService.get(
'SERVERLESS_LAMBDA_ACCESS_KEY_ID',
);
const secretAccessKey = environmentService.get(
const secretAccessKey = twentyConfigService.get(
'SERVERLESS_LAMBDA_SECRET_ACCESS_KEY',
);
const lambdaRole = environmentService.get('SERVERLESS_LAMBDA_ROLE');
const lambdaRole = twentyConfigService.get('SERVERLESS_LAMBDA_ROLE');
const subhostingRole = environmentService.get(
const subhostingRole = twentyConfigService.get(
'SERVERLESS_LAMBDA_SUBHOSTING_ROLE',
);