Disjoint Link from Object

Link was extending Object which was a mistake (as pointed out in
https://github.com/cloudflare/wildebeest/issues/35). This change
disjoints Link and Object objects, as specified by
https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link.
pull/270/head
Sven Sauleau 2023-02-13 10:03:00 +00:00
rodzic 96edda23f0
commit adced26955
2 zmienionych plików z 4 dodań i 5 usunięć

Wyświetl plik

@ -1,6 +1,7 @@
import type { APObject } from 'wildebeest/backend/src/activitypub/objects'
// https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link
export interface Link {
type: string
export interface Link extends APObject {
href: URL
name: string
}

Wyświetl plik

@ -2,14 +2,12 @@ import type { Link } from 'wildebeest/backend/src/activitypub/objects/link'
import type { Actor } from 'wildebeest/backend/src/activitypub/actors'
import { urlToHandle } from 'wildebeest/backend/src/utils/handle'
// https://www.w3.org/TR/activitystreams-vocabulary/#dfn-mention
export interface Mention extends Link {}
export function newMention(actor: Actor): Mention {
return {
type: 'Mention',
id: actor.id,
url: actor.id,
href: actor.id,
name: urlToHandle(actor.id),
}