diff options
| author | おさむのひと <46447427+samunohito@users.noreply.github.com> | 2025-05-03 16:23:06 +0900 |
|---|---|---|
| committer | Marie <github@yuugi.dev> | 2025-05-08 20:02:13 +0200 |
| commit | b91a67d74ec18b80ceaa8522e07bf28a628284d5 (patch) | |
| tree | e3111412ab8dabc391a0af3adf68b9932a56d241 /packages/backend/src/server/api/endpoint-base.ts | |
| parent | merge: merge the two post-form menus (!995) (diff) | |
| download | sharkey-b91a67d74ec18b80ceaa8522e07bf28a628284d5.tar.gz sharkey-b91a67d74ec18b80ceaa8522e07bf28a628284d5.tar.bz2 sharkey-b91a67d74ec18b80ceaa8522e07bf28a628284d5.zip | |
Revert "fix: 添付ファイルのあるリクエストを受けたときの初動を改善 (#15896)" (#15927)
* Revert "fix: 添付ファイルのあるリクエストを受けたときの初動を改善 (#15896)"
This reverts commit 7e8cc4d7c0a86ad0bf71a727fb16132e8bc180a8.
* fix CHANGELOG.md
Diffstat (limited to 'packages/backend/src/server/api/endpoint-base.ts')
| -rw-r--r-- | packages/backend/src/server/api/endpoint-base.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/backend/src/server/api/endpoint-base.ts b/packages/backend/src/server/api/endpoint-base.ts index b063487305..e061aa3a8e 100644 --- a/packages/backend/src/server/api/endpoint-base.ts +++ b/packages/backend/src/server/api/endpoint-base.ts @@ -21,23 +21,23 @@ ajv.addFormat('misskey:id', /^[a-zA-Z0-9]+$/); export type Response = Record<string, any> | void; -export type AttachmentFile = { +type File = { name: string | null; path: string; }; // TODO: paramsの型をT['params']のスキーマ定義から推論する type Executor<T extends IEndpointMeta, Ps extends Schema> = - (params: SchemaType<Ps>, user: T['requireCredential'] extends true ? MiLocalUser : MiLocalUser | null, token: MiAccessToken | null, file?: AttachmentFile, cleanup?: () => any, ip?: string | null, headers?: Record<string, string> | null) => - Promise<T['res'] extends undefined ? Response : SchemaType<NonNullable<T['res']>>>; + (params: SchemaType<Ps>, user: T['requireCredential'] extends true ? MiLocalUser : MiLocalUser | null, token: MiAccessToken | null, file?: File, cleanup?: () => any, ip?: string | null, headers?: Record<string, string> | null) => + Promise<T['res'] extends undefined ? Response : SchemaType<NonNullable<T['res']>>>; export abstract class Endpoint<T extends IEndpointMeta, Ps extends Schema> { - public exec: (params: any, user: T['requireCredential'] extends true ? MiLocalUser : MiLocalUser | null, token: MiAccessToken | null, file?: AttachmentFile, ip?: string | null, headers?: Record<string, string> | null) => Promise<any>; + public exec: (params: any, user: T['requireCredential'] extends true ? MiLocalUser : MiLocalUser | null, token: MiAccessToken | null, file?: File, ip?: string | null, headers?: Record<string, string> | null) => Promise<any>; constructor(meta: T, paramDef: Ps, cb: Executor<T, Ps>) { const validate = ajv.compile(paramDef); - this.exec = (params: any, user: T['requireCredential'] extends true ? MiLocalUser : MiLocalUser | null, token: MiAccessToken | null, file?: AttachmentFile, ip?: string | null, headers?: Record<string, string> | null) => { + this.exec = (params: any, user: T['requireCredential'] extends true ? MiLocalUser : MiLocalUser | null, token: MiAccessToken | null, file?: File, ip?: string | null, headers?: Record<string, string> | null) => { let cleanup: undefined | (() => void) = undefined; if (meta.requireFile) { |