mizzkey/packages/misskey-js/src/schemas.ts

89 lines
3.6 KiB
TypeScript
Raw Normal View History

2023-05-02 19:31:17 +02:00
import { IdSchema } from './schemas/id.js';
import {
packedUserLiteSchema,
packedUserDetailedNotMeOnlySchema,
packedMeDetailedOnlySchema,
packedUserDetailedNotMeSchema,
packedMeDetailedSchema,
packedUserDetailedSchema,
packedUserSchema,
} from './schemas/user.js';
2023-05-10 21:18:48 +02:00
import {
packedNotificationSchema,
packedNotificationStrictSchema,
} from './schemas/notification.js';
2023-05-02 19:31:17 +02:00
import { packedNoteSchema } from './schemas/note.js';
import { packedUserListSchema } from './schemas/user-list.js';
import { packedAppSchema } from './schemas/app.js';
import { packedDriveFileSchema } from './schemas/drive-file.js';
import { packedDriveFolderSchema } from './schemas/drive-folder.js';
import { packedFollowingSchema } from './schemas/following.js';
import { packedMutingSchema } from './schemas/muting.js';
import { packedRenoteMutingSchema } from './schemas/renote-muting.js';
import { packedBlockingSchema } from './schemas/blocking.js';
import { packedNoteReactionSchema } from './schemas/note-reaction.js';
import { packedHashtagSchema } from './schemas/hashtag.js';
import { packedPageSchema } from './schemas/page.js';
import { packedNoteFavoriteSchema } from './schemas/note-favorite.js';
import { packedChannelSchema } from './schemas/channel.js';
import { packedAntennaSchema } from './schemas/antenna.js';
import { packedClipSchema } from './schemas/clip.js';
import { packedFederationInstanceSchema } from './schemas/federation-instance.js';
import { packedQueueCountSchema } from './schemas/queue.js';
import { packedGalleryPostSchema } from './schemas/gallery-post.js';
import { packedEmojiDetailedSchema, packedEmojiSimpleSchema } from './schemas/emoji.js';
import { packedFlashSchema } from './schemas/flash.js';
2023-05-15 10:42:47 +02:00
import { packedAdSchema } from './schemas/ad.js';
import { packedAnnouncementSchema } from './schemas/announcement.js';
2023-05-27 18:06:42 +02:00
import { packedRelaySchema } from './schemas/relay.js';
2023-05-22 07:20:19 +02:00
import { Error, ApiError } from './schemas/error.js';
2023-05-04 12:56:24 +02:00
import type { JSONSchema7, JSONSchema7Definition, GetDef, GetRefs, GetKeys, UnionToArray } from 'schema-type';
2023-05-02 19:31:17 +02:00
export const refs = {
2023-05-10 19:48:21 +02:00
Id: IdSchema,
2023-05-02 19:31:17 +02:00
UserLite: packedUserLiteSchema,
UserDetailedNotMeOnly: packedUserDetailedNotMeOnlySchema,
MeDetailedOnly: packedMeDetailedOnlySchema,
UserDetailedNotMe: packedUserDetailedNotMeSchema,
MeDetailed: packedMeDetailedSchema,
UserDetailed: packedUserDetailedSchema,
User: packedUserSchema,
UserList: packedUserListSchema,
App: packedAppSchema,
Note: packedNoteSchema,
NoteReaction: packedNoteReactionSchema,
NoteFavorite: packedNoteFavoriteSchema,
Notification: packedNotificationSchema,
2023-05-10 21:18:48 +02:00
NotificationStrict: packedNotificationStrictSchema,
2023-05-02 19:31:17 +02:00
DriveFile: packedDriveFileSchema,
DriveFolder: packedDriveFolderSchema,
Following: packedFollowingSchema,
Muting: packedMutingSchema,
RenoteMuting: packedRenoteMutingSchema,
Blocking: packedBlockingSchema,
Hashtag: packedHashtagSchema,
Page: packedPageSchema,
Channel: packedChannelSchema,
QueueCount: packedQueueCountSchema,
Antenna: packedAntennaSchema,
Clip: packedClipSchema,
FederationInstance: packedFederationInstanceSchema,
GalleryPost: packedGalleryPostSchema,
EmojiSimple: packedEmojiSimpleSchema,
EmojiDetailed: packedEmojiDetailedSchema,
Flash: packedFlashSchema,
2023-05-15 10:42:47 +02:00
Ad: packedAdSchema,
Announcement: packedAnnouncementSchema,
2023-05-27 18:06:42 +02:00
Relay: packedRelaySchema,
2023-05-22 07:20:19 +02:00
Error: Error,
ApiError: ApiError,
2023-05-10 18:55:36 +02:00
} as const satisfies { [x: string]: JSONSchema7Definition };
2023-05-02 19:31:17 +02:00
2023-05-21 14:54:39 +02:00
export type References = GetRefs<typeof refs>;
2023-05-02 19:31:17 +02:00
2023-05-25 18:53:29 +02:00
export type Packed<x extends GetKeys<References, 'https://misskey-hub.net/api/schemas/'>> = GetDef<References, x, false, 'https://misskey-hub.net/api/schemas/'>;
2023-05-04 12:56:24 +02:00
export type Def<x extends GetKeys<References>> = GetDef<References, x>;