Home Reference Source
import {Feed} from '@fnndsc/chrisapi'
public class | source

Feed

Extends:

ResourceItemResource → Feed

Feed item resource object representing a feed.

Method Summary

Public Methods
public

delete(timeout: number): Promise

Make a DELETE request to delete this feed item resource through the REST API.

public

Get a feed comment given its id.

public

getComments(searchParams: Object, timeout: number): Promise<CommentList>

Fetch a list of comments associated to this feed from the REST API.

public

Fetch the folder associated to this feed from the REST API.

public

getNote(timeout: number): Promise<Note>

Fetch the note associated to this feed from the REST API.

public

Fetch a list of plugin instances associated to this feed from the REST API.

public

Fetch a list of taggings associated to this feed from the REST API.

public

getTags(params: Object, timeout: number): Promise<FeedTagList>

Fetch a list of tags associated to this feed from the REST API.

public

put(data: Object, timeout: number): Promise<this>

Make a PUT request to modify this feed item resource through the REST API.

public

tagFeed(tag_id: number, timeout: number): Promise<Tagging>

Tag the feed given the id of the tag.

Inherited Summary

From class Resource
public static

cloneObj(obj: Object): *

Helper method to make a deep copy clone of the passed object resource.

public get

Return true if the resource object contains any data.

public
public
public
public
public

Make a deep copy clone of this object resource.

From class ItemResource
public get

Get the item's data object (REST API descriptors).

public
public

get(timeout: number): Promise<this>

Fetch this item resource from the REST API.

public

Get an array of parameter names that can be used as properties of the data object in PUT requests.

private

_delete(timeout: number): Promise

Internal helper method to make a DELETE request to this item resource through the REST API.

private

_getResource(linkRelation: string, ResourceClass: Object, searchParams: Object, timeout: number): Promise<ResourceClass>

Internal method to fetch a related resource from the REST API that is referenced by a link relation within the item object.

private

_put(data: Object, uploadFileObj: Object, timeout: number): Promise<this>

Internal helper method to make a PUT request to this item resource through the REST API.

Public Methods

public delete(timeout: number): Promise source

Make a DELETE request to delete this feed item resource through the REST API.

Params:

NameTypeAttributeDescription
timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise

JS Promise

public getComment(id: number, timeout: number): Promise<Comment> source

Get a feed comment given its id.

Params:

NameTypeAttributeDescription
id number

comment id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<Comment>

JS Promise, resolves to a Comment object

public getComments(searchParams: Object, timeout: number): Promise<CommentList> source

Fetch a list of comments associated to this feed from the REST API.

Params:

NameTypeAttributeDescription
searchParams Object
  • optional
  • default: null

search parameters object

searchParams.limit number
  • optional

page limit

searchParams.offset number
  • optional

page offset

searchParams.id number
  • optional

match comment id exactly with this number

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<CommentList>

JS Promise, resolves to a CommentList object

public getFolder(timeout: number): Promise<FileBrowserFolder> source

Fetch the folder associated to this feed from the REST API.

Params:

NameTypeAttributeDescription
timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<FileBrowserFolder>

JS Promise, resolves to a FileBrowserFolder object

public getNote(timeout: number): Promise<Note> source

Fetch the note associated to this feed from the REST API.

Params:

NameTypeAttributeDescription
timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<Note>

JS Promise, resolves to a Note object

public getPluginInstances(params: Object, timeout: number): Promise<FeedPluginInstanceList> source

Fetch a list of plugin instances associated to this feed from the REST API.

Params:

NameTypeAttributeDescription
params Object
  • optional
  • default: null

page parameters object

params.limit number
  • optional

page limit

params.offset number
  • optional

page offset

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<FeedPluginInstanceList>

JS Promise, resolves to a FeedPluginInstanceList object

public getTaggings(params: Object, timeout: number): Promise<FeedTaggingList> source

Fetch a list of taggings associated to this feed from the REST API.

Params:

NameTypeAttributeDescription
params Object
  • optional
  • default: null

page parameters object

params.limit number
  • optional

page limit

params.offset number
  • optional

page offset

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<FeedTaggingList>

JS Promise, resolves to a FeedTaggingList object

public getTags(params: Object, timeout: number): Promise<FeedTagList> source

Fetch a list of tags associated to this feed from the REST API.

Params:

NameTypeAttributeDescription
params Object
  • optional
  • default: null

page parameters object

params.limit number
  • optional

page limit

params.offset number
  • optional

page offset

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<FeedTagList>

JS Promise, resolves to a FeedTagList object

public put(data: Object, timeout: number): Promise<this> source

Make a PUT request to modify this feed item resource through the REST API.

Params:

NameTypeAttributeDescription
data Object

request JSON data object

data.name string
  • optional

name of the feed

data.public boolean
  • optional

public status of the feed

data.owner string
  • optional

username to be added to the list of this feed's owners

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<this>

JS Promise, resolves to this object

public tagFeed(tag_id: number, timeout: number): Promise<Tagging> source

Tag the feed given the id of the tag.

Params:

NameTypeAttributeDescription
tag_id number

tag id

timeout number
  • optional
  • default: 30000

request timeout

Return:

Promise<Tagging>

JS Promise, resolves to a Tagging object