@resolveio/server-lib 3.2.10 → 3.2.11

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.
Files changed (177) hide show
  1. package/package.json +26 -26
  2. package/collections/active-subscription.collection.d.ts +0 -7
  3. package/collections/active-subscription.collection.js +0 -68
  4. package/collections/app-status.collection.d.ts +0 -7
  5. package/collections/app-status.collection.js +0 -43
  6. package/collections/app-version.collection.d.ts +0 -7
  7. package/collections/app-version.collection.js +0 -56
  8. package/collections/billing-logged-in-users.collection.d.ts +0 -7
  9. package/collections/billing-logged-in-users.collection.js +0 -73
  10. package/collections/counter.collection.d.ts +0 -9
  11. package/collections/counter.collection.js +0 -73
  12. package/collections/cron-job-history.collection.d.ts +0 -7
  13. package/collections/cron-job-history.collection.js +0 -86
  14. package/collections/cron-job.collection.d.ts +0 -7
  15. package/collections/cron-job.collection.js +0 -89
  16. package/collections/file.collection.d.ts +0 -9
  17. package/collections/file.collection.js +0 -73
  18. package/collections/flag.collection.d.ts +0 -7
  19. package/collections/flag.collection.js +0 -47
  20. package/collections/log.collection.d.ts +0 -7
  21. package/collections/log.collection.js +0 -65
  22. package/collections/logged-in-users.collection.d.ts +0 -7
  23. package/collections/logged-in-users.collection.js +0 -70
  24. package/collections/method-call.collection.d.ts +0 -6
  25. package/collections/method-call.collection.js +0 -44
  26. package/collections/method-response.collection.d.ts +0 -6
  27. package/collections/method-response.collection.js +0 -48
  28. package/collections/notification.collection.d.ts +0 -7
  29. package/collections/notification.collection.js +0 -43
  30. package/collections/queue-flag.collection.d.ts +0 -7
  31. package/collections/queue-flag.collection.js +0 -41
  32. package/collections/queue-method.collection.d.ts +0 -7
  33. package/collections/queue-method.collection.js +0 -119
  34. package/collections/queue-response.collection.d.ts +0 -7
  35. package/collections/queue-response.collection.js +0 -74
  36. package/collections/support-ticket.collection.d.ts +0 -7
  37. package/collections/support-ticket.collection.js +0 -200
  38. package/collections/user.collection.d.ts +0 -9
  39. package/collections/user.collection.js +0 -153
  40. package/cron/cron.d.ts +0 -5
  41. package/cron/cron.js +0 -160
  42. package/fixtures/cron-jobs.d.ts +0 -1
  43. package/fixtures/cron-jobs.js +0 -90
  44. package/fixtures/init.d.ts +0 -1
  45. package/fixtures/init.js +0 -67
  46. package/http/auth.d.ts +0 -2
  47. package/http/auth.js +0 -468
  48. package/http/health.d.ts +0 -1
  49. package/http/health.js +0 -8
  50. package/index.d.ts +0 -16
  51. package/index.js +0 -125
  52. package/managers/cron.manager.d.ts +0 -16
  53. package/managers/cron.manager.js +0 -202
  54. package/managers/database.manager.d.ts +0 -6
  55. package/managers/database.manager.js +0 -12
  56. package/managers/method.manager.d.ts +0 -28
  57. package/managers/method.manager.js +0 -584
  58. package/managers/queue-method.manager.d.ts +0 -13
  59. package/managers/queue-method.manager.js +0 -240
  60. package/managers/subscription.manager.d.ts +0 -28
  61. package/managers/subscription.manager.js +0 -803
  62. package/managers/support.manager.d.ts +0 -22
  63. package/managers/support.manager.js +0 -320
  64. package/methods/accounts.d.ts +0 -2
  65. package/methods/accounts.js +0 -253
  66. package/methods/aws.d.ts +0 -2
  67. package/methods/aws.js +0 -387
  68. package/methods/cloudconvert.d.ts +0 -2
  69. package/methods/cloudconvert.js +0 -37
  70. package/methods/collections.d.ts +0 -2
  71. package/methods/collections.js +0 -750
  72. package/methods/counters.d.ts +0 -2
  73. package/methods/counters.js +0 -107
  74. package/methods/cron-jobs.d.ts +0 -2
  75. package/methods/cron-jobs.js +0 -132
  76. package/methods/flags.d.ts +0 -2
  77. package/methods/flags.js +0 -6
  78. package/methods/logs.d.ts +0 -2
  79. package/methods/logs.js +0 -29
  80. package/methods/pdf.d.ts +0 -2
  81. package/methods/pdf.js +0 -303
  82. package/models/active-subscription.model.d.ts +0 -13
  83. package/models/active-subscription.model.js +0 -2
  84. package/models/app-status.model.d.ts +0 -4
  85. package/models/app-status.model.js +0 -2
  86. package/models/app-version.model.d.ts +0 -4
  87. package/models/app-version.model.js +0 -2
  88. package/models/billing-logged-in-users.model.d.ts +0 -7
  89. package/models/billing-logged-in-users.model.js +0 -2
  90. package/models/collection-document.model.d.ts +0 -6
  91. package/models/collection-document.model.js +0 -2
  92. package/models/counter.model.d.ts +0 -5
  93. package/models/counter.model.js +0 -2
  94. package/models/cron-job-history.model.d.ts +0 -12
  95. package/models/cron-job-history.model.js +0 -2
  96. package/models/cron-job.model.d.ts +0 -13
  97. package/models/cron-job.model.js +0 -2
  98. package/models/dialog.model.d.ts +0 -23
  99. package/models/dialog.model.js +0 -2
  100. package/models/file.model.d.ts +0 -9
  101. package/models/file.model.js +0 -2
  102. package/models/flag.model.d.ts +0 -5
  103. package/models/flag.model.js +0 -2
  104. package/models/log.model.d.ts +0 -11
  105. package/models/log.model.js +0 -2
  106. package/models/logged-in-users.model.d.ts +0 -9
  107. package/models/logged-in-users.model.js +0 -2
  108. package/models/method-call.model.d.ts +0 -7
  109. package/models/method-call.model.js +0 -2
  110. package/models/method-response.model.d.ts +0 -8
  111. package/models/method-response.model.js +0 -2
  112. package/models/method.model.d.ts +0 -10
  113. package/models/method.model.js +0 -2
  114. package/models/notification.model.d.ts +0 -4
  115. package/models/notification.model.js +0 -2
  116. package/models/pagination.model.d.ts +0 -11
  117. package/models/pagination.model.js +0 -20
  118. package/models/permission.model.d.ts +0 -12
  119. package/models/permission.model.js +0 -2
  120. package/models/queue-method.model.d.ts +0 -10
  121. package/models/queue-method.model.js +0 -2
  122. package/models/queue-response.model.d.ts +0 -10
  123. package/models/queue-response.model.js +0 -2
  124. package/models/select-data-label.model.d.ts +0 -9
  125. package/models/select-data-label.model.js +0 -2
  126. package/models/server-response.model.d.ts +0 -5
  127. package/models/server-response.model.js +0 -2
  128. package/models/subscription.model.d.ts +0 -30
  129. package/models/subscription.model.js +0 -2
  130. package/models/support-method.model.d.ts +0 -9
  131. package/models/support-method.model.js +0 -2
  132. package/models/support-ticket.model.d.ts +0 -61
  133. package/models/support-ticket.model.js +0 -2
  134. package/models/user.model.d.ts +0 -14
  135. package/models/user.model.js +0 -2
  136. package/private/email-templates/enrollment.html +0 -12
  137. package/private/email-templates/forgot-password.html +0 -12
  138. package/private/email-templates/support-ticket-deleted.html +0 -40
  139. package/private/email-templates/support-ticket-modified.html +0 -71
  140. package/private/email-templates/support-ticket.html +0 -71
  141. package/private/images/ResolveIO.png +0 -0
  142. package/publications/app-status.d.ts +0 -2
  143. package/publications/app-status.js +0 -14
  144. package/publications/app-version.d.ts +0 -2
  145. package/publications/app-version.js +0 -14
  146. package/publications/billing-logged-in-users.d.ts +0 -1
  147. package/publications/billing-logged-in-users.js +0 -63
  148. package/publications/cron-jobs.d.ts +0 -2
  149. package/publications/cron-jobs.js +0 -14
  150. package/publications/files.d.ts +0 -2
  151. package/publications/files.js +0 -71
  152. package/publications/flags.d.ts +0 -2
  153. package/publications/flags.js +0 -23
  154. package/publications/logs.d.ts +0 -2
  155. package/publications/logs.js +0 -26
  156. package/publications/method-calls.d.ts +0 -2
  157. package/publications/method-calls.js +0 -14
  158. package/publications/method-responses.d.ts +0 -2
  159. package/publications/method-responses.js +0 -14
  160. package/publications/notifications.d.ts +0 -2
  161. package/publications/notifications.js +0 -14
  162. package/publications/super-admin.d.ts +0 -2
  163. package/publications/super-admin.js +0 -21
  164. package/publications/support-tickets.d.ts +0 -1
  165. package/publications/support-tickets.js +0 -200
  166. package/server-app.d.ts +0 -35
  167. package/server-app.js +0 -636
  168. package/support-methods/aws.d.ts +0 -2
  169. package/support-methods/aws.js +0 -276
  170. package/support-methods/collections.d.ts +0 -2
  171. package/support-methods/collections.js +0 -471
  172. package/support-methods/counters.d.ts +0 -2
  173. package/support-methods/counters.js +0 -189
  174. package/support-methods/support.d.ts +0 -2
  175. package/support-methods/support.js +0 -236
  176. package/util/common.d.ts +0 -14
  177. package/util/common.js +0 -341
@@ -1,276 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (_) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- var file_collection_1 = require("../collections/file.collection");
39
- var mongoose_1 = require("mongoose");
40
- var simpl_schema_1 = require("simpl-schema");
41
- var pdfCnt = 1000000;
42
- function loadAWSMethods(supportManager) {
43
- supportManager.supportMethods({
44
- uploadFileAndSave: {
45
- check: new simpl_schema_1.default({
46
- fileName: {
47
- type: String
48
- },
49
- fileData: {
50
- type: String
51
- },
52
- fileSize: {
53
- type: Number
54
- },
55
- fileOrder: {
56
- type: Number
57
- },
58
- fileType: {
59
- type: String
60
- }
61
- }),
62
- function: function (fileName, fileData, fileSize, fileOrder, fileType) {
63
- var that = this;
64
- return new Promise(function (resolve, reject) {
65
- if (fileName) {
66
- var key_1 = 'uploads/' + Date.now() + '-' + (pdfCnt++) + '-' + fileName;
67
- var newParams = { Bucket: that.serverConfig.AWSBUCKET, Key: key_1, Body: Buffer.from(fileData.replace('data:' + fileData.split(',')[0].split(':')[1].split(';')[0] + ';base64,', ''), 'base64'), ACL: 'private', ContentType: fileData.split(',')[0].split(':')[1].split(';')[0], ContentDisposition: 'inline' };
68
- that.getAWS().upload(newParams, function (err, res) {
69
- if (err) {
70
- reject(err);
71
- }
72
- else if (res) {
73
- file_collection_1.SupportFiles.create({
74
- _id: mongoose_1.Types.ObjectId().toHexString(), name: fileName, size: fileSize, key: key_1, order: fileOrder, type: fileType
75
- }).then(function (resFile) {
76
- resolve(resFile);
77
- }, function (errFile) { return reject(errFile); });
78
- }
79
- });
80
- }
81
- });
82
- }
83
- },
84
- deleteFiles: {
85
- check: new simpl_schema_1.default({
86
- keys: {
87
- type: Array
88
- },
89
- 'keys.$': {
90
- type: String
91
- }
92
- }),
93
- function: function (keys) {
94
- var _this = this;
95
- return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
96
- var files, deleteCnt;
97
- var _this = this;
98
- return __generator(this, function (_a) {
99
- switch (_a.label) {
100
- case 0: return [4 /*yield*/, file_collection_1.SupportFiles.find({ key: { $in: keys } })];
101
- case 1:
102
- files = _a.sent();
103
- deleteCnt = files.length;
104
- files.forEach(function (file) {
105
- file_collection_1.SupportFiles.deleteOne({ _id: file._id }).exec();
106
- var delParams = { Bucket: _this.serverConfig.AWSBUCKET, Key: file.key };
107
- _this.getAWS().deleteObject(delParams, function (err, res) {
108
- if (err) {
109
- reject(err);
110
- }
111
- else {
112
- deleteCnt--;
113
- if (!deleteCnt) {
114
- resolve(res);
115
- }
116
- }
117
- });
118
- });
119
- return [2 /*return*/];
120
- }
121
- });
122
- }); });
123
- }
124
- },
125
- deleteFile: {
126
- check: new simpl_schema_1.default({
127
- key: {
128
- type: String
129
- }
130
- }),
131
- function: function (key) {
132
- var _this = this;
133
- return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
134
- var file, delParams;
135
- return __generator(this, function (_a) {
136
- switch (_a.label) {
137
- case 0: return [4 /*yield*/, file_collection_1.SupportFiles.findOne({ key: key })];
138
- case 1:
139
- file = _a.sent();
140
- if (!file) {
141
- reject('Could not find file');
142
- }
143
- file_collection_1.SupportFiles.deleteOne({ _id: file._id }).exec();
144
- delParams = { Bucket: this.serverConfig['AWSBUCKET'], Key: key };
145
- this.getAWS().deleteObject(delParams, function (err, res) {
146
- if (err) {
147
- reject(err);
148
- }
149
- else {
150
- resolve(res);
151
- }
152
- });
153
- return [2 /*return*/];
154
- }
155
- });
156
- }); });
157
- }
158
- },
159
- deleteFileWithId: {
160
- check: new simpl_schema_1.default({
161
- id_file: {
162
- type: String
163
- }
164
- }),
165
- function: function (id_file) {
166
- var _this = this;
167
- return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
168
- var file, delParams;
169
- return __generator(this, function (_a) {
170
- switch (_a.label) {
171
- case 0: return [4 /*yield*/, file_collection_1.SupportFiles.findOne({ _id: id_file })];
172
- case 1:
173
- file = _a.sent();
174
- if (!file) {
175
- reject('Could not find file');
176
- }
177
- delParams = { Bucket: this.serverConfig['AWSBUCKET'], Key: file.key };
178
- this.getAWS().deleteObject(delParams, function (err, res) {
179
- if (err) {
180
- reject(err);
181
- }
182
- else {
183
- resolve(res);
184
- }
185
- });
186
- file_collection_1.SupportFiles.deleteOne({ _id: file._id }).exec();
187
- return [2 /*return*/];
188
- }
189
- });
190
- }); });
191
- }
192
- },
193
- getSignedUrlWithId: {
194
- check: new simpl_schema_1.default({
195
- id_file: {
196
- type: String
197
- },
198
- expires: {
199
- type: Number
200
- }
201
- }),
202
- function: function (id_file, expires) {
203
- var _this = this;
204
- return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
205
- var file, params;
206
- return __generator(this, function (_a) {
207
- switch (_a.label) {
208
- case 0: return [4 /*yield*/, file_collection_1.SupportFiles.findOne({ _id: id_file })];
209
- case 1:
210
- file = _a.sent();
211
- params = { Bucket: this.serverConfig.AWSBUCKET, Key: file.key, Expires: expires };
212
- this.getAWS().getSignedUrl('getObject', params, function (err, res) {
213
- if (err) {
214
- reject(err);
215
- }
216
- else {
217
- resolve(res);
218
- }
219
- });
220
- return [2 /*return*/];
221
- }
222
- });
223
- }); });
224
- }
225
- },
226
- getSignedUrl: {
227
- check: new simpl_schema_1.default({
228
- key: {
229
- type: String
230
- },
231
- expires: {
232
- type: Number
233
- }
234
- }),
235
- function: function (key, expires) {
236
- var _this = this;
237
- return new Promise(function (resolve, reject) {
238
- var params = { Bucket: _this.serverConfig.AWSBUCKET, Key: key, Expires: expires };
239
- _this.getAWS().getSignedUrl('getObject', params, function (err, res) {
240
- if (err) {
241
- reject(err);
242
- }
243
- else {
244
- resolve(res);
245
- }
246
- });
247
- });
248
- }
249
- },
250
- getSignedUrls: {
251
- check: new simpl_schema_1.default({
252
- keys: {
253
- type: Array
254
- },
255
- 'keys.$': {
256
- type: String
257
- },
258
- expires: {
259
- type: Number
260
- }
261
- }),
262
- function: function (keys, expires) {
263
- var _this = this;
264
- return new Promise(function (resolve, reject) {
265
- var res = [];
266
- keys.forEach(function (key) {
267
- var params = { Bucket: _this.serverConfig.AWSBUCKET, Key: key, Expires: expires };
268
- res.push(_this.getAWS().getSignedUrl('getObject', params));
269
- });
270
- resolve(res);
271
- });
272
- }
273
- }
274
- });
275
- }
276
- exports.loadAWSMethods = loadAWSMethods;
@@ -1,2 +0,0 @@
1
- import { SupportManager } from '../managers/support.manager';
2
- export declare function loadSupportCollectionMethods(supportManager: SupportManager): void;