diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-15 11:53:26 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-19 17:26:35 +0200 |
commit | 453e83ea5d81d203ba34bc43cd5c2c750ba40568 (patch) | |
tree | 604e02f4343d13a4ba42e1fb7527ba6ab9111712 /server/lib/job-queue/handlers/utils | |
parent | 13176a07a95984a53cc59aec5217f2ce9806d1bc (diff) | |
download | PeerTube-453e83ea5d81d203ba34bc43cd5c2c750ba40568.tar.gz PeerTube-453e83ea5d81d203ba34bc43cd5c2c750ba40568.tar.zst PeerTube-453e83ea5d81d203ba34bc43cd5c2c750ba40568.zip |
Stronger model typings
Diffstat (limited to 'server/lib/job-queue/handlers/utils')
-rw-r--r-- | server/lib/job-queue/handlers/utils/activitypub-http-utils.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts b/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts index cdee1f6fd..d3bde6e6a 100644 --- a/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts +++ b/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts | |||
@@ -3,6 +3,7 @@ import { getServerActor } from '../../../../helpers/utils' | |||
3 | import { ActorModel } from '../../../../models/activitypub/actor' | 3 | import { ActorModel } from '../../../../models/activitypub/actor' |
4 | import { sha256 } from '../../../../helpers/core-utils' | 4 | import { sha256 } from '../../../../helpers/core-utils' |
5 | import { HTTP_SIGNATURE } from '../../../../initializers/constants' | 5 | import { HTTP_SIGNATURE } from '../../../../initializers/constants' |
6 | import { MActor } from '../../../../typings/models' | ||
6 | 7 | ||
7 | type Payload = { body: any, signatureActorId?: number } | 8 | type Payload = { body: any, signatureActorId?: number } |
8 | 9 | ||
@@ -19,7 +20,8 @@ async function computeBody (payload: Payload) { | |||
19 | } | 20 | } |
20 | 21 | ||
21 | async function buildSignedRequestOptions (payload: Payload) { | 22 | async function buildSignedRequestOptions (payload: Payload) { |
22 | let actor: ActorModel | null | 23 | let actor: MActor | null |
24 | |||
23 | if (payload.signatureActorId) { | 25 | if (payload.signatureActorId) { |
24 | actor = await ActorModel.load(payload.signatureActorId) | 26 | actor = await ActorModel.load(payload.signatureActorId) |
25 | if (!actor) throw new Error('Unknown signature actor id.') | 27 | if (!actor) throw new Error('Unknown signature actor id.') |