diff --git a/server/models/Integration.ts b/server/models/Integration.ts index 5aa74b910..f7d7566ce 100644 --- a/server/models/Integration.ts +++ b/server/models/Integration.ts @@ -4,6 +4,7 @@ import { Column, Table, DataType, + Scopes, } from "sequelize-typescript"; import Collection from "./Collection"; import IntegrationAuthentication from "./IntegrationAuthentication"; @@ -12,6 +13,17 @@ import User from "./User"; import BaseModel from "./base/BaseModel"; import Fix from "./decorators/Fix"; +@Scopes(() => ({ + withAuthentication: { + include: [ + { + model: IntegrationAuthentication, + as: "authentication", + required: true, + }, + ], + }, +})) @Table({ tableName: "integrations", modelName: "integration" }) @Fix class Integration extends BaseModel { diff --git a/server/types.ts b/server/types.ts index b0c0afe41..38d4d1b2c 100644 --- a/server/types.ts +++ b/server/types.ts @@ -37,6 +37,7 @@ export type DocumentEvent = | { name: "documents.create" // eslint-disable-line | "documents.publish" + | "documents.unpublish" | "documents.delete" | "documents.permanent_delete" | "documents.archive"