From 8c377b6a1aa992e35e4a4a3cbe3e9c26b70866d0 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Sun, 7 May 2023 14:23:11 +0200 Subject: [PATCH] foundkey-js: remove ads, detailed instance metadata The distinction for "DetailedInstanceMetadata" does no longer exist since commit 9022ab9f2a5872c02f6d20f1d96ebc1bee6dd43f. The `DetailedInstanceMetadata` and `LiteInstanceMetadata` have therefore been removed, leaving only `InstanceMetadata`. Changelog: Removed --- packages/foundkey-js/src/api.types.ts | 19 ++----------------- packages/foundkey-js/src/entities.ts | 9 +-------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/packages/foundkey-js/src/api.types.ts b/packages/foundkey-js/src/api.types.ts index 8670f5cd6..4c6b098f5 100644 --- a/packages/foundkey-js/src/api.types.ts +++ b/packages/foundkey-js/src/api.types.ts @@ -1,6 +1,5 @@ import { - Ad, Announcement, Antenna, App, AuthSession, Blocking, Channel, Clip, DateString, DetailedInstanceMetadata, DriveFile, DriveFolder, Following, FollowingFolloweePopulated, FollowingFollowerPopulated, FollowRequest, Instance, InstanceMetadata, - LiteInstanceMetadata, + Announcement, Antenna, App, AuthSession, Blocking, Channel, Clip, DateString, InstanceMetadata, DriveFile, DriveFolder, Following, FollowingFolloweePopulated, FollowingFollowerPopulated, FollowRequest, Instance, MeDetailed, Note, NoteFavorite, OriginType, Page, ServerInfo, Stats, User, UserDetailed, UserGroup, UserList, UserSorting, Notification, NoteReaction, Signin, MessagingMessage, } from './entities.js'; @@ -380,21 +379,7 @@ export type Endpoints = { 'messaging/messages/create': { req: { userId?: User['id']; groupId?: UserGroup['id']; text?: string; fileId?: DriveFile['id']; }; res: MessagingMessage; }; 'messaging/messages/delete': { req: { messageId: MessagingMessage['id']; }; res: null; }; 'messaging/messages/read': { req: { messageId: MessagingMessage['id']; }; res: null; }; - 'meta': { req: { detail?: boolean; }; res: { - $switch: { - $cases: [[ - { detail: true; }, - DetailedInstanceMetadata, - ], [ - { detail: false; }, - LiteInstanceMetadata, - ], [ - { detail: boolean; }, - LiteInstanceMetadata | DetailedInstanceMetadata, - ]]; - $default: LiteInstanceMetadata; - }; - }; }; + 'meta': { req: { detail?: boolean; }; res: InstanceMetadata; }; 'miauth/gen-token': { req: TODO; res: TODO; }; 'mute/create': { req: TODO; res: TODO; }; 'mute/delete': { req: { userId: User['id'] }; res: null; }; diff --git a/packages/foundkey-js/src/entities.ts b/packages/foundkey-js/src/entities.ts index 3742630bb..d2cbe8289 100644 --- a/packages/foundkey-js/src/entities.ts +++ b/packages/foundkey-js/src/entities.ts @@ -260,7 +260,7 @@ export type CustomEmoji = { aliases: string[]; }; -export type LiteInstanceMetadata = { +export type InstanceMetadata = { maintainerName: string | null; maintainerEmail: string | null; version: string; @@ -290,14 +290,9 @@ export type LiteInstanceMetadata = { notFound: string; info: string; }; -}; - -export type DetailedInstanceMetadata = LiteInstanceMetadata & { features: Record; }; -export type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata; - export type ServerInfo = { machine: string; cpu: { @@ -388,8 +383,6 @@ export type AuthSession = { token: string; }; -export type Ad = TODO; - export type Clip = TODO; export type NoteFavorite = {