kopia lustrzana https://github.com/cloudflare/wildebeest
Merge pull request #352 from cloudflare/sven/remove-last-d1-db
change remaining D1Database typespull/353/head
commit
42a56c560a
|
@ -24,7 +24,7 @@ export async function getAccount(domain: string, accountId: string, db: Database
|
|||
}
|
||||
}
|
||||
|
||||
async function getRemoteAccount(handle: Handle, acct: string, db: D1Database): Promise<MastodonAccount | null> {
|
||||
async function getRemoteAccount(handle: Handle, acct: string, db: Database): Promise<MastodonAccount | null> {
|
||||
// TODO: using webfinger isn't the optimal implementation. We could cache
|
||||
// the object in D1 and directly query the remote API, indicated by the actor's
|
||||
// url field. For now, let's keep it simple.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import * as actors from '../activitypub/actors'
|
||||
import { type Database } from 'wildebeest/backend/src/database'
|
||||
import type { Actor } from '../activitypub/actors'
|
||||
|
||||
export type WebFingerResponse = {
|
||||
|
@ -11,7 +12,7 @@ const headers = {
|
|||
accept: 'application/jrd+json',
|
||||
}
|
||||
|
||||
export async function queryAcct(domain: string, db: D1Database, acct: string): Promise<Actor | null> {
|
||||
export async function queryAcct(domain: string, db: Database, acct: string): Promise<Actor | null> {
|
||||
const url = await queryAcctLink(domain, acct)
|
||||
if (url === null) {
|
||||
return null
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
// https://docs.joinmastodon.org/methods/apps/#verify_credentials
|
||||
|
||||
import { type Database } from 'wildebeest/backend/src/database'
|
||||
import { cors } from 'wildebeest/backend/src/utils/cors'
|
||||
import { VAPIDPublicKey } from 'wildebeest/backend/src/mastodon/subscription'
|
||||
import { getVAPIDKeys } from 'wildebeest/backend/src/config'
|
||||
|
@ -24,7 +25,7 @@ export const onRequest: PagesFunction<Env, any, ContextData> = async ({ request,
|
|||
return handleRequest(env.DATABASE, request, getVAPIDKeys(env))
|
||||
}
|
||||
|
||||
export async function handleRequest(db: D1Database, request: Request, vapidKeys: JWK) {
|
||||
export async function handleRequest(db: Database, request: Request, vapidKeys: JWK) {
|
||||
if (request.method !== 'GET') {
|
||||
return new Response('', { status: 400 })
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue