@resolveio/server-lib 5.2.9 → 5.2.10

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/methods/aws.js CHANGED
@@ -60,17 +60,22 @@ function loadAWSMethods(methodManager) {
60
60
  },
61
61
  fileType: {
62
62
  type: String
63
+ },
64
+ compress: {
65
+ type: Boolean,
66
+ optional: true
63
67
  }
64
68
  }),
65
- function: function (fileName, fileData, fileSize, fileOrder, fileType) {
69
+ function: function (fileName, fileData, fileSize, fileOrder, fileType, compress) {
66
70
  var _this = this;
71
+ if (compress === void 0) { compress = true; }
67
72
  var that = this;
68
73
  return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
69
74
  var key_1, file, newParams;
70
75
  return __generator(this, function (_a) {
71
76
  if (fileName) {
72
77
  key_1 = 'uploads/' + Date.now() + '-' + (pdfCnt++) + '-' + fileName;
73
- if (fileData.split(',')[0].split(':')[1].split(';')[0] === 'application/pdf') {
78
+ if (fileData.split(',')[0].split(':')[1].split(';')[0] === 'application/pdf' && compress) {
74
79
  file = {
75
80
  _id: mongoose_1.Types.ObjectId().toHexString(),
76
81
  __v: 0,
package/methods/pdf.js CHANGED
@@ -89,7 +89,7 @@ function loadPDFMethods(methodManager) {
89
89
  }
90
90
  else {
91
91
  var fileData = 'data:application/pdf;base64,' + Buffer.from(data).toString('base64');
92
- that.callMethodInternal.call(that, 'uploadFileAndSave', fileName, fileData, (4 * Math.ceil(fileData.length / 3)), uploadFileOrder, uploadFileType, function (err, res) {
92
+ that.callMethodInternal.call(that, 'uploadFileAndSave', fileName, fileData, (4 * Math.ceil(fileData.length / 3)), uploadFileOrder, uploadFileType, false, function (err, res) {
93
93
  if (err) {
94
94
  reject(err);
95
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "5.2.9",
3
+ "version": "5.2.10",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {