1
0
Fork 0

Updated aqb to 1.6.0.

This commit is contained in:
Alan Plum 2015-01-13 13:09:40 +01:00
parent 6999a6e3e4
commit b0517096f3
5 changed files with 75 additions and 85 deletions

View File

@ -3,6 +3,13 @@ v2.5.0 (XXXX-XX-XX)
* RequestContext#bodyParam now accepts arbitrary joi schemas and rejects invalid (but well-formed) request bodies. * RequestContext#bodyParam now accepts arbitrary joi schemas and rejects invalid (but well-formed) request bodies.
v2.4.1 (XXXX-XX-XX)
-------------------
* updated AQB module to 1.6.0.
v2.4.0 (XXXX-XX-XX) v2.4.0 (XXXX-XX-XX)
------------------- -------------------

4
js/node/node_modules/aqb/README.md generated vendored
View File

@ -462,6 +462,10 @@ qb.for('doc').in('my_collection').return('doc._key').toAQL()
`PartialStatement::collect(definitions).into(varname) : Statement` `PartialStatement::collect(definitions).into(varname) : Statement`
### COLLECT var1 = expr1, var2 = expr2, …, varn = exprn INTO varname COUNT
`PartialStatement::collect(definitions).into(varname).count() : Statement`
### SORT args… ### SORT args…
`PartialStatement::sort(args…) : Statement` `PartialStatement::sort(args…) : Statement`

File diff suppressed because one or more lines are too long

135
js/node/node_modules/aqb/types.js generated vendored
View File

