forked from FoundKeyGang/FoundKey
server: remove integration-related fields from meta
This commit is contained in:
parent
c1a51547a9
commit
b4b1204f77
5 changed files with 27 additions and 172 deletions
|
@ -0,0 +1,27 @@
|
||||||
|
export class removeIntegrations1670359028055 {
|
||||||
|
name = 'removeIntegrations1670359028055'
|
||||||
|
|
||||||
|
async up(queryRunner) {
|
||||||
|
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableTwitterIntegration"`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "twitterConsumerKey"`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "twitterConsumerSecret"`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableGithubIntegration"`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "githubClientId"`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "githubClientSecret"`);
|
||||||
|
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 "discordClientSecret"`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async down(queryRunner) {
|
||||||
|
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 "enableDiscordIntegration" boolean NOT NULL DEFAULT false`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "meta" ADD "githubClientSecret" character varying(128)`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "meta" ADD "githubClientId" character varying(128)`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "meta" ADD "enableGithubIntegration" boolean NOT NULL DEFAULT false`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "meta" ADD "twitterConsumerSecret" character varying(128)`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "meta" ADD "twitterConsumerKey" character varying(128)`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "meta" ADD "enableTwitterIntegration" boolean NOT NULL DEFAULT false`);
|
||||||
|
}
|
||||||
|
}
|
|
@ -246,57 +246,6 @@ export class Meta {
|
||||||
})
|
})
|
||||||
public swPrivateKey: string;
|
public swPrivateKey: string;
|
||||||
|
|
||||||
@Column('boolean', {
|
|
||||||
default: false,
|
|
||||||
})
|
|
||||||
public enableTwitterIntegration: boolean;
|
|
||||||
|
|
||||||
@Column('varchar', {
|
|
||||||
length: 128,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
public twitterConsumerKey: string | null;
|
|
||||||
|
|
||||||
@Column('varchar', {
|
|
||||||
length: 128,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
public twitterConsumerSecret: string | null;
|
|
||||||
|
|
||||||
@Column('boolean', {
|
|
||||||
default: false,
|
|
||||||
})
|
|
||||||
public enableGithubIntegration: boolean;
|
|
||||||
|
|
||||||
@Column('varchar', {
|
|
||||||
length: 128,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
public githubClientId: string | null;
|
|
||||||
|
|
||||||
@Column('varchar', {
|
|
||||||
length: 128,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
public githubClientSecret: string | null;
|
|
||||||
|
|
||||||
@Column('boolean', {
|
|
||||||
default: false,
|
|
||||||
})
|
|
||||||
public enableDiscordIntegration: boolean;
|
|
||||||
|
|
||||||
@Column('varchar', {
|
|
||||||
length: 128,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
public discordClientId: string | null;
|
|
||||||
|
|
||||||
@Column('varchar', {
|
|
||||||
length: 128,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
public discordClientSecret: string | null;
|
|
||||||
|
|
||||||
@Column('enum', {
|
@Column('enum', {
|
||||||
enum: TranslationService,
|
enum: TranslationService,
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
|
@ -102,18 +102,6 @@ export const meta = {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
enableTwitterIntegration: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
enableGithubIntegration: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
enableDiscordIntegration: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
translatorAvailable: {
|
translatorAvailable: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
|
@ -163,30 +151,6 @@ export const meta = {
|
||||||
optional: true, nullable: true,
|
optional: true, nullable: true,
|
||||||
format: 'id',
|
format: 'id',
|
||||||
},
|
},
|
||||||
twitterConsumerKey: {
|
|
||||||
type: 'string',
|
|
||||||
optional: true, nullable: true,
|
|
||||||
},
|
|
||||||
twitterConsumerSecret: {
|
|
||||||
type: 'string',
|
|
||||||
optional: true, nullable: true,
|
|
||||||
},
|
|
||||||
githubClientId: {
|
|
||||||
type: 'string',
|
|
||||||
optional: true, nullable: true,
|
|
||||||
},
|
|
||||||
githubClientSecret: {
|
|
||||||
type: 'string',
|
|
||||||
optional: true, nullable: true,
|
|
||||||
},
|
|
||||||
discordClientId: {
|
|
||||||
type: 'string',
|
|
||||||
optional: true, nullable: true,
|
|
||||||
},
|
|
||||||
discordClientSecret: {
|
|
||||||
type: 'string',
|
|
||||||
optional: true, nullable: true,
|
|
||||||
},
|
|
||||||
summaryProxy: {
|
summaryProxy: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
optional: true, nullable: true,
|
optional: true, nullable: true,
|
||||||
|
@ -324,9 +288,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
defaultLightTheme: instance.defaultLightTheme,
|
defaultLightTheme: instance.defaultLightTheme,
|
||||||
defaultDarkTheme: instance.defaultDarkTheme,
|
defaultDarkTheme: instance.defaultDarkTheme,
|
||||||
enableEmail: instance.enableEmail,
|
enableEmail: instance.enableEmail,
|
||||||
enableTwitterIntegration: instance.enableTwitterIntegration,
|
|
||||||
enableGithubIntegration: instance.enableGithubIntegration,
|
|
||||||
enableDiscordIntegration: instance.enableDiscordIntegration,
|
|
||||||
pinnedPages: instance.pinnedPages,
|
pinnedPages: instance.pinnedPages,
|
||||||
pinnedClipId: instance.pinnedClipId,
|
pinnedClipId: instance.pinnedClipId,
|
||||||
cacheRemoteFiles: instance.cacheRemoteFiles,
|
cacheRemoteFiles: instance.cacheRemoteFiles,
|
||||||
|
@ -338,12 +299,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
hcaptchaSecretKey: instance.hcaptchaSecretKey,
|
hcaptchaSecretKey: instance.hcaptchaSecretKey,
|
||||||
recaptchaSecretKey: instance.recaptchaSecretKey,
|
recaptchaSecretKey: instance.recaptchaSecretKey,
|
||||||
proxyAccountId: instance.proxyAccountId,
|
proxyAccountId: instance.proxyAccountId,
|
||||||
twitterConsumerKey: instance.twitterConsumerKey,
|
|
||||||
twitterConsumerSecret: instance.twitterConsumerSecret,
|
|
||||||
githubClientId: instance.githubClientId,
|
|
||||||
githubClientSecret: instance.githubClientSecret,
|
|
||||||
discordClientId: instance.discordClientId,
|
|
||||||
discordClientSecret: instance.discordClientSecret,
|
|
||||||
summalyProxy: instance.summalyProxy,
|
summalyProxy: instance.summalyProxy,
|
||||||
email: instance.email,
|
email: instance.email,
|
||||||
smtpSecure: instance.smtpSecure,
|
smtpSecure: instance.smtpSecure,
|
||||||
|
|
|
@ -60,15 +60,6 @@ export const paramDef = {
|
||||||
deeplAuthKey: { type: 'string', nullable: true },
|
deeplAuthKey: { type: 'string', nullable: true },
|
||||||
libreTranslateAuthKey: { type: 'string', nullable: true },
|
libreTranslateAuthKey: { type: 'string', nullable: true },
|
||||||
libreTranslateEndpoint: { type: 'string', nullable: true },
|
libreTranslateEndpoint: { type: 'string', nullable: true },
|
||||||
enableTwitterIntegration: { type: 'boolean' },
|
|
||||||
twitterConsumerKey: { type: 'string', nullable: true },
|
|
||||||
twitterConsumerSecret: { type: 'string', nullable: true },
|
|
||||||
enableGithubIntegration: { type: 'boolean' },
|
|
||||||
githubClientId: { type: 'string', nullable: true },
|
|
||||||
githubClientSecret: { type: 'string', nullable: true },
|
|
||||||
enableDiscordIntegration: { type: 'boolean' },
|
|
||||||
discordClientId: { type: 'string', nullable: true },
|
|
||||||
discordClientSecret: { type: 'string', nullable: true },
|
|
||||||
enableEmail: { type: 'boolean' },
|
enableEmail: { type: 'boolean' },
|
||||||
email: { type: 'string', nullable: true },
|
email: { type: 'string', nullable: true },
|
||||||
smtpSecure: { type: 'boolean' },
|
smtpSecure: { type: 'boolean' },
|
||||||
|
@ -230,42 +221,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
set.summalyProxy = ps.summalyProxy;
|
set.summalyProxy = ps.summalyProxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ps.enableTwitterIntegration !== undefined) {
|
|
||||||
set.enableTwitterIntegration = ps.enableTwitterIntegration;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.twitterConsumerKey !== undefined) {
|
|
||||||
set.twitterConsumerKey = ps.twitterConsumerKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.twitterConsumerSecret !== undefined) {
|
|
||||||
set.twitterConsumerSecret = ps.twitterConsumerSecret;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.enableGithubIntegration !== undefined) {
|
|
||||||
set.enableGithubIntegration = ps.enableGithubIntegration;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.githubClientId !== undefined) {
|
|
||||||
set.githubClientId = ps.githubClientId;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.githubClientSecret !== undefined) {
|
|
||||||
set.githubClientSecret = ps.githubClientSecret;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.enableDiscordIntegration !== undefined) {
|
|
||||||
set.enableDiscordIntegration = ps.enableDiscordIntegration;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.discordClientId !== undefined) {
|
|
||||||
set.discordClientId = ps.discordClientId;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.discordClientSecret !== undefined) {
|
|
||||||
set.discordClientSecret = ps.discordClientSecret;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.enableEmail !== undefined) {
|
if (ps.enableEmail !== undefined) {
|
||||||
set.enableEmail = ps.enableEmail;
|
set.enableEmail = ps.enableEmail;
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,18 +170,6 @@ export const meta = {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
enableTwitterIntegration: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
enableGithubIntegration: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
enableDiscordIntegration: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
translatorAvailable: {
|
translatorAvailable: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
|
@ -222,18 +210,6 @@ export const meta = {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
twitter: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
github: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
discord: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
serviceWorker: {
|
serviceWorker: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: true, nullable: false,
|
optional: true, nullable: false,
|
||||||
|
@ -314,10 +290,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
defaultDarkTheme: instance.defaultDarkTheme,
|
defaultDarkTheme: instance.defaultDarkTheme,
|
||||||
enableEmail: instance.enableEmail,
|
enableEmail: instance.enableEmail,
|
||||||
|
|
||||||
enableTwitterIntegration: instance.enableTwitterIntegration,
|
|
||||||
enableGithubIntegration: instance.enableGithubIntegration,
|
|
||||||
enableDiscordIntegration: instance.enableDiscordIntegration,
|
|
||||||
|
|
||||||
translatorAvailable: translatorAvailable(instance),
|
translatorAvailable: translatorAvailable(instance),
|
||||||
|
|
||||||
pinnedPages: instance.pinnedPages,
|
pinnedPages: instance.pinnedPages,
|
||||||
|
@ -338,9 +310,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
hcaptcha: instance.enableHcaptcha,
|
hcaptcha: instance.enableHcaptcha,
|
||||||
recaptcha: instance.enableRecaptcha,
|
recaptcha: instance.enableRecaptcha,
|
||||||
objectStorage: instance.useObjectStorage,
|
objectStorage: instance.useObjectStorage,
|
||||||
twitter: instance.enableTwitterIntegration,
|
|
||||||
github: instance.enableGithubIntegration,
|
|
||||||
discord: instance.enableDiscordIntegration,
|
|
||||||
serviceWorker: true,
|
serviceWorker: true,
|
||||||
miauth: true,
|
miauth: true,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue