From 33034b0e02860513d277e8f8a08f96a84592b3e3 Mon Sep 17 00:00:00 2001 From: yupix Date: Mon, 4 Dec 2023 16:53:31 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E3=82=AD=E3=83=BC=E3=83=9E=E3=81=AE=E6=94=B9=E5=96=84?= =?UTF-8?q?=20(#12568)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: notifyにenumを設定 * feat: securityKeysListの型を明確に * feat: notificationRecieveConfigにpropertiesを定義 * chore: misskey.jsのmodelを更新 * fix: as constをつけ忘れている --- .../backend/src/models/json-schema/user.ts | 43 +++++++++++++ packages/misskey-js/src/autogen/endpoint.ts | 2 +- packages/misskey-js/src/autogen/entities.ts | 2 +- packages/misskey-js/src/autogen/models.ts | 2 +- packages/misskey-js/src/autogen/types.ts | 63 +++++++++++++++++-- 5 files changed, 105 insertions(+), 7 deletions(-) diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts index a2ec203e96..2621e7e6c0 100644 --- a/packages/backend/src/models/json-schema/user.ts +++ b/packages/backend/src/models/json-schema/user.ts @@ -3,6 +3,18 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +const notificationRecieveConfig = { + type: 'object', + nullable: false, optional: true, + properties: { + type: { + type: 'string', + nullable: false, optional: false, + enum: ['all', 'following', 'follower', 'mutualFollow', 'list', 'never'], + }, + }, +} as const; + export const packedUserLiteSchema = { type: 'object', properties: { @@ -398,6 +410,7 @@ export const packedUserDetailedNotMeOnlySchema = { notify: { type: 'string', nullable: false, optional: true, + enum: ['normal', 'none'], }, withReplies: { type: 'boolean', @@ -553,6 +566,19 @@ export const packedMeDetailedOnlySchema = { notificationRecieveConfig: { type: 'object', nullable: false, optional: false, + properties: { + app: notificationRecieveConfig, + quote: notificationRecieveConfig, + reply: notificationRecieveConfig, + follow: notificationRecieveConfig, + renote: notificationRecieveConfig, + mention: notificationRecieveConfig, + reaction: notificationRecieveConfig, + pollEnded: notificationRecieveConfig, + achievementEarned: notificationRecieveConfig, + receiveFollowRequest: notificationRecieveConfig, + followRequestAccepted: notificationRecieveConfig, + }, }, emailNotificationTypes: { type: 'array', @@ -697,6 +723,23 @@ export const packedMeDetailedOnlySchema = { items: { type: 'object', nullable: false, optional: false, + properties: { + id: { + type: 'string', + nullable: false, optional: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + name: { + type: 'string', + nullable: false, optional: false, + }, + lastUsed: { + type: 'string', + nullable: false, optional: false, + format: 'date-time', + }, + }, }, }, //#endregion diff --git a/packages/misskey-js/src/autogen/endpoint.ts b/packages/misskey-js/src/autogen/endpoint.ts index b46e69f691..cf571fc689 100644 --- a/packages/misskey-js/src/autogen/endpoint.ts +++ b/packages/misskey-js/src/autogen/endpoint.ts @@ -1,6 +1,6 @@ /* * version: 2023.12.0-beta.1 - * generatedAt: 2023-12-03T02:04:45.058Z + * generatedAt: 2023-12-04T07:13:58.541Z */ import type { diff --git a/packages/misskey-js/src/autogen/entities.ts b/packages/misskey-js/src/autogen/entities.ts index a51ee037d0..bbfa14913f 100644 --- a/packages/misskey-js/src/autogen/entities.ts +++ b/packages/misskey-js/src/autogen/entities.ts @@ -1,6 +1,6 @@ /* * version: 2023.12.0-beta.1 - * generatedAt: 2023-12-03T02:04:45.053Z + * generatedAt: 2023-12-04T07:13:58.538Z */ import { operations } from './types.js'; diff --git a/packages/misskey-js/src/autogen/models.ts b/packages/misskey-js/src/autogen/models.ts index c2b27b2c58..566b6dfb97 100644 --- a/packages/misskey-js/src/autogen/models.ts +++ b/packages/misskey-js/src/autogen/models.ts @@ -1,6 +1,6 @@ /* * version: 2023.12.0-beta.1 - * generatedAt: 2023-12-03T02:04:45.051Z + * generatedAt: 2023-12-04T07:13:58.535Z */ import { components } from './types.js'; diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index 44ed4dbaa8..b734b36e49 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -3,7 +3,7 @@ /* * version: 2023.12.0-beta.1 - * generatedAt: 2023-12-03T02:04:44.864Z + * generatedAt: 2023-12-04T07:13:58.362Z */ /** @@ -3218,7 +3218,8 @@ export type components = { isBlocked?: boolean; isMuted?: boolean; isRenoteMuted?: boolean; - notify?: string; + /** @enum {string} */ + notify?: 'normal' | 'none'; withReplies?: boolean; }; MeDetailedOnly: { @@ -3253,7 +3254,52 @@ export type components = { mutedWords: string[][]; hardMutedWords: string[][]; mutedInstances: string[] | null; - notificationRecieveConfig: Record; + notificationRecieveConfig: { + app?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + quote?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + reply?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + follow?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + renote?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + mention?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + reaction?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + pollEnded?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + achievementEarned?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + receiveFollowRequest?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + followRequestAccepted?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + }; emailNotificationTypes: string[]; achievements: { name: string; @@ -3287,7 +3333,16 @@ export type components = { }; email?: string | null; emailVerified?: boolean | null; - securityKeysList?: Record[]; + securityKeysList?: { + /** + * Format: id + * @example xxxxxxxxxx + */ + id: string; + name: string; + /** Format: date-time */ + lastUsed: string; + }[]; }; UserDetailedNotMe: components['schemas']['UserLite'] & components['schemas']['UserDetailedNotMeOnly']; MeDetailed: components['schemas']['UserLite'] & components['schemas']['UserDetailedNotMeOnly'] & components['schemas']['MeDetailedOnly'];