forked from siranweb/activitypub-types
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
005727b
commit 71a6450
Showing
60 changed files
with
1,349 additions
and
1,048 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"trailingComma": "all", | ||
"tabWidth": 4, | ||
"semi": true, | ||
"arrowParens": "always", | ||
"bracketSameLine": false, | ||
"bracketSpacing": true, | ||
"quoteProps": "as-needed", | ||
"useTabs": true, | ||
"singleQuote": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './fields'; | ||
export * from './model-interfaces'; | ||
export * from "./fields"; | ||
export * from "./model-interfaces"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
import { APActivity } from './activity.interface'; | ||
import { APActivity } from "./activity.interface"; | ||
|
||
export type APAccept = APActivity | ||
export type APAccept = APActivity & { type: "Accept" }; | ||
|
||
export const ActivityIsAccept = ( | ||
activity: APActivity, | ||
): activity is APAccept => { | ||
return activity.type == "Accept"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,64 @@ | ||
import { APObject } from '../common/object.interface'; | ||
import { APObject } from "../common/object.interface"; | ||
import { | ||
ActorField, | ||
InstrumentField, | ||
ObjectField, | ||
OriginField, | ||
ResultField, | ||
TargetField | ||
} from '../../fields'; | ||
ActorField, | ||
InstrumentField, | ||
ObjectField, | ||
OriginField, | ||
ResultField, | ||
TargetField, | ||
} from "../../fields"; | ||
|
||
export interface APActivity extends APObject { | ||
/** | ||
* Describes one or more entities that either performed or are expected to perform the activity. | ||
* Any single activity can have multiple actors. The actor MAY be specified using an indirect Link. | ||
* | ||
* {@link https://www.w3.org/ns/activitystreams#actor Docs} | ||
*/ | ||
actor?: ActorField | ActorField[]; | ||
|
||
/** | ||
* Describes one or more entities that either performed or are expected to perform the activity. | ||
* Any single activity can have multiple actors. The actor MAY be specified using an indirect Link. | ||
* | ||
* {@link https://www.w3.org/ns/activitystreams#actor Docs} | ||
*/ | ||
actor?: ActorField | ActorField[]; | ||
/** | ||
* When used within an Activity, describes the direct object of the activity. | ||
* For instance, in the activity "John added a movie to his wishlist", | ||
* the object of the activity is the movie added. | ||
* | ||
* {@link https://www.w3.org/ns/activitystreams#object Docs} | ||
*/ | ||
object?: ObjectField | ObjectField[]; | ||
|
||
/** | ||
* When used within an Activity, describes the direct object of the activity. | ||
* For instance, in the activity "John added a movie to his wishlist", | ||
* the object of the activity is the movie added. | ||
* | ||
* {@link https://www.w3.org/ns/activitystreams#object Docs} | ||
*/ | ||
object?: ObjectField | ObjectField[]; | ||
/** | ||
* Describes the indirect object, or target, of the activity. The precise meaning of the target is largely dependent | ||
* on the type of action being described but will often be the object of the English preposition "to". | ||
* For instance, in the activity "John added a movie to his wishlist", the target of the activity | ||
* is John's wishlist. An activity can have more than one target. | ||
* | ||
* {@link https://www.w3.org/ns/activitystreams#target Docs} | ||
*/ | ||
target?: TargetField | TargetField[]; | ||
|
||
/** | ||
* Describes the indirect object, or target, of the activity. The precise meaning of the target is largely dependent | ||
* on the type of action being described but will often be the object of the English preposition "to". | ||
* For instance, in the activity "John added a movie to his wishlist", the target of the activity | ||
* is John's wishlist. An activity can have more than one target. | ||
* | ||
* {@link https://www.w3.org/ns/activitystreams#target Docs} | ||
*/ | ||
target?: TargetField | TargetField[]; | ||
/** | ||
* Describes the result of the activity. For instance, if a particular action results | ||
* in the creation of a new resource, the result property can be used to describe that new resource. | ||
* | ||
* {@link https://www.w3.org/ns/activitystreams#result Docs} | ||
*/ | ||
result?: ResultField | ResultField[]; | ||
|
||
/** | ||
* Describes the result of the activity. For instance, if a particular action results | ||
* in the creation of a new resource, the result property can be used to describe that new resource. | ||
* | ||
* {@link https://www.w3.org/ns/activitystreams#result Docs} | ||
*/ | ||
result?: ResultField | ResultField[]; | ||
/** | ||
* Describes an indirect object of the activity from which the activity is directed. | ||
* The precise meaning of the origin is the object of the English preposition "from". | ||
* For instance, in the activity "John moved an item to List B from List A", | ||
* the origin of the activity is "List A". | ||
* | ||
* {@link https://www.w3.org/ns/activitystreams#origin Docs} | ||
*/ | ||
origin?: OriginField | OriginField[]; | ||
|
||
/** | ||
* Describes an indirect object of the activity from which the activity is directed. | ||
* The precise meaning of the origin is the object of the English preposition "from". | ||
* For instance, in the activity "John moved an item to List B from List A", | ||
* the origin of the activity is "List A". | ||
* | ||
* {@link https://www.w3.org/ns/activitystreams#origin Docs} | ||
*/ | ||
origin?: OriginField | OriginField[]; | ||
|
||
/** | ||
* Identifies one or more objects used (or to be used) | ||
* in the completion of an Activity. | ||
* | ||
* {@link https://www.w3.org/ns/activitystreams#instrument Docs} | ||
*/ | ||
instrument?: InstrumentField | InstrumentField[]; | ||
/** | ||
* Identifies one or more objects used (or to be used) | ||
* in the completion of an Activity. | ||
* | ||
* {@link https://www.w3.org/ns/activitystreams#instrument Docs} | ||
*/ | ||
instrument?: InstrumentField | InstrumentField[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import { APActivity } from './activity.interface'; | ||
import { APActivity } from "./activity.interface"; | ||
|
||
export type APAdd = APActivity | ||
export type APAdd = APActivity & { type: "Add" }; | ||
|
||
export const ActivityIsAdd = (activity: APActivity): activity is APAdd => { | ||
return activity.type == "Add"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
import { APActivity } from './activity.interface'; | ||
import { APActivity } from "./activity.interface"; | ||
|
||
export type APAnnounce = APActivity | ||
export type APAnnounce = APActivity & { type: "Announce" }; | ||
|
||
export const ActivityIsAnnounce = ( | ||
activity: APActivity, | ||
): activity is APAnnounce => { | ||
return activity.type == "Announce"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
import { APIntransitiveActivity } from './intransitive-activity.interface'; | ||
import { APIntransitiveActivity } from "./intransitive-activity.interface"; | ||
|
||
export type APArrive = APIntransitiveActivity | ||
export type APArrive = APIntransitiveActivity & { type: "Arrive" }; | ||
|
||
export const ActivityIsArrive = ( | ||
activity: APIntransitiveActivity, | ||
): activity is APArrive => { | ||
return activity.type == "Arrive"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
import { APIgnore } from './ignore.interface'; | ||
import { APActivity } from "./activity.interface"; | ||
import { APIgnore } from "./ignore.interface"; | ||
|
||
export type APBlock = APIgnore | ||
export type APBlock = APIgnore & { type: "Block" }; | ||
|
||
export const ActivityIsBlock = (activity: APActivity): activity is APBlock => { | ||
return activity.type == "Block"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
import { APActivity } from './activity.interface'; | ||
import { APActivity } from "./activity.interface"; | ||
|
||
export type APCreate = APActivity | ||
export type APCreate = APActivity & { type: "Create" }; | ||
|
||
export const ActivityIsCreate = ( | ||
activity: APActivity, | ||
): activity is APCreate => { | ||
return activity.type == "Create"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
import { APActivity } from './activity.interface'; | ||
import { APActivity } from "./activity.interface"; | ||
|
||
export type APDelete = APActivity | ||
export type APDelete = APActivity & { type: "Delete" }; | ||
|
||
export const ActivityIsDelete = ( | ||
activity: APActivity, | ||
): activity is APDelete => { | ||
return activity.type == "Delete"; | ||
}; |
Oops, something went wrong.