Module: jiveutil

jiveutil

Library of useful functions.

Source:

Members

<static> iterator :*

Type:
  • *
Source:

<static> oauth :*

Type:
  • *
Source:

<static> request :module:jiveRequest

Useful request related utilities

Type:
  • module:jiveRequest
Source:

Methods

<static> base64Decode(str) → {*|string}

Parameters:
Name Type Description
str
Source:
Returns:
Type
* | string

<static> base64Encode(object) → {*|string}

Parameters:
Name Type Description
object
Source:
Returns:
Type
* | string

<static> basicAuthorizationHeaderValid(auth, clientId, clientSecret, authRequired) → {boolean}

Parameters:
Name Type Description
auth
clientId
clientSecret
authRequired
Source:
Returns:
Type
boolean

<static> buildRequest(url, method, postBody, headers, requestOptions) → {Promise}

By default this will build a request of type 'application/json'. Set a Content-Type header explicitly if its supposed to be a different type.

Parameters:
Name Type Description
url String
method String
postBody Object

leave null unless PUT or POST

headers Object

leave null or empty [] if no additional headers

requestOptions Object

leave null or empty [] if no additional request optinos

Source:
Returns:

Promise

Type
Promise

<static> fscopy(source, target) → {Promise}

Parameters:
Name Type Description
source
target
Source:
Returns:

Promise

Type
Promise

<static> fsexists(path) → {Promise}

Parameters:
Name Type Description
path
Source:
Returns:

Promise

Type
Promise

<static> fsGetSize(filename) → {Promise}

Gets the file size in bytes.

Parameters:
Name Type Description
filename

the path to the file.

Source:
Returns:

Promise

Type
Promise

<static> fsisdir(path) → {Promise}

Parameters:
Name Type Description
path
Source:
Returns:

Promise

Type
Promise

<static> fsmkdir(path) → {Promise}

Parameters:
Name Type Description
path
Source:
Returns:

Promise

Type
Promise

<static> fsread(path) → {Promise}

Parameters:
Name Type Description
path
Source:
Returns:

Promise

Type
Promise

<static> fsreaddir(path) → {Promise}

Parameters:
Name Type Description
path
Source:
Returns:

Promise

Type
Promise

<static> fsreadJson(path) → {Promise}

Parameters:
Name Type Description
path
Source:
Returns:

Promise

Type
Promise

<static> fsrename(source, target, force) → {Promise}

Parameters:
Name Type Description
source
target
force
Source:
Returns:

Promise

Type
Promise

<static> fsrmdir(path) → {Promise}

Parameters:
Name Type Description
path
Source:
Returns:

Promise

Type
Promise

<static> fsTemplateCopy(source, target, substitutions) → {Promise}

Parameters:
Name Type Description
source
target
substitutions
Source:
Returns:

Promise

Type
Promise

<static> fsTemplateRead(source, substitutions) → {Promise}

Parameters:
Name Type Description
source
substitutions
Source:
Returns:

Promise

Type
Promise

<static> fsTemplateWrite(data, target, substitutions) → {Promise}

Parameters:
Name Type Description
data
target
substitutions
Source:
Returns:

Promise

Type
Promise

<static> fswrite(data, path) → {Promise}

Parameters:
Name Type Description
data
path
Source:
Returns:

Promise

Type
Promise

<static> guid() → {String}

Useful general utility functions.

Source:
Returns:

guid

Type
String

<static> jiveAuthorizationHeaderValid(auth, clientId, clientSecret, authRequired) → {boolean}

Parameters:
Name Type Description
auth
clientId
clientSecret
authRequired
Source:
Returns:
Type
boolean

<static> recursiveCopy(root, target, force, substitutions, file) → {Promise}

Parameters:
Name Type Description
root
target
force
substitutions
file
Source:
Returns:

Promise

Type
Promise

<static> recursiveDirectoryProcessor(currentFsItem, root, targetRoot, force, processor) → {Promise}

Parameters:
Name Type Description
currentFsItem
root
targetRoot
force
processor
Source:
Returns:

Promise

Type
Promise

<static> sortObject(o) → {Object}

Parameters:
Name Type Description
o
Source:
Returns:
Type
Object

<static> zipFolder(root, targetZip, flatten) → {Promise}

Parameters:
Name Type Description
root
targetZip
flatten
Source:
Returns:

Promise

Type
Promise