Home Reference Source
import FeedUtil from 'chris-utils'
public class | source

FeedUtil

An instance of this class represents Feed utility service

Static Method Summary

Static Public Methods
public static

createService(chrisClient: Client): FeedUtil

Create a service object of this class

Constructor Summary

Public Constructor
public

constructor(chrisClient: Client)

Constructor

Member Summary

Public Members
public

Method Summary

Public Methods
public

async createAndZipFeed(dataPath: String, feedName: String, zipName: String): Promise<Feed>

A method to create, zip & download a new feed

public

async createFeed(dataPath: String, feedName: String): Promise<Feed>

Create a new feed in CUBE

public

async getFeed(feedId: number): Promise<Feed>

Get a feed given it's id

public

async getProgress(feed: Object): Promise<number>

Get the progress of a given feed

public

async getRunTime(feed: Object): Promise<number>

Get the cumulative run time of a given feed

public

async getSize(feed: object): Promise<number>

Get the total file size of a given feed

Static Public Methods

public static createService(chrisClient: Client): FeedUtil source

Create a service object of this class

Params:

NameTypeAttributeDescription
chrisClient Client

Return:

FeedUtil

Public Constructors

public constructor(chrisClient: Client) source

Constructor

Params:

NameTypeAttributeDescription
chrisClient Client

A Chris Client Object

Public Members

public chrisClient: * source

Public Methods

public async createAndZipFeed(dataPath: String, feedName: String, zipName: String): Promise<Feed> source

A method to create, zip & download a new feed

Params:

NameTypeAttributeDescription
dataPath String

A valid path in Chris Swift storage

feedName String

Name of the new feed

zipName String

A file name

Return:

Promise<Feed>

A JS Promise, resolves to a Feed Object

public async createFeed(dataPath: String, feedName: String): Promise<Feed> source

Create a new feed in CUBE

Params:

NameTypeAttributeDescription
dataPath String

A path in Chris Swift Storage

feedName String

Name of a new feed

Return:

Promise<Feed>

A JS Promise, resolves to a Feed object

public async getFeed(feedId: number): Promise<Feed> source

Get a feed given it's id

Params:

NameTypeAttributeDescription
feedId number

A Feed id

Return:

Promise<Feed>

JS Promise, resolves to a feed object

public async getProgress(feed: Object): Promise<number> source

Get the progress of a given feed

Params:

NameTypeAttributeDescription
feed Object

A Feed object

Return:

Promise<number>

A JS Promise, resolves to a number representing feed's progress

public async getRunTime(feed: Object): Promise<number> source

Get the cumulative run time of a given feed

Params:

NameTypeAttributeDescription
feed Object

A Feed object

Return:

Promise<number>

A JS Promise, resolves to a number representing feed's run time

public async getSize(feed: object): Promise<number> source

Get the total file size of a given feed

Params:

NameTypeAttributeDescription
feed object

A Feed object

Return:

Promise<number>

A JS Promise, resolves to a number represnting feed's size