Library of useful functions.
- Source:
Members
-
<static> iterator :*
-
Type:
- *
-
<static> oauth :*
-
Type:
- *
-
<static> request :module:jiveRequest
-
Useful request related utilities
Type:
- module:jiveRequest
Methods
-
<static> base64Decode(str) → {*|string}
-
Parameters:
Name Type Description str
Returns:
- Type
- * | string
-
<static> base64Encode(object) → {*|string}
-
Parameters:
Name Type Description object
Returns:
- Type
- * | string
-
<static> basicAuthorizationHeaderValid(auth, clientId, clientSecret, authRequired) → {boolean}
-
Parameters:
Name Type Description auth
clientId
clientSecret
authRequired
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
Returns:
Promise
- Type
- Promise
-
<static> fsexists(path) → {Promise}
-
Parameters:
Name Type Description path
Returns:
Promise
- Type
- Promise
-
<static> fsGetSize(filename) → {Promise}
-
Gets the file size in bytes.
Parameters:
Name Type Description filename
the path to the file.
Returns:
Promise
- Type
- Promise
-
<static> fsisdir(path) → {Promise}
-
Parameters:
Name Type Description path
Returns:
Promise
- Type
- Promise
-
<static> fsmkdir(path) → {Promise}
-
Parameters:
Name Type Description path
Returns:
Promise
- Type
- Promise
-
<static> fsread(path) → {Promise}
-
Parameters:
Name Type Description path
Returns:
Promise
- Type
- Promise
-
<static> fsreaddir(path) → {Promise}
-
Parameters:
Name Type Description path
Returns:
Promise
- Type
- Promise
-
<static> fsreadJson(path) → {Promise}
-
Parameters:
Name Type Description path
Returns:
Promise
- Type
- Promise
-
<static> fsrename(source, target, force) → {Promise}
-
Parameters:
Name Type Description source
target
force
Returns:
Promise
- Type
- Promise
-
<static> fsrmdir(path) → {Promise}
-
Parameters:
Name Type Description path
Returns:
Promise
- Type
- Promise
-
<static> fsTemplateCopy(source, target, substitutions) → {Promise}
-
Parameters:
Name Type Description source
target
substitutions
Returns:
Promise
- Type
- Promise
-
<static> fsTemplateRead(source, substitutions) → {Promise}
-
Parameters:
Name Type Description source
substitutions
Returns:
Promise
- Type
- Promise
-
<static> fsTemplateWrite(data, target, substitutions) → {Promise}
-
Parameters:
Name Type Description data
target
substitutions
Returns:
Promise
- Type
- Promise
-
<static> fswrite(data, path) → {Promise}
-
Parameters:
Name Type Description data
path
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
Returns:
- Type
- boolean
-
<static> recursiveCopy(root, target, force, substitutions, file) → {Promise}
-
Parameters:
Name Type Description root
target
force
substitutions
file
Returns:
Promise
- Type
- Promise
-
<static> recursiveDirectoryProcessor(currentFsItem, root, targetRoot, force, processor) → {Promise}
-
Parameters:
Name Type Description currentFsItem
root
targetRoot
force
processor
Returns:
Promise
- Type
- Promise
-
<static> sortObject(o) → {Object}
-
Parameters:
Name Type Description o
Returns:
- Type
- Object
-
<static> zipFolder(root, targetZip, flatten) → {Promise}
-
Parameters:
Name Type Description root
targetZip
flatten
Returns:
Promise
- Type
- Promise