@resolveio/server-lib 7.0.1 → 7.0.2
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/support.js +8 -30
- package/methods/support.js.map +1 -1
- package/package.json +1 -1
package/methods/support.js
CHANGED
|
@@ -15,7 +15,7 @@ function loadSupportMethods(methodManager) {
|
|
|
15
15
|
return new Promise(function (resolve, reject) {
|
|
16
16
|
request({
|
|
17
17
|
method: 'POST',
|
|
18
|
-
url: 'https://resolveio.com/api/support/billing-user',
|
|
18
|
+
url: 'https://backend.resolveio.com/api/support/billing-user',
|
|
19
19
|
headers: {
|
|
20
20
|
'Content-Type': 'application/json; charset=UTF-8'
|
|
21
21
|
},
|
|
@@ -37,15 +37,15 @@ function loadSupportMethods(methodManager) {
|
|
|
37
37
|
type: String
|
|
38
38
|
}
|
|
39
39
|
}),
|
|
40
|
-
function: function (
|
|
40
|
+
function: function (id_support_ticket) {
|
|
41
41
|
return new Promise(function (resolve, reject) {
|
|
42
42
|
request({
|
|
43
43
|
method: 'POST',
|
|
44
|
-
url: 'https://resolveio.com/api/support/supportTicketWithId',
|
|
44
|
+
url: 'https://backend.resolveio.com/api/support/supportTicketWithId',
|
|
45
45
|
headers: {
|
|
46
46
|
'Content-Type': 'application/json; charset=UTF-8'
|
|
47
47
|
},
|
|
48
|
-
json:
|
|
48
|
+
json: { id_support_ticket: id_support_ticket }
|
|
49
49
|
}, (function (error, response, body) {
|
|
50
50
|
if (!error && body && !body.error) {
|
|
51
51
|
resolve(body.result);
|
|
@@ -63,7 +63,7 @@ function loadSupportMethods(methodManager) {
|
|
|
63
63
|
return new Promise(function (resolve, reject) {
|
|
64
64
|
request({
|
|
65
65
|
method: 'POST',
|
|
66
|
-
url: 'https://resolveio.com/api/support/supportInsertTicket',
|
|
66
|
+
url: 'https://backend.resolveio.com/api/support/supportInsertTicket',
|
|
67
67
|
headers: {
|
|
68
68
|
'Content-Type': 'application/json; charset=UTF-8'
|
|
69
69
|
},
|
|
@@ -85,29 +85,7 @@ function loadSupportMethods(methodManager) {
|
|
|
85
85
|
return new Promise(function (resolve, reject) {
|
|
86
86
|
request({
|
|
87
87
|
method: 'POST',
|
|
88
|
-
url: 'https://resolveio.com/api/support/supportUpdateTicket',
|
|
89
|
-
headers: {
|
|
90
|
-
'Content-Type': 'application/json; charset=UTF-8'
|
|
91
|
-
},
|
|
92
|
-
json: supportTicket
|
|
93
|
-
}, (function (error, response, body) {
|
|
94
|
-
if (!error && body && !body.error) {
|
|
95
|
-
resolve(body.result);
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
reject(error || body.result);
|
|
99
|
-
}
|
|
100
|
-
}));
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
supportDeleteSupportTicket: {
|
|
105
|
-
skipValidation: true,
|
|
106
|
-
function: function (supportTicket) {
|
|
107
|
-
return new Promise(function (resolve, reject) {
|
|
108
|
-
request({
|
|
109
|
-
method: 'POST',
|
|
110
|
-
url: 'https://resolveio.com/api/support/supportUpdateTicket',
|
|
88
|
+
url: 'https://backend.resolveio.com/api/support/supportUpdateTicket',
|
|
111
89
|
headers: {
|
|
112
90
|
'Content-Type': 'application/json; charset=UTF-8'
|
|
113
91
|
},
|
|
@@ -157,7 +135,7 @@ function loadSupportMethods(methodManager) {
|
|
|
157
135
|
return new Promise(function (resolve, reject) {
|
|
158
136
|
request({
|
|
159
137
|
method: 'POST',
|
|
160
|
-
url: 'https://resolveio.com/api/support/supportticketsWithOptions',
|
|
138
|
+
url: 'https://backend.resolveio.com/api/support/supportticketsWithOptions',
|
|
161
139
|
headers: {
|
|
162
140
|
'Content-Type': 'application/json; charset=UTF-8'
|
|
163
141
|
},
|
|
@@ -190,7 +168,7 @@ function loadSupportMethods(methodManager) {
|
|
|
190
168
|
return new Promise(function (resolve, reject) {
|
|
191
169
|
request({
|
|
192
170
|
method: 'POST',
|
|
193
|
-
url: 'https://resolveio.com/api/support/supportCountTickets',
|
|
171
|
+
url: 'https://backend.resolveio.com/api/support/supportCountTickets',
|
|
194
172
|
headers: {
|
|
195
173
|
'Content-Type': 'application/json; charset=UTF-8'
|
|
196
174
|
},
|
package/methods/support.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/methods/support.ts"],"names":[],"mappings":";;AAAA,6CAAwC;AAGxC,iCAAmC;AAEnC,SAAgB,kBAAkB,CAAC,aAA4B;IAC9D,aAAa,CAAC,OAAO,CAAC;QACf,wBAAwB,EAAE;YACzB,KAAK,EAAE,IAAI,sBAAY,CAAC;gBAC7B,IAAI,EAAE;oBACL,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,IAAI;iBACd;aACQ,CAAC;YACF,QAAQ,EAAE,UAAS,IAAI;gBACnB,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;oBAC/B,OAAO,CAAC;wBACJ,MAAM,EAAE,MAAM;wBACd,GAAG,EAAE,gDAAgD;wBACrD,OAAO,EAAE;4BACL,cAAc,EAAE,iCAAiC;yBACpD;wBACD,IAAI,EAAE,IAAI;qBACb,EAAE,CAAC,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;wBACtB,IAAI,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;4BAC/B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;yBACxB;6BACI;4BACD,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;yBAChC;oBACpB,CAAC,CAAC,CAAC,CAAC;gBACO,CAAC,CAAC,CAAC;YACP,CAAC;SACV;QACD,6BAA6B,EAAE;YACxB,KAAK,EAAE,IAAI,sBAAY,CAAC;gBAC7B,iBAAiB,EAAE;oBAClB,IAAI,EAAE,MAAM;iBACZ;aACQ,CAAC;YACF,QAAQ,EAAE,UAAS,IAAI;gBACnB,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,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AAC;AA/cD,gDA+cC;AAED,SAAS,YAAY,CAAC,MAAM,EAAE,KAAK;IAClC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;KAAE;IAC/F,OAAO,MAAM,CAAC;AACf,CAAC","file":"support.js","sourcesContent":["import SimpleSchema from 'simpl-schema';\nimport * as handlebars from 'handlebars';\nimport { MethodManager } from '../managers/method.manager';\nimport * as request from 'request';\n\nexport function loadSupportMethods(methodManager: MethodManager) {\n\tmethodManager.methods({\n supportCreateBillingUser: {\n \tcheck: new SimpleSchema({\n\t\t\t\tuser: {\n\t\t\t\t\ttype: Object,\n\t\t\t\t\tblackbox: true\n\t\t\t\t}\n }),\n function: function(user) {\n return new Promise((resolve, reject) => {\n request({\n method: 'POST',\n url: 'https://resolveio.com/api/support/billing-user',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n json: user\n }, ((error, response, body) => {\n if (!error && body && !body.error) {\n resolve(body.result);\n }\n else {\n reject(error || body.result);\n }\n\t\t\t\t\t}));\n });\n }\n\t\t},\n\t\tsupportGetSupportTicketWithId: {\n \tcheck: new SimpleSchema({\n\t\t\t\tid_support_ticket: {\n\t\t\t\t\ttype: String\n\t\t\t\t}\n }),\n function: function(user) {\n return new Promise((resolve, reject) => {\n request({\n method: 'POST',\n url: 'https://resolveio.com/api/support/supportTicketWithId',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n json: user\n }, ((error, response, body) => {\n if (!error && body && !body.error) {\n resolve(body.result);\n }\n else {\n reject(error || body.result);\n }\n\t\t\t\t\t}));\n });\n }\n\t\t},\n\t\tsupportInsertSupportTicket: {\n \tskipValidation: true,\n function: function(supportTicket) {\n return new Promise((resolve, reject) => {\n request({\n method: 'POST',\n url: 'https://resolveio.com/api/support/supportInsertTicket',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n json: supportTicket\n }, ((error, response, body) => {\n if (!error && body && !body.error) {\n resolve(body.result);\n }\n else {\n reject(error || body.result);\n }\n\t\t\t\t\t}));\n });\n }\n\t\t},\n\t\tsupportUpdateSupportTicket: {\n\t\t\tskipValidation: true,\n function: function(supportTicket) {\n return new Promise((resolve, reject) => {\n request({\n method: 'POST',\n url: 'https://resolveio.com/api/support/supportUpdateTicket',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n json: supportTicket\n }, ((error, response, body) => {\n if (!error && body && !body.error) {\n resolve(body.result);\n }\n else {\n reject(error || body.result);\n }\n\t\t\t\t\t}));\n });\n }\n\t\t},\n\t\tsupportDeleteSupportTicket: {\n\t\t\tskipValidation: true,\n function: function(supportTicket) {\n return new Promise((resolve, reject) => {\n request({\n method: 'POST',\n url: 'https://resolveio.com/api/support/supportUpdateTicket',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n json: supportTicket\n }, ((error, response, body) => {\n if (!error && body && !body.error) {\n resolve(body.result);\n }\n else {\n reject(error || body.result);\n }\n\t\t\t\t\t}));\n });\n }\n\t\t},\n\t\tsupportticketsWithOptions: {\n\t\t\tcheck: new SimpleSchema({\n\t\t\t\toptions: {\n\t\t\t\t\ttype: Object\n\t\t\t\t},\n\t\t\t\t'options.limit': {\n\t\t\t\t\ttype: Number\n\t\t\t\t},\n\t\t\t\t'options.skip': {\n\t\t\t\t\ttype: Number\n\t\t\t\t},\n\t\t\t\t'options.sort': {\n\t\t\t\t\ttype: Object,\n\t\t\t\t\tblackbox: true\n\t\t\t\t},\n\t\t\t\t'options.fields': {\n\t\t\t\t\ttype: Object,\n\t\t\t\t\tblackbox: true\n\t\t\t\t},\n\t\t\t\tsearchString: {\n\t\t\t\t\ttype: String\n\t\t\t\t},\n\t\t\t\tfilters: {\n\t\t\t\t\ttype: Array\n\t\t\t\t},\n\t\t\t\t'filters.$': {\n\t\t\t\t\ttype: Object,\n\t\t\t\t\tblackbox: true\n\t\t\t\t}\n }),\n function: function(options, searchString, filters) {\n return new Promise((resolve, reject) => {\n request({\n method: 'POST',\n url: 'https://resolveio.com/api/support/supportticketsWithOptions',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n json: [options, searchString, filters]\n }, ((error, response, body) => {\n if (!error && body && !body.error) {\n resolve(body.result);\n }\n else {\n reject(error || body.result);\n }\n\t\t\t\t\t}));\n });\n }\n\t\t},\n\t\tsupportticketCount: {\n\t\t\tcheck: new SimpleSchema({\n\t\t\t\tsearchString: {\n\t\t\t\t\ttype: String\n\t\t\t\t},\n\t\t\t\tfilters: {\n\t\t\t\t\ttype: Array\n\t\t\t\t},\n\t\t\t\t'filters.$': {\n\t\t\t\t\ttype: Object,\n\t\t\t\t\tblackbox: true\n\t\t\t\t}\n }),\n function: function(searchString, filters) {\n return new Promise((resolve, reject) => {\n request({\n method: 'POST',\n url: 'https://resolveio.com/api/support/supportCountTickets',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n json: [searchString, filters]\n }, ((error, response, body) => {\n if (!error && body && !body.error) {\n resolve(body.result);\n }\n else {\n reject(error || body.result);\n }\n\t\t\t\t\t}));\n });\n }\n\t\t}\n\t\t// sendSupportTicketEmail: {\n\t\t// \tcheck: new SimpleSchema({\n\t\t// \t\tsupportTicket: {\n\t\t// \t\t\ttype: Object,\n\t\t// \t\t\tblackbox: true\n\t\t// \t\t},\n\t\t// \t\tid_files: {\n\t\t// \t\t\ttype: Array,\n\t\t// \t\t\toptional: true\t\t\t\n\t\t// \t\t},\n\t\t// \t\t'id_files.$': {\n\t\t// \t\t\ttype: String\n\t\t// \t\t}\n\t\t// \t}),\n\t\t// \tfunction: function(supportTicket: SupportTicketModel, id_files?: string[]) {\n\t\t// \t\treturn new Promise(async (resolve, reject) => {\t\t\t\t\t\n\t\t// \t\t\tif (id_files && id_files.length) {\n\t\t// \t\t\t\tlet files = await Files.find({\n\t\t// \t\t\t\t\t_id: {$in: id_files}\n\t\t// \t\t\t\t});\n\n\t\t// \t\t\t\tthis.callMethodInternal.call(this, 'getSignedUrls', files.map(a => a.key), 900, (err, res) => {\n\t\t// \t\t\t\t\tif (res) {\n\t\t// \t\t\t\t\t\tthis.readFile('email-templates/support-ticket.html').then(async html => {\n\t\t// \t\t\t\t\t\t\tlet template = handlebars.compile(html);\n\t\n\t\t// \t\t\t\t\t\t\thandlebars.registerHelper('greaterThan', (a, b) => {\n\t\t// \t\t\t\t\t\t\t\treturn a > b;\n\t\t// \t\t\t\t\t\t\t});\n\t\n\t\t// \t\t\t\t\t\t\thandlebars.registerHelper('equals', (a, b) => {\n\t\t// \t\t\t\t\t\t\t\treturn a === b;\n\t\t// \t\t\t\t\t\t\t});\n\t\n\t\t// \t\t\t\t\t\t\tlet filesAttached = [];\n\t\n\t\t// \t\t\t\t\t\t\tlet fileCnt = 0;\n\t\t// \t\t\t\t\t\t\tres.forEach(url => {\n\t\t// \t\t\t\t\t\t\t\tfilesAttached.push({filename: files[fileCnt].name, path: url});\n\t\t// \t\t\t\t\t\t\t\tfileCnt++;\n\t\t// \t\t\t\t\t\t\t});\n\t\n\t\t// \t\t\t\t\t\t\tthis.readImage('images/ResolveIO.png').then(logoData => {\n\t\t// \t\t\t\t\t\t\t\tsupportTicket['logo'] = 'data:image/png;base64,' + logoData;\n\t\t\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\t\t\t\tif (supportTicket.client_user && supportTicket.client_user.email) {\n\t\n\t\t// \t\t\t\t\t\t\t\t\tsupportTicket['user'] = supportTicket.client_user.user;\n\t\t// \t\t\t\t\t\t\t\t\tsupportTicket['fileAttached'] = filesAttached;\n\t\n\t\t// \t\t\t\t\t\t\t\t\tthis.sendEmail(\n\t\t// \t\t\t\t\t\t\t\t\t\tsupportTicket.client_user.email, \n\t\t// \t\t\t\t\t\t\t\t\t\t'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, \n\t\t// \t\t\t\t\t\t\t\t\t\t'', \n\t\t// \t\t\t\t\t\t\t\t\t\ttemplate(supportTicket),\n\t\t// \t\t\t\t\t\t\t\t\t\tfilesAttached\n\t\t// \t\t\t\t\t\t\t\t\t);\n\t\t// \t\t\t\t\t\t\t\t}\n\t\t// \t\t\t\t\t\t\t}, err => {\n\t\t// \t\t\t\t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t\t\t\t});\n\t\n\t\t// \t\t\t\t\t\t\tresolve(true);\n\t\t// \t\t\t\t\t\t}, err => {\n\t\t// \t\t\t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t\t\t});\n\t\n\t\t// \t\t\t\t\t\tresolve(true);\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t\telse {\n\t\t// \t\t\t\t\t\tthis.callMethodInternal.call(this, 'insertErrorLog', 'supportTicketsmethod - getsignedurl', [\n\t\t// \t\t\t\t\t\t\tfiles.map(a => a.key), err\n\t\t// \t\t\t\t\t\t]);\n\t\t// \t\t\t\t\t\treject(err);\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t});\n\t\t// \t\t\t}\n\t\t// \t\t\telse {\n\t\t// \t\t\t\tthis.readFile('email-templates/support-ticket.html').then(async html => {\n\t\t// \t\t\t\t\tlet template = handlebars.compile(html);\n\n\t\t// \t\t\t\t\thandlebars.registerHelper('greaterThan', (a, b) => {\n\t\t// \t\t\t\t\t\treturn a > b;\n\t\t// \t\t\t\t\t});\n\n\t\t// \t\t\t\t\thandlebars.registerHelper('equals', (a, b) => {\n\t\t// \t\t\t\t\t\treturn a === b;\n\t\t// \t\t\t\t\t});\n\n\t\t// \t\t\t\t\tthis.readImage('images/ResolveIO.png').then(logoData => {\n\t\t// \t\t\t\t\t\tsupportTicket['logo'] = 'data:image/png;base64,' + logoData;\n\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\t\tif (supportTicket.client_user && supportTicket.client_user.email) {\n\n\t\t// \t\t\t\t\t\t\tsupportTicket['user'] = supportTicket.client_user.user;\n\n\t\t// \t\t\t\t\t\t\tthis.sendEmail(\n\t\t// \t\t\t\t\t\t\t\tsupportTicket.client_user.email, \n\t\t// \t\t\t\t\t\t\t\t'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, \n\t\t// \t\t\t\t\t\t\t\t'', \n\t\t// \t\t\t\t\t\t\t\ttemplate(supportTicket),\n\t\t// \t\t\t\t\t\t\t\tnull\n\t\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}, err => {\n\t\t// \t\t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t\t});\n\n\t\t// \t\t\t\t\tresolve(true);\n\t\t// \t\t\t\t}, err => {\n\t\t// \t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t});\n\n\t\t// \t\t\t\tresolve(true);\n\t\t// \t\t\t}\n\t\t// \t\t});\n\t\t// \t}\n\t\t// },\n\t\t// sendSupportTicketModifiedEmail: {\n\t\t// \tcheck: new SimpleSchema({\n\t\t// \t\tsupportTicket: {\n\t\t// \t\t\ttype: Object,\n\t\t// \t\t\tblackbox: true\n\t\t// \t\t},\n\t\t// \t\tid_files: {\n\t\t// \t\t\ttype: Array\t\t\t\t\t\n\t\t// \t\t},\n\t\t// \t\t'id_files.$': {\n\t\t// \t\t\ttype: String\n\t\t// \t\t}\n\t\t// \t}),\n\t\t// \tfunction: function(supportTicket: SupportTicketModel, id_files: string[]) {\n\t\t// \t\treturn new Promise(async (resolve, reject) => {\n\n\t\t// \t\t\tlet files = await Files.find({\n\t\t// \t\t\t\t_id: {$in: id_files}\n\t\t// \t\t\t});\n\n\t\t// \t\t\tthis.callMethodInternal.call(this, 'getSignedUrls', files.map(a => a.key), 900, (err, res) => {\n\t\t// \t\t\t\tif (res) {\n\t\t// \t\t\t\t\tthis.readFile('email-templates/support-ticket-modified.html').then(async html => {\n\t\t// \t\t\t\t\t\tlet template = handlebars.compile(html);\n\n\t\t// \t\t\t\t\t\thandlebars.registerHelper('greaterThan', (a, b) => {\n\t\t// \t\t\t\t\t\t\treturn a > b;\n\t\t// \t\t\t\t\t\t});\n\n\t\t// \t\t\t\t\t\thandlebars.registerHelper('equals', (a, b) => {\n\t\t// \t\t\t\t\t\t\treturn a === b;\n\t\t// \t\t\t\t\t\t});\n\n\t\t// \t\t\t\t\t\tlet filesAttached = [];\n\n\t\t// \t\t\t\t\t\tlet fileCnt = 0;\n\t\t// \t\t\t\t\t\tres.forEach(url => {\n\t\t// \t\t\t\t\t\t\tfilesAttached.push({filename: files[fileCnt].name, path: url});\n\t\t// \t\t\t\t\t\t\tfileCnt++;\n\t\t// \t\t\t\t\t\t});\n\n\t\t// \t\t\t\t\t\tthis.readImage('images/ResolveIO.png').then(logoData => {\n\t\t// \t\t\t\t\t\t\tsupportTicket['logo'] = 'data:image/png;base64,' + logoData;\n\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\t\t\tsupportTicket.current_watchers.forEach(user => {\n\t\t\t\t\t\n\t\t// \t\t\t\t\t\t\t\tsupportTicket['user'] = user.user;\n\t\t// \t\t\t\t\t\t\t\tsupportTicket['fileAttached'] = filesAttached;\n\n\t\t// \t\t\t\t\t\t\t\tthis.sendEmail(\n\t\t// \t\t\t\t\t\t\t\t\tuser.email, \n\t\t// \t\t\t\t\t\t\t\t\t'ResolveIO - a ticket has been modified: ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, \n\t\t// \t\t\t\t\t\t\t\t\t'', \n\t\t// \t\t\t\t\t\t\t\t\ttemplate(supportTicket),\n\t\t// \t\t\t\t\t\t\t\t\tfilesAttached\n\t\t// \t\t\t\t\t\t\t\t);\n\t\t// \t\t\t\t\t\t\t});\n\n\t\t// \t\t\t\t\t\t\tif (supportTicket.client_user && supportTicket.client_user.email) {\n\n\t\t// \t\t\t\t\t\t\t\tsupportTicket['user'] = supportTicket.client_user.user;\n\t\t// \t\t\t\t\t\t\t\tsupportTicket['fileAttached'] = filesAttached;\n\n\t\t// \t\t\t\t\t\t\t\tthis.sendEmail(\n\t\t// \t\t\t\t\t\t\t\t\tsupportTicket.client_user.email, \n\t\t// \t\t\t\t\t\t\t\t\t'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, \n\t\t// \t\t\t\t\t\t\t\t\t'', \n\t\t// \t\t\t\t\t\t\t\t\ttemplate(supportTicket),\n\t\t// \t\t\t\t\t\t\t\t\tfilesAttached\n\t\t// \t\t\t\t\t\t\t\t);\n\t\t// \t\t\t\t\t\t\t}\n\t\t// \t\t\t\t\t\t}, err => {\n\t\t// \t\t\t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t\t\t});\n\t\t\n\t\t// \t\t\t\t\t\tresolve(true);\n\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\t}, err => {\n\t\t// \t\t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t\t});\n\n\t\t// \t\t\t\t\tresolve(true);\n\t\t// \t\t\t\t}\n\t\t// \t\t\t\telse {\n\t\t// \t\t\t\t\tthis.callMethodInternal.call(this, 'insertErrorLog', 'supportTicketsmethod - getsignedurl', [\n\t\t// \t\t\t\t\t\tfiles.map(a => a.key), err\n\t\t// \t\t\t\t\t]);\n\t\t// \t\t\t\t\treject(err);\n\t\t// \t\t\t\t}\n\t\t// \t\t\t});\n\t\t// \t\t});\n\t\t// \t}\n\t\t// },\n\t\t// sendSupportTicketDeletedEmail: {\n\t\t// \tcheck: new SimpleSchema({\n\t\t// \t\tsupportTicket: {\n\t\t// \t\t\ttype: Object,\n\t\t// \t\t\tblackbox: true\n\t\t// \t\t}\n\t\t// \t}),\n\t\t// \tfunction: function(supportTicket: SupportTicketModel) {\n\t\t// \t\treturn new Promise(async (resolve, reject) => {\n\t\t// \t\t\tthis.callMethodInternal.call(this, 'getSignedUrls', [], 900, (err, res) => {\n\t\t// \t\t\t\tif (res) {\n\t\t// \t\t\t\t\tthis.readFile('email-templates/support-ticket-deleted.html').then(async html => {\n\t\t// \t\t\t\t\t\tlet template = handlebars.compile(html);\n\n\t\t// \t\t\t\t\t\thandlebars.registerHelper('greaterThan', (a, b) => {\n\t\t// \t\t\t\t\t\t\treturn a > b;\n\t\t// \t\t\t\t\t\t});\n\n\t\t// \t\t\t\t\t\thandlebars.registerHelper('equals', (a, b) => {\n\t\t// \t\t\t\t\t\t\treturn a === b;\n\t\t// \t\t\t\t\t\t});\n\n\t\t// \t\t\t\t\t\tif (supportTicket.client_user && supportTicket.client_user.email) {\n\t\t// \t\t\t\t\t\t\tthis.sendEmail(\n\t\t// \t\t\t\t\t\t\t\tsupportTicket.client_user.email, \n\t\t// \t\t\t\t\t\t\t\t'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, \n\t\t// \t\t\t\t\t\t\t\t'', \n\t\t// \t\t\t\t\t\t\t\ttemplate(supportTicket),\n\t\t// \t\t\t\t\t\t\t\t[]\n\t\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}, err => {\n\t\t// \t\t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t\t});\n\n\t\t// \t\t\t\t\tresolve(true);\n\t\t// \t\t\t\t}\n\t\t// \t\t\t\telse {\n\t\t// \t\t\t\t\tthis.callMethodInternal.call(this, 'insertErrorLog', 'supportTicketsmethod - getsignedurl', [\n\t\t// \t\t\t\t\t\t[], err\n\t\t// \t\t\t\t\t]);\n\t\t// \t\t\t\t\treject(err);\n\t\t// \t\t\t\t}\n\t\t// \t\t\t});\n\t\t// \t\t});\n\t\t// \t}\n\t\t// }\n\t});\n}\n\nfunction randomString(length, chars) {\n\tlet result = '';\n\tfor (let i = length; i > 0; --i) { result += chars[Math.floor(Math.random() * chars.length)]; }\n\treturn result;\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/methods/support.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B,yFAAyF;QACzF,iDAAiD;QAEjD,6DAA6D;QAC7D,uBAAuB;QACvB,YAAY;QAEZ,wDAAwD;QACxD,yBAAyB;QACzB,YAAY;QAEZ,4EAA4E;QAC5E,yBAAyB;QACzB,4CAA4C;QAC5C,iHAAiH;QACjH,eAAe;QACf,mCAAmC;QACnC,aAAa;QACb,YAAY;QACZ,UAAU;QACV,mBAAmB;QACnB,0BAA0B;QAC1B,WAAW;QAEX,sBAAsB;QACtB,QAAQ;QACR,aAAa;QACb,qGAAqG;QACrG,gBAAgB;QAChB,WAAW;QACX,oBAAoB;QACpB,QAAQ;QACR,SAAS;QACT,QAAQ;QACR,KAAK;QACL,IAAI;KACJ,CAAC,CAAC;AACJ,CAAC;AAzbD,gDAybC;AAED,SAAS,YAAY,CAAC,MAAM,EAAE,KAAK;IAClC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;KAAE;IAC/F,OAAO,MAAM,CAAC;AACf,CAAC","file":"support.js","sourcesContent":["import SimpleSchema from 'simpl-schema';\nimport * as handlebars from 'handlebars';\nimport { MethodManager } from '../managers/method.manager';\nimport * as request from 'request';\n\nexport function loadSupportMethods(methodManager: MethodManager) {\n\tmethodManager.methods({\n supportCreateBillingUser: {\n \tcheck: new SimpleSchema({\n\t\t\t\tuser: {\n\t\t\t\t\ttype: Object,\n\t\t\t\t\tblackbox: true\n\t\t\t\t}\n }),\n function: function(user) {\n return new Promise((resolve, reject) => {\n request({\n method: 'POST',\n url: 'https://backend.resolveio.com/api/support/billing-user',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n json: user\n }, ((error, response, body) => {\n if (!error && body && !body.error) {\n resolve(body.result);\n }\n else {\n reject(error || body.result);\n }\n\t\t\t\t\t}));\n });\n }\n\t\t},\n\t\tsupportGetSupportTicketWithId: {\n \tcheck: new SimpleSchema({\n\t\t\t\tid_support_ticket: {\n\t\t\t\t\ttype: String\n\t\t\t\t}\n }),\n function: function(id_support_ticket) {\n return new Promise((resolve, reject) => {\n request({\n method: 'POST',\n url: 'https://backend.resolveio.com/api/support/supportTicketWithId',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n json: {id_support_ticket: id_support_ticket}\n }, ((error, response, body) => {\n if (!error && body && !body.error) {\n resolve(body.result);\n }\n else {\n reject(error || body.result);\n }\n\t\t\t\t\t}));\n });\n }\n\t\t},\n\t\tsupportInsertSupportTicket: {\n \tskipValidation: true,\n function: function(supportTicket) {\n return new Promise((resolve, reject) => {\n request({\n method: 'POST',\n url: 'https://backend.resolveio.com/api/support/supportInsertTicket',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n json: supportTicket\n }, ((error, response, body) => {\n if (!error && body && !body.error) {\n resolve(body.result);\n }\n else {\n reject(error || body.result);\n }\n\t\t\t\t\t}));\n });\n }\n\t\t},\n\t\tsupportUpdateSupportTicket: {\n\t\t\tskipValidation: true,\n function: function(supportTicket) {\n return new Promise((resolve, reject) => {\n request({\n method: 'POST',\n url: 'https://backend.resolveio.com/api/support/supportUpdateTicket',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n json: supportTicket\n }, ((error, response, body) => {\n if (!error && body && !body.error) {\n resolve(body.result);\n }\n else {\n reject(error || body.result);\n }\n\t\t\t\t\t}));\n });\n }\n\t\t},\n\t\tsupportticketsWithOptions: {\n\t\t\tcheck: new SimpleSchema({\n\t\t\t\toptions: {\n\t\t\t\t\ttype: Object\n\t\t\t\t},\n\t\t\t\t'options.limit': {\n\t\t\t\t\ttype: Number\n\t\t\t\t},\n\t\t\t\t'options.skip': {\n\t\t\t\t\ttype: Number\n\t\t\t\t},\n\t\t\t\t'options.sort': {\n\t\t\t\t\ttype: Object,\n\t\t\t\t\tblackbox: true\n\t\t\t\t},\n\t\t\t\t'options.fields': {\n\t\t\t\t\ttype: Object,\n\t\t\t\t\tblackbox: true\n\t\t\t\t},\n\t\t\t\tsearchString: {\n\t\t\t\t\ttype: String\n\t\t\t\t},\n\t\t\t\tfilters: {\n\t\t\t\t\ttype: Array\n\t\t\t\t},\n\t\t\t\t'filters.$': {\n\t\t\t\t\ttype: Object,\n\t\t\t\t\tblackbox: true\n\t\t\t\t}\n }),\n function: function(options, searchString, filters) {\n return new Promise((resolve, reject) => {\n request({\n method: 'POST',\n url: 'https://backend.resolveio.com/api/support/supportticketsWithOptions',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n json: [options, searchString, filters]\n }, ((error, response, body) => {\n if (!error && body && !body.error) {\n resolve(body.result);\n }\n else {\n reject(error || body.result);\n }\n\t\t\t\t\t}));\n });\n }\n\t\t},\n\t\tsupportticketCount: {\n\t\t\tcheck: new SimpleSchema({\n\t\t\t\tsearchString: {\n\t\t\t\t\ttype: String\n\t\t\t\t},\n\t\t\t\tfilters: {\n\t\t\t\t\ttype: Array\n\t\t\t\t},\n\t\t\t\t'filters.$': {\n\t\t\t\t\ttype: Object,\n\t\t\t\t\tblackbox: true\n\t\t\t\t}\n }),\n function: function(searchString, filters) {\n return new Promise((resolve, reject) => {\n request({\n method: 'POST',\n url: 'https://backend.resolveio.com/api/support/supportCountTickets',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n json: [searchString, filters]\n }, ((error, response, body) => {\n if (!error && body && !body.error) {\n resolve(body.result);\n }\n else {\n reject(error || body.result);\n }\n\t\t\t\t\t}));\n });\n }\n\t\t}\n\t\t// sendSupportTicketEmail: {\n\t\t// \tcheck: new SimpleSchema({\n\t\t// \t\tsupportTicket: {\n\t\t// \t\t\ttype: Object,\n\t\t// \t\t\tblackbox: true\n\t\t// \t\t},\n\t\t// \t\tid_files: {\n\t\t// \t\t\ttype: Array,\n\t\t// \t\t\toptional: true\t\t\t\n\t\t// \t\t},\n\t\t// \t\t'id_files.$': {\n\t\t// \t\t\ttype: String\n\t\t// \t\t}\n\t\t// \t}),\n\t\t// \tfunction: function(supportTicket: SupportTicketModel, id_files?: string[]) {\n\t\t// \t\treturn new Promise(async (resolve, reject) => {\t\t\t\t\t\n\t\t// \t\t\tif (id_files && id_files.length) {\n\t\t// \t\t\t\tlet files = await Files.find({\n\t\t// \t\t\t\t\t_id: {$in: id_files}\n\t\t// \t\t\t\t});\n\n\t\t// \t\t\t\tthis.callMethodInternal.call(this, 'getSignedUrls', files.map(a => a.key), 900, (err, res) => {\n\t\t// \t\t\t\t\tif (res) {\n\t\t// \t\t\t\t\t\tthis.readFile('email-templates/support-ticket.html').then(async html => {\n\t\t// \t\t\t\t\t\t\tlet template = handlebars.compile(html);\n\t\n\t\t// \t\t\t\t\t\t\thandlebars.registerHelper('greaterThan', (a, b) => {\n\t\t// \t\t\t\t\t\t\t\treturn a > b;\n\t\t// \t\t\t\t\t\t\t});\n\t\n\t\t// \t\t\t\t\t\t\thandlebars.registerHelper('equals', (a, b) => {\n\t\t// \t\t\t\t\t\t\t\treturn a === b;\n\t\t// \t\t\t\t\t\t\t});\n\t\n\t\t// \t\t\t\t\t\t\tlet filesAttached = [];\n\t\n\t\t// \t\t\t\t\t\t\tlet fileCnt = 0;\n\t\t// \t\t\t\t\t\t\tres.forEach(url => {\n\t\t// \t\t\t\t\t\t\t\tfilesAttached.push({filename: files[fileCnt].name, path: url});\n\t\t// \t\t\t\t\t\t\t\tfileCnt++;\n\t\t// \t\t\t\t\t\t\t});\n\t\n\t\t// \t\t\t\t\t\t\tthis.readImage('images/ResolveIO.png').then(logoData => {\n\t\t// \t\t\t\t\t\t\t\tsupportTicket['logo'] = 'data:image/png;base64,' + logoData;\n\t\t\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\t\t\t\tif (supportTicket.client_user && supportTicket.client_user.email) {\n\t\n\t\t// \t\t\t\t\t\t\t\t\tsupportTicket['user'] = supportTicket.client_user.user;\n\t\t// \t\t\t\t\t\t\t\t\tsupportTicket['fileAttached'] = filesAttached;\n\t\n\t\t// \t\t\t\t\t\t\t\t\tthis.sendEmail(\n\t\t// \t\t\t\t\t\t\t\t\t\tsupportTicket.client_user.email, \n\t\t// \t\t\t\t\t\t\t\t\t\t'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, \n\t\t// \t\t\t\t\t\t\t\t\t\t'', \n\t\t// \t\t\t\t\t\t\t\t\t\ttemplate(supportTicket),\n\t\t// \t\t\t\t\t\t\t\t\t\tfilesAttached\n\t\t// \t\t\t\t\t\t\t\t\t);\n\t\t// \t\t\t\t\t\t\t\t}\n\t\t// \t\t\t\t\t\t\t}, err => {\n\t\t// \t\t\t\t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t\t\t\t});\n\t\n\t\t// \t\t\t\t\t\t\tresolve(true);\n\t\t// \t\t\t\t\t\t}, err => {\n\t\t// \t\t\t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t\t\t});\n\t\n\t\t// \t\t\t\t\t\tresolve(true);\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t\telse {\n\t\t// \t\t\t\t\t\tthis.callMethodInternal.call(this, 'insertErrorLog', 'supportTicketsmethod - getsignedurl', [\n\t\t// \t\t\t\t\t\t\tfiles.map(a => a.key), err\n\t\t// \t\t\t\t\t\t]);\n\t\t// \t\t\t\t\t\treject(err);\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t});\n\t\t// \t\t\t}\n\t\t// \t\t\telse {\n\t\t// \t\t\t\tthis.readFile('email-templates/support-ticket.html').then(async html => {\n\t\t// \t\t\t\t\tlet template = handlebars.compile(html);\n\n\t\t// \t\t\t\t\thandlebars.registerHelper('greaterThan', (a, b) => {\n\t\t// \t\t\t\t\t\treturn a > b;\n\t\t// \t\t\t\t\t});\n\n\t\t// \t\t\t\t\thandlebars.registerHelper('equals', (a, b) => {\n\t\t// \t\t\t\t\t\treturn a === b;\n\t\t// \t\t\t\t\t});\n\n\t\t// \t\t\t\t\tthis.readImage('images/ResolveIO.png').then(logoData => {\n\t\t// \t\t\t\t\t\tsupportTicket['logo'] = 'data:image/png;base64,' + logoData;\n\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\t\tif (supportTicket.client_user && supportTicket.client_user.email) {\n\n\t\t// \t\t\t\t\t\t\tsupportTicket['user'] = supportTicket.client_user.user;\n\n\t\t// \t\t\t\t\t\t\tthis.sendEmail(\n\t\t// \t\t\t\t\t\t\t\tsupportTicket.client_user.email, \n\t\t// \t\t\t\t\t\t\t\t'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, \n\t\t// \t\t\t\t\t\t\t\t'', \n\t\t// \t\t\t\t\t\t\t\ttemplate(supportTicket),\n\t\t// \t\t\t\t\t\t\t\tnull\n\t\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}, err => {\n\t\t// \t\t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t\t});\n\n\t\t// \t\t\t\t\tresolve(true);\n\t\t// \t\t\t\t}, err => {\n\t\t// \t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t});\n\n\t\t// \t\t\t\tresolve(true);\n\t\t// \t\t\t}\n\t\t// \t\t});\n\t\t// \t}\n\t\t// },\n\t\t// sendSupportTicketModifiedEmail: {\n\t\t// \tcheck: new SimpleSchema({\n\t\t// \t\tsupportTicket: {\n\t\t// \t\t\ttype: Object,\n\t\t// \t\t\tblackbox: true\n\t\t// \t\t},\n\t\t// \t\tid_files: {\n\t\t// \t\t\ttype: Array\t\t\t\t\t\n\t\t// \t\t},\n\t\t// \t\t'id_files.$': {\n\t\t// \t\t\ttype: String\n\t\t// \t\t}\n\t\t// \t}),\n\t\t// \tfunction: function(supportTicket: SupportTicketModel, id_files: string[]) {\n\t\t// \t\treturn new Promise(async (resolve, reject) => {\n\n\t\t// \t\t\tlet files = await Files.find({\n\t\t// \t\t\t\t_id: {$in: id_files}\n\t\t// \t\t\t});\n\n\t\t// \t\t\tthis.callMethodInternal.call(this, 'getSignedUrls', files.map(a => a.key), 900, (err, res) => {\n\t\t// \t\t\t\tif (res) {\n\t\t// \t\t\t\t\tthis.readFile('email-templates/support-ticket-modified.html').then(async html => {\n\t\t// \t\t\t\t\t\tlet template = handlebars.compile(html);\n\n\t\t// \t\t\t\t\t\thandlebars.registerHelper('greaterThan', (a, b) => {\n\t\t// \t\t\t\t\t\t\treturn a > b;\n\t\t// \t\t\t\t\t\t});\n\n\t\t// \t\t\t\t\t\thandlebars.registerHelper('equals', (a, b) => {\n\t\t// \t\t\t\t\t\t\treturn a === b;\n\t\t// \t\t\t\t\t\t});\n\n\t\t// \t\t\t\t\t\tlet filesAttached = [];\n\n\t\t// \t\t\t\t\t\tlet fileCnt = 0;\n\t\t// \t\t\t\t\t\tres.forEach(url => {\n\t\t// \t\t\t\t\t\t\tfilesAttached.push({filename: files[fileCnt].name, path: url});\n\t\t// \t\t\t\t\t\t\tfileCnt++;\n\t\t// \t\t\t\t\t\t});\n\n\t\t// \t\t\t\t\t\tthis.readImage('images/ResolveIO.png').then(logoData => {\n\t\t// \t\t\t\t\t\t\tsupportTicket['logo'] = 'data:image/png;base64,' + logoData;\n\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\t\t\tsupportTicket.current_watchers.forEach(user => {\n\t\t\t\t\t\n\t\t// \t\t\t\t\t\t\t\tsupportTicket['user'] = user.user;\n\t\t// \t\t\t\t\t\t\t\tsupportTicket['fileAttached'] = filesAttached;\n\n\t\t// \t\t\t\t\t\t\t\tthis.sendEmail(\n\t\t// \t\t\t\t\t\t\t\t\tuser.email, \n\t\t// \t\t\t\t\t\t\t\t\t'ResolveIO - a ticket has been modified: ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, \n\t\t// \t\t\t\t\t\t\t\t\t'', \n\t\t// \t\t\t\t\t\t\t\t\ttemplate(supportTicket),\n\t\t// \t\t\t\t\t\t\t\t\tfilesAttached\n\t\t// \t\t\t\t\t\t\t\t);\n\t\t// \t\t\t\t\t\t\t});\n\n\t\t// \t\t\t\t\t\t\tif (supportTicket.client_user && supportTicket.client_user.email) {\n\n\t\t// \t\t\t\t\t\t\t\tsupportTicket['user'] = supportTicket.client_user.user;\n\t\t// \t\t\t\t\t\t\t\tsupportTicket['fileAttached'] = filesAttached;\n\n\t\t// \t\t\t\t\t\t\t\tthis.sendEmail(\n\t\t// \t\t\t\t\t\t\t\t\tsupportTicket.client_user.email, \n\t\t// \t\t\t\t\t\t\t\t\t'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, \n\t\t// \t\t\t\t\t\t\t\t\t'', \n\t\t// \t\t\t\t\t\t\t\t\ttemplate(supportTicket),\n\t\t// \t\t\t\t\t\t\t\t\tfilesAttached\n\t\t// \t\t\t\t\t\t\t\t);\n\t\t// \t\t\t\t\t\t\t}\n\t\t// \t\t\t\t\t\t}, err => {\n\t\t// \t\t\t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t\t\t});\n\t\t\n\t\t// \t\t\t\t\t\tresolve(true);\n\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\t}, err => {\n\t\t// \t\t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t\t});\n\n\t\t// \t\t\t\t\tresolve(true);\n\t\t// \t\t\t\t}\n\t\t// \t\t\t\telse {\n\t\t// \t\t\t\t\tthis.callMethodInternal.call(this, 'insertErrorLog', 'supportTicketsmethod - getsignedurl', [\n\t\t// \t\t\t\t\t\tfiles.map(a => a.key), err\n\t\t// \t\t\t\t\t]);\n\t\t// \t\t\t\t\treject(err);\n\t\t// \t\t\t\t}\n\t\t// \t\t\t});\n\t\t// \t\t});\n\t\t// \t}\n\t\t// },\n\t\t// sendSupportTicketDeletedEmail: {\n\t\t// \tcheck: new SimpleSchema({\n\t\t// \t\tsupportTicket: {\n\t\t// \t\t\ttype: Object,\n\t\t// \t\t\tblackbox: true\n\t\t// \t\t}\n\t\t// \t}),\n\t\t// \tfunction: function(supportTicket: SupportTicketModel) {\n\t\t// \t\treturn new Promise(async (resolve, reject) => {\n\t\t// \t\t\tthis.callMethodInternal.call(this, 'getSignedUrls', [], 900, (err, res) => {\n\t\t// \t\t\t\tif (res) {\n\t\t// \t\t\t\t\tthis.readFile('email-templates/support-ticket-deleted.html').then(async html => {\n\t\t// \t\t\t\t\t\tlet template = handlebars.compile(html);\n\n\t\t// \t\t\t\t\t\thandlebars.registerHelper('greaterThan', (a, b) => {\n\t\t// \t\t\t\t\t\t\treturn a > b;\n\t\t// \t\t\t\t\t\t});\n\n\t\t// \t\t\t\t\t\thandlebars.registerHelper('equals', (a, b) => {\n\t\t// \t\t\t\t\t\t\treturn a === b;\n\t\t// \t\t\t\t\t\t});\n\n\t\t// \t\t\t\t\t\tif (supportTicket.client_user && supportTicket.client_user.email) {\n\t\t// \t\t\t\t\t\t\tthis.sendEmail(\n\t\t// \t\t\t\t\t\t\t\tsupportTicket.client_user.email, \n\t\t// \t\t\t\t\t\t\t\t'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, \n\t\t// \t\t\t\t\t\t\t\t'', \n\t\t// \t\t\t\t\t\t\t\ttemplate(supportTicket),\n\t\t// \t\t\t\t\t\t\t\t[]\n\t\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}, err => {\n\t\t// \t\t\t\t\t\tconsole.log(err);\n\t\t// \t\t\t\t\t});\n\n\t\t// \t\t\t\t\tresolve(true);\n\t\t// \t\t\t\t}\n\t\t// \t\t\t\telse {\n\t\t// \t\t\t\t\tthis.callMethodInternal.call(this, 'insertErrorLog', 'supportTicketsmethod - getsignedurl', [\n\t\t// \t\t\t\t\t\t[], err\n\t\t// \t\t\t\t\t]);\n\t\t// \t\t\t\t\treject(err);\n\t\t// \t\t\t\t}\n\t\t// \t\t\t});\n\t\t// \t\t});\n\t\t// \t}\n\t\t// }\n\t});\n}\n\nfunction randomString(length, chars) {\n\tlet result = '';\n\tfor (let i = length; i > 0; --i) { result += chars[Math.floor(Math.random() * chars.length)]; }\n\treturn result;\n}"]}
|