fix(misskey-js): /signupと/signinの定義を作成してフロントの型エラーを抑制する (#12846)
* fix(misskey-js): /signupと/signinの定義を復活してフロントの型エラーを抑制する * fix ci * fix ci * fix * fix --------- Co-authored-by: osamu <46447427+sam-osamu@users.noreply.github.com>
This commit is contained in:
parent
a9127e3ecd
commit
30311aca18
19 changed files with 170 additions and 53 deletions
|
@ -1034,6 +1034,18 @@ export type Endpoints = Overwrite<Endpoints_2, {
|
|||
};
|
||||
};
|
||||
};
|
||||
'signup': {
|
||||
req: SignupRequest;
|
||||
res: SignupResponse;
|
||||
};
|
||||
'signup-pending': {
|
||||
req: SignupPendingRequest;
|
||||
res: SignupPendingResponse;
|
||||
};
|
||||
'signin': {
|
||||
req: SigninRequest;
|
||||
res: SigninResponse;
|
||||
};
|
||||
}>;
|
||||
|
||||
// @public (undocumented)
|
||||
|
@ -1053,6 +1065,12 @@ declare namespace entities {
|
|||
EmojiUpdated,
|
||||
EmojiDeleted,
|
||||
AnnouncementCreated,
|
||||
SignupRequest,
|
||||
SignupResponse,
|
||||
SignupPendingRequest,
|
||||
SignupPendingResponse,
|
||||
SigninRequest,
|
||||
SigninResponse,
|
||||
EmptyRequest,
|
||||
EmptyResponse,
|
||||
AdminMetaResponse,
|
||||
|
@ -2615,6 +2633,47 @@ type ServerStatsLog = string[];
|
|||
// @public (undocumented)
|
||||
type Signin = components['schemas']['Signin'];
|
||||
|
||||
// @public (undocumented)
|
||||
type SigninRequest = {
|
||||
username: string;
|
||||
password: string;
|
||||
token?: string;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
type SigninResponse = {
|
||||
id: User['id'];
|
||||
i: string;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
type SignupPendingRequest = {
|
||||
code: string;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
type SignupPendingResponse = {
|
||||
id: User['id'];
|
||||
i: string;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
type SignupRequest = {
|
||||
username: string;
|
||||
password: string;
|
||||
host?: string;
|
||||
invitationCode?: string;
|
||||
emailAddress?: string;
|
||||
'hcaptcha-response'?: string | null;
|
||||
'g-recaptcha-response'?: string | null;
|
||||
'turnstile-response'?: string | null;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
type SignupResponse = MeDetailed & {
|
||||
token: string;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
type StatsResponse = operations['stats']['responses']['200']['content']['application/json'];
|
||||
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
import { Endpoints as Gen } from './autogen/endpoint';
|
||||
import { UserDetailed } from './autogen/models';
|
||||
import { UsersShowRequest } from './autogen/entities';
|
||||
import {
|
||||
SigninRequest,
|
||||
SigninResponse,
|
||||
SignupPendingRequest,
|
||||
SignupPendingResponse,
|
||||
SignupRequest,
|
||||
SignupResponse,
|
||||
} from './entities';
|
||||
|
||||
type Overwrite<T, U extends { [Key in keyof T]?: unknown }> = Omit<
|
||||
T,
|
||||
|
@ -55,6 +63,21 @@ export type Endpoints = Overwrite<
|
|||
$default: UserDetailed;
|
||||
};
|
||||
};
|
||||
}
|
||||
},
|
||||
// api.jsonには載せないものなのでここで定義
|
||||
'signup': {
|
||||
req: SignupRequest;
|
||||
res: SignupResponse;
|
||||
},
|
||||
// api.jsonには載せないものなのでここで定義
|
||||
'signup-pending': {
|
||||
req: SignupPendingRequest;
|
||||
res: SignupPendingResponse;
|
||||
},
|
||||
// api.jsonには載せないものなのでここで定義
|
||||
'signin': {
|
||||
req: SigninRequest;
|
||||
res: SigninResponse;
|
||||
},
|
||||
}
|
||||
>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { ModerationLogPayloads } from './consts.js';
|
||||
import { Announcement, EmojiDetailed, Page, User, UserDetailed } from './autogen/models';
|
||||
import { Announcement, EmojiDetailed, MeDetailed, MeDetailedOnly, Page, User, UserDetailed } from './autogen/models';
|
||||
|
||||
export * from './autogen/entities';
|
||||
export * from './autogen/models';
|
||||
|
@ -183,3 +183,38 @@ export type EmojiDeleted = {
|
|||
export type AnnouncementCreated = {
|
||||
announcement: Announcement;
|
||||
};
|
||||
|
||||
export type SignupRequest = {
|
||||
username: string;
|
||||
password: string;
|
||||
host?: string;
|
||||
invitationCode?: string;
|
||||
emailAddress?: string;
|
||||
'hcaptcha-response'?: string | null;
|
||||
'g-recaptcha-response'?: string | null;
|
||||
'turnstile-response'?: string | null;
|
||||
}
|
||||
|
||||
export type SignupResponse = MeDetailed & {
|
||||
token: string;
|
||||
}
|
||||
|
||||
export type SignupPendingRequest = {
|
||||
code: string;
|
||||
};
|
||||
|
||||
export type SignupPendingResponse = {
|
||||
id: User['id'],
|
||||
i: string,
|
||||
};
|
||||
|
||||
export type SigninRequest = {
|
||||
username: string;
|
||||
password: string;
|
||||
token?: string;
|
||||
};
|
||||
|
||||
export type SigninResponse = {
|
||||
id: User['id'],
|
||||
i: string,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue