elderwand 0.1.67 → 0.1.70

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.
@@ -97,6 +97,7 @@ module.exports.inherit = function (child) {
97
97
  page: page + 1,
98
98
  pages: pages,
99
99
  perPage: perPage,
100
+ pageCount: pageCount,
100
101
  isFiltered: Object.keys(req.anyKey).length > 0 ? true : false,
101
102
  //menu: utils.getUserMenu(req.user),
102
103
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elderwand",
3
- "version": "0.1.67",
3
+ "version": "0.1.70",
4
4
  "description": "Mamtas Technology Internal Framework",
5
5
  "main": "./node_modules/.bin/nodemon index.js",
6
6
  "scripts": {
package/utils/utils.js CHANGED
@@ -208,7 +208,7 @@ exports.doRequest = function(options, http, cb){
208
208
 
209
209
  if(options.method != "GET"){
210
210
  if(options.encodingType == "json"){
211
- post_data = Buffer.from(JSON.stringify(options.postData),'utf8');
211
+ post_data = new Buffer(JSON.stringify(options.postData), "utf-8");
212
212
  options.headers['Content-Length'] = post_data.length;
213
213
  options.headers['Content-Type'] = "application/json";
214
214
 
@@ -217,12 +217,11 @@ exports.doRequest = function(options, http, cb){
217
217
  options.headers['Content-Length'] = post_data.length;
218
218
 
219
219
  }else{
220
- post_data = Buffer.from(querystring.stringify(options.postData),'utf8');
220
+ post_data = querystring.stringify(options.postData);
221
221
  options.headers['Content-Length'] = post_data.length;
222
222
  options.headers['Content-Type'] = "application/x-www-form-urlencoded; charset=UTF-8";
223
223
  }
224
224
  }
225
- //EWLog(options)
226
225
  var req = http.request(options, function(res){
227
226
  res.setEncoding(options.encoding);
228
227
  var data = '';
@@ -238,7 +237,11 @@ exports.doRequest = function(options, http, cb){
238
237
  });
239
238
  });
240
239
  if(options.method != "GET"){
241
- req.write(post_data,'binary');
240
+ if(options.encodingType == "binary"){
241
+ req.write(post_data,'binary');
242
+ }else{
243
+ var ret = req.write(post_data, "utf-8");
244
+ }
242
245
  }
243
246
 
244
247
  req.on('error', function(e) {
@@ -256,6 +259,7 @@ exports.doRequest = function(options, http, cb){
256
259
  };
257
260
 
258
261
 
262
+
259
263
  exports.createHttpPostOptions = function(url, parameters, data){
260
264
  var options = {
261
265
  socksPort: 9050, // Tor