6181 workflows create a custom code executor (#6235)

Closes #6181

## Testing
- download Altair graphql dev tool https://altairgraphql.dev/#download
- create a file locally `test.ts` containing:
```
export const handler = async (event: object, context: object) => {
  return { test: 'toto', data: event['data'] };
}
```
- play those requests in Altair:
mutation UpsertFunction($file: Upload!) {
  upsertFunction(name: "toto", file: $file)
}

mutation ExecFunction {
  executeFunction(name:"toto", payload: {data: "titi"})
}
- it will run the local driver, add those env variable to test with
lambda driver
```
CUSTOM_CODE_ENGINE_DRIVER_TYPE=lambda
LAMBDA_REGION=eu-west-2
LAMBDA_ROLE=<ASK_ME>
```
This commit is contained in:
martmull
2024-07-17 17:53:01 +02:00
committed by GitHub
parent e6f6069fe7
commit 47ddc7be83
37 changed files with 2382 additions and 16 deletions

View File

@@ -258,6 +258,7 @@ export enum FileFolder {
Attachment = 'Attachment',
PersonPicture = 'PersonPicture',
ProfilePicture = 'ProfilePicture',
ServerlessFunction = 'ServerlessFunction',
WorkspaceLogo = 'WorkspaceLogo'
}
@@ -683,6 +684,26 @@ export type Sentry = {
release?: Maybe<Scalars['String']>;
};
export type ServerlessFunctionConnection = {
__typename?: 'ServerlessFunctionConnection';
/** Array of edges. */
edges: Array<ServerlessFunctionEdge>;
/** Paging information */
pageInfo: PageInfo;
};
export type ServerlessFunctionExecutionResult = {
__typename?: 'ServerlessFunctionExecutionResult';
/** Execution result in JSON format */
result: Scalars['JSON'];
};
/** SyncStatus of the serverlessFunction */
export enum ServerlessFunctionSyncStatus {
NotReady = 'NOT_READY',
Ready = 'READY'
}
export type SessionEntity = {
__typename?: 'SessionEntity';
url?: Maybe<Scalars['String']>;
@@ -1064,6 +1085,23 @@ export type RelationEdge = {
node: Relation;
};
export type ServerlessFunction = {
__typename?: 'serverlessFunction';
createdAt: Scalars['DateTime'];
id: Scalars['UUID'];
name: Scalars['String'];
syncStatus: ServerlessFunctionSyncStatus;
updatedAt: Scalars['DateTime'];
};
export type ServerlessFunctionEdge = {
__typename?: 'serverlessFunctionEdge';
/** Cursor for this node. */
cursor: Scalars['ConnectionCursor'];
/** The node containing the serverlessFunction */
node: ServerlessFunction;
};
export type TimelineCalendarEventFragmentFragment = { __typename?: 'TimelineCalendarEvent', id: any, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: CalendarChannelVisibility, participants: Array<{ __typename?: 'TimelineCalendarEventParticipant', personId?: any | null, workspaceMemberId?: any | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> };
export type TimelineCalendarEventParticipantFragmentFragment = { __typename?: 'TimelineCalendarEventParticipant', personId?: any | null, workspaceMemberId?: any | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };