summaryrefslogtreecommitdiff
path: root/src/remote/activitypub/request.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-03-24 11:05:37 +0900
committerGitHub <noreply@github.com>2021-03-24 11:05:37 +0900
commitce340aba7a37394c70b9f3d7cece9cfa5e91d94c (patch)
tree99612ea0d039f20e0baa9ca243e8cec0af96b11a /src/remote/activitypub/request.ts
parentfix bug (diff)
downloadsharkey-ce340aba7a37394c70b9f3d7cece9cfa5e91d94c.tar.gz
sharkey-ce340aba7a37394c70b9f3d7cece9cfa5e91d94c.tar.bz2
sharkey-ce340aba7a37394c70b9f3d7cece9cfa5e91d94c.zip
Refactor (#7394)
* wip * wip * wip * wip * wip * Update define.ts * Update update.ts * Update user.ts * wip * wip * Update request.ts * URL * wip * wip * wip * wip * Update invite.ts * Update create.ts
Diffstat (limited to 'src/remote/activitypub/request.ts')
-rw-r--r--src/remote/activitypub/request.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/remote/activitypub/request.ts b/src/remote/activitypub/request.ts
index fc774bc9a5..e4dca32329 100644
--- a/src/remote/activitypub/request.ts
+++ b/src/remote/activitypub/request.ts
@@ -4,14 +4,14 @@ import { sign } from 'http-signature';
import * as crypto from 'crypto';
import config from '@/config';
-import { ILocalUser } from '../../models/entities/user';
+import { User } from '@/models/entities/user';
import { getAgentByUrl } from '@/misc/fetch';
import { URL } from 'url';
import got from 'got';
import * as Got from 'got';
import { getUserKeypair } from '@/misc/keypair-store';
-export default async (user: ILocalUser, url: string, object: any) => {
+export default async (user: { id: User['id'] }, url: string, object: any) => {
const timeout = 10 * 1000;
const { protocol, hostname, port, pathname, search } = new URL(url);
@@ -24,7 +24,7 @@ export default async (user: ILocalUser, url: string, object: any) => {
const keypair = await getUserKeypair(user.id);
- await new Promise((resolve, reject) => {
+ await new Promise<void>((resolve, reject) => {
const req = https.request({
agent: getAgentByUrl(new URL(`https://example.net`)),
protocol,
@@ -69,7 +69,7 @@ export default async (user: ILocalUser, url: string, object: any) => {
* @param user http-signature user
* @param url URL to fetch
*/
-export async function signedGet(url: string, user: ILocalUser) {
+export async function signedGet(url: string, user: { id: User['id'] }) {
const timeout = 10 * 1000;
const keypair = await getUserKeypair(user.id);