Global

Members

(constant) IPC

Source:

Entry point for child_process.fork to run a corresponding resource / job.

Methods

clearTaskRecord(taskId) → {Promise}

Source:

clear task record in db with task id

Parameters:
Name Type Description
taskId string

the id of task in db.

Returns:

promise - Promise object

Type
Promise

create(params) → {Object}

Source:

Event Groups CRUD - The function creating to make a new event groups data.

Parameters:
Name Type Description
params Object

params

Returns:
Type
Object

createCollection(db, name, size) → {Promise}

Source:

Ensure capped collection exists and return latest document in it to start streaming from.

Parameters:
Name Type Default Description
db Mongo

db object

name String

collection name

size Number 10000000

collection size

Returns:

resolves to array of [collection, _id of last record]

Type
Promise

debounce(func, minWait, maxWait) → {function}

Source:

Debounce function which decreases number of calls to func to be once in minWait ... maxWait.

Parameters:
Name Type Description
func function

function to debounce

minWait number

minimal waiting time

maxWait number

maximal waiting time

Returns:

debounced function

Type
function

dig(config, over, name, value) → {object}

Source:

Digs one level down in config document

Parameters:
Name Type Description
config object

config to traverse

over object

override object

name string

name of config to override

value varies

value to set to config

Returns:

recursive config modification

Type
object

dot(obj, is, value) → {varies}

Source:

Get value in nested objects

Parameters:
Name Type Description
obj object

object to checl

is string | array

keys for nested value

value any

if provided acts as setter setting this value in nested object

Returns:

returns value in provided key in nested object

Type
varies

fromCountlyRoot(relativePath) → {string}

Source:

Resolves the given relative path to absolute from Countly repository root path.

Parameters:
Name Type Description
relativePath string

The path relative to Countly root directory.

Returns:

The absolute path resolved for the given relative path.

Type
string

getCountryName(cc) → {string}

Source:

Convert short country name to proper name

Parameters:
Name Type Description
cc string

short country name, for example, Trinidad

Returns:

normal country name

Type
string

getId() → {string}

Source:

Generate random id

Returns:

randomly generated id

Type
string

module:api/utils/log(name) → {module:api/utils/log~Logger}

Source:

Creates new logger object for provided module

Parameters:
Name Type Description
name string

name of the module

Returns:

logger object

Type
module:api/utils/log~Logger

promiseOrCallback(promise, callbackopt) → {Promise}

Source:

Return promise or callback based on params

Parameters:
Name Type Attributes Description
promise Promise

promise for data

callback function <optional>

callback to call

Returns:

Returned promise

Type
Promise

random() → {string}

Source:

Return random string

Returns:

random string

Type
string

(async) remove(params)

Source:

Event Groups CRUD - The function deleting which created Event Groups data by _id

Parameters:
Name Type Description
params Object

update(params)

Source:

Event Groups CRUD - The function updating which created Event Groups data by _id

Parameters:
Name Type Description
params Object

Type Definitions

APICallback(error, responseMessage, headers, returnCode, params)

Source:

Custom API response handler callback

Parameters:
Name Type Description
error bool

true if there was problem processing request, and false if request was processed successfully

responseMessage string

what API returns

headers object

what API would have returned to HTTP request

returnCode number

HTTP code, what API would have returned to HTTP request

params params

request context that was passed to requestProcessor, modified during request processing

params

Source:
Properties:
Name Type Description
href string

full URL href

res res

nodejs response object

req req

nodejs request object

qstring object

all the passed fields either through query string in GET requests or body and query string for POST requests

apiPath string

two top level url path, for example /i/analytics

fullPath string

full url path, for example /i/analytics/dashboards

files object

object with uploaded files, available in POST requests which upload files

cancelRequest string

Used for skipping SDK requests, if contains true, then request should be ignored and not processed. Can be set at any time by any plugin, but API only checks for it in beggining after / and /sdk events, so that is when plugins should set it if needed. Should contain reason for request cancelation

bulk boolean

True if this SDK request is processed from the bulk method

promises array

Array of the promises by different events. When all promises are fulfilled, request counts as processed

ip_address string

IP address of the device submitted request, exists in all SDK requests

user object

Data with some user info, like country geolocation, etc from the request, exists in all SDK requests

app_user object

Document from the app_users collection for current user, exists in all SDK requests after validation

app_user_id object

ID of app_users document for the user, exists in all SDK requests after validation

app object

Document for the app sending request, exists in all SDK requests after validation and after validateUserForDataReadAPI validation

app_id ObjectID

ObjectID of the app document, available after validation

app_cc string

Selected app country, available after validation

appTimezone string

Selected app timezone, available after validation

member object

All data about dashboard user sending the request, exists on all requests containing api_key, after validation through validation methods

time timeObject

Time object for the request

Main request processing object containing all information shared through all the parts of the same request

Type:
  • object

timeObject

Source:
Properties:
Name Type Description
now momentjs

momentjs instance for request's time in app's timezone

nowUTC momentjs

momentjs instance for request's time in UTC

nowWithoutTimestamp momentjs

momentjs instance for current time in app's timezone

timestamp number

request's seconds timestamp

mstimestamp number

request's miliseconds timestamp

yearly string

year of request time in app's timezone in YYYY format

monthly string

month of request time in app's timezone in YYYY.M format

daily string

date of request time in app's timezone in YYYY.M.D format

hourly string

hour of request time in app's timezone in YYYY.M.D.H format

weekly number

week of request time in app's timezone as result day of the year, divided by 7

month string

month of request time in app's timezone in format M

day string

day of request time in app's timezone in format D

hour string

hour of request time in app's timezone in format H

Type:
  • object