alchemymvc 1.4.0-alpha.8 → 1.4.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/class/conduit.js +2 -2
- package/lib/class/model.js +13 -8
- package/lib/core/alchemy_functions.js +6 -2
- package/package.json +1 -1
package/lib/class/conduit.js
CHANGED
|
@@ -511,7 +511,7 @@ Conduit.setMethod(function time() {
|
|
|
511
511
|
*
|
|
512
512
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
513
513
|
* @since 0.2.0
|
|
514
|
-
* @version 1.
|
|
514
|
+
* @version 1.4.0
|
|
515
515
|
*
|
|
516
516
|
* @param {IncomingMessage} req
|
|
517
517
|
* @param {ServerResponse} res
|
|
@@ -541,7 +541,7 @@ Conduit.setMethod(async function parseRequest() {
|
|
|
541
541
|
}
|
|
542
542
|
|
|
543
543
|
if (this.rewritten_request_route_param) {
|
|
544
|
-
let params = Object.assign({}, this.route_string_parameters, this.rewritten_request_route_param);
|
|
544
|
+
let params = Object.assign({...this.url.query}, this.route_string_parameters, this.rewritten_request_route_param);
|
|
545
545
|
let new_url = this.route.generateUrl(params, this);
|
|
546
546
|
this.overrideResponseUrl(new_url);
|
|
547
547
|
}
|
package/lib/class/model.js
CHANGED
|
@@ -679,21 +679,26 @@ Model.setMethod(function disableTranslations() {
|
|
|
679
679
|
*
|
|
680
680
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
681
681
|
* @since 0.5.0
|
|
682
|
-
* @version
|
|
682
|
+
* @version 1.4.0
|
|
683
683
|
*
|
|
684
684
|
* @param {Array} pipeline
|
|
685
685
|
* @param {Function} callback
|
|
686
686
|
*/
|
|
687
|
-
Model.setMethod(function aggregate(pipeline, callback) {
|
|
687
|
+
Model.setMethod(async function aggregate(pipeline, callback) {
|
|
688
688
|
|
|
689
|
-
this.datasource.collection(this.table
|
|
689
|
+
let collection = await this.datasource.collection(this.table);
|
|
690
690
|
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
691
|
+
if (err) {
|
|
692
|
+
return pledge.reject(err);
|
|
693
|
+
}
|
|
694
694
|
|
|
695
|
-
|
|
696
|
-
|
|
695
|
+
let cursor = collection.aggregate(pipeline);
|
|
696
|
+
|
|
697
|
+
if (typeof callback == 'function') {
|
|
698
|
+
callback(null, cursor);
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
return cursor;
|
|
697
702
|
});
|
|
698
703
|
|
|
699
704
|
/**
|
|
@@ -1159,7 +1159,7 @@ function convertDataUriToFile(data_uri) {
|
|
|
1159
1159
|
*
|
|
1160
1160
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
1161
1161
|
* @since 1.3.0
|
|
1162
|
-
* @version 1.
|
|
1162
|
+
* @version 1.4.0
|
|
1163
1163
|
*
|
|
1164
1164
|
* @param {string} url
|
|
1165
1165
|
*
|
|
@@ -1226,10 +1226,14 @@ Alchemy.setMethod(function download(url, options) {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
|
|
1228
1228
|
if (!name) {
|
|
1229
|
-
name = alchemy.ObjectId();
|
|
1229
|
+
name = alchemy.ObjectId() + '';
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
1232
|
|
|
1233
|
+
if (!name || typeof name != 'string') {
|
|
1234
|
+
name = alchemy.ObjectId() + '';
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1233
1237
|
if (name.indexOf('/') > -1) {
|
|
1234
1238
|
name = name.replaceAll('/', '-');
|
|
1235
1239
|
}
|