mirror of
https://github.com/outline/outline.git
synced 2026-01-02 09:09:50 -06:00
* GA integration settings * trackingId -> measurementId Hook up script * Public page GA tracking Correct layout of settings * Remove multiple codepaths for loading GA measurementID, add missing db index * Remove unneccessary changes, tsc * test
55 lines
1.1 KiB
TypeScript
55 lines
1.1 KiB
TypeScript
import {
|
|
DataType,
|
|
Table,
|
|
ForeignKey,
|
|
BelongsTo,
|
|
Column,
|
|
} from "sequelize-typescript";
|
|
import { IntegrationService } from "@shared/types";
|
|
import Team from "./Team";
|
|
import User from "./User";
|
|
import IdModel from "./base/IdModel";
|
|
import Encrypted, {
|
|
getEncryptedColumn,
|
|
setEncryptedColumn,
|
|
} from "./decorators/Encrypted";
|
|
import Fix from "./decorators/Fix";
|
|
|
|
@Table({ tableName: "authentications", modelName: "authentication" })
|
|
@Fix
|
|
class IntegrationAuthentication extends IdModel {
|
|
@Column(DataType.STRING)
|
|
service: IntegrationService;
|
|
|
|
@Column(DataType.ARRAY(DataType.STRING))
|
|
scopes: string[];
|
|
|
|
@Column(DataType.BLOB)
|
|
@Encrypted
|
|
get token() {
|
|
return getEncryptedColumn(this, "token");
|
|
}
|
|
|
|
set token(value: string) {
|
|
setEncryptedColumn(this, "token", value);
|
|
}
|
|
|
|
// associations
|
|
|
|
@BelongsTo(() => User, "userId")
|
|
user: User;
|
|
|
|
@ForeignKey(() => User)
|
|
@Column(DataType.UUID)
|
|
userId: string;
|
|
|
|
@BelongsTo(() => Team, "teamId")
|
|
team: Team;
|
|
|
|
@ForeignKey(() => Team)
|
|
@Column(DataType.UUID)
|
|
teamId: string;
|
|
}
|
|
|
|
export default IntegrationAuthentication;
|