From 99e74cc53c8c93a4b94cd2871a07cca6f46dcf41 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sun, 3 Nov 2024 16:21:55 +0900 Subject: [PATCH] =?UTF-8?q?fix(misskey-js):=20miauth=20check=E3=81=AE?= =?UTF-8?q?=E5=9E=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/misskey-js/etc/misskey-js.api.md | 14 ++++++++++++++ packages/misskey-js/src/api.types.ts | 7 ++++++- packages/misskey-js/src/entities.ts | 8 ++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/packages/misskey-js/etc/misskey-js.api.md b/packages/misskey-js/etc/misskey-js.api.md index 061b533b72..a99cefb0aa 100644 --- a/packages/misskey-js/etc/misskey-js.api.md +++ b/packages/misskey-js/etc/misskey-js.api.md @@ -1194,6 +1194,10 @@ export type Endpoints = Overwrite; res: AdminRolesCreateResponse; }; + [ep: `miauth/${string}/check`]: { + req: EmptyRequest; + res: MiAuthCheckResponse; + }; }>; // @public (undocumented) @@ -1223,6 +1227,7 @@ declare namespace entities { SigninWithPasskeyRequest, SigninWithPasskeyInitResponse, SigninWithPasskeyResponse, + MiAuthCheckResponse, PartialRolePolicyOverride, EmptyRequest, EmptyResponse, @@ -2439,6 +2444,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: User; +} | { + ok: false; +}; + // @public (undocumented) type MiauthGenTokenRequest = operations['miauth___gen-token']['requestBody']['content']['application/json']; diff --git a/packages/misskey-js/src/api.types.ts b/packages/misskey-js/src/api.types.ts index 838949f8e1..7be1b6ce5f 100644 --- a/packages/misskey-js/src/api.types.ts +++ b/packages/misskey-js/src/api.types.ts @@ -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 = Omit< @@ -104,6 +105,10 @@ export type Endpoints = Overwrite< 'admin/roles/create': { req: Overwrite; res: AdminRolesCreateResponse; + }, + [ep: `miauth/${string}/check`]: { + req: EmptyRequest; + res: MiAuthCheckResponse; } } > diff --git a/packages/misskey-js/src/entities.ts b/packages/misskey-js/src/entities.ts index dd88791ed0..84fe72a829 100644 --- a/packages/misskey-js/src/entities.ts +++ b/packages/misskey-js/src/entities.ts @@ -311,6 +311,14 @@ export type SigninWithPasskeyResponse = { signinResponse: SigninFlowResponse & { finished: true }; }; +export type MiAuthCheckResponse = { + ok: true; + token: string; + user: User; +} | { + ok: false; +}; + type Values> = T[keyof T]; export type PartialRolePolicyOverride = Partial<{[k in keyof RolePolicies]: Omit, 'value'> & { value: RolePolicies[k] }}>;