Compare commits
6 Commits
83d9920b9a
...
2668053119
Author | SHA1 | Date |
---|---|---|
かっこかり | 2668053119 | |
kakkokari-gtyih | a4e4799613 | |
kakkokari-gtyih | 576e0bc9db | |
kakkokari-gtyih | b328c15bea | |
kakkokari-gtyih | 96fe7784c3 | |
kakkokari-gtyih | 99e74cc53c |
|
@ -61,6 +61,7 @@
|
|||
- Fix: User Webhookテスト機能のMock Payloadを修正
|
||||
|
||||
### Misskey.js
|
||||
- Enhance: `/miauth/{sessionId}/check` の型を追加
|
||||
- Fix: Stream初期化時、別途WebSocketを指定する場合の型定義を修正
|
||||
|
||||
## 2024.10.1
|
||||
|
|
|
@ -1160,6 +1160,13 @@ export type Endpoints = Overwrite<Endpoints_2, {
|
|||
};
|
||||
};
|
||||
};
|
||||
'admin/roles/create': {
|
||||
req: Overwrite<AdminRolesCreateRequest, {
|
||||
policies: PartialRolePolicyOverride;
|
||||
}>;
|
||||
res: AdminRolesCreateResponse;
|
||||
};
|
||||
}> & {
|
||||
'signup': {
|
||||
req: SignupRequest;
|
||||
res: SignupResponse;
|
||||
|
@ -1188,13 +1195,11 @@ export type Endpoints = Overwrite<Endpoints_2, {
|
|||
};
|
||||
};
|
||||
};
|
||||
'admin/roles/create': {
|
||||
req: Overwrite<AdminRolesCreateRequest, {
|
||||
policies: PartialRolePolicyOverride;
|
||||
}>;
|
||||
res: AdminRolesCreateResponse;
|
||||
[ep: `miauth/${string}/check`]: {
|
||||
req: EmptyRequest;
|
||||
res: MiAuthCheckResponse;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
type EndpointsResponse = operations['endpoints']['responses']['200']['content']['application/json'];
|
||||
|
@ -1223,6 +1228,7 @@ declare namespace entities {
|
|||
SigninWithPasskeyRequest,
|
||||
SigninWithPasskeyInitResponse,
|
||||
SigninWithPasskeyResponse,
|
||||
MiAuthCheckResponse,
|
||||
PartialRolePolicyOverride,
|
||||
EmptyRequest,
|
||||
EmptyResponse,
|
||||
|
@ -2447,6 +2453,15 @@ type MetaRequest = operations['meta']['requestBody']['content']['application/jso
|
|||
// @public (undocumented)
|
||||
type MetaResponse = operations['meta']['responses']['200']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type MiAuthCheckResponse = {
|
||||
ok: true;
|
||||
token: string;
|
||||
user: UserDetailedNotMe;
|
||||
} | {
|
||||
ok: false;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
type MiauthGenTokenRequest = operations['miauth___gen-token']['requestBody']['content']['application/json'];
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Endpoints as Gen } from './autogen/endpoint.js';
|
||||
import { UserDetailed } from './autogen/models.js';
|
||||
import { AdminRolesCreateRequest, AdminRolesCreateResponse, UsersShowRequest } from './autogen/entities.js';
|
||||
import { AdminRolesCreateRequest, AdminRolesCreateResponse, UsersShowRequest, EmptyRequest } from './autogen/entities.js';
|
||||
import {
|
||||
PartialRolePolicyOverride,
|
||||
SigninFlowRequest,
|
||||
|
@ -12,6 +12,7 @@ import {
|
|||
SignupPendingResponse,
|
||||
SignupRequest,
|
||||
SignupResponse,
|
||||
MiAuthCheckResponse,
|
||||
} from './entities.js';
|
||||
|
||||
type Overwrite<T, U extends { [Key in keyof T]?: unknown }> = Omit<
|
||||
|
@ -57,6 +58,7 @@ export type SwitchCaseResponseType<E extends keyof Endpoints, P extends Endpoint
|
|||
export type Endpoints = Overwrite<
|
||||
Gen,
|
||||
{
|
||||
// ▼ api.jsonのオーバーライド ▼
|
||||
'users/show': {
|
||||
req: UsersShowRequest;
|
||||
res: {
|
||||
|
@ -70,40 +72,45 @@ export type Endpoints = Overwrite<
|
|||
};
|
||||
};
|
||||
},
|
||||
// api.jsonには載せないものなのでここで定義
|
||||
'signup': {
|
||||
req: SignupRequest;
|
||||
res: SignupResponse;
|
||||
},
|
||||
// api.jsonには載せないものなのでここで定義
|
||||
'signup-pending': {
|
||||
req: SignupPendingRequest;
|
||||
res: SignupPendingResponse;
|
||||
},
|
||||
// api.jsonには載せないものなのでここで定義
|
||||
'signin-flow': {
|
||||
req: SigninFlowRequest;
|
||||
res: SigninFlowResponse;
|
||||
},
|
||||
'signin-with-passkey': {
|
||||
req: SigninWithPasskeyRequest;
|
||||
res: {
|
||||
$switch: {
|
||||
$cases: [
|
||||
[
|
||||
{
|
||||
context: string;
|
||||
},
|
||||
SigninWithPasskeyResponse,
|
||||
],
|
||||
];
|
||||
$default: SigninWithPasskeyInitResponse;
|
||||
},
|
||||
},
|
||||
},
|
||||
'admin/roles/create': {
|
||||
req: Overwrite<AdminRolesCreateRequest, { policies: PartialRolePolicyOverride }>;
|
||||
res: AdminRolesCreateResponse;
|
||||
}
|
||||
},
|
||||
// ▲ api.jsonのオーバーライド ▲
|
||||
}
|
||||
>
|
||||
> & {
|
||||
// ▼ api.jsonに載らないもの ▼
|
||||
'signup': {
|
||||
req: SignupRequest;
|
||||
res: SignupResponse;
|
||||
},
|
||||
'signup-pending': {
|
||||
req: SignupPendingRequest;
|
||||
res: SignupPendingResponse;
|
||||
},
|
||||
'signin-flow': {
|
||||
req: SigninFlowRequest;
|
||||
res: SigninFlowResponse;
|
||||
},
|
||||
'signin-with-passkey': {
|
||||
req: SigninWithPasskeyRequest;
|
||||
res: {
|
||||
$switch: {
|
||||
$cases: [
|
||||
[
|
||||
{
|
||||
context: string;
|
||||
},
|
||||
SigninWithPasskeyResponse,
|
||||
],
|
||||
];
|
||||
$default: SigninWithPasskeyInitResponse;
|
||||
},
|
||||
},
|
||||
},
|
||||
[ep: `miauth/${string}/check`]: {
|
||||
req: EmptyRequest;
|
||||
res: MiAuthCheckResponse;
|
||||
},
|
||||
// ▲ api.jsonに載らないもの ▲
|
||||
};
|
||||
|
|
|
@ -311,6 +311,14 @@ export type SigninWithPasskeyResponse = {
|
|||
signinResponse: SigninFlowResponse & { finished: true };
|
||||
};
|
||||
|
||||
export type MiAuthCheckResponse = {
|
||||
ok: true;
|
||||
token: string;
|
||||
user: UserDetailedNotMe;
|
||||
} | {
|
||||
ok: false;
|
||||
};
|
||||
|
||||
type Values<T extends Record<PropertyKey, unknown>> = T[keyof T];
|
||||
|
||||
export type PartialRolePolicyOverride = Partial<{[k in keyof RolePolicies]: Omit<Values<Role['policies']>, 'value'> & { value: RolePolicies[k] }}>;
|
||||
|
|
Loading…
Reference in New Issue