Add ability to link Slack <-> Outline accounts (#6682)
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
Table,
|
||||
IsUUID,
|
||||
PrimaryKey,
|
||||
Scopes,
|
||||
} from "sequelize-typescript";
|
||||
import Model from "@server/models/base/Model";
|
||||
import { ValidationError } from "../errors";
|
||||
@@ -28,6 +29,20 @@ import AzureClient from "plugins/azure/server/azure";
|
||||
import GoogleClient from "plugins/google/server/google";
|
||||
import OIDCClient from "plugins/oidc/server/oidc";
|
||||
|
||||
@Scopes(() => ({
|
||||
withUserAuthentication: (userId: string) => ({
|
||||
include: [
|
||||
{
|
||||
model: UserAuthentication,
|
||||
as: "userAuthentications",
|
||||
required: true,
|
||||
where: {
|
||||
userId,
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
}))
|
||||
@Table({
|
||||
tableName: "authentication_providers",
|
||||
modelName: "authentication_provider",
|
||||
|
||||
@@ -9,10 +9,7 @@ import {
|
||||
IsIn,
|
||||
} from "sequelize-typescript";
|
||||
import { IntegrationType, IntegrationService } from "@shared/types";
|
||||
import type {
|
||||
IntegrationSettings,
|
||||
UserCreatableIntegrationService,
|
||||
} from "@shared/types";
|
||||
import type { IntegrationSettings } from "@shared/types";
|
||||
import Collection from "./Collection";
|
||||
import IntegrationAuthentication from "./IntegrationAuthentication";
|
||||
import Team from "./Team";
|
||||
@@ -43,7 +40,7 @@ class Integration<T = unknown> extends IdModel<
|
||||
|
||||
@IsIn([Object.values(IntegrationService)])
|
||||
@Column(DataType.STRING)
|
||||
service: IntegrationService | UserCreatableIntegrationService;
|
||||
service: IntegrationService;
|
||||
|
||||
@Column(DataType.JSONB)
|
||||
settings: IntegrationSettings<T>;
|
||||
|
||||
Reference in New Issue
Block a user