Update manifest structure (#17547)

Move all sync entities in an `entities` key. Rename functions to
logicFunctions

```json
{
  application: {
    ...
  },
  entities: {
    objects: [],
    logicFunctions: [],
    ...
  }
}
```
This commit is contained in:
martmull
2026-01-30 16:26:45 +01:00
committed by GitHub
parent bc022f82cb
commit f46da3eefd
162 changed files with 2555 additions and 3778 deletions
@@ -0,0 +1,60 @@
import kebabCase from 'lodash.kebabcase';
import { v4 } from 'uuid';
export const getLogicFunctionBaseFile = ({
name,
universalIdentifier = v4(),
}: {
name: string;
universalIdentifier?: string;
}) => {
const kebabCaseName = kebabCase(name);
const triggerUniversalIdentifier = v4();
return `import { defineLogicFunction } from 'twenty-sdk';
// Logic function handler - rename and implement your logic
const handler = async (params: {
a: string;
b: number;
}): Promise<{ message: string }> => {
const { a, b } = params;
// Replace with your own logic
const message = \`Hello, input: \${a} and \${b}\`;
return { message };
};
export default defineLogicFunction({
universalIdentifier: '${universalIdentifier}',
name: '${kebabCaseName}',
description: 'Add a description for your logic function',
timeoutSeconds: 5,
handler,
triggers: [
// Add your triggers here
// Route trigger example:
// {
// universalIdentifier: '${triggerUniversalIdentifier}',
// type: 'route',
// path: '/${kebabCaseName}',
// httpMethod: 'POST',
// isAuthRequired: true,
// },
// Cron trigger example:
// {
// universalIdentifier: '...',
// type: 'cron',
// pattern: '0 0 * * *', // Daily at midnight
// },
// Database event trigger example:
// {
// universalIdentifier: '...',
// type: 'databaseEvent',
// eventName: 'objectName.created',
// },
],
});
`;
};