This module is meant for managing apps
- Description:
This module is meant for managing apps
- Source:
Methods
(static) createApp(params) → {boolean}
- Description:
Creates new app, and outputs result to browser
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object with args to create app |
Returns:
true if operation successful
- Type
- boolean
(static) deleteApp(params) → {boolean}
- Description:
Deletes existing app's and outputs result to browser
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object with app_id to delete |
Returns:
true if operation successful
- Type
- boolean
(static) getAllApps(params) → {boolean}
- Description:
Get all apps and outputs to browser, requires global admin permission
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true if got data from db, false if did not
- Type
- boolean
(static) getAppPlugins(params) → {boolean}
- Description:
Returns application level configurations
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object with query parameters appId and name(optional parameter) |
Returns:
returns true;
- Type
- boolean
(static) getAppsDetails(params) → {boolean}
- Description:
Gets app details for specific app and outputs to browser
- Source:
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}
- Description:
Get only apps that current user has access to and outputs to browser
- Source:
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}
- Description:
Resets app to clean state
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object with app_id to reset |
Returns:
true if operation successful
- Type
- boolean
(static) updateApp(params) → {boolean}
- Description:
Updates existing app, and outputs result to browser
- Source:
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}
- Description:
Updates existing app's configurations and outputs result to browser
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object with args to update app with |
Returns:
true if operation successful
- Type
- boolean
(inner) checkUniqueKey(params, callback, update)
- Description:
Check if APP KEY is unique before updating app
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
callback |
function | callback to update app |
update |
boolean | true when updating app, false when creating new app |
(inner) deleteAllAppData(appId, fromAppDelete, params, app)
- Description:
Deletes all app's data or resets data to clean state
- Source:
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)
- Description:
Deletes app's data, either all or for specific period, as well as can reset data to clean state
- Source:
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)
- Description:
Deletes long tasks for app
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
appId |
string | id of the app for which to delete data |
(inner) deletePeriodAppData(appId, fromAppDelete, params, app)
- Description:
Deletes app's data for specific period
- Source:
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 |
(async, inner) iconUpload(params) → {object}
- Description:
upload app icon function
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object with args to create app |
Returns:
return promise object;
- Type
- object
(inner) isValidCategory(category) → {boolean}
- Description:
Validate category
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
category |
string | category value |
Returns:
if category was valid or not
- Type
- boolean
(inner) isValidCountry(country) → {boolean}
- Description:
Validate country
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
country |
string | country value |
Returns:
if country was valid or not
- Type
- boolean
(inner) isValidTimezone(timezone) → {boolean}
- Description:
Validate timezone
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
timezone |
string | timezone value |
Returns:
if timezone was valid or not
- Type
- boolean
(inner) isValidType(type) → {boolean}
- Description:
Validate app type
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
type |
string | type value |
Returns:
if type was valid or not
- Type
- boolean
(inner) packApps(apps) → {object}
- Description:
Converts apps array into object with app_id as key
- Source:
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)
- Description:
Validate and correct app's properties, by modifying original object
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
app |
object | app document |
(inner) validateAppUpdateProps(app) → {array}
- Description:
Validate and correct an app update's properties, replacing invalid values with defaults
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
app |
object | app update document |
Returns:
invalidProps - keys of invalid properties
- Type
- array