## Summary - Remove `latestVersion` and `publishedVersions` columns from `LogicFunction` entity - Remove version parameter from logic function execution, build, and source code retrieval - Update all related services, DTOs, utilities, and tests - Add database migration to drop the version columns
31 lines
1.3 KiB
TypeScript
31 lines
1.3 KiB
TypeScript
import { type LogicFunctionDTO } from 'src/engine/metadata-modules/logic-function/dtos/logic-function.dto';
|
|
import { type FlatLogicFunction } from 'src/engine/metadata-modules/logic-function/types/flat-logic-function.type';
|
|
|
|
export const fromFlatLogicFunctionToLogicFunctionDto = ({
|
|
flatLogicFunction,
|
|
}: {
|
|
flatLogicFunction: FlatLogicFunction;
|
|
}): LogicFunctionDTO => {
|
|
return {
|
|
id: flatLogicFunction.id,
|
|
name: flatLogicFunction.name,
|
|
description: flatLogicFunction.description ?? undefined,
|
|
runtime: flatLogicFunction.runtime,
|
|
timeoutSeconds: flatLogicFunction.timeoutSeconds,
|
|
sourceHandlerPath: flatLogicFunction.sourceHandlerPath,
|
|
builtHandlerPath: flatLogicFunction.builtHandlerPath,
|
|
handlerName: flatLogicFunction.handlerName,
|
|
toolInputSchema: flatLogicFunction.toolInputSchema ?? undefined,
|
|
isTool: flatLogicFunction.isTool,
|
|
applicationId: flatLogicFunction.applicationId ?? undefined,
|
|
workspaceId: flatLogicFunction.workspaceId,
|
|
createdAt: new Date(flatLogicFunction.createdAt),
|
|
updatedAt: new Date(flatLogicFunction.updatedAt),
|
|
cronTriggerSettings: flatLogicFunction.cronTriggerSettings ?? undefined,
|
|
databaseEventTriggerSettings:
|
|
flatLogicFunction.databaseEventTriggerSettings ?? undefined,
|
|
httpRouteTriggerSettings:
|
|
flatLogicFunction.httpRouteTriggerSettings ?? undefined,
|
|
};
|
|
};
|