2023-05-10 17:34:13 +00:00
|
|
|
import { Packed, Def } from '../src/schemas';
|
2023-05-21 16:35:48 +00:00
|
|
|
import { expectType } from 'tsd';
|
2023-05-10 17:34:13 +00:00
|
|
|
|
|
|
|
describe('schemas', () => {
|
|
|
|
test('user', () => {
|
|
|
|
type UserLite = Packed<'UserLite'>;
|
|
|
|
expectType<UserLite>({
|
|
|
|
id: 'string',
|
|
|
|
name: null,
|
|
|
|
username: 'string',
|
|
|
|
host: null,
|
|
|
|
avatarUrl: 'string',
|
|
|
|
avatarBlurhash: 'string',
|
|
|
|
isAdmin: false,
|
|
|
|
isModerator: false,
|
|
|
|
isBot: false,
|
|
|
|
isCat: false,
|
|
|
|
onlineStatus: null,
|
|
|
|
});
|
|
|
|
type UserDetailedNotMeOnly = Packed<'UserDetailedNotMeOnly'>;
|
|
|
|
type UserDetailedNotMe = Packed<'UserDetailedNotMe'>;
|
|
|
|
type MeDetailed = Packed<'MeDetailed'>;
|
|
|
|
type User = Packed<'User'>;
|
|
|
|
type UserDetailed = Packed<'UserDetailed'>;
|
|
|
|
});
|
|
|
|
test('user list', () => {
|
|
|
|
type UserList = Packed<'UserList'>;
|
|
|
|
});
|
|
|
|
test('app', () => {
|
|
|
|
type App = Packed<'App'>;
|
|
|
|
});
|
|
|
|
test('note', () => {
|
|
|
|
type Note = Packed<'Note'>;
|
|
|
|
});
|
|
|
|
test('note reaction', () => {
|
|
|
|
type NoteReaction = Packed<'NoteReaction'>;
|
|
|
|
});
|
|
|
|
test('note favorite', () => {
|
|
|
|
type NoteFavorite = Packed<'NoteFavorite'>;
|
|
|
|
});
|
|
|
|
test('notification', () => {
|
|
|
|
type Notification = Packed<'Notification'>;
|
2023-05-21 16:35:48 +00:00
|
|
|
type NotificationStrict = Packed<'NotificationStrict'>;
|
2023-05-10 17:34:13 +00:00
|
|
|
});
|
|
|
|
test('drive file', () => {
|
|
|
|
type DriveFile = Packed<'DriveFile'>;
|
|
|
|
});
|
|
|
|
test('drive folder', () => {
|
|
|
|
type DriveFolder = Packed<'DriveFolder'>;
|
|
|
|
});
|
|
|
|
test('following', () => {
|
|
|
|
type Following = Packed<'Following'>;
|
|
|
|
});
|
|
|
|
test('muting', () => {
|
|
|
|
type Muting = Packed<'Muting'>;
|
|
|
|
});
|
|
|
|
test('renote muting', () => {
|
|
|
|
type RenoteMuting = Packed<'RenoteMuting'>;
|
|
|
|
});
|
|
|
|
test('blocking', () => {
|
|
|
|
type Blocking = Packed<'Blocking'>;
|
|
|
|
});
|
|
|
|
test('hashtag', () => {
|
|
|
|
type Hashtag = Packed<'Hashtag'>;
|
|
|
|
});
|
|
|
|
test('page', () => {
|
|
|
|
type Page = Packed<'Page'>;
|
|
|
|
});
|
|
|
|
test('channel', () => {
|
|
|
|
type Channel = Packed<'Channel'>;
|
|
|
|
});
|
|
|
|
test('queue count', () => {
|
|
|
|
type QueueCount = Packed<'QueueCount'>;
|
|
|
|
});
|
|
|
|
test('antenna', () => {
|
|
|
|
type Antenna = Packed<'Antenna'>;
|
|
|
|
});
|
|
|
|
test('clip', () => {
|
|
|
|
type Clip = Packed<'Clip'>;
|
|
|
|
});
|
|
|
|
test('federation instance', () => {
|
|
|
|
type FederationInstance = Packed<'FederationInstance'>;
|
|
|
|
});
|
|
|
|
test('gallery post', () => {
|
|
|
|
type GalleryPost = Packed<'GalleryPost'>;
|
|
|
|
});
|
|
|
|
test('emoji', () => {
|
|
|
|
type EmojiSimple = Packed<'EmojiSimple'>;
|
|
|
|
type EmojiDetailed = Packed<'EmojiDetailed'>;
|
|
|
|
});
|
|
|
|
test('flash', () => {
|
|
|
|
type Flash = Packed<'Flash'>;
|
|
|
|
});
|
2023-05-15 09:44:23 +00:00
|
|
|
test('announcement', () => {
|
|
|
|
type Announcement = Packed<'Announcement'>;
|
|
|
|
});
|
|
|
|
test('ad', () => {
|
|
|
|
type Ad = Packed<'Ad'>;
|
|
|
|
});
|
2023-05-27 16:06:42 +00:00
|
|
|
test('relay', () => {
|
|
|
|
type Relay = Packed<'Relay'>;
|
|
|
|
});
|
2023-05-27 19:17:29 +00:00
|
|
|
test('role', () => {
|
|
|
|
type Role = Packed<'Role'>;
|
|
|
|
type CF = Role['condFormula'];
|
2023-05-27 16:42:44 +00:00
|
|
|
type RoleAssign = Packed<'RoleAssign'>;
|
2023-05-27 19:17:29 +00:00
|
|
|
type RolePolicy = Packed<'RolePolicy'>;
|
|
|
|
type RoleCondFormula = Packed<'RoleCondFormula'>;
|
2023-05-27 16:42:44 +00:00
|
|
|
});
|
2023-05-29 13:28:31 +00:00
|
|
|
test('abuse user report', () => {
|
|
|
|
type AbuseUserReport = Packed<'AbuseUserReport'>;
|
|
|
|
});
|
2023-05-29 16:26:16 +00:00
|
|
|
test('meta', () => {
|
|
|
|
type MetaShared = Packed<'InstanceMetaShared'>;
|
|
|
|
//type Meta = Packed<'InstanceMeta'>;
|
|
|
|
type MetaAdmin = Packed<'InstanceMetaAdmin'>;
|
|
|
|
});
|
|
|
|
test('server info', () => {
|
|
|
|
type ServerInfo = Packed<'ServerInfo'>;
|
|
|
|
type ServerInfoAdmin = Packed<'ServerInfoAdmin'>;
|
|
|
|
});
|
2023-05-29 16:39:03 +00:00
|
|
|
test('moderation log', () => {
|
|
|
|
type ModerationLog = Packed<'ModerationLog'>;
|
|
|
|
});
|
2023-05-22 05:20:19 +00:00
|
|
|
test('error', () => {
|
|
|
|
type Error = Packed<'Error'>;
|
|
|
|
type ApiError = Packed<'ApiError'>;
|
|
|
|
});
|
2023-05-10 17:34:13 +00:00
|
|
|
});
|