Fix env not optional + serverless logging (#15186)
Several fixes after discussing with @BOHEUS - set applicationManifest env key optional - fix server local serverless function logging (introduces a new env variable `SERVERLESS_LOGS_ENABLED` defaulting to false)
This commit is contained in:
+9
-9
@@ -11,21 +11,21 @@ export type PackageJson = {
|
||||
npm: string;
|
||||
yarn: string;
|
||||
};
|
||||
env: Record<
|
||||
string,
|
||||
{
|
||||
key: string;
|
||||
value?: string;
|
||||
description?: string;
|
||||
isSecret: boolean;
|
||||
}
|
||||
>;
|
||||
env?: EnvManifest;
|
||||
icon?: string;
|
||||
version: string;
|
||||
dependencies?: object;
|
||||
devDependencies?: object;
|
||||
};
|
||||
|
||||
export type EnvManifest = Record<string, EnvVariableManifest>;
|
||||
|
||||
export type EnvVariableManifest = {
|
||||
value?: string;
|
||||
description?: string;
|
||||
isSecret: boolean;
|
||||
};
|
||||
|
||||
export type AppManifest = PackageJson & {
|
||||
agents: AgentManifest[];
|
||||
objects: ObjectManifest[];
|
||||
|
||||
+2
-8
@@ -4,6 +4,7 @@ import { isDefined } from 'twenty-shared/utils';
|
||||
import { In, Not, Repository } from 'typeorm';
|
||||
|
||||
import { ApplicationVariable } from 'src/engine/core-modules/applicationVariable/application-variable.entity';
|
||||
import { EnvManifest } from 'src/engine/core-modules/application/types/application.types';
|
||||
|
||||
export class ApplicationVariableService {
|
||||
constructor(
|
||||
@@ -28,14 +29,7 @@ export class ApplicationVariableService {
|
||||
env,
|
||||
applicationId,
|
||||
}: {
|
||||
env: Record<
|
||||
string,
|
||||
{
|
||||
value?: string;
|
||||
description?: string;
|
||||
isSecret: boolean;
|
||||
}
|
||||
>;
|
||||
env?: EnvManifest;
|
||||
applicationId: string;
|
||||
}) {
|
||||
if (!isDefined(env)) {
|
||||
|
||||
@@ -444,6 +444,15 @@ export class ConfigVariables {
|
||||
@CastToUpperSnakeCase()
|
||||
SERVERLESS_TYPE: ServerlessDriverType = ServerlessDriverType.LOCAL;
|
||||
|
||||
@ConfigVariablesMetadata({
|
||||
group: ConfigVariablesGroup.ServerlessConfig,
|
||||
description:
|
||||
'Configure whether console logs from serverless functions are displayed in the terminal',
|
||||
type: ConfigVariableType.BOOLEAN,
|
||||
})
|
||||
@IsOptional()
|
||||
SERVERLESS_LOGS_ENABLED: false;
|
||||
|
||||
@ConfigVariablesMetadata({
|
||||
group: ConfigVariablesGroup.ServerlessConfig,
|
||||
description: 'Throttle limit for serverless function execution',
|
||||
|
||||
Reference in New Issue
Block a user