Ensure enum schema and Make "as const" put once

This commit is contained in:
tamaina
2022-01-14 19:55:09 +09:00
parent 59a5d00d6b
commit 37bae7b929
25 changed files with 716 additions and 713 deletions

View File

@@ -50,18 +50,18 @@ export const refs = {
export type Packed<x extends keyof typeof refs> = ObjType<(typeof refs[x])['properties']>; export type Packed<x extends keyof typeof refs> = ObjType<(typeof refs[x])['properties']>;
export interface Schema { export type Schema = {
type: 'boolean' | 'number' | 'string' | 'array' | 'object' | 'any'; readonly type: 'boolean' | 'number' | 'string' | 'array' | 'object' | 'any';
nullable: boolean; readonly nullable: boolean;
optional: boolean; readonly optional: boolean;
items?: Schema; readonly items?: Schema;
properties?: Obj; readonly properties?: Obj;
description?: string; readonly description?: string;
example?: any; readonly example?: any;
format?: string; readonly format?: string;
ref?: keyof typeof refs; readonly ref?: keyof typeof refs;
enum?: string[]; readonly enum?: ReadonlyArray<string>;
default?: boolean | null; readonly default?: boolean | null;
} }
type NonUndefinedPropertyNames<T extends Obj> = { type NonUndefinedPropertyNames<T extends Obj> = {
@@ -98,7 +98,10 @@ type NullOrUndefined<p extends Schema, T> =
export type SchemaType<p extends Schema> = export type SchemaType<p extends Schema> =
p['type'] extends 'number' ? NullOrUndefined<p, number> : p['type'] extends 'number' ? NullOrUndefined<p, number> :
p['type'] extends 'string' ? NullOrUndefined<p, string> : p['type'] extends 'string' ?
p['enum'] extends ReadonlyArray<string> ?
NullOrUndefined<p, p['enum'][number]> :
NullOrUndefined<p, string> :
p['type'] extends 'boolean' ? NullOrUndefined<p, boolean> : p['type'] extends 'boolean' ? NullOrUndefined<p, boolean> :
p['type'] extends 'array' ? NullOrUndefined<p, MyType<NonNullable<p['items']>>[]> : p['type'] extends 'array' ? NullOrUndefined<p, MyType<NonNullable<p['items']>>[]> :
p['type'] extends 'object' ? ( p['type'] extends 'object' ? (

View File

@@ -19,7 +19,7 @@ export class AntennaRepository extends Repository<Antenna> {
name: antenna.name, name: antenna.name,
keywords: antenna.keywords, keywords: antenna.keywords,
excludeKeywords: antenna.excludeKeywords, excludeKeywords: antenna.excludeKeywords,
src: antenna.src, src: antenna.src as Packed<'Antenna'>['src'],
userListId: antenna.userListId, userListId: antenna.userListId,
userGroupId: userGroupJoining ? userGroupJoining.userGroupId : null, userGroupId: userGroupJoining ? userGroupJoining.userGroupId : null,
users: antenna.users, users: antenna.users,
@@ -28,6 +28,6 @@ export class AntennaRepository extends Repository<Antenna> {
withReplies: antenna.withReplies, withReplies: antenna.withReplies,
withFile: antenna.withFile, withFile: antenna.withFile,
hasUnreadNote, hasUnreadNote,
}; } as Packed<'Antenna'>;
} }
} }

View File

@@ -1,90 +1,90 @@
export const packedAntennaSchema = { export const packedAntennaSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
name: { name: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
keywords: { keywords: {
type: 'array' as const, type: 'array',
optional: false as const, nullable: false as const, optional: false, nullable: false,
items: { items: {
type: 'array' as const, type: 'array',
optional: false as const, nullable: false as const, optional: false, nullable: false,
items: { items: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
}, },
}, },
excludeKeywords: { excludeKeywords: {
type: 'array' as const, type: 'array',
optional: false as const, nullable: false as const, optional: false, nullable: false,
items: { items: {
type: 'array' as const, type: 'array',
optional: false as const, nullable: false as const, optional: false, nullable: false,
items: { items: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
}, },
}, },
src: { src: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
enum: ['home', 'all', 'users', 'list', 'group'], enum: ['home', 'all', 'users', 'list', 'group'],
}, },
userListId: { userListId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
format: 'id', format: 'id',
}, },
userGroupId: { userGroupId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
format: 'id', format: 'id',
}, },
users: { users: {
type: 'array' as const, type: 'array',
optional: false as const, nullable: false as const, optional: false, nullable: false,
items: { items: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
}, },
caseSensitive: { caseSensitive: {
type: 'boolean' as const, type: 'boolean',
optional: false as const, nullable: false as const, optional: false, nullable: false,
default: false, default: false,
}, },
notify: { notify: {
type: 'boolean' as const, type: 'boolean',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
withReplies: { withReplies: {
type: 'boolean' as const, type: 'boolean',
optional: false as const, nullable: false as const, optional: false, nullable: false,
default: false, default: false,
}, },
withFile: { withFile: {
type: 'boolean' as const, type: 'boolean',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
hasUnreadNote: { hasUnreadNote: {
type: 'boolean' as const, type: 'boolean',
optional: false as const, nullable: false as const, optional: false, nullable: false,
default: false, default: false,
}, },
}, },
}; } as const;

View File

@@ -1,34 +1,34 @@
export const packedAppSchema = { export const packedAppSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
name: { name: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
callbackUrl: { callbackUrl: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
permission: { permission: {
type: 'array' as const, type: 'array',
optional: false as const, nullable: false as const, optional: false, nullable: false,
items: { items: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
}, },
secret: { secret: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
isAuthorized: { isAuthorized: {
type: 'boolean' as const, type: 'boolean',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
}, },
}; } as const;

View File

@@ -1,27 +1,27 @@
export const packedBlockingSchema = { export const packedBlockingSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
blockeeId: { blockeeId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
blockee: { blockee: {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
ref: 'User' as const, ref: 'User',
}, },
}, },
}; } as const;

View File

@@ -1,52 +1,52 @@
export const packedChannelSchema = { export const packedChannelSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
lastNotedAt: { lastNotedAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
format: 'date-time', format: 'date-time',
}, },
name: { name: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
description: { description: {
type: 'string' as const, type: 'string',
nullable: true as const, optional: false as const, nullable: true, optional: false,
}, },
bannerUrl: { bannerUrl: {
type: 'string' as const, type: 'string',
format: 'url', format: 'url',
nullable: true as const, optional: false as const, nullable: true, optional: false,
}, },
notesCount: { notesCount: {
type: 'number' as const, type: 'number',
nullable: false as const, optional: false as const, nullable: false, optional: false,
}, },
usersCount: { usersCount: {
type: 'number' as const, type: 'number',
nullable: false as const, optional: false as const, nullable: false, optional: false,
}, },
isFollowing: { isFollowing: {
type: 'boolean' as const, type: 'boolean',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
userId: { userId: {
type: 'string' as const, type: 'string',
nullable: true as const, optional: false as const, nullable: true, optional: false,
format: 'id', format: 'id',
}, },
}, },
}; } as const;

View File

@@ -1,39 +1,39 @@
export const packedClipSchema = { export const packedClipSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
userId: { userId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
user: { user: {
type: 'object' as const, type: 'object',
ref: 'User' as const, ref: 'User',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
name: { name: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
description: { description: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
isPublic: { isPublic: {
type: 'boolean' as const, type: 'boolean',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
}, },
}; } as const;

View File

@@ -1,108 +1,108 @@
export const packedDriveFileSchema = { export const packedDriveFileSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
name: { name: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
example: 'lenna.jpg', example: 'lenna.jpg',
}, },
type: { type: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
example: 'image/jpeg', example: 'image/jpeg',
}, },
md5: { md5: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'md5', format: 'md5',
example: '15eca7fba0480996e2245f5185bf39f2', example: '15eca7fba0480996e2245f5185bf39f2',
}, },
size: { size: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
example: 51469, example: 51469,
}, },
isSensitive: { isSensitive: {
type: 'boolean' as const, type: 'boolean',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
blurhash: { blurhash: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
properties: { properties: {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
width: { width: {
type: 'number' as const, type: 'number',
optional: true as const, nullable: false as const, optional: true, nullable: false,
example: 1280, example: 1280,
}, },
height: { height: {
type: 'number' as const, type: 'number',
optional: true as const, nullable: false as const, optional: true, nullable: false,
example: 720, example: 720,
}, },
orientation: { orientation: {
type: 'number' as const, type: 'number',
optional: true as const, nullable: false as const, optional: true, nullable: false,
example: 8, example: 8,
}, },
avgColor: { avgColor: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: false as const, optional: true, nullable: false,
example: 'rgb(40,65,87)', example: 'rgb(40,65,87)',
}, },
}, },
}, },
url: { url: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
format: 'url', format: 'url',
}, },
thumbnailUrl: { thumbnailUrl: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
format: 'url', format: 'url',
}, },
comment: { comment: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
folderId: { folderId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
folder: { folder: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: true as const, optional: true, nullable: true,
ref: 'DriveFolder' as const, ref: 'DriveFolder',
}, },
userId: { userId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
user: { user: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: true as const, optional: true, nullable: true,
ref: 'User' as const, ref: 'User',
}, },
}, },
}; } as const;

