mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 19:53:08 +02:00
serial
This commit is contained in:
parent
68a2aa3efd
commit
931cea75b6
4 changed files with 67 additions and 35 deletions
|
@ -1650,6 +1650,9 @@ export const endpoints = {
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
|
'admin/show-user': {
|
||||||
|
|
||||||
|
},
|
||||||
} as const satisfies { [x: string]: IEndpointMeta; };
|
} as const satisfies { [x: string]: IEndpointMeta; };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { Serialized } from "schema-type";
|
||||||
import { Packed } from "./schemas";
|
import { Packed } from "./schemas";
|
||||||
|
|
||||||
export type ID = Packed<'Id'>;
|
export type ID = Packed<'Id'>;
|
||||||
|
@ -6,21 +7,21 @@ export type DateString = string;
|
||||||
type TODO = Record<string, any>;
|
type TODO = Record<string, any>;
|
||||||
|
|
||||||
// NOTE: 極力この型を使うのは避け、UserLite か UserDetailed か明示するように
|
// NOTE: 極力この型を使うのは避け、UserLite か UserDetailed か明示するように
|
||||||
export type User = Packed<'User'>;
|
export type User = Serialized<Packed<'User'>>;
|
||||||
|
|
||||||
export type UserLite = Packed<'UserLite'>;
|
export type UserLite = Serialized<Packed<'UserLite'>>;
|
||||||
export type UserDetailed = Packed<'UserDetailed'>;
|
export type UserDetailed = Serialized<Packed<'UserDetailed'>>;
|
||||||
export type UserList = Packed<'UserList'>;
|
export type UserList = Serialized<Packed<'UserList'>>;
|
||||||
export type MeDetailed = Packed<'MeDetailed'>;
|
export type MeDetailed = Serialized<Packed<'MeDetailed'>>;
|
||||||
export type DriveFile = Packed<'DriveFile'>;
|
export type DriveFile = Serialized<Packed<'DriveFile'>>;
|
||||||
export type DriveFolder = Packed<'DriveFolder'>;
|
export type DriveFolder = Serialized<Packed<'DriveFolder'>>;
|
||||||
export type GalleryPost = Packed<'GalleryPost'>;
|
export type GalleryPost = Serialized<Packed<'GalleryPost'>>;
|
||||||
export type Note = Packed<'Note'>;
|
export type Note = Serialized<Packed<'Note'>>;
|
||||||
export type NoteReaction = Packed<'NoteReaction'>;
|
export type NoteReaction = Serialized<Packed<'NoteReaction'>>;
|
||||||
export type NoteFavorite = Packed<'NoteFavorite'>;
|
export type NoteFavorite = Serialized<Packed<'NoteFavorite'>>;
|
||||||
export type Notification = Packed<'NotificationStrict'>;
|
export type Notification = Serialized<Packed<'NotificationStrict'>>;
|
||||||
export type CustomEmoji = Packed<'EmojiSimple'> | Packed<'EmojiDetailed'>;
|
export type CustomEmoji = Serialized<Packed<'EmojiSimple'> | Packed<'EmojiDetailed'>>;
|
||||||
export type Page = Packed<'Page'>;
|
export type Page = Serialized<Packed<'Page'>>;
|
||||||
|
|
||||||
export type PageEvent = {
|
export type PageEvent = {
|
||||||
pageId: Page['id'];
|
pageId: Page['id'];
|
||||||
|
@ -30,19 +31,19 @@ export type PageEvent = {
|
||||||
user: User;
|
user: User;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Announcement = Packed<'Announcement'>;
|
export type Announcement = Serialized<Packed<'Announcement'>>;
|
||||||
export type Antenna = Packed<'Antenna'>;
|
export type Antenna = Serialized<Packed<'Antenna'>>;
|
||||||
export type App = Packed<'App'>;
|
export type App = Serialized<Packed<'App'>>;
|
||||||
export type Ad = Packed<'Ad'>;
|
export type Ad = Serialized<Packed<'Ad'>>;
|
||||||
export type Clip = Packed<'Clip'>;
|
export type Clip = Serialized<Packed<'Clip'>>;
|
||||||
export type Channel = Packed<'Channel'>;
|
export type Channel = Serialized<Packed<'Channel'>>;
|
||||||
export type Following = Packed<'Following'>;
|
export type Following = Serialized<Packed<'Following'>>;
|
||||||
export type Blocking = Packed<'Blocking'>;
|
export type Blocking = Serialized<Packed<'Blocking'>>;
|
||||||
export type Relay = Packed<'Relay'>;
|
export type Relay = Serialized<Packed<'Relay'>>;
|
||||||
export type Role = Packed<'Role'>;
|
export type Role = Serialized<Packed<'Role'>>;
|
||||||
export type RoleAssign = Packed<'RoleAssign'>;
|
export type RoleAssign = Serialized<Packed<'RoleAssign'>>;
|
||||||
export type RolePolicy = Packed<'RolePolicy'>;
|
export type RolePolicy = Serialized<Packed<'RolePolicy'>>;
|
||||||
export type RoleCondFormula = Packed<'RoleCondFormula'>;
|
export type RoleCondFormula = Serialized<Packed<'RoleCondFormula'>>;
|
||||||
|
|
||||||
export type LiteInstanceMetadata = {
|
export type LiteInstanceMetadata = {
|
||||||
maintainerName: string | null;
|
maintainerName: string | null;
|
||||||
|
@ -106,7 +107,7 @@ export type DetailedInstanceMetadata = LiteInstanceMetadata & {
|
||||||
|
|
||||||
export type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata;
|
export type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata;
|
||||||
|
|
||||||
export type ServerInfo = Packed<'ServerInfo'>;
|
export type ServerInfo = Selialized<Packed<'ServerInfo'>>;
|
||||||
|
|
||||||
export type Stats = {
|
export type Stats = {
|
||||||
notesCount: number;
|
notesCount: number;
|
||||||
|
@ -167,13 +168,7 @@ export type Instance = {
|
||||||
infoUpdatedAt: DateString | null;
|
infoUpdatedAt: DateString | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Signin = {
|
export type Signin = Serialized<Packed<'SignIn'>>;
|
||||||
id: ID;
|
|
||||||
createdAt: DateString;
|
|
||||||
ip: string;
|
|
||||||
headers: Record<string, any>;
|
|
||||||
success: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type UserSorting =
|
export type UserSorting =
|
||||||
| '+follower'
|
| '+follower'
|
||||||
|
|
|
@ -51,6 +51,9 @@ import {
|
||||||
ServerInfoSchema,
|
ServerInfoSchema,
|
||||||
ServerInfoAdminSchema,
|
ServerInfoAdminSchema,
|
||||||
} from './schemas/server-info.js';
|
} from './schemas/server-info.js';
|
||||||
|
import {
|
||||||
|
SignInSchema,
|
||||||
|
} from './schemas/sign-in.js';
|
||||||
import { packedModerationLogSchema } from './schemas/moderation-log.js';
|
import { packedModerationLogSchema } from './schemas/moderation-log.js';
|
||||||
import { Error, ApiError } from './schemas/error.js';
|
import { Error, ApiError } from './schemas/error.js';
|
||||||
import type { JSONSchema7, JSONSchema7Definition, GetDef, GetRefs, GetKeys, UnionToArray } from 'schema-type';
|
import type { JSONSchema7, JSONSchema7Definition, GetDef, GetRefs, GetKeys, UnionToArray } from 'schema-type';
|
||||||
|
@ -103,6 +106,7 @@ export const refs = {
|
||||||
ServerInfo: ServerInfoSchema,
|
ServerInfo: ServerInfoSchema,
|
||||||
ServerInfoAdmin: ServerInfoAdminSchema,
|
ServerInfoAdmin: ServerInfoAdminSchema,
|
||||||
ModerationLog: packedModerationLogSchema,
|
ModerationLog: packedModerationLogSchema,
|
||||||
|
SignIn: SignInSchema,
|
||||||
|
|
||||||
Error: Error,
|
Error: Error,
|
||||||
ApiError: ApiError,
|
ApiError: ApiError,
|
||||||
|
|
30
packages/misskey-js/src/schemas/sign-in.ts
Normal file
30
packages/misskey-js/src/schemas/sign-in.ts
Normal file
|
@ -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 a new issue