@resolveio/server-lib 1.0.21 → 1.0.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {
@@ -21,11 +21,7 @@
21
21
  .tg .tg-yw4l{vertical-align:top;}
22
22
  </style>
23
23
 
24
-
25
-
26
- Good Day,<br><br>
27
-
28
- A support ticket: (#{{support_ticket_number_string}}) has been deleted.
24
+ Support ticket #{{support_ticket_number_string}} has been deleted.
29
25
 
30
26
  <br><br>
31
27
  <div id="containter">
@@ -35,16 +31,10 @@ A support ticket: (#{{support_ticket_number_string}}) has been deleted.
35
31
  <th class="tg-yw4l" style="padding: 0; margin: 0; border-left: 1px solid #999;">
36
32
  <img src="{{logo}}" style="width: auto; height: 90px; background-color: white; margin-left: -10px; margin-bottom: -10px;" alt="Logo">
37
33
  </th>
38
- <th class="tg-yw4l" style="min-width: 1050px; max-width: 1050px; font-size: 20px; color: white; text-align: right; padding: 30px;">Support Ticket</th>
34
+ <th class="tg-yw4l" style="min-width: 800px; max-width: 800px; font-size: 20px; color: white; text-align: right; padding: 30px;">Support Ticket</th>
39
35
  </tr>
40
36
  </thead>
41
37
  <tbody>
42
38
  </tbody>
43
39
  </table>
44
- </div>
45
- <br><br><br>
46
-
47
- ResolveIO, LLC<br>
48
- Dustin Poole<br>
49
- <a href="mailTo:ar@resolveio.com">ar@resolveio.com</a><br>
50
- 432-661-6150<br><br>
40
+ </div>
@@ -21,11 +21,7 @@
21
21
  .tg .tg-yw4l{vertical-align:top;}
22
22
  </style>
23
23
 
24
-
25
-
26
- Good Day,<br><br>
27
-
28
- A new support ticket: (#{{support_ticket_number_string}}), has been modified by {{user_created}}.
24
+ Support ticket: #{{support_ticket_number_string}} has been modified by {{user_created}}.
29
25
  <br><br>
30
26
  <div id="containter">
31
27
  <table class="tg">
@@ -34,7 +30,7 @@ A new support ticket: (#{{support_ticket_number_string}}), has been modified by
34
30
  <th class="tg-yw4l" style="padding: 0; margin: 0; border-left: 1px solid #999;">
35
31
  <img src="{{logo}}" style="width: auto; height: 90px; background-color: white; margin-left: -10px; margin-bottom: -10px;" alt="Logo">
36
32
  </th>
37
- <th class="tg-yw4l" style="min-width: 1050px; max-width: 1050px; font-size: 20px; color: white; text-align: right; padding: 30px;">Support Ticket</th>
33
+ <th class="tg-yw4l" style="min-width: 800px; max-width: 800px; font-size: 20px; color: white; text-align: right; padding: 30px;">Support Ticket</th>
38
34
  </tr>
39
35
  </thead>
40
36
  <tbody>
@@ -42,6 +38,10 @@ A new support ticket: (#{{support_ticket_number_string}}), has been modified by
42
38
  <td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Support Ticket <br>Number</td>
43
39
  <td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{support_ticket_number_string}}</td>
44
40
  </tr>
41
+ <tr>
42
+ <td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Client</td>
43
+ <td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{client}}</td>
44
+ </tr>
45
45
  <tr>
46
46
  <td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Type</td>
47
47
  <td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{type}}</td>
@@ -68,10 +68,4 @@ A new support ticket: (#{{support_ticket_number_string}}), has been modified by
68
68
  </tr>
69
69
  </tbody>
70
70
  </table>
71
- </div>
72
- <br><br><br>
73
-
74
- ResolveIO, LLC<br>
75
- Dustin Poole<br>
76
- <a href="mailTo:ar@resolveio.com">ar@resolveio.com</a><br>
77
- 432-661-6150<br><br>
71
+ </div>
@@ -16,16 +16,12 @@
16
16
  }
17
17
  .tg {border-collapse:collapse;border-spacing:0;border-color:#999;}
18
18
  .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#999;color:#444;background-color:#F7FDFA;border-top-width:1px;border-bottom-width:1px;}
19
- .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#999;color:#fff;background-color:rgb(0, 137, 250);border-top-width:1px;border-bottom-width:1px;}
19
+ .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#999;color:black;background-color:#fff;border-top-width:1px;border-bottom-width:1px;}
20
20
  .tg .tg-baqh{text-align:left;vertical-align:top}
21
21
  .tg .tg-yw4l{vertical-align:top;}
22
22
  </style>
23
23
 
24
-
25
-
26
- Good Day,<br><br>
27
-
28
- A new support ticket: (#{{support_ticket_number_string}}), has been created by {{user_created}}.
24
+ New support ticket #{{support_ticket_number_string}} has been created by {{user_created}}.
29
25
  <br><br>
30
26
  <div id="containter">
31
27
  <table class="tg">
@@ -34,7 +30,7 @@ A new support ticket: (#{{support_ticket_number_string}}), has been created by {
34
30
  <th class="tg-yw4l" style="padding: 0; margin: 0; border-left: 1px solid #999;">
35
31
  <img src="{{logo}}" style="width: auto; height: 90px; background-color: white; margin-left: -10px; margin-bottom: -10px;" alt="Logo">
36
32
  </th>
37
- <th class="tg-yw4l" style="min-width: 1050px; max-width: 1050px; font-size: 20px; color: white; text-align: right; padding: 30px;">Support Ticket</th>
33
+ <th class="tg-yw4l" style="min-width: 800px; max-width: 800px; font-size: 20px; color: white; text-align: right; padding: 30px;">Support Ticket</th>
38
34
  </tr>
39
35
  </thead>
40
36
  <tbody>
@@ -42,6 +38,10 @@ A new support ticket: (#{{support_ticket_number_string}}), has been created by {
42
38
  <td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Support Ticket <br>Number</td>
43
39
  <td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{support_ticket_number_string}}</td>
44
40
  </tr>
41
+ <tr>
42
+ <td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Client</td>
43
+ <td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{client}}</td>
44
+ </tr>
45
45
  <tr>
46
46
  <td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Type</td>
47
47
  <td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{type}}</td>
@@ -68,10 +68,4 @@ A new support ticket: (#{{support_ticket_number_string}}), has been created by {
68
68
  </tr>
69
69
  </tbody>
70
70
  </table>
71
- </div>
72
- <br><br><br>
73
-
74
- ResolveIO, LLC<br>
75
- Dustin Poole<br>
76
- <a href="mailTo:ar@resolveio.com">ar@resolveio.com</a><br>
77
- 432-661-6150<br><br>
71
+ </div>
Binary file
@@ -38,8 +38,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
38
38
  var simpl_schema_1 = require("simpl-schema");
39
39
  var file_collection_1 = require("../collections/file.collection");
40
40
  var handlebars = require("handlebars");
41
- var user_collection_1 = require("../collections/user.collection");
42
- var notification_collection_1 = require("../collections/notification.collection");
43
41
  function loadSupportMethods(supportManager) {
44
42
  supportManager.supportMethods({
45
43
  sendSupportTicketEmail: {
@@ -70,51 +68,32 @@ function loadSupportMethods(supportManager) {
70
68
  this.callMethodInternal.call(this, 'getSignedUrls', files.map(function (a) { return a.key; }), 900, function (err, res) {
71
69
  if (res) {
72
70
  _this.readFile('email-templates/support-ticket.html').then(function (html) { return __awaiter(_this, void 0, void 0, function () {
73
- var template, filesAttached, fileCnt, notification, users_1;
71
+ var template, filesAttached, fileCnt;
74
72
  var _this = this;
75
73
  return __generator(this, function (_a) {
76
- switch (_a.label) {
77
- case 0:
78
- template = handlebars.compile(html);
79
- handlebars.registerHelper('greaterThan', function (a, b) {
80
- return a > b;
81
- });
82
- handlebars.registerHelper('equals', function (a, b) {
83
- return a === b;
84
- });
85
- filesAttached = [];
86
- fileCnt = 0;
87
- res.forEach(function (url) {
88
- filesAttached.push({ filename: files[fileCnt].name, path: url });
89
- fileCnt++;
90
- });
91
- return [4 /*yield*/, notification_collection_1.Notifications.findOne({ name: 'Support Ticket Created' })];
92
- case 1:
93
- notification = _a.sent();
94
- if (!notification) return [3 /*break*/, 3];
95
- return [4 /*yield*/, user_collection_1.Users.find({ roles: 'notify-' + notification.name })];
96
- case 2:
97
- users_1 = _a.sent();
98
- this.readImage('images/ResolveIO.png').then(function (logoData) {
99
- supportTicket['logo'] = 'data:image/png;base64,' + logoData;
100
- users_1.forEach(function (user) {
101
- supportTicket['user'] = user.fullname;
102
- supportTicket['fileAttached'] = filesAttached;
103
- _this.sendEmail(user.email, 'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, '', template(supportTicket), filesAttached);
104
- });
105
- if (supportTicket.client_user && supportTicket.client_user.email) {
106
- supportTicket['user'] = supportTicket.client_user.user;
107
- supportTicket['fileAttached'] = filesAttached;
108
- _this.sendEmail(supportTicket.client_user.email, 'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, '', template(supportTicket), filesAttached);
109
- }
110
- });
111
- resolve(true);
112
- return [3 /*break*/, 4];
113
- case 3:
114
- reject('No Notification');
115
- _a.label = 4;
116
- case 4: return [2 /*return*/];
117
- }
74
+ template = handlebars.compile(html);
75
+ handlebars.registerHelper('greaterThan', function (a, b) {
76
+ return a > b;
77
+ });
78
+ handlebars.registerHelper('equals', function (a, b) {
79
+ return a === b;
80
+ });
81
+ filesAttached = [];
82
+ fileCnt = 0;
83
+ res.forEach(function (url) {
84
+ filesAttached.push({ filename: files[fileCnt].name, path: url });
85
+ fileCnt++;
86
+ });
87
+ this.readImage('images/ResolveIO.png').then(function (logoData) {
88
+ supportTicket['logo'] = 'data:image/png;base64,' + logoData;
89
+ if (supportTicket.client_user && supportTicket.client_user.email) {
90
+ supportTicket['user'] = supportTicket.client_user.user;
91
+ supportTicket['fileAttached'] = filesAttached;
92
+ _this.sendEmail(supportTicket.client_user.email, 'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, '', template(supportTicket), filesAttached);
93
+ }
94
+ });
95
+ resolve(true);
96
+ return [2 /*return*/];
118
97
  });
119
98
  }); });
120
99
  resolve(true);
@@ -223,39 +202,19 @@ function loadSupportMethods(supportManager) {
223
202
  this.callMethodInternal.call(this, 'getSignedUrls', [], 900, function (err, res) {
224
203
  if (res) {
225
204
  _this.readFile('email-templates/support-ticket-deleted.html').then(function (html) { return __awaiter(_this, void 0, void 0, function () {
226
- var template, notification, users;
227
- var _this = this;
205
+ var template;
228
206
  return __generator(this, function (_a) {
229
- switch (_a.label) {
230
- case 0:
231
- template = handlebars.compile(html);
232
- handlebars.registerHelper('greaterThan', function (a, b) {
233
- return a > b;
234
- });
235
- handlebars.registerHelper('equals', function (a, b) {
236
- return a === b;
237
- });
238
- return [4 /*yield*/, notification_collection_1.Notifications.findOne({ name: 'Support Ticket Deleted' })];
239
- case 1:
240
- notification = _a.sent();
241
- if (!notification) return [3 /*break*/, 3];
242
- return [4 /*yield*/, user_collection_1.Users.find({ roles: 'notify-' + notification.name })];
243
- case 2:
244
- users = _a.sent();
245
- users.forEach(function (user) {
246
- _this.sendEmail(user.email, 'ResolveIO - a ticket has been deleted: ' + supportTicket.support_ticket_number_string, '', template(null), []);
247
- });
248
- resolve(true);
249
- return [3 /*break*/, 4];
250
- case 3:
251
- reject('No Notification');
252
- _a.label = 4;
253
- case 4:
254
- if (supportTicket.client_user && supportTicket.client_user.email) {
255
- this.sendEmail(supportTicket.client_user.email, 'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, '', template(supportTicket), []);
256
- }
257
- return [2 /*return*/];
207
+ template = handlebars.compile(html);
208
+ handlebars.registerHelper('greaterThan', function (a, b) {
209
+ return a > b;
210
+ });
211
+ handlebars.registerHelper('equals', function (a, b) {
212
+ return a === b;
213
+ });
214
+ if (supportTicket.client_user && supportTicket.client_user.email) {
215
+ this.sendEmail(supportTicket.client_user.email, 'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, '', template(supportTicket), []);
258
216
  }
217
+ return [2 /*return*/];
259
218
  });
260
219
  }); });
261
220
  resolve(true);