6071 return only updated fields of records in zapier update trigger (#8193)

- move webhook triggers into `entity-events-to-db.listener.ts`
- refactor event management
- add a `@OnDatabaseEvent` decorator to manage database events
- add updatedFields in updated events
- update openApi webhooks docs
- update zapier integration
This commit is contained in:
martmull
2024-11-04 17:44:36 +01:00
committed by GitHub
parent 741020fbb0
commit 695991881f
62 changed files with 547 additions and 578 deletions

View File

@ -16,6 +16,7 @@ import {
WorkflowVersionWorkspaceEntity,
} from 'src/modules/workflow/common/standard-objects/workflow-version.workspace-entity';
import { WorkflowWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow.workspace-entity';
import { DatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/enums/database-event-action';
@WorkspaceQueryHook({
key: `workflow.createMany`,
@ -62,7 +63,7 @@ export class WorkflowCreateManyPostQueryHook
});
this.workspaceEventEmitter.emit(
`workflowVersion.created`,
`workflowVersion.${DatabaseEventAction.CREATED}`,
workflowVersionsToCreate.map((workflowVersionToCreate) => {
return {
userId: authContext.user?.id,

View File

@ -16,6 +16,7 @@ import {
WorkflowVersionWorkspaceEntity,
} from 'src/modules/workflow/common/standard-objects/workflow-version.workspace-entity';
import { WorkflowWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow.workspace-entity';
import { DatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/enums/database-event-action';
@WorkspaceQueryHook({
key: `workflow.createOne`,
@ -58,7 +59,7 @@ export class WorkflowCreateOnePostQueryHook
});
this.workspaceEventEmitter.emit(
`workflowVersion.created`,
`workflowVersion.${DatabaseEventAction.CREATED}`,
[
{
userId: authContext.user?.id,