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

101 lines
4 KiB
TypeScript
Raw Normal View History

2023-05-02 17:31:17 +00:00
import { IdSchema } from './schemas/id.js';
import {
packedUserLiteSchema,
packedUserDetailedNotMeOnlySchema,
packedMeDetailedOnlySchema,
packedUserDetailedNotMeSchema,
packedMeDetailedSchema,
packedUserDetailedSchema,
packedUserSchema,
} from './schemas/user.js';
2023-05-10 19:18:48 +00:00
import {
packedNotificationSchema,
packedNotificationStrictSchema,
} from './schemas/notification.js';
2023-05-02 17:31:17 +00: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 08:42:47 +00:00
import { packedAdSchema } from './schemas/ad.js';
import { packedAnnouncementSchema } from './schemas/announcement.js';
2023-05-27 16:06:42 +00:00
import { packedRelaySchema } from './schemas/relay.js';
2023-05-29 13:28:31 +00:00
import { packedAbuseUserReportSchema } from './schemas/abuse-user-report.js';
2023-05-27 19:17:29 +00:00
import {
packedRoleSchema,
packedRoleAssignSchema,
packedRolePolicySchema,
packedRoleCondFormulaSchema,
} from './schemas/role.js';
2023-05-22 05:20:19 +00:00
import { Error, ApiError } from './schemas/error.js';
2023-05-04 10:56:24 +00:00
import type { JSONSchema7, JSONSchema7Definition, GetDef, GetRefs, GetKeys, UnionToArray } from 'schema-type';
2023-05-02 17:31:17 +00:00
export const refs = {
2023-05-10 17:48:21 +00:00
Id: IdSchema,
2023-05-02 17:31:17 +00: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 19:18:48 +00:00
NotificationStrict: packedNotificationStrictSchema,
2023-05-02 17:31:17 +00: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 08:42:47 +00:00
Ad: packedAdSchema,
Announcement: packedAnnouncementSchema,
2023-05-27 16:06:42 +00:00
Relay: packedRelaySchema,
2023-05-27 19:17:29 +00:00
Role: packedRoleSchema,
2023-05-27 16:42:44 +00:00
RoleAssign: packedRoleAssignSchema,
2023-05-27 19:17:29 +00:00
RolePolicy: packedRolePolicySchema,
RoleCondFormula: packedRoleCondFormulaSchema,
2023-05-29 13:28:31 +00:00
AbuseUserReport: packedAbuseUserReportSchema,
2023-05-27 16:42:44 +00:00
2023-05-22 05:20:19 +00:00
Error: Error,
ApiError: ApiError,
2023-05-10 16:55:36 +00:00
} as const satisfies { [x: string]: JSONSchema7Definition };
2023-05-02 17:31:17 +00:00
2023-05-21 12:54:39 +00:00
export type References = GetRefs<typeof refs>;
2023-05-02 17:31:17 +00:00
2023-05-25 16:53:29 +00: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 10:56:24 +00:00
export type Def<x extends GetKeys<References>> = GetDef<References, x>;