api/parts/mgmt/apps

This module is meant for managing apps

Source:

Methods

(static) createApp(params) → {boolean}

Source:

Creates new app, and outputs result to browser

Parameters:
Name Type Description
params params

params object with args to create app

Returns:

true if operation successful

Type
boolean

(static) deleteApp(params) → {boolean}

Source:

Deletes existing app's and outputs result to browser

Parameters:
Name Type Description
params params

params object with app_id to delete

Returns:

true if operation successful

Type
boolean

(static) getAllApps(params) → {boolean}

Source:

Get all apps and outputs to browser, requires global admin permission

Parameters:
Name Type Description
params params

params object

Returns:

true if got data from db, false if did not

Type
boolean

(static) getAppsDetails(params) → {boolean}

Source:

Gets app details for specific app and outputs to browser

Parameters:
Name Type Description
params params

params object

Returns:

true if got data from db, false if did not

Type
boolean

(static) getCurrentUserApps(params) → {boolean}

Source:

Get only apps that current user has access to and outputs to browser

Parameters:
Name Type Description
params params

params object

Returns:

true if got data from db, false if did not

Type
boolean

(static) resetApp(params) → {boolean}

Source:

Resets app to clean state

Parameters:
Name Type Description
params params

params object with app_id to reset

Returns:

true if operation successful

Type
boolean

(static) updateApp(params) → {boolean}

Source:

Updates existing app, and outputs result to browser

Parameters:
Name Type Description
params params

params object with args to update app with

Returns:

true if operation successful

Type
boolean

(static) updateAppPlugins(params) → {boolean}

Source:

Updates existing app's configurations and outputs result to browser

Parameters:
Name Type Description
params params

params object with args to update app with

Returns:

true if operation successful

Type
boolean

(inner) deleteAllAppData(appId, fromAppDelete, params, app)

Source:

Deletes all app's data or resets data to clean state

Parameters:
Name Type Description
appId string

id of the app for which to delete data

fromAppDelete boolean

true if all document will also be deleted

params params

params object

app object

app document

(inner) deleteAppData(appId, fromAppDelete, params, app)

Source:

Deletes app's data, either all or for specific period, as well as can reset data to clean state

Parameters:
Name Type Description
appId string

id of the app for which to delete data

fromAppDelete boolean

true if all document will also be deleted

params params

params object

app object

app document

(inner) deleteAppLongTasks(appId)

Source:

Deletes long tasks for app

Parameters:
Name Type Description
appId string

id of the app for which to delete data

(inner) deletePeriodAppData(appId, fromAppDelete, params, app)

Source:

Deletes app's data for specific period

Parameters:
Name Type Description
appId string

id of the app for which to delete data

fromAppDelete boolean

true if all document will also be deleted

params params

params object

app object

app document

(inner) iconUpload(params) → {object}

Source:

upload app icon function

Parameters:
Name Type Description
params params

params object with args to create app

Returns:

return promise object;

Type
object

(inner) isValidCategory(category) → {boolean}

Source:

Validate category

Parameters:
Name Type Description
category string

category value

Returns:

if category was valid or not

Type
boolean

(inner) isValidCountry(country) → {boolean}

Source:

Validate country

Parameters:
Name Type Description
country string

country value

Returns:

if country was valid or not

Type
boolean

(inner) isValidTimezone(timezone) → {boolean}

Source:

Validate timezone

Parameters:
Name Type Description
timezone string

timezone value

Returns:

if timezone was valid or not

Type
boolean

(inner) isValidType(type) → {boolean}

Source:

Validate app type

Parameters:
Name Type Description
type string

type value

Returns:

if type was valid or not

Type
boolean

(inner) packApps(apps) → {object}

Source:

Converts apps array into object with app_id as key

Parameters:
Name Type Description
apps array

array of apps documents

Returns:

with app_id as key and app doc as value

Type
object

(inner) processAppProps(app)

Source:

Validate and correct app's properties, by modifying original object

Parameters:
Name Type Description
app object

app document

(inner) validateAppUpdateProps(app) → {array}

Source:

Validate and correct an app update's properties, replacing invalid values with defaults

Parameters:
Name Type Description
app object

app update document

Returns:

invalidProps - keys of invalid properties

Type
array