Home Reference Source

References

summary
public

F compile(code: string): function

since 0.1.0
public

F parse(code: string): Object

since 0.1.0
public

F throwError(message: string, node: Object)

A shorthand function to throw a CompilerError

since 0.1.0
public

F validate(ast: Object)

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
private

The map in which published, cached functions are stored.

since 0.2.0
private

The map in which unpublished, cached functions are stored.

since 0.2.0
public

V cache: {"add": *, "init": *, "initRequest": *, "remove": *}

Cache functions exported in this module.

since 0.2.0
public

V compiler: {"_messages": *, "compileRequest": *, "compileString": *, "compileStringSync": *}

An object containg compiler fields and functions to be exported.

since 0.1.0
public

V messages: {"ILLEGAL_DIRNAME": string, "ILLEGAL_FILENAME": string, "ILLEGAL_CLEARIMMEDIATE": string, "ILLEGAL_CLEARINTERVAL": string, "ILLEGAL_CLEARTIMEOUT": string, "ILLEGAL_CONSOLE": string, "ILLEGAL_EXPORTS": string, "ILLEGAL_EVAL": string, "ILLEGAL_GLOBAL": string, "ILLEGAL_MODULE": string, "ILLEGAL_PROCESS": string, "ILLEGAL_REQUIRE": string, "ILLEGAL_SETIMMEDIATE": string, "ILLEGAL_SETINTERVAL": string, "ILLEGAL_SETTIMEOUT": string, "ILLEGAL_THIS": string, "MULTIPLE_TOP_LEVEL_STATEMENTS": string, "NOT_A_FUNCTION": string, "NOT_AN_ARROW_FUNCTION": string, "PARSER_FAILURE": string}

An object acting like a map where key represents the type of message and the value is a string with the message itself.

since 0.1.0
public

V responses: {"INVALID_ID": *, "INTERNAL_SERVER_ERROR": *, "MISSING_PARAMS": *, "MISSING_RESOURCE": *, "REMOVED_RESOURCE": *, "RESOURCE_NOT_FOUND": *, "SAVE_RESULT": *, "SUCCESS": *, "UPDATE_RESULT": *, "UPDATE_ERROR": *, "VALIDATION_ERROR": *}

An object acting like a map where key represents the type of response from a mongo database transaction (eg.

since 0.1.0
public

V util: {"getObjectId": *, "dbResultCallback": *}

Utility object.

since 0.1.0
public

V isTest: *

ignore

cealloga

summary
public

F core(plugins: *): Object

public

F dev(plugins: *): Array

public

F prod(plugins: *): Array

classes

summary
public

An instance of this class is passed into a compiled ceallog function when its corresponding service is called at /ceallog/*.

since 0.1.0
public

Error used by ceallog dev and prod routers

since 0.1.0
public

Error used by compiler

since 0.1.0
public

Normalised HTTP error class used prior to sending response.

since 0.1.0
public

Error used by list router

since 0.1.0
public

Error used by publisher router

since 0.1.0
public

Error used by record router

since 0.1.0
public

Error used by unpublish router

since 0.1.0
public

Error used by validate router

since 0.1.0

code

summary
public

F formatter(response: Object)

Used to format mongoose responses prior to sending json response.

since 0.1.0
public

F query(req: Object, res: Object, next: function): *

Queries code based on query string parameters provided.

since 0.1.0
public

F findNew(req: Object, res: Object, next: function)

Attempts to find the existing published resource by the id provided.

since 0.1.0
public

F findOld(req: Object, res: Object, next: function)

Attempts to find the existing published resource by the name of the new record.

since 0.1.0
public

Compiles the new code before proceeding.

since 0.1.0
public

F update(req: Object, res: Object, next: function)

Updates the old record published field to false and the new record published field to true.

since 0.1.0
public

F findPublished(req: Object, res: Object, next: function)

Attempts to find the existing published resource by the name provided.

since 0.1.0
public

F update(req: Object, res: Object, next: function)

Attempts to change published to false and update req.unpublisher.record.

since 0.1.0
public

F handleBody(req: Object, res: Object, next: function): *

Checks req.body to make sure it contains body, name, and label fields.

since 0.1.0
public

Proceeds to next function if no compiler error occured.

since 0.1.0
public

F save(req: Object, res: Object, next: function)

Saves code resource to mongodb.

since 0.1.0
public

F validateURIBlacklist(req: Object, res: Object, next: function): *

Checks whether req.body.name is in the URI blacklist and proceeds if not.

since 0.1.0
public

F validateURIComponent(req: Object, res: Object, next: function): *

Determines whether req.body.name is a valid URI component.

since 0.1.0
public

V messages: {"MISSING_NAME_PARAMETER": string}

An object acting like a map where key represents the type of message and the value is a string with the message itself.

since 0.1.0
public

V messages: {"MISSING_PARAMS": string, "NON_EXISTING_RESOURCE": string}

An object acting like a map where key represents the type of message and the value is a string with the message itself.

since 0.1.0
public

V messages: {"MISSING_PARAMS": string, "NON_EXISTING_RESOURCE": string}

An object acting like a map where key represents the type of message and the value is a string with the message itself.

since 0.1.0
public

V messages: {"MISSING_PARAMS": string, "NON_EXISTING_RESOURCE": string, "UNKNOWN_UPDATE_ERROR": string}

An object acting like a map where key represents the type of message and the value is a string with the message itself.

since 0.1.0
public

V messages: {"NAME_NOT_ALLOWED": string, "NO_BODY": string, "NO_LABEL": string, "NO_NAME": string, "INVALID_NAME": string, "UNEXPECTED_DB_RESULT": string}

An object acting like a map where key represents the type of message and the value is a string with the message itself.

since 0.1.0

plugins

summary
public

Number of days in which an unpublished ceallogFunction can remain cached.

since 0.2.0