diff --git a/src/models/repositories/app.ts b/src/models/repositories/app.ts index 2287bd4390..3bd7af05a0 100644 --- a/src/models/repositories/app.ts +++ b/src/models/repositories/app.ts @@ -1,9 +1,7 @@ import { EntityRepository, Repository } from 'typeorm'; import { App } from '@/models/entities/app'; import { AccessTokens } from '../index'; -import { SchemaType } from '@/misc/schema'; - -export type PackedApp = SchemaType; +import { Packed } from '@/misc/schema'; @EntityRepository(App) export class AppRepository extends Repository { @@ -15,7 +13,7 @@ export class AppRepository extends Repository { includeSecret?: boolean, includeProfileImageIds?: boolean } - ): Promise { + ): Promise> { const opts = Object.assign({ detail: false, includeSecret: false, diff --git a/src/models/repositories/messaging-message.ts b/src/models/repositories/messaging-message.ts index f97905af2f..abdff63689 100644 --- a/src/models/repositories/messaging-message.ts +++ b/src/models/repositories/messaging-message.ts @@ -1,11 +1,9 @@ import { EntityRepository, Repository } from 'typeorm'; import { MessagingMessage } from '@/models/entities/messaging-message'; import { Users, DriveFiles, UserGroups } from '../index'; -import { SchemaType } from '@/misc/schema'; +import { Packed } from '@/misc/schema'; import { User } from '@/models/entities/user'; -export type PackedMessagingMessage = SchemaType; - @EntityRepository(MessagingMessage) export class MessagingMessageRepository extends Repository { public validateText(text: string): boolean { @@ -19,7 +17,7 @@ export class MessagingMessageRepository extends Repository { populateRecipient?: boolean, populateGroup?: boolean, } - ): Promise { + ): Promise> { const opts = options || { populateRecipient: true, populateGroup: true, diff --git a/src/services/push-notification.ts b/src/services/push-notification.ts index 5bd7499692..23781acbe2 100644 --- a/src/services/push-notification.ts +++ b/src/services/push-notification.ts @@ -3,10 +3,10 @@ import config from '@/config/index'; import { SwSubscriptions } from '@/models/index'; import { fetchMeta } from '@/misc/fetch-meta'; import { PackedNotification } from '../models/repositories/notification'; -import { PackedMessagingMessage } from '../models/repositories/messaging-message'; +import { Packed } from '@/misc/schema'; type notificationType = 'notification' | 'unreadMessagingMessage'; -type notificationBody = PackedNotification | PackedMessagingMessage; +type notificationBody = PackedNotification | Packed<'MessagingMessage'>; export default async function(userId: string, type: notificationType, body: notificationBody) { const meta = await fetchMeta();