@resolveio/server-lib 5.2.14 → 5.2.15-newrole

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.
@@ -22,13 +22,6 @@ var schema = {
22
22
  type: Date,
23
23
  optional: true
24
24
  },
25
- readonly: {
26
- type: Boolean,
27
- optional: true
28
- },
29
- active: {
30
- type: Boolean
31
- },
32
25
  attempts: {
33
26
  type: Number,
34
27
  optional: true
@@ -65,53 +58,67 @@ var schema = {
65
58
  type: String
66
59
  },
67
60
  roles: {
61
+ type: Object
62
+ },
63
+ 'roles.super_admin': {
64
+ type: Boolean
65
+ },
66
+ 'roles.approvals': {
68
67
  type: Array
69
68
  },
70
- 'roles.$': {
69
+ 'roles.approvals.$': {
70
+ type: Object
71
+ },
72
+ 'roles.approvals.$.name': {
71
73
  type: String
72
74
  },
73
- phonenumber: {
74
- type: String,
75
- optional: true
75
+ 'roles.approvals.$.type': {
76
+ type: String
76
77
  },
77
- other: {
78
- type: Object,
79
- blackbox: true,
80
- optional: true
78
+ 'roles.approvals.$.accounting_code': {
79
+ type: String
81
80
  },
82
- assets: {
83
- type: Array,
84
- optional: true
81
+ 'roles.groups': {
82
+ type: Array
85
83
  },
86
- 'assets.$': {
84
+ 'roles.groups.$': {
87
85
  type: Object
88
86
  },
89
- 'assets.$.type': {
87
+ 'roles.groups.$.name': {
90
88
  type: String
91
89
  },
92
- 'assets.$.id_asset': {
93
- type: String
90
+ 'roles.groups.$.views': {
91
+ type: Array
94
92
  },
95
- 'assets.$.asset_number': {
93
+ 'roles.groups.$.views.$': {
96
94
  type: String
97
95
  },
98
- 'assets.$.ownership': {
99
- type: String
96
+ 'roles.groups.$.yard': {
97
+ type: String,
98
+ optional: true
99
+ },
100
+ 'roles.notifications': {
101
+ type: Array
100
102
  },
101
- 'assets.$.ownership_driver': {
103
+ 'roles.notifications.$': {
102
104
  type: String
103
105
  },
104
- 'assets.$.date_start': {
105
- type: Date
106
+ 'roles.miscs': {
107
+ type: Array
106
108
  },
107
- 'assets.$.date_end': {
108
- type: Date,
109
- optional: true
109
+ 'roles.miscs.$': {
110
+ type: String
110
111
  },
111
- id_function: {
112
+ active: Boolean,
113
+ phonenumber: {
112
114
  type: String,
113
115
  optional: true
114
116
  },
117
+ other: {
118
+ type: Object,
119
+ optional: true,
120
+ blackbox: true
121
+ },
115
122
  customers: {
116
123
  type: Array,
117
124
  optional: true,
package/fixtures/init.js CHANGED
@@ -37,8 +37,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
38
  var app_version_collection_1 = require("../collections/app-version.collection");
39
39
  var logged_in_users_collection_1 = require("../collections/logged-in-users.collection");
40
- var active_subscription_collection_1 = require("../collections/active-subscription.collection");
41
40
  var mongoose_1 = require("mongoose");
41
+ var active_subscription_collection_1 = require("../collections/active-subscription.collection");
42
42
  function loadServerInit() {
43
43
  return __awaiter(this, void 0, void 0, function () {
44
44
  var appVersion;
package/methods/pdf.js CHANGED
@@ -71,7 +71,7 @@ function loadPDFMethods(methodManager) {
71
71
  })
72
72
  }
73
73
  });
74
- page.property('content', "\n <head>\n <style>\n @font-face {\n font-family: 'Dejavu Serif', serif;\n font-style: normal;\n font-weight: normal;\n src: url(\"/usr/share/fonts/dejavu/DejaVuSerif.ttf\");\n }\n\n @font-face {\n font-family: 'Dejavu Serif', serif;\n font-style: normal;\n font-weight: bold;\n src: url(\"/usr/share/fonts/dejavu/DejaVuSerif-Bold.ttf\");\n }\n\n @font-face {\n font-family: 'Dejavu Serif', serif;\n font-style: italic;\n font-weight: normal;\n src: url(\"/usr/share/fonts/dejavu/DejaVuSerif-Italic.ttf\");\n }\n\n @font-face {\n font-family: 'Dejavu Serif', serif;\n font-style: italic;\n font-weight: bold;\n src: url(\"/usr/share/fonts/dejavu/DejaVuSerif-BoldItalic.ttf\");\n }\n\n body {\n font-family: 'Dejavu Serif', serif;\n font-size: " + (fontSize ? fontSize : '8px') + ";\n }\n\n .row {\n display: -webkit-flex;\n display: flex;\n flex-wrap: wrap;\n -webkit-flex-wrap: wrap;\n }\n \n .page-break {\n page-break-before: always !important;\n margin-bottom: 1px;\n }\n\n .cell {\n box-sizing: border-box;\n padding : 2px;\n -webkit-flex: 1;\n word-wrap: break-word;\n }\n\n .cell-no-padding {\n box-sizing: border-box;\n -webkit-flex: 1;\n word-wrap: break-word;\n }\n\n .centered {\n -webkit-justify-content: center;\n -webkit-align-items: center;\n display: -webkit-flex;\n text-align: center;\n }\n\n .centered-left {\n -webkit-align-items: center;\n display: -webkit-flex;\n -webkit-justify-content: flex-start;\n }\n\n .centered-right {\n -webkit-justify-content: flex-end;\n -webkit-align-items: center;\n display: -webkit-flex;\n }\n \n .box {\n border: 1px solid black;\n margin: -1px 0px 0px -1px;\n }\n\n .boxNoBorder {\n margin: -1px 0px 0px -1px;\n }\n\n pre {\n white-space: pre-wrap; /* css-3 */\n white-space: -moz-pre-wrap; /* Mozilla, since 1999 */\n white-space: -pre-wrap; /* Opera 4-6 */\n white-space: -o-pre-wrap; /* Opera 7 */\n word-wrap: break-word; /* Internet Explorer 5.5+ */\n font-size: 12px;\n font-family: Open Sans; \n }\n </style>\n </head>\n <body>\n " + html.replace(new RegExp('flex-basis:', 'g'), '-webkit-flex-basis:').replace(new RegExp('flex:', 'g'), '-webkit-flex:') + '</body>');
74
+ page.property('content', "\n\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t<style>\n\t\t\t\t\t\t\t\t@font-face {\n\t\t\t\t\t\t\t\t\tfont-family: 'Dejavu Serif', serif;\n\t\t\t\t\t\t\t\t\tfont-style: normal;\n\t\t\t\t\t\t\t\t\tfont-weight: normal;\n\t\t\t\t\t\t\t\t\tsrc: url(\"/usr/share/fonts/dejavu/DejaVuSerif.ttf\");\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t@font-face {\n\t\t\t\t\t\t\t\t\tfont-family: 'Dejavu Serif', serif;\n\t\t\t\t\t\t\t\t\tfont-style: normal;\n\t\t\t\t\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\t\t\t\tsrc: url(\"/usr/share/fonts/dejavu/DejaVuSerif-Bold.ttf\");\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t@font-face {\n\t\t\t\t\t\t\t\t\tfont-family: 'Dejavu Serif', serif;\n\t\t\t\t\t\t\t\t\tfont-style: italic;\n\t\t\t\t\t\t\t\t\tfont-weight: normal;\n\t\t\t\t\t\t\t\t\tsrc: url(\"/usr/share/fonts/dejavu/DejaVuSerif-Italic.ttf\");\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t@font-face {\n\t\t\t\t\t\t\t\t\tfont-family: 'Dejavu Serif', serif;\n\t\t\t\t\t\t\t\t\tfont-style: italic;\n\t\t\t\t\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\t\t\t\tsrc: url(\"/usr/share/fonts/dejavu/DejaVuSerif-BoldItalic.ttf\");\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbody {\n\t\t\t\t\t\t\t\t\tfont-family: 'Dejavu Serif', serif;\n\t\t\t\t\t\t\t\t\tfont-size: " + (fontSize ? fontSize : '8px') + ";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t.row {\n\t\t\t\t\t\t\t\t\tdisplay: -webkit-flex;\n\t\t\t\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\t\t\t\tflex-wrap: wrap;\n\t\t\t\t\t\t\t\t\t-webkit-flex-wrap: wrap;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t.page-break {\n\t\t\t\t\t\t\t\t\tpage-break-before: always !important;\n\t\t\t\t\t\t\t\t\tmargin-bottom: 1px;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t.cell {\n\t\t\t\t\t\t\t\t\tbox-sizing: border-box;\n\t\t\t\t\t\t\t\t\tpadding : 2px;\n\t\t\t\t\t\t\t\t\t-webkit-flex: 1;\n\t\t\t\t\t\t\t\t\tword-wrap: break-word;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t.cell-no-padding {\n\t\t\t\t\t\t\t\t\tbox-sizing: border-box;\n\t\t\t\t\t\t\t\t\t-webkit-flex: 1;\n\t\t\t\t\t\t\t\t\tword-wrap: break-word;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t.centered {\n\t\t\t\t\t\t\t\t\t-webkit-justify-content: center;\n\t\t\t\t\t\t\t\t\t-webkit-align-items: center;\n\t\t\t\t\t\t\t\t\tdisplay: -webkit-flex;\n\t\t\t\t\t\t\t\t\ttext-align: center;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t.centered-left {\n\t\t\t\t\t\t\t\t\t-webkit-align-items: center;\n\t\t\t\t\t\t\t\t\tdisplay: -webkit-flex;\n\t\t\t\t\t\t\t\t\t-webkit-justify-content: flex-start;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t.centered-right {\n\t\t\t\t\t\t\t\t\t-webkit-justify-content: flex-end;\n\t\t\t\t\t\t\t\t\t-webkit-align-items: center;\n\t\t\t\t\t\t\t\t\tdisplay: -webkit-flex;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t.box {\n\t\t\t\t\t\t\t\t\tborder: 1px solid black;\n\t\t\t\t\t\t\t\t\tmargin: -1px 0px 0px -1px;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t.boxNoBorder {\n\t\t\t\t\t\t\t\t\tmargin: -1px 0px 0px -1px;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tpre {\n\t\t\t\t\t\t\t\t\twhite-space: pre-wrap; /* css-3 */\n\t\t\t\t\t\t\t\t\twhite-space: -moz-pre-wrap; /* Mozilla, since 1999 */\n\t\t\t\t\t\t\t\t\twhite-space: -pre-wrap; /* Opera 4-6 */\n\t\t\t\t\t\t\t\t\twhite-space: -o-pre-wrap; /* Opera 7 */\n\t\t\t\t\t\t\t\t\tword-wrap: break-word; /* Internet Explorer 5.5+ */\n\t\t\t\t\t\t\t\t\tfont-size: 12px;\n\t\t\t\t\t\t\t\t\tfont-family: Open Sans; \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</style>\n\t\t\t\t\t\t</head>\n\t\t\t\t\t\t<body>\n\t\t\t\t\t" + html.replace(new RegExp('flex-basis:', 'g'), '-webkit-flex-basis:').replace(new RegExp('flex:', 'g'), '-webkit-flex:') + '</body>');
75
75
  var tmpFileName = (pdfCnt++) + '-' + fileName;
76
76
  var interval = setInterval(function () {
77
77
  if (requestsArray.length === 0) {
@@ -120,6 +120,134 @@ function loadPDFMethods(methodManager) {
120
120
  });
121
121
  }
122
122
  },
123
+ compressBase64AndUploadPDF: {
124
+ skipQueue: true,
125
+ check: new simpl_schema_1.default({
126
+ id_file: {
127
+ type: String
128
+ },
129
+ fileName: {
130
+ type: String
131
+ },
132
+ filePath: {
133
+ type: String
134
+ },
135
+ fileContent: {
136
+ type: String
137
+ }
138
+ }),
139
+ function: function (id_file, fileName, filePath, fileContent) {
140
+ var _this = this;
141
+ return new Promise(function (resolve, reject) {
142
+ _this.callMethodInternal.call(_this, 'getCCProcessURL').then(function (resCC) {
143
+ //send request
144
+ request({
145
+ method: 'POST',
146
+ url: 'https:' + resCC.url,
147
+ headers: {
148
+ 'Content-Type': 'application/json'
149
+ },
150
+ json: {
151
+ mode: 'compress',
152
+ input: 'base64',
153
+ file: fileContent,
154
+ filename: fileName,
155
+ outputformat: 'pdf',
156
+ wait: true,
157
+ output: {
158
+ 's3': {
159
+ 'accesskeyid': _this.serverConfig['AWSACCESSKEYID'],
160
+ 'secretaccesskey': _this.serverConfig['AWSSECRETACCESSKEY'],
161
+ 'region': _this.serverConfig['AWSREGION'],
162
+ 'bucket': _this.serverConfig['AWSBUCKET'],
163
+ 'path': filePath
164
+ }
165
+ }
166
+ }
167
+ }, function (error, response, body) {
168
+ if (!error) {
169
+ if (body.output.size) {
170
+ file_collection_1.Files.updateOne({ _id: id_file }, { $set: { size: body.output.size } }).exec();
171
+ resolve();
172
+ }
173
+ else {
174
+ reject('Compressed file has no size, compress failed');
175
+ }
176
+ }
177
+ else {
178
+ reject(error);
179
+ }
180
+ });
181
+ }, function (errCC) { return reject(errCC); });
182
+ });
183
+ }
184
+ },
185
+ compressPDFOnS3: {
186
+ skipQueue: true,
187
+ check: new simpl_schema_1.default({
188
+ id_file: {
189
+ type: String
190
+ },
191
+ fileName: {
192
+ type: String
193
+ },
194
+ filePath: {
195
+ type: String
196
+ }
197
+ }),
198
+ function: function (id_file, fileName, filePath) {
199
+ var _this = this;
200
+ return new Promise(function (resolve, reject) {
201
+ _this.callMethodInternal.call(_this, 'getCCProcessURL').then(function (resCC) {
202
+ //send request
203
+ request({
204
+ method: 'POST',
205
+ url: 'https:' + resCC.url,
206
+ headers: {
207
+ 'Content-Type': 'application/json'
208
+ },
209
+ json: {
210
+ mode: 'compress',
211
+ input: {
212
+ 's3': {
213
+ 'accesskeyid': _this.serverConfig['AWSACCESSKEYID'],
214
+ 'secretaccesskey': _this.serverConfig['AWSSECRETACCESSKEY'],
215
+ 'region': _this.serverConfig['AWSREGION'],
216
+ 'bucket': _this.serverConfig['AWSBUCKET']
217
+ }
218
+ },
219
+ file: filePath,
220
+ filename: fileName,
221
+ outputformat: 'pdf',
222
+ wait: true,
223
+ output: {
224
+ 's3': {
225
+ 'accesskeyid': _this.serverConfig['AWSACCESSKEYID'],
226
+ 'secretaccesskey': _this.serverConfig['AWSSECRETACCESSKEY'],
227
+ 'region': _this.serverConfig['AWSREGION'],
228
+ 'bucket': _this.serverConfig['AWSBUCKET'],
229
+ 'path': filePath
230
+ }
231
+ }
232
+ }
233
+ }, function (error, response, body) {
234
+ if (!error) {
235
+ if (body.output.size) {
236
+ file_collection_1.Files.updateOne({ _id: id_file }, { $set: { size: body.output.size } }).exec();
237
+ resolve();
238
+ }
239
+ else {
240
+ reject('Compressed file has no size, compress failed');
241
+ }
242
+ }
243
+ else {
244
+ reject(error);
245
+ }
246
+ });
247
+ }, function (errCC) { return reject(errCC); });
248
+ });
249
+ }
250
+ },
123
251
  mergePDF: {
124
252
  skipQueue: true,
125
253
  check: new simpl_schema_1.default({
@@ -314,134 +442,6 @@ function loadPDFMethods(methodManager) {
314
442
  });
315
443
  }
316
444
  },
317
- compressBase64AndUploadPDF: {
318
- skipQueue: true,
319
- check: new simpl_schema_1.default({
320
- id_file: {
321
- type: String
322
- },
323
- fileName: {
324
- type: String
325
- },
326
- filePath: {
327
- type: String
328
- },
329
- fileContent: {
330
- type: String
331
- }
332
- }),
333
- function: function (id_file, fileName, filePath, fileContent) {
334
- var _this = this;
335
- return new Promise(function (resolve, reject) {
336
- _this.callMethodInternal.call(_this, 'getCCProcessURL').then(function (resCC) {
337
- //send request
338
- request({
339
- method: 'POST',
340
- url: 'https:' + resCC.url,
341
- headers: {
342
- 'Content-Type': 'application/json'
343
- },
344
- json: {
345
- mode: 'compress',
346
- input: 'base64',
347
- file: fileContent,
348
- filename: fileName,
349
- outputformat: 'pdf',
350
- wait: true,
351
- output: {
352
- 's3': {
353
- 'accesskeyid': _this.serverConfig['AWSACCESSKEYID'],
354
- 'secretaccesskey': _this.serverConfig['AWSSECRETACCESSKEY'],
355
- 'region': _this.serverConfig['AWSREGION'],
356
- 'bucket': _this.serverConfig['AWSBUCKET'],
357
- 'path': filePath
358
- }
359
- }
360
- }
361
- }, function (error, response, body) {
362
- if (!error) {
363
- if (body.output.size) {
364
- file_collection_1.Files.updateOne({ _id: id_file }, { $set: { size: body.output.size } }).exec();
365
- resolve();
366
- }
367
- else {
368
- reject('Compressed file has no size, compress failed');
369
- }
370
- }
371
- else {
372
- reject(error);
373
- }
374
- });
375
- }, function (errCC) { return reject(errCC); });
376
- });
377
- }
378
- },
379
- compressPDFOnS3: {
380
- skipQueue: true,
381
- check: new simpl_schema_1.default({
382
- id_file: {
383
- type: String
384
- },
385
- fileName: {
386
- type: String
387
- },
388
- filePath: {
389
- type: String
390
- }
391
- }),
392
- function: function (id_file, fileName, filePath) {
393
- var _this = this;
394
- return new Promise(function (resolve, reject) {
395
- _this.callMethodInternal.call(_this, 'getCCProcessURL').then(function (resCC) {
396
- //send request
397
- request({
398
- method: 'POST',
399
- url: 'https:' + resCC.url,
400
- headers: {
401
- 'Content-Type': 'application/json'
402
- },
403
- json: {
404
- mode: 'compress',
405
- input: {
406
- 's3': {
407
- 'accesskeyid': _this.serverConfig['AWSACCESSKEYID'],
408
- 'secretaccesskey': _this.serverConfig['AWSSECRETACCESSKEY'],
409
- 'region': _this.serverConfig['AWSREGION'],
410
- 'bucket': _this.serverConfig['AWSBUCKET']
411
- }
412
- },
413
- file: filePath,
414
- filename: fileName,
415
- outputformat: 'pdf',
416
- wait: true,
417
- output: {
418
- 's3': {
419
- 'accesskeyid': _this.serverConfig['AWSACCESSKEYID'],
420
- 'secretaccesskey': _this.serverConfig['AWSSECRETACCESSKEY'],
421
- 'region': _this.serverConfig['AWSREGION'],
422
- 'bucket': _this.serverConfig['AWSBUCKET'],
423
- 'path': filePath
424
- }
425
- }
426
- }
427
- }, function (error, response, body) {
428
- if (!error) {
429
- if (body.output.size) {
430
- file_collection_1.Files.updateOne({ _id: id_file }, { $set: { size: body.output.size } }).exec();
431
- resolve();
432
- }
433
- else {
434
- reject('Compressed file has no size, compress failed');
435
- }
436
- }
437
- else {
438
- reject(error);
439
- }
440
- });
441
- }, function (errCC) { return reject(errCC); });
442
- });
443
- }
444
- }
445
445
  });
446
446
  }
447
447
  exports.loadPDFMethods = loadPDFMethods;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "5.2.14",
3
+ "version": "5.2.15-newrole",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {