From 6bcbd2dfc25726ca518f3ec8271c13327e93e488 Mon Sep 17 00:00:00 2001 From: SiRanWeb Date: Wed, 2 Nov 2022 16:38:32 +0300 Subject: [PATCH] add source field --- src/common/common.types.ts | 6 +++++- src/models/apObject/APObject.types.ts | 13 ++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/common/common.types.ts b/src/common/common.types.ts index 159e418..8fdfae4 100644 --- a/src/common/common.types.ts +++ b/src/common/common.types.ts @@ -125,4 +125,8 @@ export type OrderedCollectionItemsValue = string | OrderedCollectionPage | Link; export type OrderedCollectionPagePartOfValue = string | OrderedCollection | Link; export type OrderedCollectionPageNextValue = string | OrderedCollection | Link; export type OrderedCollectionPagePrevValue = string | OrderedCollection | Link; -export type StartIndexValue = number; \ No newline at end of file +export type StartIndexValue = number; +export type SourceValue = { + content: ContentValue, + mediaType?: MediaType, +} \ No newline at end of file diff --git a/src/models/apObject/APObject.types.ts b/src/models/apObject/APObject.types.ts index b9b59af..092cf46 100644 --- a/src/models/apObject/APObject.types.ts +++ b/src/models/apObject/APObject.types.ts @@ -28,7 +28,7 @@ import { SummaryValue, SummaryMapValue, UpdatedValue, - DurationValue, + DurationValue, SourceValue, } from "../../common/common.types"; export interface APObjectFields { @@ -323,4 +323,15 @@ export interface APObjectFields { * P2Y6M5DT12H35M30S (2 years, 6 months, 5 days, 12 hours, 35 minutes, 30 seconds) */ duration?: DurationValue; + + /** + * ActivityPub extends the Object by supplying the source property. The source property is intended to + * convey some sort of source from which the content markup was derived, as a form of provenance, or to + * support future editing by clients. In general, clients do the conversion from source to content, not + * the other way around. + * The value of source is itself an object which uses its own content and mediaType fields to supply source information. + * + * {@link https://www.w3.org/TR/activitypub/#source-property Docs} + */ + source?: SourceValue; } \ No newline at end of file