mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00
Stronger model typings
This commit is contained in:
parent
13176a07a9
commit
453e83ea5d
176 changed files with 2118 additions and 1133 deletions
|
@ -3,6 +3,7 @@ import { getServerActor } from '../../../../helpers/utils'
|
|||
import { ActorModel } from '../../../../models/activitypub/actor'
|
||||
import { sha256 } from '../../../../helpers/core-utils'
|
||||
import { HTTP_SIGNATURE } from '../../../../initializers/constants'
|
||||
import { MActor } from '../../../../typings/models'
|
||||
|
||||
type Payload = { body: any, signatureActorId?: number }
|
||||
|
||||
|
@ -19,7 +20,8 @@ async function computeBody (payload: Payload) {
|
|||
}
|
||||
|
||||
async function buildSignedRequestOptions (payload: Payload) {
|
||||
let actor: ActorModel | null
|
||||
let actor: MActor | null
|
||||
|
||||
if (payload.signatureActorId) {
|
||||
actor = await ActorModel.load(payload.signatureActorId)
|
||||
if (!actor) throw new Error('Unknown signature actor id.')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue