forked from FoundKeyGang/FoundKey
server: remove integrations field from user
This commit is contained in:
parent
87e1e658f2
commit
b023741f50
6 changed files with 2 additions and 17 deletions
|
@ -11,9 +11,11 @@ export class removeIntegrations1670359028055 {
|
||||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableDiscordIntegration"`);
|
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableDiscordIntegration"`);
|
||||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "discordClientId"`);
|
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "discordClientId"`);
|
||||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "discordClientSecret"`);
|
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "discordClientSecret"`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "integrations"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async down(queryRunner) {
|
async down(queryRunner) {
|
||||||
|
await queryRunner.query(`ALTER TABLE "user_profile" ADD "integrations" jsonb NOT NULL DEFAULT '{}'`);
|
||||||
await queryRunner.query(`ALTER TABLE "meta" ADD "discordClientSecret" character varying(128)`);
|
await queryRunner.query(`ALTER TABLE "meta" ADD "discordClientSecret" character varying(128)`);
|
||||||
await queryRunner.query(`ALTER TABLE "meta" ADD "discordClientId" character varying(128)`);
|
await queryRunner.query(`ALTER TABLE "meta" ADD "discordClientId" character varying(128)`);
|
||||||
await queryRunner.query(`ALTER TABLE "meta" ADD "enableDiscordIntegration" boolean NOT NULL DEFAULT false`);
|
await queryRunner.query(`ALTER TABLE "meta" ADD "enableDiscordIntegration" boolean NOT NULL DEFAULT false`);
|
||||||
|
|
|
@ -167,11 +167,6 @@ export class UserProfile {
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
public pinnedPage: Page | null;
|
public pinnedPage: Page | null;
|
||||||
|
|
||||||
@Column('jsonb', {
|
|
||||||
default: {},
|
|
||||||
})
|
|
||||||
public integrations: Record<string, any>;
|
|
||||||
|
|
||||||
@Index()
|
@Index()
|
||||||
@Column('boolean', {
|
@Column('boolean', {
|
||||||
default: false, select: false,
|
default: false, select: false,
|
||||||
|
|
|
@ -387,7 +387,6 @@ export const UserRepository = db.getRepository(User).extend({
|
||||||
hasUnreadMessagingMessage: this.getHasUnreadMessagingMessage(user.id),
|
hasUnreadMessagingMessage: this.getHasUnreadMessagingMessage(user.id),
|
||||||
hasUnreadNotification: this.getHasUnreadNotification(user.id),
|
hasUnreadNotification: this.getHasUnreadNotification(user.id),
|
||||||
hasPendingReceivedFollowRequest: this.getHasPendingReceivedFollowRequest(user.id),
|
hasPendingReceivedFollowRequest: this.getHasPendingReceivedFollowRequest(user.id),
|
||||||
integrations: profile!.integrations,
|
|
||||||
mutedWords: profile!.mutedWords,
|
mutedWords: profile!.mutedWords,
|
||||||
mutedInstances: profile!.mutedInstances,
|
mutedInstances: profile!.mutedInstances,
|
||||||
mutingNotificationTypes: profile!.mutingNotificationTypes,
|
mutingNotificationTypes: profile!.mutingNotificationTypes,
|
||||||
|
|
|
@ -352,10 +352,6 @@ export const packedMeDetailedOnlySchema = {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
},
|
},
|
||||||
integrations: {
|
|
||||||
type: 'object',
|
|
||||||
nullable: true, optional: false,
|
|
||||||
},
|
|
||||||
mutedWords: {
|
mutedWords: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
|
|
|
@ -45,11 +45,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const maskedKeys = ['accessToken', 'accessTokenSecret', 'refreshToken'];
|
|
||||||
Object.keys(profile.integrations).forEach(integration => {
|
|
||||||
maskedKeys.forEach(key => profile.integrations[integration][key] = '<MASKED>');
|
|
||||||
});
|
|
||||||
|
|
||||||
const signins = await Signins.findBy({ userId: user.id });
|
const signins = await Signins.findBy({ userId: user.id });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -61,7 +56,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
carefulBot: profile.carefulBot,
|
carefulBot: profile.carefulBot,
|
||||||
injectFeaturedNote: profile.injectFeaturedNote,
|
injectFeaturedNote: profile.injectFeaturedNote,
|
||||||
receiveAnnouncementEmail: profile.receiveAnnouncementEmail,
|
receiveAnnouncementEmail: profile.receiveAnnouncementEmail,
|
||||||
integrations: profile.integrations,
|
|
||||||
mutedWords: profile.mutedWords,
|
mutedWords: profile.mutedWords,
|
||||||
mutedInstances: profile.mutedInstances,
|
mutedInstances: profile.mutedInstances,
|
||||||
mutingNotificationTypes: profile.mutingNotificationTypes,
|
mutingNotificationTypes: profile.mutingNotificationTypes,
|
||||||
|
|
|
@ -98,7 +98,6 @@ export type MeDetailed = UserDetailed & {
|
||||||
hasUnreadSpecifiedNotes: boolean;
|
hasUnreadSpecifiedNotes: boolean;
|
||||||
hideOnlineStatus: boolean;
|
hideOnlineStatus: boolean;
|
||||||
injectFeaturedNote: boolean;
|
injectFeaturedNote: boolean;
|
||||||
integrations: Record<string, any>;
|
|
||||||
isDeleted: boolean;
|
isDeleted: boolean;
|
||||||
isExplorable: boolean;
|
isExplorable: boolean;
|
||||||
mutedWords: string[][];
|
mutedWords: string[][];
|
||||||
|
|
Loading…
Reference in a new issue