serial
This commit is contained in:
parent
68a2aa3efd
commit
931cea75b6
|
@ -1650,6 +1650,9 @@ export const endpoints = {
|
|||
}
|
||||
}],
|
||||
},
|
||||
'admin/show-user': {
|
||||
|
||||
},
|
||||
} as const satisfies { [x: string]: IEndpointMeta; };
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { Serialized } from "schema-type";
|
||||
import { Packed } from "./schemas";
|
||||
|
||||
export type ID = Packed<'Id'>;
|
||||
|
@ -6,21 +7,21 @@ export type DateString = string;
|
|||
type TODO = Record<string, any>;
|
||||
|
||||
// NOTE: 極力この型を使うのは避け、UserLite か UserDetailed か明示するように
|
||||
export type User = Packed<'User'>;
|
||||
export type User = Serialized<Packed<'User'>>;
|
||||
|
||||
export type UserLite = Packed<'UserLite'>;
|
||||
export type UserDetailed = Packed<'UserDetailed'>;
|
||||
export type UserList = Packed<'UserList'>;
|
||||
export type MeDetailed = Packed<'MeDetailed'>;
|
||||
export type DriveFile = Packed<'DriveFile'>;
|
||||
export type DriveFolder = Packed<'DriveFolder'>;
|
||||
export type GalleryPost = Packed<'GalleryPost'>;
|
||||
export type Note = Packed<'Note'>;
|
||||
export type NoteReaction = Packed<'NoteReaction'>;
|
||||
export type NoteFavorite = Packed<'NoteFavorite'>;
|
||||
export type Notification = Packed<'NotificationStrict'>;
|
||||
export type CustomEmoji = Packed<'EmojiSimple'> | Packed<'EmojiDetailed'>;
|
||||
export type Page = Packed<'Page'>;
|
||||
export type UserLite = Serialized<Packed<'UserLite'>>;
|
||||
export type UserDetailed = Serialized<Packed<'UserDetailed'>>;
|
||||
export type UserList = Serialized<Packed<'UserList'>>;
|
||||
export type MeDetailed = Serialized<Packed<'MeDetailed'>>;
|
||||
export type DriveFile = Serialized<Packed<'DriveFile'>>;
|
||||
export type DriveFolder = Serialized<Packed<'DriveFolder'>>;
|
||||
export type GalleryPost = Serialized<Packed<'GalleryPost'>>;
|
||||
export type Note = Serialized<Packed<'Note'>>;
|
||||
export type NoteReaction = Serialized<Packed<'NoteReaction'>>;
|
||||
export type NoteFavorite = Serialized<Packed<'NoteFavorite'>>;
|
||||
export type Notification = Serialized<Packed<'NotificationStrict'>>;
|
||||
export type CustomEmoji = Serialized<Packed<'EmojiSimple'> | Packed<'EmojiDetailed'>>;
|
||||
export type Page = Serialized<Packed<'Page'>>;
|
||||
|
||||
export type PageEvent = {
|
||||
pageId: Page['id'];
|
||||
|
@ -30,19 +31,19 @@ export type PageEvent = {
|
|||
user: User;
|
||||
};
|
||||
|
||||
export type Announcement = Packed<'Announcement'>;
|
||||
export type Antenna = Packed<'Antenna'>;
|
||||
export type App = Packed<'App'>;
|
||||
export type Ad = Packed<'Ad'>;
|
||||
export type Clip = Packed<'Clip'>;
|
||||
export type Channel = Packed<'Channel'>;
|
||||
export type Following = Packed<'Following'>;
|
||||
export type Blocking = Packed<'Blocking'>;
|
||||
export type Relay = Packed<'Relay'>;
|
||||
export type Role = Packed<'Role'>;
|
||||
export type RoleAssign = Packed<'RoleAssign'>;
|
||||
export type RolePolicy = Packed<'RolePolicy'>;
|
||||
export type RoleCondFormula = Packed<'RoleCondFormula'>;
|
||||
export type Announcement = Serialized<Packed<'Announcement'>>;
|
||||
export type Antenna = Serialized<Packed<'Antenna'>>;
|
||||
export type App = Serialized<Packed<'App'>>;
|
||||
export type Ad = Serialized<Packed<'Ad'>>;
|
||||
export type Clip = Serialized<Packed<'Clip'>>;
|
||||
export type Channel = Serialized<Packed<'Channel'>>;
|
||||
export type Following = Serialized<Packed<'Following'>>;
|
||||
export type Blocking = Serialized<Packed<'Blocking'>>;
|
||||
export type Relay = Serialized<Packed<'Relay'>>;
|
||||
export type Role = Serialized<Packed<'Role'>>;
|
||||
export type RoleAssign = Serialized<Packed<'RoleAssign'>>;
|
||||
export type RolePolicy = Serialized<Packed<'RolePolicy'>>;
|
||||
export type RoleCondFormula = Serialized<Packed<'RoleCondFormula'>>;
|
||||
|
||||
export type LiteInstanceMetadata = {
|
||||
maintainerName: string | null;
|
||||
|
@ -106,7 +107,7 @@ export type DetailedInstanceMetadata = LiteInstanceMetadata & {
|
|||
|
||||
export type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata;
|
||||
|
||||
export type ServerInfo = Packed<'ServerInfo'>;
|
||||
export type ServerInfo = Selialized<Packed<'ServerInfo'>>;
|
||||
|
||||
export type Stats = {
|
||||
notesCount: number;
|
||||
|
@ -167,13 +168,7 @@ export type Instance = {
|
|||
infoUpdatedAt: DateString | null;
|
||||
};
|
||||
|
||||
export type Signin = {
|
||||
id: ID;
|
||||
createdAt: DateString;
|
||||
ip: string;
|
||||
headers: Record<string, any>;
|
||||
success: boolean;
|
||||
};
|
||||
export type Signin = Serialized<Packed<'SignIn'>>;
|
||||
|
||||
export type UserSorting =
|
||||
| '+follower'
|
||||
|
|
|
@ -51,6 +51,9 @@ import {
|
|||
ServerInfoSchema,
|
||||
ServerInfoAdminSchema,
|
||||
} from './schemas/server-info.js';
|
||||
import {
|
||||
SignInSchema,
|
||||
} from './schemas/sign-in.js';
|
||||
import { packedModerationLogSchema } from './schemas/moderation-log.js';
|
||||
import { Error, ApiError } from './schemas/error.js';
|
||||
import type { JSONSchema7, JSONSchema7Definition, GetDef, GetRefs, GetKeys, UnionToArray } from 'schema-type';
|
||||
|
@ -103,6 +106,7 @@ export const refs = {
|
|||
ServerInfo: ServerInfoSchema,
|
||||
ServerInfoAdmin: ServerInfoAdminSchema,
|
||||
ModerationLog: packedModerationLogSchema,
|
||||
SignIn: SignInSchema,
|
||||
|
||||
Error: Error,
|
||||
ApiError: ApiError,
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
import type { JSONSchema7Definition } from 'schema-type';
|
||||
|
||||
export const SignInSchema = {
|
||||
$id: 'https://misskey-hub.net/api/schemas/SignIn',
|
||||
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
|
||||
createdAt: {
|
||||
type: 'string',
|
||||
format: 'date-time',
|
||||
},
|
||||
ip: {
|
||||
type: 'string',
|
||||
},
|
||||
headers: {
|
||||
type: 'object',
|
||||
},
|
||||
success: {
|
||||
type: 'boolean',
|
||||
},
|
||||
},
|
||||
required: [
|
||||
'id',
|
||||
'createdAt',
|
||||
'ip',
|
||||
'headers',
|
||||
'success',
|
||||
],
|
||||
} as const satisfies JSONSchema7Definition;
|
Loading…
Reference in New Issue