Function
Static Public Summary | ||
public |
|
since 0.1.0 |
public |
|
|
public |
|
|
public |
Attempts to find the existing published resource by the id provided. |
since 0.1.0 |
public |
Attempts to find the existing published resource by the name of the new record. |
since 0.1.0 |
public |
findPublished(req: Object, res: Object, next: function) Attempts to find the existing published resource by the name provided. |
since 0.1.0 |
public |
Used to format mongoose responses prior to sending json response. |
since 0.1.0 |
public |
handleBody(req: Object, res: Object, next: function): * Checks |
since 0.1.0 |
public |
handleCompilerResult(req: Object, res: Object, next: function) Compiles the new code before proceeding. |
since 0.1.0 |
public |
handleCompilerResult(req: Object, res: Object, next: function) Proceeds to next function if no compiler error occured. |
since 0.1.0 |
public |
|
since 0.1.0 |
public |
|
|
public |
Queries code based on query string parameters provided. |
since 0.1.0 |
public |
Saves code resource to mongodb. |
since 0.1.0 |
public |
throwError(message: string, node: Object) A shorthand function to throw a |
since 0.1.0 |
public |
Attempts to change published to false and update
|
since 0.1.0 |
public |
Updates the old record |
since 0.1.0 |
public |
A void function that validates a ceallog function syntax tree based on a series of rules, and throwing an error if not. |
since 0.1.0 |
public |
validateURIBlacklist(req: Object, res: Object, next: function): * Checks whether |
since 0.1.0 |
public |
validateURIComponent(req: Object, res: Object, next: function): * Determines whether |
since 0.1.0 |
Static Public
public compile(code: string): function since 0.1.0 source
Params:
Name | Type | Attribute | Description |
code | string | Code to compile. |
Return:
function | A closure function that takes a |
public core(plugins: *): Object source
Params:
Name | Type | Attribute | Description |
plugins | * | {...Object} Plugin modules to be applied to ceallog function execution |
public dev(plugins: *): Array source
Params:
Name | Type | Attribute | Description |
plugins | * | {...Object} Plugin modules to be applied to ceallog function execution |
public findNew(req: Object, res: Object, next: function) since 0.1.0 source
Attempts to find the existing published resource by the id provided. If
successful, the result is added to req.publisher.newRecord
.
public findOld(req: Object, res: Object, next: function) since 0.1.0 source
Attempts to find the existing published resource by the name of the new
record. If successful, the result is added to req.publisher.oldRecord
.
public findPublished(req: Object, res: Object, next: function) since 0.1.0 source
Attempts to find the existing published resource by the name provided.
If successful, the result is added to req.unpublisher.result
.
public formatter(response: Object) since 0.1.0 source
Used to format mongoose responses prior to sending json response.
Params:
Name | Type | Attribute | Description |
response | Object | mongoose response to be formatted. |
public handleBody(req: Object, res: Object, next: function): * since 0.1.0 source
Checks req.body
to make sure it contains body
, name
, and label
fields. If not, an error is sent via res
. If so, the next function is
called.
Return:
* |
public handleCompilerResult(req: Object, res: Object, next: function) since 0.1.0 source
Compiles the new code before proceeding.
public handleCompilerResult(req: Object, res: Object, next: function) since 0.1.0 source
Proceeds to next function if no compiler error occured. If an error did
occur, it is normalised as an HttpError
, including location information if
available, then sent with a 400 status code.
public parse(code: string): Object since 0.1.0 source
Params:
Name | Type | Attribute | Description |
code | string | String containing code to be parsed. |
public prod(plugins: *): Array source
Params:
Name | Type | Attribute | Description |
plugins | * | {...Object} Plugin modules to be applied to ceallog function execution |
public query(req: Object, res: Object, next: function): * since 0.1.0 source
Queries code based on query string parameters provided. If none are provided, the latest results for each ceallog function name is sent.
Return:
* |
public save(req: Object, res: Object, next: function) since 0.1.0 source
Saves code resource to mongodb. Sends 201 response if successful, error response otherwise.
public throwError(message: string, node: Object) since 0.1.0 source
A shorthand function to throw a CompilerError
Throw:
Error with line location info if applicable. |
public update(req: Object, res: Object, next: function) since 0.1.0 source
Attempts to change published to false and update
req.unpublisher.record
.
public update(req: Object, res: Object, next: function) since 0.1.0 source
Updates the old record published
field to false
and the new record
published
field to true
.
public validate(ast: Object) since 0.1.0 source
A void function that validates a ceallog function syntax tree based on a series of rules, and throwing an error if not.
Params:
Name | Type | Attribute | Description |
ast | Object | ceallog function abstract syntax tree to be validated. |
public validateURIBlacklist(req: Object, res: Object, next: function): * since 0.1.0 source
Checks whether req.body.name
is in the URI blacklist and proceeds if
not. Sends a 400 response otherwise.
Return:
* |
public validateURIComponent(req: Object, res: Object, next: function): * since 0.1.0 source
Determines whether req.body.name
is a valid URI component.
This function is a limitted implementation of the rules for RFC-2396: URI
Generic Syntax (https://www.ietf.org/rfc/rfc2396.txt) as applied to relative
segment URI components (see section 5).
Return:
* |