View File

@@ -1,40 +1,40 @@
export const packedDriveFolderSchema = { export const packedDriveFolderSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
name: { name: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
foldersCount: { foldersCount: {
type: 'number' as const, type: 'number',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
filesCount: { filesCount: {
type: 'number' as const, type: 'number',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
parentId: { parentId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
parent: { parent: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: true as const, optional: true, nullable: true,
ref: 'DriveFolder' as const, ref: 'DriveFolder',
}, },
}, },
}; } as const;

View File

@@ -1,37 +1,37 @@
export const packedEmojiSchema = { export const packedEmojiSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
aliases: { aliases: {
type: 'array' as const, type: 'array',
optional: false as const, nullable: false as const, optional: false, nullable: false,
items: { items: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
}, },
name: { name: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
category: { category: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
host: { host: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
url: { url: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
}, },
}; } as const;

View File

@@ -1,106 +1,106 @@
import config from "@/config"; import config from "@/config";
export const packedFederationInstanceSchema = { export const packedFederationInstanceSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
caughtAt: { caughtAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
host: { host: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
example: 'misskey.example.com', example: 'misskey.example.com',
}, },
usersCount: { usersCount: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
notesCount: { notesCount: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
followingCount: { followingCount: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
followersCount: { followersCount: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
driveUsage: { driveUsage: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
driveFiles: { driveFiles: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
latestRequestSentAt: { latestRequestSentAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
format: 'date-time', format: 'date-time',
}, },
lastCommunicatedAt: { lastCommunicatedAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
isNotResponding: { isNotResponding: {
type: 'boolean' as const, type: 'boolean',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
isSuspended: { isSuspended: {
type: 'boolean' as const, type: 'boolean',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
softwareName: { softwareName: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
example: 'misskey', example: 'misskey',
}, },
softwareVersion: { softwareVersion: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
example: config.version, example: config.version,
}, },
openRegistrations: { openRegistrations: {
type: 'boolean' as const, type: 'boolean',
optional: false as const, nullable: true as const, optional: false, nullable: true,
example: true, example: true,
}, },
name: { name: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
description: { description: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
maintainerName: { maintainerName: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
maintainerEmail: { maintainerEmail: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
iconUrl: { iconUrl: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
format: 'url', format: 'url',
}, },
infoUpdatedAt: { infoUpdatedAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
format: 'date-time', format: 'date-time',
}, },
}, },
}; } as const;

View File

@@ -1,37 +1,37 @@
export const packedFollowingSchema = { export const packedFollowingSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
followeeId: { followeeId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
followee: { followee: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: false as const, optional: true, nullable: false,
ref: 'User' as const, ref: 'User',
}, },
followerId: { followerId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
follower: { follower: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: false as const, optional: true, nullable: false,
ref: 'User' as const, ref: 'User',
}, },
}, },
}; } as const;

View File

@@ -1,70 +1,70 @@
export const packedGalleryPostSchema = { export const packedGalleryPostSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
updatedAt: { updatedAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
title: { title: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
description: { description: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
userId: { userId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
user: { user: {
type: 'object' as const, type: 'object',
ref: 'User' as const, ref: 'User',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
fileIds: { fileIds: {
type: 'array' as const, type: 'array',
optional: true as const, nullable: false as const, optional: true, nullable: false,
items: { items: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
}, },
files: { files: {
type: 'array' as const, type: 'array',
optional: true as const, nullable: false as const, optional: true, nullable: false,
items: { items: {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
ref: 'DriveFile' as const, ref: 'DriveFile',
}, },
}, },
tags: { tags: {
type: 'array' as const, type: 'array',
optional: true as const, nullable: false as const, optional: true, nullable: false,
items: { items: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
}, },
isSensitive: { isSensitive: {
type: 'boolean' as const, type: 'boolean',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
}, },
}; } as const;

View File

@@ -1,35 +1,35 @@
export const packedHashtagSchema = { export const packedHashtagSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
tag: { tag: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
example: 'misskey', example: 'misskey',
}, },
mentionedUsersCount: { mentionedUsersCount: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
mentionedLocalUsersCount: { mentionedLocalUsersCount: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
mentionedRemoteUsersCount: { mentionedRemoteUsersCount: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
attachedUsersCount: { attachedUsersCount: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
attachedLocalUsersCount: { attachedLocalUsersCount: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
attachedRemoteUsersCount: { attachedRemoteUsersCount: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
}, },
}; } as const;

View File

@@ -1,74 +1,74 @@
export const packedMessagingMessageSchema = { export const packedMessagingMessageSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
userId: { userId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
user: { user: {
type: 'object' as const, type: 'object',
ref: 'User' as const, ref: 'User',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
text: { text: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
fileId: { fileId: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: true as const, optional: true, nullable: true,
format: 'id', format: 'id',
}, },
file: { file: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: true as const, optional: true, nullable: true,
ref: 'DriveFile' as const, ref: 'DriveFile',
}, },
recipientId: { recipientId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
format: 'id', format: 'id',
}, },
recipient: { recipient: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: true as const, optional: true, nullable: true,
ref: 'User' as const, ref: 'User',
}, },
groupId: { groupId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
format: 'id', format: 'id',
}, },
group: { group: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: true as const, optional: true, nullable: true,
ref: 'UserGroup' as const, ref: 'UserGroup',
}, },
isRead: { isRead: {
type: 'boolean' as const, type: 'boolean',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
reads: { reads: {
type: 'array' as const, type: 'array',
optional: true as const, nullable: false as const, optional: true, nullable: false,
items: { items: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
}, },
}, },
}; } as const;

View File

@@ -1,27 +1,27 @@
export const packedMutingSchema = { export const packedMutingSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
muteeId: { muteeId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
mutee: { mutee: {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
ref: 'User' as const, ref: 'User',
}, },
}, },
}; } as const;

View File

@@ -1,27 +1,27 @@
export const packedNoteFavoriteSchema = { export const packedNoteFavoriteSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
note: { note: {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
ref: 'Note' as const, ref: 'Note',
}, },
noteId: { noteId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
}, },
}; } as const;

View File

@@ -1,26 +1,26 @@
export const packedNoteReactionSchema = { export const packedNoteReactionSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
user: { user: {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
ref: 'User' as const, ref: 'User',
}, },
type: { type: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
}, },
}; } as const;

View File

@@ -1,184 +1,184 @@
export const packedNoteSchema = { export const packedNoteSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
text: { text: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
cw: { cw: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: true as const, optional: true, nullable: true,
}, },
userId: { userId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
user: { user: {
type: 'object' as const, type: 'object',
ref: 'User' as const, ref: 'User',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
replyId: { replyId: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: true as const, optional: true, nullable: true,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
renoteId: { renoteId: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: true as const, optional: true, nullable: true,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
reply: { reply: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: true as const, optional: true, nullable: true,
ref: 'Note' as const, ref: 'Note',
}, },
renote: { renote: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: true as const, optional: true, nullable: true,
ref: 'Note' as const, ref: 'Note',
}, },
isHidden: { isHidden: {
type: 'boolean' as const, type: 'boolean',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
visibility: { visibility: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
mentions: { mentions: {
type: 'array' as const, type: 'array',
optional: true as const, nullable: false as const, optional: true, nullable: false,
items: { items: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
}, },
visibleUserIds: { visibleUserIds: {
type: 'array' as const, type: 'array',
optional: true as const, nullable: false as const, optional: true, nullable: false,
items: { items: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
}, },
fileIds: { fileIds: {
type: 'array' as const, type: 'array',
optional: true as const, nullable: false as const, optional: true, nullable: false,
items: { items: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
}, },
files: { files: {
type: 'array' as const, type: 'array',
optional: true as const, nullable: false as const, optional: true, nullable: false,
items: { items: {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
ref: 'DriveFile' as const, ref: 'DriveFile',
}, },
}, },
tags: { tags: {
type: 'array' as const, type: 'array',
optional: true as const, nullable: false as const, optional: true, nullable: false,
items: { items: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
}, },
poll: { poll: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: true as const, optional: true, nullable: true,
}, },
channelId: { channelId: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: true as const, optional: true, nullable: true,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
channel: { channel: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: true as const, optional: true, nullable: true,
items: { items: {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
name: { name: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
}, },
}, },
}, },
localOnly: { localOnly: {
type: 'boolean' as const, type: 'boolean',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
emojis: { emojis: {
type: 'array' as const, type: 'array',
optional: false as const, nullable: false as const, optional: false, nullable: false,
items: { items: {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
name: { name: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
url: { url: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
}, },
}, },
}, },
reactions: { reactions: {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
renoteCount: { renoteCount: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
repliesCount: { repliesCount: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
uri: { uri: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
url: { url: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
myReaction: { myReaction: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: true as const, optional: true, nullable: true,
}, },
}, },
}; } as const;

View File

@@ -1,67 +1,67 @@
import { notificationTypes } from "@/types"; import { notificationTypes } from "@/types";
export const packedNotificationSchema = { export const packedNotificationSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
isRead: { isRead: {
type: 'boolean' as const, type: 'boolean',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
type: { type: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
enum: [...notificationTypes], enum: [...notificationTypes],
}, },
user: { user: {
type: 'object' as const, type: 'object',
ref: 'User' as const, ref: 'User',
optional: true as const, nullable: true as const, optional: true, nullable: true,
}, },
userId: { userId: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: true as const, optional: true, nullable: true,
format: 'id', format: 'id',
}, },
note: { note: {
type: 'object' as const, type: 'object',
ref: 'Note' as const, ref: 'Note',
optional: true as const, nullable: true as const, optional: true, nullable: true,
}, },
reaction: { reaction: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: true as const, optional: true, nullable: true,
}, },
choice: { choice: {
type: 'number' as const, type: 'number',
optional: true as const, nullable: true as const, optional: true, nullable: true,
}, },
invitation: { invitation: {
type: 'object' as const, type: 'object',
optional: true as const, nullable: true as const, optional: true, nullable: true,
}, },
body: { body: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: true as const, optional: true, nullable: true,
}, },
header: { header: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: true as const, optional: true, nullable: true,
}, },
icon: { icon: {
type: 'string' as const, type: 'string',
optional: true as const, nullable: true as const, optional: true, nullable: true,
}, },
}, },
}; } as const;

View File

@@ -1,52 +1,52 @@
export const packedPageSchema = { export const packedPageSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
updatedAt: { updatedAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
title: { title: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
name: { name: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
summary: { summary: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: true as const, optional: false, nullable: true,
}, },
content: { content: {
type: 'array' as const, type: 'array',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
variables: { variables: {
type: 'array' as const, type: 'array',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
userId: { userId: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
}, },
user: { user: {
type: 'object' as const, type: 'object',
ref: 'User' as const, ref: 'User',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
}, },
}; } as const;

View File

@@ -1,26 +1,26 @@
export const packedQueueCountSchema = { export const packedQueueCountSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
waiting: { waiting: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
active: { active: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
completed: { completed: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
failed: { failed: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
delayed: { delayed: {
type: 'number' as const, type: 'number',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
}, },
}; } as const;

View File

@@ -1,35 +1,35 @@
export const packedUserGroupSchema = { export const packedUserGroupSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
name: { name: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
ownerId: { ownerId: {
type: 'string' as const, type: 'string',
nullable: false as const, optional: false as const, nullable: false, optional: false,
format: 'id', format: 'id',
}, },
userIds: { userIds: {
type: 'array' as const, type: 'array',
nullable: false as const, optional: true as const, nullable: false, optional: true,
items: { items: {
type: 'string' as const, type: 'string',
nullable: false as const, optional: false as const, nullable: false, optional: false,
format: 'id', format: 'id',
}, },
}, },
}, },
}; } as const;

View File

@@ -1,30 +1,30 @@
export const packedUserListSchema = { export const packedUserListSchema = {
type: 'object' as const, type: 'object',
optional: false as const, nullable: false as const, optional: false, nullable: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
name: { name: {
type: 'string' as const, type: 'string',
optional: false as const, nullable: false as const, optional: false, nullable: false,
}, },
userIds: { userIds: {
type: 'array' as const, type: 'array',
nullable: false as const, optional: true as const, nullable: false, optional: true,
items: { items: {
type: 'string' as const, type: 'string',
nullable: false as const, optional: false as const, nullable: false, optional: false,
format: 'id', format: 'id',
}, },
}, },
}, },
}; } as const;

View File

@@ -1,309 +1,309 @@
export const packedUserSchema = { export const packedUserSchema = {
type: 'object' as const, type: 'object',
nullable: false as const, optional: false as const, nullable: false, optional: false,
properties: { properties: {
id: { id: {
type: 'string' as const, type: 'string',
nullable: false as const, optional: false as const, nullable: false, optional: false,
format: 'id', format: 'id',
example: 'xxxxxxxxxx', example: 'xxxxxxxxxx',
}, },
name: { name: {
type: 'string' as const, type: 'string',
nullable: true as const, optional: false as const, nullable: true, optional: false,
example: '藍', example: '藍',
}, },
username: { username: {
type: 'string' as const, type: 'string',
nullable: false as const, optional: false as const, nullable: false, optional: false,
example: 'ai', example: 'ai',
}, },
host: { host: {
type: 'string' as const, type: 'string',
nullable: true as const, optional: false as const, nullable: true, optional: false,
example: 'misskey.example.com', example: 'misskey.example.com',
}, },
avatarUrl: { avatarUrl: {
type: 'string' as const, type: 'string',
format: 'url', format: 'url',
nullable: true as const, optional: false as const, nullable: true, optional: false,
}, },
avatarBlurhash: { avatarBlurhash: {
type: 'any' as const, type: 'any',
nullable: true as const, optional: false as const, nullable: true, optional: false,
}, },
avatarColor: { avatarColor: {
type: 'any' as const, type: 'any',
nullable: true as const, optional: false as const, nullable: true, optional: false,
default: null, default: null,
}, },
isAdmin: { isAdmin: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
default: false, default: false,
}, },
isModerator: { isModerator: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
default: false, default: false,
}, },
isBot: { isBot: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
isCat: { isCat: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
emojis: { emojis: {
type: 'array' as const, type: 'array',
nullable: false as const, optional: false as const, nullable: false, optional: false,
items: { items: {
type: 'object' as const, type: 'object',
nullable: false as const, optional: false as const, nullable: false, optional: false,
properties: { properties: {
name: { name: {
type: 'string' as const, type: 'string',
nullable: false as const, optional: false as const, nullable: false, optional: false,
}, },
url: { url: {
type: 'string' as const, type: 'string',
nullable: false as const, optional: false as const, nullable: false, optional: false,
format: 'url', format: 'url',
}, },
}, },
}, },
}, },
url: { url: {
type: 'string' as const, type: 'string',
format: 'url', format: 'url',
nullable: true as const, optional: true as const, nullable: true, optional: true,
}, },
createdAt: { createdAt: {
type: 'string' as const, type: 'string',
nullable: false as const, optional: true as const, nullable: false, optional: true,
format: 'date-time', format: 'date-time',
}, },
updatedAt: { updatedAt: {
type: 'string' as const, type: 'string',
nullable: true as const, optional: true as const, nullable: true, optional: true,
format: 'date-time', format: 'date-time',
}, },
bannerUrl: { bannerUrl: {
type: 'string' as const, type: 'string',
format: 'url', format: 'url',
nullable: true as const, optional: true as const, nullable: true, optional: true,
}, },
bannerBlurhash: { bannerBlurhash: {
type: 'any' as const, type: 'any',
nullable: true as const, optional: true as const, nullable: true, optional: true,
}, },
bannerColor: { bannerColor: {
type: 'any' as const, type: 'any',
nullable: true as const, optional: true as const, nullable: true, optional: true,
default: null, default: null,
}, },
isLocked: { isLocked: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
isSuspended: { isSuspended: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
example: false, example: false,
}, },
description: { description: {
type: 'string' as const, type: 'string',
nullable: true as const, optional: true as const, nullable: true, optional: true,
example: 'Hi masters, I am Ai!', example: 'Hi masters, I am Ai!',
}, },
location: { location: {
type: 'string' as const, type: 'string',
nullable: true as const, optional: true as const, nullable: true, optional: true,
}, },
birthday: { birthday: {
type: 'string' as const, type: 'string',
nullable: true as const, optional: true as const, nullable: true, optional: true,
example: '2018-03-12', example: '2018-03-12',
}, },
fields: { fields: {
type: 'array' as const, type: 'array',
nullable: false as const, optional: true as const, nullable: false, optional: true,
items: { items: {
type: 'object' as const, type: 'object',
nullable: false as const, optional: false as const, nullable: false, optional: false,
properties: { properties: {
name: { name: {
type: 'string' as const, type: 'string',
nullable: false as const, optional: false as const, nullable: false, optional: false,
}, },
value: { value: {
type: 'string' as const, type: 'string',
nullable: false as const, optional: false as const, nullable: false, optional: false,
}, },
}, },
maxLength: 4, maxLength: 4,
}, },
}, },
followersCount: { followersCount: {
type: 'number' as const, type: 'number',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
followingCount: { followingCount: {
type: 'number' as const, type: 'number',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
notesCount: { notesCount: {
type: 'number' as const, type: 'number',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
pinnedNoteIds: { pinnedNoteIds: {
type: 'array' as const, type: 'array',
nullable: false as const, optional: true as const, nullable: false, optional: true,
items: { items: {
type: 'string' as const, type: 'string',
nullable: false as const, optional: false as const, nullable: false, optional: false,
format: 'id', format: 'id',
}, },
}, },
pinnedNotes: { pinnedNotes: {
type: 'array' as const, type: 'array',
nullable: false as const, optional: true as const, nullable: false, optional: true,
items: { items: {
type: 'object' as const, type: 'object',
nullable: false as const, optional: false as const, nullable: false, optional: false,
ref: 'Note' as const, ref: 'Note',
}, },
}, },
pinnedPageId: { pinnedPageId: {
type: 'string' as const, type: 'string',
nullable: true as const, optional: true as const, nullable: true, optional: true,
}, },
pinnedPage: { pinnedPage: {
type: 'object' as const, type: 'object',
nullable: true as const, optional: true as const, nullable: true, optional: true,
ref: 'Page' as const, ref: 'Page',
}, },
twoFactorEnabled: { twoFactorEnabled: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
default: false, default: false,
}, },
usePasswordLessLogin: { usePasswordLessLogin: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
default: false, default: false,
}, },
securityKeys: { securityKeys: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
default: false, default: false,
}, },
avatarId: { avatarId: {
type: 'string' as const, type: 'string',
nullable: true as const, optional: true as const, nullable: true, optional: true,
format: 'id', format: 'id',
}, },
bannerId: { bannerId: {
type: 'string' as const, type: 'string',
nullable: true as const, optional: true as const, nullable: true, optional: true,
format: 'id', format: 'id',
}, },
autoWatch: { autoWatch: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
injectFeaturedNote: { injectFeaturedNote: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
alwaysMarkNsfw: { alwaysMarkNsfw: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
carefulBot: { carefulBot: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
autoAcceptFollowed: { autoAcceptFollowed: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
hasUnreadSpecifiedNotes: { hasUnreadSpecifiedNotes: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
hasUnreadMentions: { hasUnreadMentions: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
hasUnreadAnnouncement: { hasUnreadAnnouncement: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
hasUnreadAntenna: { hasUnreadAntenna: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
hasUnreadChannel: { hasUnreadChannel: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
hasUnreadMessagingMessage: { hasUnreadMessagingMessage: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
hasUnreadNotification: { hasUnreadNotification: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
hasPendingReceivedFollowRequest: { hasPendingReceivedFollowRequest: {
type: 'boolean' as const, type: 'boolean',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
integrations: { integrations: {
type: 'object' as const, type: 'object',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
mutedWords: { mutedWords: {
type: 'array' as const, type: 'array',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
mutedInstances: { mutedInstances: {
type: 'array' as const, type: 'array',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
mutingNotificationTypes: { mutingNotificationTypes: {
type: 'array' as const, type: 'array',
nullable: false as const, optional: true as const, nullable: false, optional: true,
}, },
isFollowing: { isFollowing: {
type: 'boolean' as const, type: 'boolean',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
hasPendingFollowRequestFromYou: { hasPendingFollowRequestFromYou: {
type: 'boolean' as const, type: 'boolean',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
hasPendingFollowRequestToYou: { hasPendingFollowRequestToYou: {
type: 'boolean' as const, type: 'boolean',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
isFollowed: { isFollowed: {
type: 'boolean' as const, type: 'boolean',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
isBlocking: { isBlocking: {
type: 'boolean' as const, type: 'boolean',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
isBlocked: { isBlocked: {
type: 'boolean' as const, type: 'boolean',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
isMuted: { isMuted: {
type: 'boolean' as const, type: 'boolean',
optional: true as const, nullable: false as const, optional: true, nullable: false,
}, },
}, },
}; } as const;