Client
API client object.
Static Method Summary
Static Public Methods | ||
public static |
createUser(usersUrl: string, username: string, password: string, email: string, timeout: number): Object Create a new user account. |
|
public static |
Fetch a user's login authorization token from the REST API. |
|
public static |
runAsyncTask(taskGenerator: function*()) Helper method to run an asynchronous task defined by a task generator function. |
Constructor Summary
Public Constructor | ||
public |
constructor(url: string, auth: Object) Constructor |
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
createPipeline(data: Object, timeout: number): Object Create a new pipeline resource through the REST API. |
|
public |
createPlugin(data: Object, uploadFileObj: Object, timeout: number): Object Create a new plugin resource through the REST API. |
|
public |
createPluginCollaborator(pluginMetaId: number, data: Object, timeout: number): Object Create a new plugin collaborator resource through the REST API. |
|
public |
createPluginStar(data: Object, timeout: number): Object Create a new plugin star resource through the REST API. |
|
public |
getCollabPluginMetas(params: Object, timeout: number): Object Fetch a list of authenticated user's collaborated plugin metas from the REST API. |
|
public |
getFavoritePluginMetas(params: Object, timeout: number): Object Fetch a list of authenticated user's favorite plugin metas from the REST API. |
|
public |
getPipeline(id: number, timeout: number): Object Get a pipeline resource object given its id. |
|
public |
getPipelines(searchParams: Object, timeout: number): Object Get a paginated list of pipeline data (descriptors) given query search parameters. |
|
public |
Get a plugin resource object given its id. |
|
public |
getPluginMeta(id: number, timeout: number): Object Get a plugin meta resource object given its id. |
|
public |
getPluginMetas(searchParams: Object, timeout: number): Object Get a paginated list of plugin metas from the REST API given query search parameters. |
|
public |
getPluginStar(id: number, timeout: number): Object Get an authenticated-user-specific plugin star resource object given its id. |
|
public |
getPluginStars(searchParams: Object, timeout: number): Object Get a paginated list of authenticated-user-specific plugin star data (descriptors) given query search parameters. |
|
public |
getPlugins(searchParams: Object, timeout: number): Object Get a paginated list of plugin data (descriptors) given query search parameters. |
|
public |
Get a user resource object for the currently authenticated user. |
|
public |
Set the urls of the high level API resources. |
Private Methods | ||
private |
Internal method to fetch a high level resource through the REST API. |
Static Public Methods
public static createUser(usersUrl: string, username: string, password: string, email: string, timeout: number): Object source
Create a new user account.
public static getAuthToken(authUrl: string, username: string, password: string, timeout: number): Object source
Fetch a user's login authorization token from the REST API.
public static runAsyncTask(taskGenerator: function*()) source
Helper method to run an asynchronous task defined by a task generator function.
Params:
Name | Type | Attribute | Description |
taskGenerator | function*() | generator function |
Public Constructors
Public Members
public pluginMetasUrl: * source
Public Methods
public createPipeline(data: Object, timeout: number): Object source
Create a new pipeline resource through the REST API.
Params:
Name | Type | Attribute | Description |
data | Object | request JSON data object |
|
data.name | string | pipeline name |
|
data.plugin_tree | string | JSON string containing a plugin tree list |
|
data.authors | string |
|
pipeline authors |
data.category | string |
|
pipeline category |
data.description | string |
|
pipeline description |
data.locked | boolean |
|
pipeline status |
timeout | number |
|
request timeout |
public createPlugin(data: Object, uploadFileObj: Object, timeout: number): Object source
Create a new plugin resource through the REST API.
Params:
Name | Type | Attribute | Description |
data | Object | request JSON data object |
|
data.name | string | plugin name |
|
data.dock_image | string | plugin docker image |
|
data.public_repo | string | plugin repo |
|
uploadFileObj | Object | custom file object |
|
uploadFileObj.descriptor_file | Object | file blob |
|
timeout | number |
|
request timeout |
public createPluginCollaborator(pluginMetaId: number, data: Object, timeout: number): Object source
Create a new plugin collaborator resource through the REST API.
public createPluginStar(data: Object, timeout: number): Object source
Create a new plugin star resource through the REST API.
public getCollabPluginMetas(params: Object, timeout: number): Object source
Fetch a list of authenticated user's collaborated plugin metas from the REST API.
public getFavoritePluginMetas(params: Object, timeout: number): Object source
Fetch a list of authenticated user's favorite plugin metas from the REST API.
public getPipeline(id: number, timeout: number): Object source
Get a pipeline resource object given its id.
public getPipelines(searchParams: Object, timeout: number): Object source
Get a paginated list of pipeline data (descriptors) given query search parameters. If no search parameters is given then get the default first page.
Params:
Name | Type | Attribute | Description |
searchParams | Object |
|
search parameters |
searchParams.limit | number |
|
page limit |
searchParams.offset | number |
|
page offset |
searchParams.id | number |
|
match pipeline id exactly with this number |
searchParams.name | string |
|
match pipeline name containing this string |
searchParams.category | string |
|
match pipeline category containing this string |
searchParams.owner_username | string |
|
match pipeline's owner username exactly with this string |
searchParams.description | string |
|
match pipeline description containing this string |
searchParams.authors | string |
|
match pipeline authors containing this string |
searchParams.min_creation_date | string |
|
match pipeline creation date after this date |
searchParams.max_creation_date | string |
|
match pipeline creation date before this date |
timeout | number |
|
request timeout |
public getPlugin(id: number, timeout: number): Object source
Get a plugin resource object given its id.
public getPluginMeta(id: number, timeout: number): Object source
Get a plugin meta resource object given its id.
public getPluginMetas(searchParams: Object, timeout: number): Object source
Get a paginated list of plugin metas from the REST API given query search parameters. If no search parameters then get the default first page.
Params:
Name | Type | Attribute | Description |
searchParams | Object |
|
search parameters object |
searchParams.limit | number |
|
page limit |
searchParams.offset | number |
|
page offset |
searchParams.id | number |
|
match plugin meta id exactly with this number |
searchParams.name | string |
|
match plugin meta name containing this string |
searchParams.name_exact | string |
|
match plugin meta name exactly with this string |
searchParams.title | string |
|
match plugin meta title containing this string |
searchParams.type | string |
|
match plugin meta type exactly with this string |
searchParams.category | string |
|
match plugin meta category exactly with this string |
searchParams.authors | string |
|
match plugin meta authors containing this string |
searchParams.min_creation_date | number |
|
match feed creation date gte this date |
searchParams.max_creation_date | number |
|
match feed creation date lte this date |
searchParams.name_title_category | string |
|
match plugin meta name, title or category containing this string |
searchParams.name_authors_category | string |
|
match plugin meta name, authors or category containing this string |
searchParams.owner_username | string |
|
match plugin meta owner's username exactly with this string |
timeout | number |
|
request timeout |
public getPluginStar(id: number, timeout: number): Object source
Get an authenticated-user-specific plugin star resource object given its id.
public getPluginStars(searchParams: Object, timeout: number): Object source
Get a paginated list of authenticated-user-specific plugin star data (descriptors) given query search parameters. If no search parameters is given then get the default first page.
Params:
Name | Type | Attribute | Description |
searchParams | Object |
|
search parameters |
searchParams.limit | number |
|
page limit |
searchParams.offset | number |
|
page offset |
searchParams.id | number |
|
match plugin star id exactly with this number |
searchParams.plugin_name | string |
|
match plugin name exactly with this string |
timeout | number |
|
request timeout |
public getPlugins(searchParams: Object, timeout: number): Object source
Get a paginated list of plugin data (descriptors) given query search parameters. If no search parameters is given then get the default first page.
Params:
Name | Type | Attribute | Description |
searchParams | Object |
|
search parameters |
searchParams.limit | number |
|
page limit |
searchParams.offset | number |
|
page offset |
searchParams.id | number |
|
match plugin id exactly with this number |
searchParams.name | string |
|
match plugin name containing this string |
searchParams.name_latest | string |
|
match plugin name containing this string and return only the latest version |
searchParams.name_exact | string |
|
match plugin name exactly with this string |
searchParams.name_exact_latest | string |
|
match plugin name exactly with this string and return only the latest version |
searchParams.dock_image | string |
|
match plugin docker image exactly with this string |
searchParams.type | string |
|
match plugin type with this string |
searchParams.category | string |
|
match plugin category containing this string |
searchParams.owner_username | string |
|
match plugin username containing this string |
searchParams.min_creation_date | string |
|
match plugin creation date after this date |
searchParams.max_creation_date | string |
|
match plugin creation date before this date |
searchParams.title | string |
|
match plugin title containing this string |
searchParams.version | string |
|
match plugin version exactly with this string |
searchParams.description | string |
|
match plugin description containing this string |
searchParams.name_title_category | string |
|
match plugin name, title or category containing this string |
timeout | number |
|
request timeout |
public getUser(timeout: number): Object source
Get a user resource object for the currently authenticated user.
Params:
Name | Type | Attribute | Description |
timeout | number |
|
request timeout |
public setUrls(timeout: number): Object source
Set the urls of the high level API resources.
Params:
Name | Type | Attribute | Description |
timeout | number |
|
request timeout |