@ -240,7 +240,7 @@ Identifier.prototype = new Expression();
Identifier.prototype.constructor = Identifier; Identifier.prototype.constructor = Identifier;
Identifier.prototype.toAQL = function () { Identifier.prototype.toAQL = function () {
var value = String(this.value); var value = String(this.value);
if (keywords.indexOf(value.toLowerCase()) === -1) { if (keywords.indexOf(value.toLowerCase()) === -1 && value.indexOf('-') === -1) {
return value; return value;
} }
return '`' + value + '`'; return '`' + value + '`';
@ -506,7 +506,7 @@ function CollectExpression(prev, dfns) {
CollectExpression.prototype = new PartialStatement(); CollectExpression.prototype = new PartialStatement();
CollectExpression.prototype.constructor = CollectExpression; CollectExpression.prototype.constructor = CollectExpression;
CollectExpression.prototype.into = function (varname) { CollectExpression.prototype.into = function (varname) {
return new CollectIntoExpression(this.prev, this.dfns, varname); return new CollectIntoExpression(this, varname);
}; };
CollectExpression.prototype.toAQL = function () { CollectExpression.prototype.toAQL = function () {
return ( return (
@ -514,10 +514,13 @@ CollectExpression.prototype.toAQL = function () {
'COLLECT ' + this.dfns.toAQL() 'COLLECT ' + this.dfns.toAQL()
); );
}; };
CollectExpression.prototype.keep = function () {
var args = Array.prototype.slice.call(arguments);
return new CollectKeepExpression(this, args);
};
function CollectIntoExpression(prev, dfns, varname) { function CollectIntoExpression(prev, varname) {
this.prev = prev; this.prev = prev;
this.dfns = new Definitions(dfns);
this.varname = new Identifier(varname); this.varname = new Identifier(varname);
} }
CollectIntoExpression.prototype = new PartialStatement(); CollectIntoExpression.prototype = new PartialStatement();
@ -525,10 +528,46 @@ CollectIntoExpression.prototype.constructor = CollectIntoExpression;
CollectIntoExpression.prototype.toAQL = function () { CollectIntoExpression.prototype.toAQL = function () {
return ( return (
(this.prev ? this.prev.toAQL() + ' ' : '') + (this.prev ? this.prev.toAQL() + ' ' : '') +
'COLLECT ' + this.dfns.toAQL() + 'INTO ' + this.varname.toAQL()
' INTO ' + this.varname.toAQL()
); );
}; };
CollectIntoExpression.prototype.count = function () {
return new CollectCountExpression(this);
};
CollectIntoExpression.prototype.keep = CollectExpression.prototype.keep;
function CollectCountExpression(prev) {
this.prev = prev;
}
CollectCountExpression.prototype = new PartialStatement();
CollectCountExpression.prototype.constructor = CollectCountExpression;
CollectCountExpression.prototype.toAQL = function () {
return (
(this.prev ? this.prev.toAQL() + ' ' : '') +
'COUNT'
);
};
CollectCountExpression.prototype.keep = CollectExpression.prototype.keep;
function CollectKeepExpression(prev, args) {
if (!args || !Array.isArray(args)) {
throw new AqlError('Expected sort list to be an array: ' + args);
}
if (!args.length) {
throw new AqlError('Expected sort list not to be empty: ' + args);
}
this.prev = prev;
this.args = args.map(autoCastToken);
}
CollectKeepExpression.prototype = new PartialStatement();
CollectKeepExpression.prototype.constructor = CollectKeepExpression;
CollectKeepExpression.prototype.toAQL = function () {
return (
(this.prev ? this.prev.toAQL() + ' ' : '') +
'KEEP ' + this.args.map(wrapAQL).join(', ')
);
};
CollectKeepExpression.prototype.keep = CollectExpression.prototype.keep;
function SortExpression(prev, args) { function SortExpression(prev, args) {
if (!args || !Array.isArray(args)) { if (!args || !Array.isArray(args)) {
@ -623,7 +662,7 @@ function RemoveExpression(prev, expr, collection) {
RemoveExpression.prototype = new Statement(); RemoveExpression.prototype = new Statement();
RemoveExpression.prototype.constructor = RemoveExpression; RemoveExpression.prototype.constructor = RemoveExpression;
RemoveExpression.prototype.options = function (opts) { RemoveExpression.prototype.options = function (opts) {
return new RemoveExpressionWithOptions(this.prev, this.expr, this.collection, opts); return new OptionsExpression(this, opts);
}; };
RemoveExpression.prototype.toAQL = function () { RemoveExpression.prototype.toAQL = function () {
return ( return (
@ -633,20 +672,16 @@ RemoveExpression.prototype.toAQL = function () {
); );
}; };
function RemoveExpressionWithOptions(prev, expr, collection, opts) { function OptionsExpression(prev, opts) {
this.prev = prev; this.prev = prev;
this.expr = autoCastToken(expr);
this.collection = new Identifier(collection);
this.opts = autoCastToken(opts); this.opts = autoCastToken(opts);
} }
RemoveExpressionWithOptions.prototype = new Statement(); OptionsExpression.prototype = new Statement();
RemoveExpressionWithOptions.prototype.constructor = RemoveExpressionWithOptions; OptionsExpression.prototype.constructor = OptionsExpression;
RemoveExpressionWithOptions.prototype.toAQL = function () { OptionsExpression.prototype.toAQL = function () {
return ( return (
(this.prev ? this.prev.toAQL() + ' ' : '') + (this.prev ? this.prev.toAQL() + ' ' : '') +
'REMOVE ' + wrapAQL(this.expr) + 'OPTIONS ' + wrapAQL(this.opts)
' IN ' + wrapAQL(this.collection) +
' OPTIONS ' + wrapAQL(this.opts)
); );
}; };
@ -658,7 +693,7 @@ function InsertExpression(prev, expr, collection) {
InsertExpression.prototype = new Statement(); InsertExpression.prototype = new Statement();
InsertExpression.prototype.constructor = InsertExpression; InsertExpression.prototype.constructor = InsertExpression;
InsertExpression.prototype.options = function (opts) { InsertExpression.prototype.options = function (opts) {
return new InsertExpressionWithOptions(this.prev, this.expr, this.collection, opts); return new OptionsExpression(this, opts);
}; };
InsertExpression.prototype.toAQL = function () { InsertExpression.prototype.toAQL = function () {
return ( return (
@ -668,23 +703,6 @@ InsertExpression.prototype.toAQL = function () {
); );
}; };
function InsertExpressionWithOptions(prev, expr, collection, opts) {
this.prev = prev;
this.expr = autoCastToken(expr);
this.collection = new Identifier(collection);
this.opts = autoCastToken(opts);
}
InsertExpressionWithOptions.prototype = new Statement();
InsertExpressionWithOptions.prototype.constructor = InsertExpressionWithOptions;
InsertExpressionWithOptions.prototype.toAQL = function () {
return (
(this.prev ? this.prev.toAQL() + ' ' : '') +
'INSERT ' + wrapAQL(this.expr) +
' INTO ' + wrapAQL(this.collection) +
' OPTIONS ' + wrapAQL(this.opts)
);
};
function UpdateExpression(prev, expr, withExpr, collection) { function UpdateExpression(prev, expr, withExpr, collection) {
this.prev = prev; this.prev = prev;
this.expr = autoCastToken(expr); this.expr = autoCastToken(expr);
@ -694,7 +712,7 @@ function UpdateExpression(prev, expr, withExpr, collection) {
UpdateExpression.prototype = new Statement(); UpdateExpression.prototype = new Statement();
UpdateExpression.prototype.constructor = UpdateExpression; UpdateExpression.prototype.constructor = UpdateExpression;
UpdateExpression.prototype.options = function (opts) { UpdateExpression.prototype.options = function (opts) {
return new UpdateExpressionWithOptions(this.prev, this.expr, this.withExpr, this.collection, opts); return new OptionsExpression(this, opts);
}; };
UpdateExpression.prototype.toAQL = function () { UpdateExpression.prototype.toAQL = function () {
return ( return (
@ -705,25 +723,6 @@ UpdateExpression.prototype.toAQL = function () {
); );
}; };
function UpdateExpressionWithOptions(prev, expr, withExpr, collection, opts) {
this.prev = prev;
this.expr = autoCastToken(expr);
this.withExpr = withExpr === undefined ? undefined : autoCastToken(withExpr);
this.collection = new Identifier(collection);
this.opts = autoCastToken(opts);
}
UpdateExpressionWithOptions.prototype = new Statement();
UpdateExpressionWithOptions.prototype.constructor = UpdateExpressionWithOptions;
UpdateExpressionWithOptions.prototype.toAQL = function () {
return (
(this.prev ? this.prev.toAQL() + ' ' : '') +
'UPDATE ' + wrapAQL(this.expr) +
(this.withExpr ? ' WITH ' + wrapAQL(this.withExpr) : '') +
' IN ' + wrapAQL(this.collection) +
' OPTIONS ' + wrapAQL(this.opts)
);
};
function ReplaceExpression(prev, expr, withExpr, collection) { function ReplaceExpression(prev, expr, withExpr, collection) {
this.prev = prev; this.prev = prev;
this.expr = autoCastToken(expr); this.expr = autoCastToken(expr);
@ -733,7 +732,7 @@ function ReplaceExpression(prev, expr, withExpr, collection) {
ReplaceExpression.prototype = new Statement(); ReplaceExpression.prototype = new Statement();
ReplaceExpression.prototype.constructor = ReplaceExpression; ReplaceExpression.prototype.constructor = ReplaceExpression;
ReplaceExpression.prototype.options = function (opts) { ReplaceExpression.prototype.options = function (opts) {
return new ReplaceExpressionWithOptions(this.prev, this.expr, this.withExpr, this.collection, opts); return new OptionsExpression(this, opts);
}; };
ReplaceExpression.prototype.toAQL = function () { ReplaceExpression.prototype.toAQL = function () {
return ( return (
@ -744,25 +743,6 @@ ReplaceExpression.prototype.toAQL = function () {
); );
}; };
function ReplaceExpressionWithOptions(prev, expr, withExpr, collection, opts) {
this.prev = prev;
this.expr = autoCastToken(expr);
this.withExpr = withExpr === undefined ? undefined : autoCastToken(withExpr);
this.collection = new Identifier(collection);
this.opts = autoCastToken(opts);
}
ReplaceExpressionWithOptions.prototype = new Statement();
ReplaceExpressionWithOptions.prototype.constructor = ReplaceExpressionWithOptions;
ReplaceExpressionWithOptions.prototype.toAQL = function () {
return (
(this.prev ? this.prev.toAQL() + ' ' : '') +
'REPLACE ' + wrapAQL(this.expr) +
(this.withExpr ? ' WITH ' + wrapAQL(this.withExpr) : '') +
' IN ' + wrapAQL(this.collection) +
' OPTIONS ' + wrapAQL(this.opts)
);
};
exports.autoCastToken = autoCastToken; exports.autoCastToken = autoCastToken;
exports.RawExpression = RawExpression; exports.RawExpression = RawExpression;
exports.NullLiteral = NullLiteral; exports.NullLiteral = NullLiteral;
@ -800,7 +780,6 @@ exports._Statement = Statement;
exports._PartialStatement = PartialStatement; exports._PartialStatement = PartialStatement;
exports._Definitions = Definitions; exports._Definitions = Definitions;
exports._CollectIntoExpression = CollectIntoExpression; exports._CollectIntoExpression = CollectIntoExpression;
exports._RemoveExpressionWithOptions = RemoveExpressionWithOptions; exports._CollectCountExpression = CollectCountExpression;
exports._InsertExpressionWithOptions = InsertExpressionWithOptions; exports._CollectKeepExpression = CollectKeepExpression;
exports._UpdateExpressionWithOptions = UpdateExpressionWithOptions; exports._OptionsExpression = OptionsExpression;
exports._ReplaceExpressionWithOptions = ReplaceExpressionWithOptions;

View File

@ -1,6 +1,6 @@
{ {
"dependencies": { "dependencies": {
"aqb": "1.5.2", "aqb": "1.6.0",
"buster-format": "0.5.6", "buster-format": "0.5.6",
"cheerio": "0.17.0", "cheerio": "0.17.0",
"coffee-script": "1.7.1", "coffee-script": "1.7.1",