mirror of
https://github.com/twentyhq/twenty
synced 2026-04-21 13:37:22 +00:00
## Summary Rename "Serverless Function" to "Logic Function" across the codebase for clearer naming. ### Environment Variable Changes | Old | New | |-----|-----| | `SERVERLESS_TYPE` | `LOGIC_FUNCTION_TYPE` | | `SERVERLESS_LAMBDA_REGION` | `LOGIC_FUNCTION_LAMBDA_REGION` | | `SERVERLESS_LAMBDA_ROLE` | `LOGIC_FUNCTION_LAMBDA_ROLE` | | `SERVERLESS_LAMBDA_SUBHOSTING_URL` | `LOGIC_FUNCTION_LAMBDA_SUBHOSTING_URL` | | `SERVERLESS_LAMBDA_ACCESS_KEY_ID` | `LOGIC_FUNCTION_LAMBDA_ACCESS_KEY_ID` | | `SERVERLESS_LAMBDA_SECRET_ACCESS_KEY` | `LOGIC_FUNCTION_LAMBDA_SECRET_ACCESS_KEY` | ### Breaking Changes - Environment variables must be updated in production deployments - Database migration renames `serverlessFunction` → `logicFunction` tables
20 lines
565 B
TypeScript
20 lines
565 B
TypeScript
import { isDefined } from 'twenty-shared/utils';
|
|
|
|
export const getToolInputSchemaFromSourceCode = async (
|
|
sourceCode: string,
|
|
): Promise<object | null> => {
|
|
const { getFunctionInputSchema } = await import('./getFunctionInputSchema');
|
|
const inputSchema = getFunctionInputSchema(sourceCode);
|
|
|
|
// Logic functions take a single params object
|
|
const firstParam = inputSchema[0];
|
|
|
|
if (firstParam?.type === 'object' && isDefined(firstParam.properties)) {
|
|
return {
|
|
type: 'object',
|
|
properties: firstParam.properties,
|
|
};
|
|
}
|
|
|
|
return null;
|
|
};
|