diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1c6615e17f1..37f10a0af63 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -63,6 +63,7 @@ jobs: workspace: - backend - misskey-js + - sw steps: - uses: actions/checkout@v3.3.0 with: diff --git a/packages/misskey-js/etc/misskey-js.api.md b/packages/misskey-js/etc/misskey-js.api.md index 2511f14dcc5..55a8a0b04a1 100644 --- a/packages/misskey-js/etc/misskey-js.api.md +++ b/packages/misskey-js/etc/misskey-js.api.md @@ -166,6 +166,8 @@ export type Channels = { readAllAntennas: () => void; unreadAntenna: (payload: Antenna) => void; readAllAnnouncements: () => void; + readAllChannels: () => void; + unreadChannel: (payload: Note['id']) => void; myTokenRegenerated: () => void; reversiNoInvites: () => void; reversiInvited: (payload: FIXME) => void; @@ -2353,6 +2355,7 @@ type MeDetailed = UserDetailed & { hasPendingReceivedFollowRequest: boolean; hasUnreadAnnouncement: boolean; hasUnreadAntenna: boolean; + hasUnreadChannel: boolean; hasUnreadMentions: boolean; hasUnreadMessagingMessage: boolean; hasUnreadNotification: boolean; @@ -2484,6 +2487,9 @@ type Notification_2 = { user: User; userId: User['id']; note: Note; +} | { + type: 'pollEnded'; + note: Note; } | { type: 'follow'; user: User; @@ -2609,11 +2615,7 @@ export class Stream extends EventEmitter { // (undocumented) removeSharedConnectionPool(pool: Pool): void; // (undocumented) - send(typeOrPayload: string): void; - // (undocumented) - send(typeOrPayload: string, payload: any): void; - // (undocumented) - send(typeOrPayload: Record | any[]): void; + send(typeOrPayload: any, payload?: any): void; // (undocumented) state: 'initializing' | 'reconnecting' | 'connected'; // (undocumented) @@ -2710,7 +2712,7 @@ type UserSorting = '+follower' | '-follower' | '+createdAt' | '-createdAt' | '+u // src/api.types.ts:16:32 - (ae-forgotten-export) The symbol "TODO" needs to be exported by the entry point index.d.ts // src/api.types.ts:18:25 - (ae-forgotten-export) The symbol "NoParams" needs to be exported by the entry point index.d.ts // src/api.types.ts:594:18 - (ae-forgotten-export) The symbol "ShowUserReq" needs to be exported by the entry point index.d.ts -// src/streaming.types.ts:33:4 - (ae-forgotten-export) The symbol "FIXME" needs to be exported by the entry point index.d.ts +// src/streaming.types.ts:35:4 - (ae-forgotten-export) The symbol "FIXME" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) diff --git a/packages/misskey-js/src/entities.ts b/packages/misskey-js/src/entities.ts index 7343fd74ad9..d473dc0a706 100644 --- a/packages/misskey-js/src/entities.ts +++ b/packages/misskey-js/src/entities.ts @@ -217,6 +217,9 @@ export type Notification = { user: User; userId: User['id']; note: Note; +} | { + type: 'pollEnded'; + note: Note; } | { type: 'follow'; user: User; diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts index 6286d076c7d..a43b746d289 100644 --- a/packages/sw/src/scripts/create-notification.ts +++ b/packages/sw/src/scripts/create-notification.ts @@ -170,7 +170,7 @@ async function composeNotification(data: pushNotificationDataMap[keyof pushNotif case 'pollEnded': return [t('_notification.pollEnded'), { - body: data.body.note.text || '', + body: data.body.note.text ?? '', badge: iconUrl('chart-arrows'), tag: `poll:${data.body.note.id}`, data, diff --git a/packages/sw/src/scripts/operations.ts b/packages/sw/src/scripts/operations.ts index 8936a7763af..df3c054a655 100644 --- a/packages/sw/src/scripts/operations.ts +++ b/packages/sw/src/scripts/operations.ts @@ -4,7 +4,6 @@ */ import * as Misskey from 'misskey-js'; import { SwMessage, swMessageOrderType } from '@/types'; -import { acct as getAcct } from '@/filters/user'; import { getAccountFromId } from '@/scripts/get-account-from-id'; import { getUrlWithLoginId } from '@/scripts/login-id';