@stemy/backend 3.4.8 → 3.4.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.
@@ -87,7 +87,7 @@
87
87
  }
88
88
  return t;
89
89
  }
90
- function __decorate$z(decorators, target, key, desc) {
90
+ function __decorate$A(decorators, target, key, desc) {
91
91
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
92
92
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
93
93
  r = Reflect.decorate(decorators, target, key, desc);
@@ -104,7 +104,7 @@
104
104
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
105
105
  return Reflect.metadata(metadataKey, metadataValue);
106
106
  }
107
- function __awaiter$y(thisArg, _arguments, P, generator) {
107
+ function __awaiter$z(thisArg, _arguments, P, generator) {
108
108
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
109
109
  return new (P || (P = Promise))(function (resolve, reject) {
110
110
  function fulfilled(value) { try {
@@ -360,7 +360,7 @@
360
360
  return typeof state === "function" ? receiver === state : state.has(receiver);
361
361
  }
362
362
 
363
- var __awaiter$x = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
363
+ var __awaiter$y = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
364
364
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
365
365
  return new (P || (P = Promise))(function (resolve, reject) {
366
366
  function fulfilled(value) { try {
@@ -560,7 +560,7 @@
560
560
  };
561
561
  }
562
562
  function toImage(src, params, meta) {
563
- return __awaiter$x(this, void 0, void 0, function () {
563
+ return __awaiter$y(this, void 0, void 0, function () {
564
564
  var crop, buffer, _a, cropBefore, cropAfter, img, _b, width, height, canvasScaleX, canvasScaleY, e_2;
565
565
  return __generator(this, function (_c) {
566
566
  switch (_c.label) {
@@ -721,7 +721,7 @@
721
721
  }
722
722
  function readAndDeleteFile(path, timeout) {
723
723
  if (timeout === void 0) { timeout = 5000; }
724
- return __awaiter$x(this, void 0, void 0, function () {
724
+ return __awaiter$y(this, void 0, void 0, function () {
725
725
  var data;
726
726
  return __generator(this, function (_a) {
727
727
  switch (_a.label) {
@@ -738,7 +738,7 @@
738
738
  });
739
739
  }
740
740
  function writeFile(path$1, data) {
741
- return __awaiter$x(this, void 0, void 0, function () {
741
+ return __awaiter$y(this, void 0, void 0, function () {
742
742
  return __generator(this, function (_a) {
743
743
  switch (_a.label) {
744
744
  case 0: return [4 /*yield*/, mkdirRecursive(path.dirname(path$1))];
@@ -1082,7 +1082,7 @@
1082
1082
  return ("" + str).replace(/[&\/\\#, +()$~%.@'":*?<>{}]/g, to);
1083
1083
  }
1084
1084
 
1085
- var __decorate$y = (this && this.__decorate) || function (decorators, target, key, desc) {
1085
+ var __decorate$z = (this && this.__decorate) || function (decorators, target, key, desc) {
1086
1086
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1087
1087
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1088
1088
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1123,7 +1123,7 @@
1123
1123
  };
1124
1124
  return IsFile;
1125
1125
  }());
1126
- exports.IsFile = __decorate$y([
1126
+ exports.IsFile = __decorate$z([
1127
1127
  classValidator.ValidatorConstraint()
1128
1128
  ], exports.IsFile);
1129
1129
  exports.IsObjectId = /** @class */ (function () {
@@ -1135,7 +1135,7 @@
1135
1135
  };
1136
1136
  return IsObjectId;
1137
1137
  }());
1138
- exports.IsObjectId = __decorate$y([
1138
+ exports.IsObjectId = __decorate$z([
1139
1139
  classValidator.ValidatorConstraint()
1140
1140
  ], exports.IsObjectId);
1141
1141
 
@@ -1197,7 +1197,7 @@
1197
1197
  return Parameter;
1198
1198
  }());
1199
1199
 
1200
- var __decorate$x = (this && this.__decorate) || function (decorators, target, key, desc) {
1200
+ var __decorate$y = (this && this.__decorate) || function (decorators, target, key, desc) {
1201
1201
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1202
1202
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1203
1203
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1207,7 +1207,7 @@
1207
1207
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1208
1208
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1209
1209
  };
1210
- var __awaiter$w = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1210
+ var __awaiter$x = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1211
1211
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1212
1212
  return new (P || (P = Promise))(function (resolve, reject) {
1213
1213
  function fulfilled(value) { try {
@@ -1255,7 +1255,7 @@
1255
1255
  };
1256
1256
  AssetProcessor.fileTypeFromBuffer = function (buffer) {
1257
1257
  var _a;
1258
- return __awaiter$w(this, void 0, void 0, function () {
1258
+ return __awaiter$x(this, void 0, void 0, function () {
1259
1259
  var type;
1260
1260
  return __generator(this, function (_b) {
1261
1261
  switch (_b.label) {
@@ -1289,7 +1289,7 @@
1289
1289
  return imageTypes.indexOf(contentType) >= 0;
1290
1290
  };
1291
1291
  AssetProcessor.copyImageMeta = function (buffer, metadata, fileType) {
1292
- return __awaiter$w(this, void 0, void 0, function () {
1292
+ return __awaiter$x(this, void 0, void 0, function () {
1293
1293
  var match, attrs, parts, output;
1294
1294
  return __generator(this, function (_b) {
1295
1295
  switch (_b.label) {
@@ -1336,7 +1336,7 @@
1336
1336
  });
1337
1337
  };
1338
1338
  AssetProcessor.prototype.process = function (buffer, metadata, fileType) {
1339
- return __awaiter$w(this, void 0, void 0, function () {
1339
+ return __awaiter$x(this, void 0, void 0, function () {
1340
1340
  return __generator(this, function (_b) {
1341
1341
  switch (_b.label) {
1342
1342
  case 0:
@@ -1356,12 +1356,12 @@
1356
1356
  };
1357
1357
  return AssetProcessor;
1358
1358
  }());
1359
- exports.AssetProcessor = AssetProcessor_1 = __decorate$x([
1359
+ exports.AssetProcessor = AssetProcessor_1 = __decorate$y([
1360
1360
  tsyringe.injectable(),
1361
1361
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped)
1362
1362
  ], exports.AssetProcessor);
1363
1363
 
1364
- var __decorate$w = (this && this.__decorate) || function (decorators, target, key, desc) {
1364
+ var __decorate$x = (this && this.__decorate) || function (decorators, target, key, desc) {
1365
1365
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1366
1366
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1367
1367
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1413,14 +1413,14 @@
1413
1413
  };
1414
1414
  return Configuration;
1415
1415
  }());
1416
- exports.Configuration = __decorate$w([
1416
+ exports.Configuration = __decorate$x([
1417
1417
  tsyringe.injectable(),
1418
1418
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
1419
1419
  __param$8(0, tsyringe.injectAll(PARAMETER)),
1420
1420
  __metadata$q("design:paramtypes", [Array])
1421
1421
  ], exports.Configuration);
1422
1422
 
1423
- var __decorate$v = (this && this.__decorate) || function (decorators, target, key, desc) {
1423
+ var __decorate$w = (this && this.__decorate) || function (decorators, target, key, desc) {
1424
1424
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1425
1425
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1426
1426
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1434,7 +1434,7 @@
1434
1434
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1435
1435
  return Reflect.metadata(k, v);
1436
1436
  };
1437
- var __awaiter$v = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1437
+ var __awaiter$w = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1438
1438
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1439
1439
  return new (P || (P = Promise))(function (resolve, reject) {
1440
1440
  function fulfilled(value) { try {
@@ -1482,7 +1482,7 @@
1482
1482
  configurable: true
1483
1483
  });
1484
1484
  MongoConnector.prototype.connect = function () {
1485
- return __awaiter$v(this, void 0, void 0, function () {
1485
+ return __awaiter$w(this, void 0, void 0, function () {
1486
1486
  var _a;
1487
1487
  return __generator(this, function (_b) {
1488
1488
  switch (_b.label) {
@@ -1506,13 +1506,13 @@
1506
1506
  };
1507
1507
  return MongoConnector;
1508
1508
  }());
1509
- exports.MongoConnector = __decorate$v([
1509
+ exports.MongoConnector = __decorate$w([
1510
1510
  tsyringe.injectable(),
1511
1511
  tsyringe.singleton(),
1512
1512
  __metadata$p("design:paramtypes", [exports.Configuration])
1513
1513
  ], exports.MongoConnector);
1514
1514
 
1515
- var __awaiter$u = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1515
+ var __awaiter$v = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1516
1516
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1517
1517
  return new (P || (P = Promise))(function (resolve, reject) {
1518
1518
  function fulfilled(value) { try {
@@ -1548,7 +1548,7 @@
1548
1548
  return this.collection.updateOne({ _id: this.mId }, { $set: this.toJSON() });
1549
1549
  };
1550
1550
  BaseEntity.prototype.load = function () {
1551
- return __awaiter$u(this, void 0, void 0, function () {
1551
+ return __awaiter$v(this, void 0, void 0, function () {
1552
1552
  var res;
1553
1553
  return __generator(this, function (_a) {
1554
1554
  switch (_a.label) {
@@ -1571,7 +1571,7 @@
1571
1571
  return BaseEntity;
1572
1572
  }());
1573
1573
 
1574
- var __awaiter$t = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1574
+ var __awaiter$u = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1575
1575
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1576
1576
  return new (P || (P = Promise))(function (resolve, reject) {
1577
1577
  function fulfilled(value) { try {
@@ -1626,7 +1626,7 @@
1626
1626
  configurable: true
1627
1627
  });
1628
1628
  Asset.prototype.unlink = function () {
1629
- return __awaiter$t(this, void 0, void 0, function () {
1629
+ return __awaiter$u(this, void 0, void 0, function () {
1630
1630
  return __generator(this, function (_a) {
1631
1631
  return [2 /*return*/, deleteFromBucket(this.bucket, this.mId)];
1632
1632
  });
@@ -1636,7 +1636,7 @@
1636
1636
  return streamToBuffer(this.stream);
1637
1637
  };
1638
1638
  Asset.prototype.download = function (metadata) {
1639
- return __awaiter$t(this, void 0, void 0, function () {
1639
+ return __awaiter$u(this, void 0, void 0, function () {
1640
1640
  return __generator(this, function (_a) {
1641
1641
  switch (_a.label) {
1642
1642
  case 0:
@@ -1656,14 +1656,14 @@
1656
1656
  };
1657
1657
  Asset.prototype.getImage = function (params) {
1658
1658
  if (params === void 0) { params = null; }
1659
- return __awaiter$t(this, void 0, void 0, function () {
1659
+ return __awaiter$u(this, void 0, void 0, function () {
1660
1660
  return __generator(this, function (_a) {
1661
1661
  return [2 /*return*/, toImage(this.stream, params, this.metadata)];
1662
1662
  });
1663
1663
  });
1664
1664
  };
1665
1665
  Asset.prototype.downloadImage = function (params, metadata) {
1666
- return __awaiter$t(this, void 0, void 0, function () {
1666
+ return __awaiter$u(this, void 0, void 0, function () {
1667
1667
  var _a;
1668
1668
  return __generator(this, function (_b) {
1669
1669
  switch (_b.label) {
@@ -1678,7 +1678,7 @@
1678
1678
  return Asset;
1679
1679
  }(BaseEntity));
1680
1680
 
1681
- var __awaiter$s = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1681
+ var __awaiter$t = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1682
1682
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1683
1683
  return new (P || (P = Promise))(function (resolve, reject) {
1684
1684
  function fulfilled(value) { try {
@@ -1713,21 +1713,21 @@
1713
1713
  configurable: true
1714
1714
  });
1715
1715
  TempAsset.prototype.unlink = function () {
1716
- return __awaiter$s(this, void 0, void 0, function () {
1716
+ return __awaiter$t(this, void 0, void 0, function () {
1717
1717
  return __generator(this, function (_a) {
1718
1718
  throw new Error("Temp asset '" + this.id + "' can not be removed!");
1719
1719
  });
1720
1720
  });
1721
1721
  };
1722
1722
  TempAsset.prototype.getBuffer = function () {
1723
- return __awaiter$s(this, void 0, void 0, function () {
1723
+ return __awaiter$t(this, void 0, void 0, function () {
1724
1724
  return __generator(this, function (_a) {
1725
1725
  return [2 /*return*/, this.buffer];
1726
1726
  });
1727
1727
  });
1728
1728
  };
1729
1729
  TempAsset.prototype.download = function (metadata) {
1730
- return __awaiter$s(this, void 0, void 0, function () {
1730
+ return __awaiter$t(this, void 0, void 0, function () {
1731
1731
  return __generator(this, function (_a) {
1732
1732
  return [2 /*return*/, this.stream];
1733
1733
  });
@@ -1741,14 +1741,14 @@
1741
1741
  return this.downloadImage(params);
1742
1742
  };
1743
1743
  TempAsset.prototype.save = function () {
1744
- return __awaiter$s(this, void 0, void 0, function () {
1744
+ return __awaiter$t(this, void 0, void 0, function () {
1745
1745
  return __generator(this, function (_a) {
1746
1746
  return [2 /*return*/, this];
1747
1747
  });
1748
1748
  });
1749
1749
  };
1750
1750
  TempAsset.prototype.load = function () {
1751
- return __awaiter$s(this, void 0, void 0, function () {
1751
+ return __awaiter$t(this, void 0, void 0, function () {
1752
1752
  return __generator(this, function (_a) {
1753
1753
  return [2 /*return*/, this];
1754
1754
  });
@@ -1765,7 +1765,7 @@
1765
1765
  return TempAsset;
1766
1766
  }());
1767
1767
 
1768
- var __decorate$u = (this && this.__decorate) || function (decorators, target, key, desc) {
1768
+ var __decorate$v = (this && this.__decorate) || function (decorators, target, key, desc) {
1769
1769
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1770
1770
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1771
1771
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1779,7 +1779,7 @@
1779
1779
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1780
1780
  return Reflect.metadata(k, v);
1781
1781
  };
1782
- var __awaiter$r = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1782
+ var __awaiter$s = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1783
1783
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1784
1784
  return new (P || (P = Promise))(function (resolve, reject) {
1785
1785
  function fulfilled(value) { try {
@@ -1809,7 +1809,7 @@
1809
1809
  Assets.prototype.write = function (stream, contentType, metadata) {
1810
1810
  if (contentType === void 0) { contentType = null; }
1811
1811
  if (metadata === void 0) { metadata = null; }
1812
- return __awaiter$r(this, void 0, void 0, function () {
1812
+ return __awaiter$s(this, void 0, void 0, function () {
1813
1813
  var uploadStream, buffer, fileType, e_1;
1814
1814
  return __generator(this, function (_b) {
1815
1815
  switch (_b.label) {
@@ -1843,7 +1843,7 @@
1843
1843
  Assets.prototype.writeBuffer = function (buffer, metadata, contentType) {
1844
1844
  if (metadata === void 0) { metadata = null; }
1845
1845
  if (contentType === void 0) { contentType = null; }
1846
- return __awaiter$r(this, void 0, void 0, function () {
1846
+ return __awaiter$s(this, void 0, void 0, function () {
1847
1847
  var fileType, e_2;
1848
1848
  return __generator(this, function (_b) {
1849
1849
  switch (_b.label) {
@@ -1875,7 +1875,7 @@
1875
1875
  };
1876
1876
  Assets.prototype.writeUrl = function (url, metadata) {
1877
1877
  if (metadata === void 0) { metadata = null; }
1878
- return __awaiter$r(this, void 0, void 0, function () {
1878
+ return __awaiter$s(this, void 0, void 0, function () {
1879
1879
  var oneWeek, asset, buffer;
1880
1880
  return __generator(this, function (_b) {
1881
1881
  switch (_b.label) {
@@ -1899,7 +1899,7 @@
1899
1899
  };
1900
1900
  Assets.prototype.download = function (url, contentType) {
1901
1901
  if (contentType === void 0) { contentType = null; }
1902
- return __awaiter$r(this, void 0, void 0, function () {
1902
+ return __awaiter$s(this, void 0, void 0, function () {
1903
1903
  var buffer, fileType, e_3, metadata;
1904
1904
  return __generator(this, function (_b) {
1905
1905
  switch (_b.label) {
@@ -1935,14 +1935,14 @@
1935
1935
  });
1936
1936
  };
1937
1937
  Assets.prototype.read = function (id) {
1938
- return __awaiter$r(this, void 0, void 0, function () {
1938
+ return __awaiter$s(this, void 0, void 0, function () {
1939
1939
  return __generator(this, function (_b) {
1940
1940
  return [2 /*return*/, !id ? null : this.find({ _id: new bson.ObjectId(id) })];
1941
1941
  });
1942
1942
  });
1943
1943
  };
1944
1944
  Assets.prototype.find = function (where) {
1945
- return __awaiter$r(this, void 0, void 0, function () {
1945
+ return __awaiter$s(this, void 0, void 0, function () {
1946
1946
  var data;
1947
1947
  return __generator(this, function (_b) {
1948
1948
  switch (_b.label) {
@@ -1955,7 +1955,7 @@
1955
1955
  });
1956
1956
  };
1957
1957
  Assets.prototype.findMany = function (where) {
1958
- return __awaiter$r(this, void 0, void 0, function () {
1958
+ return __awaiter$s(this, void 0, void 0, function () {
1959
1959
  var cursor, items, result, items_1, items_1_1, item;
1960
1960
  var e_4, _b;
1961
1961
  return __generator(this, function (_c) {
@@ -1987,7 +1987,7 @@
1987
1987
  });
1988
1988
  };
1989
1989
  Assets.prototype.deleteMany = function (where) {
1990
- return __awaiter$r(this, void 0, void 0, function () {
1990
+ return __awaiter$s(this, void 0, void 0, function () {
1991
1991
  var assets;
1992
1992
  return __generator(this, function (_b) {
1993
1993
  switch (_b.label) {
@@ -2000,7 +2000,7 @@
2000
2000
  });
2001
2001
  };
2002
2002
  Assets.prototype.unlink = function (id) {
2003
- return __awaiter$r(this, void 0, void 0, function () {
2003
+ return __awaiter$s(this, void 0, void 0, function () {
2004
2004
  var asset;
2005
2005
  return __generator(this, function (_b) {
2006
2006
  switch (_b.label) {
@@ -2015,7 +2015,7 @@
2015
2015
  });
2016
2016
  };
2017
2017
  Assets.prototype.upload = function (stream, fileType, metadata) {
2018
- return __awaiter$r(this, void 0, void 0, function () {
2018
+ return __awaiter$s(this, void 0, void 0, function () {
2019
2019
  var contentType;
2020
2020
  var _this = this;
2021
2021
  return __generator(this, function (_b) {
@@ -2051,13 +2051,13 @@
2051
2051
  };
2052
2052
  return Assets;
2053
2053
  }());
2054
- exports.Assets = __decorate$u([
2054
+ exports.Assets = __decorate$v([
2055
2055
  tsyringe.injectable(),
2056
2056
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
2057
2057
  __metadata$o("design:paramtypes", [exports.MongoConnector, exports.AssetProcessor])
2058
2058
  ], exports.Assets);
2059
2059
 
2060
- var __awaiter$q = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2060
+ var __awaiter$r = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2061
2061
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2062
2062
  return new (P || (P = Promise))(function (resolve, reject) {
2063
2063
  function fulfilled(value) { try {
@@ -2120,7 +2120,7 @@
2120
2120
  configurable: true
2121
2121
  });
2122
2122
  LazyAsset.prototype.unlink = function () {
2123
- return __awaiter$q(this, void 0, void 0, function () {
2123
+ return __awaiter$r(this, void 0, void 0, function () {
2124
2124
  return __generator(this, function (_a) {
2125
2125
  switch (_a.label) {
2126
2126
  case 0: return [4 /*yield*/, this.load()];
@@ -2152,7 +2152,7 @@
2152
2152
  });
2153
2153
  };
2154
2154
  LazyAsset.prototype.loadAsset = function () {
2155
- return __awaiter$q(this, void 0, void 0, function () {
2155
+ return __awaiter$r(this, void 0, void 0, function () {
2156
2156
  return __generator(this, function (_a) {
2157
2157
  switch (_a.label) {
2158
2158
  case 0: return [4 /*yield*/, this.load()];
@@ -2177,7 +2177,7 @@
2177
2177
  });
2178
2178
  };
2179
2179
  LazyAsset.prototype.writeAsset = function (asset) {
2180
- return __awaiter$q(this, void 0, void 0, function () {
2180
+ return __awaiter$r(this, void 0, void 0, function () {
2181
2181
  return __generator(this, function (_a) {
2182
2182
  switch (_a.label) {
2183
2183
  case 0:
@@ -2191,7 +2191,7 @@
2191
2191
  });
2192
2192
  };
2193
2193
  LazyAsset.prototype.startWorkingOnAsset = function (fromLoad) {
2194
- return __awaiter$q(this, void 0, void 0, function () {
2194
+ return __awaiter$r(this, void 0, void 0, function () {
2195
2195
  var _a;
2196
2196
  return __generator(this, function (_b) {
2197
2197
  switch (_b.label) {
@@ -2215,7 +2215,7 @@
2215
2215
  return LazyAsset;
2216
2216
  }(BaseEntity));
2217
2217
 
2218
- var __decorate$t = (this && this.__decorate) || function (decorators, target, key, desc) {
2218
+ var __decorate$u = (this && this.__decorate) || function (decorators, target, key, desc) {
2219
2219
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2220
2220
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2221
2221
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2232,7 +2232,7 @@
2232
2232
  var __param$7 = (this && this.__param) || function (paramIndex, decorator) {
2233
2233
  return function (target, key) { decorator(target, key, paramIndex); };
2234
2234
  };
2235
- var __awaiter$p = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2235
+ var __awaiter$q = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2236
2236
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2237
2237
  return new (P || (P = Promise))(function (resolve, reject) {
2238
2238
  function fulfilled(value) { try {
@@ -2283,7 +2283,7 @@
2283
2283
  };
2284
2284
  JobManager.prototype.process = function (jobType, params) {
2285
2285
  if (params === void 0) { params = {}; }
2286
- return __awaiter$p(this, void 0, void 0, function () {
2286
+ return __awaiter$q(this, void 0, void 0, function () {
2287
2287
  var instance, jobName;
2288
2288
  return __generator(this, function (_a) {
2289
2289
  instance = null;
@@ -2300,7 +2300,7 @@
2300
2300
  };
2301
2301
  JobManager.prototype.enqueueWithName = function (name, params) {
2302
2302
  if (params === void 0) { params = {}; }
2303
- return __awaiter$p(this, void 0, void 0, function () {
2303
+ return __awaiter$q(this, void 0, void 0, function () {
2304
2304
  return __generator(this, function (_a) {
2305
2305
  return [2 /*return*/, this.sendToWorkers(this.tryResolveFromName(name, params), params)];
2306
2306
  });
@@ -2308,7 +2308,7 @@
2308
2308
  };
2309
2309
  JobManager.prototype.enqueue = function (jobType, params) {
2310
2310
  if (params === void 0) { params = {}; }
2311
- return __awaiter$p(this, void 0, void 0, function () {
2311
+ return __awaiter$q(this, void 0, void 0, function () {
2312
2312
  return __generator(this, function (_a) {
2313
2313
  return [2 /*return*/, this.sendToWorkers(this.tryResolveAndInit(jobType, params), params)];
2314
2314
  });
@@ -2339,7 +2339,7 @@
2339
2339
  });
2340
2340
  };
2341
2341
  JobManager.prototype.startProcessing = function () {
2342
- return __awaiter$p(this, void 0, void 0, function () {
2342
+ return __awaiter$q(this, void 0, void 0, function () {
2343
2343
  var host, pushHost, pullHost;
2344
2344
  var _this = this;
2345
2345
  return __generator(this, function (_a) {
@@ -2365,7 +2365,7 @@
2365
2365
  case 2:
2366
2366
  _a.sent();
2367
2367
  console.log("Worker consumer connected to: " + pullHost);
2368
- this.workerPull.on("message", function (name, args, uniqId) { return __awaiter$p(_this, void 0, void 0, function () {
2368
+ this.workerPull.on("message", function (name, args, uniqId) { return __awaiter$q(_this, void 0, void 0, function () {
2369
2369
  var jobName, jobParams, uniqueId, e_1, e_2;
2370
2370
  return __generator(this, function (_a) {
2371
2371
  switch (_a.label) {
@@ -2463,7 +2463,7 @@
2463
2463
  return container.resolve(jobType);
2464
2464
  };
2465
2465
  JobManager.prototype.sendToWorkers = function (jobName, params) {
2466
- return __awaiter$p(this, void 0, void 0, function () {
2466
+ return __awaiter$q(this, void 0, void 0, function () {
2467
2467
  var publisher, uniqueId;
2468
2468
  return __generator(this, function (_a) {
2469
2469
  switch (_a.label) {
@@ -2481,14 +2481,14 @@
2481
2481
  };
2482
2482
  return JobManager;
2483
2483
  }());
2484
- exports.JobManager = __decorate$t([
2484
+ exports.JobManager = __decorate$u([
2485
2485
  tsyringe.injectable(),
2486
2486
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
2487
2487
  __param$7(1, tsyringe.inject(DI_CONTAINER)), __param$7(2, tsyringe.injectAll(JOB)),
2488
2488
  __metadata$n("design:paramtypes", [exports.Configuration, Object, Array])
2489
2489
  ], exports.JobManager);
2490
2490
 
2491
- var __awaiter$o = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2491
+ var __awaiter$p = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2492
2492
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2493
2493
  return new (P || (P = Promise))(function (resolve, reject) {
2494
2494
  function fulfilled(value) { try {
@@ -2566,7 +2566,7 @@
2566
2566
  return this;
2567
2567
  };
2568
2568
  Progress.prototype.createSubProgress = function (progressValue, max, message) {
2569
- return __awaiter$o(this, void 0, void 0, function () {
2569
+ return __awaiter$p(this, void 0, void 0, function () {
2570
2570
  return __generator(this, function (_a) {
2571
2571
  switch (_a.label) {
2572
2572
  case 0:
@@ -2588,7 +2588,7 @@
2588
2588
  });
2589
2589
  };
2590
2590
  Progress.prototype.setMax = function (max) {
2591
- return __awaiter$o(this, void 0, void 0, function () {
2591
+ return __awaiter$p(this, void 0, void 0, function () {
2592
2592
  return __generator(this, function (_a) {
2593
2593
  switch (_a.label) {
2594
2594
  case 0:
@@ -2605,7 +2605,7 @@
2605
2605
  });
2606
2606
  };
2607
2607
  Progress.prototype.setMessage = function (message) {
2608
- return __awaiter$o(this, void 0, void 0, function () {
2608
+ return __awaiter$p(this, void 0, void 0, function () {
2609
2609
  return __generator(this, function (_a) {
2610
2610
  switch (_a.label) {
2611
2611
  case 0:
@@ -2619,7 +2619,7 @@
2619
2619
  });
2620
2620
  };
2621
2621
  Progress.prototype.setError = function (error) {
2622
- return __awaiter$o(this, void 0, void 0, function () {
2622
+ return __awaiter$p(this, void 0, void 0, function () {
2623
2623
  return __generator(this, function (_a) {
2624
2624
  switch (_a.label) {
2625
2625
  case 0:
@@ -2634,7 +2634,7 @@
2634
2634
  };
2635
2635
  Progress.prototype.advance = function (value) {
2636
2636
  if (value === void 0) { value = 1; }
2637
- return __awaiter$o(this, void 0, void 0, function () {
2637
+ return __awaiter$p(this, void 0, void 0, function () {
2638
2638
  return __generator(this, function (_a) {
2639
2639
  switch (_a.label) {
2640
2640
  case 0:
@@ -2656,7 +2656,7 @@
2656
2656
  });
2657
2657
  };
2658
2658
  Progress.prototype.cancel = function () {
2659
- return __awaiter$o(this, void 0, void 0, function () {
2659
+ return __awaiter$p(this, void 0, void 0, function () {
2660
2660
  return __generator(this, function (_a) {
2661
2661
  switch (_a.label) {
2662
2662
  case 0:
@@ -2755,7 +2755,7 @@
2755
2755
  return this;
2756
2756
  };
2757
2757
  SubProgress.prototype.createSubProgress = function (progressValue, max, message) {
2758
- return __awaiter$o(this, void 0, void 0, function () {
2758
+ return __awaiter$p(this, void 0, void 0, function () {
2759
2759
  return __generator(this, function (_a) {
2760
2760
  switch (_a.label) {
2761
2761
  case 0:
@@ -2776,7 +2776,7 @@
2776
2776
  });
2777
2777
  };
2778
2778
  SubProgress.prototype.setMax = function (max) {
2779
- return __awaiter$o(this, void 0, void 0, function () {
2779
+ return __awaiter$p(this, void 0, void 0, function () {
2780
2780
  return __generator(this, function (_a) {
2781
2781
  switch (_a.label) {
2782
2782
  case 0:
@@ -2793,7 +2793,7 @@
2793
2793
  });
2794
2794
  };
2795
2795
  SubProgress.prototype.setMessage = function (message) {
2796
- return __awaiter$o(this, void 0, void 0, function () {
2796
+ return __awaiter$p(this, void 0, void 0, function () {
2797
2797
  return __generator(this, function (_a) {
2798
2798
  switch (_a.label) {
2799
2799
  case 0:
@@ -2808,7 +2808,7 @@
2808
2808
  });
2809
2809
  };
2810
2810
  SubProgress.prototype.setError = function (error) {
2811
- return __awaiter$o(this, void 0, void 0, function () {
2811
+ return __awaiter$p(this, void 0, void 0, function () {
2812
2812
  return __generator(this, function (_a) {
2813
2813
  switch (_a.label) {
2814
2814
  case 0:
@@ -2824,7 +2824,7 @@
2824
2824
  };
2825
2825
  SubProgress.prototype.advance = function (value) {
2826
2826
  if (value === void 0) { value = 1; }
2827
- return __awaiter$o(this, void 0, void 0, function () {
2827
+ return __awaiter$p(this, void 0, void 0, function () {
2828
2828
  return __generator(this, function (_a) {
2829
2829
  switch (_a.label) {
2830
2830
  case 0:
@@ -2841,7 +2841,7 @@
2841
2841
  });
2842
2842
  };
2843
2843
  SubProgress.prototype.cancel = function () {
2844
- return __awaiter$o(this, void 0, void 0, function () {
2844
+ return __awaiter$p(this, void 0, void 0, function () {
2845
2845
  return __generator(this, function (_a) {
2846
2846
  switch (_a.label) {
2847
2847
  case 0:
@@ -2856,7 +2856,7 @@
2856
2856
  });
2857
2857
  };
2858
2858
  SubProgress.prototype.save = function () {
2859
- return __awaiter$o(this, void 0, void 0, function () {
2859
+ return __awaiter$p(this, void 0, void 0, function () {
2860
2860
  var ratio, newProgress, current;
2861
2861
  return __generator(this, function (_a) {
2862
2862
  switch (_a.label) {
@@ -2875,7 +2875,7 @@
2875
2875
  });
2876
2876
  };
2877
2877
  SubProgress.prototype.load = function () {
2878
- return __awaiter$o(this, void 0, void 0, function () {
2878
+ return __awaiter$p(this, void 0, void 0, function () {
2879
2879
  return __generator(this, function (_a) {
2880
2880
  return [2 /*return*/, null];
2881
2881
  });
@@ -2887,7 +2887,7 @@
2887
2887
  return SubProgress;
2888
2888
  }());
2889
2889
 
2890
- var __decorate$s = (this && this.__decorate) || function (decorators, target, key, desc) {
2890
+ var __decorate$t = (this && this.__decorate) || function (decorators, target, key, desc) {
2891
2891
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2892
2892
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2893
2893
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2901,7 +2901,7 @@
2901
2901
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
2902
2902
  return Reflect.metadata(k, v);
2903
2903
  };
2904
- var __awaiter$n = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2904
+ var __awaiter$o = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2905
2905
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2906
2906
  return new (P || (P = Promise))(function (resolve, reject) {
2907
2907
  function fulfilled(value) { try {
@@ -2933,11 +2933,11 @@
2933
2933
  });
2934
2934
  }
2935
2935
  Progresses.prototype.waitToFinish = function (id) {
2936
- return __awaiter$n(this, void 0, void 0, function () {
2936
+ return __awaiter$o(this, void 0, void 0, function () {
2937
2937
  var _this = this;
2938
2938
  return __generator(this, function (_a) {
2939
2939
  return [2 /*return*/, Promise.race([
2940
- this.waitForProgress(id, function () { return __awaiter$n(_this, void 0, void 0, function () {
2940
+ this.waitForProgress(id, function () { return __awaiter$o(_this, void 0, void 0, function () {
2941
2941
  var progress;
2942
2942
  return __generator(this, function (_a) {
2943
2943
  switch (_a.label) {
@@ -2956,7 +2956,7 @@
2956
2956
  }
2957
2957
  });
2958
2958
  }); }, 500),
2959
- this.waitForProgress(id, function () { return __awaiter$n(_this, void 0, void 0, function () {
2959
+ this.waitForProgress(id, function () { return __awaiter$o(_this, void 0, void 0, function () {
2960
2960
  return __generator(this, function (_a) {
2961
2961
  return [2 /*return*/, this.progresses[id] || null];
2962
2962
  });
@@ -2966,14 +2966,14 @@
2966
2966
  });
2967
2967
  };
2968
2968
  Progresses.prototype.get = function (id) {
2969
- return __awaiter$n(this, void 0, void 0, function () {
2969
+ return __awaiter$o(this, void 0, void 0, function () {
2970
2970
  return __generator(this, function (_a) {
2971
2971
  return [2 /*return*/, !id ? null : this.find({ _id: new bson.ObjectId(id) })];
2972
2972
  });
2973
2973
  });
2974
2974
  };
2975
2975
  Progresses.prototype.find = function (where) {
2976
- return __awaiter$n(this, void 0, void 0, function () {
2976
+ return __awaiter$o(this, void 0, void 0, function () {
2977
2977
  var data;
2978
2978
  return __generator(this, function (_a) {
2979
2979
  switch (_a.label) {
@@ -2987,7 +2987,7 @@
2987
2987
  };
2988
2988
  Progresses.prototype.create = function (max) {
2989
2989
  if (max === void 0) { max = 100; }
2990
- return __awaiter$n(this, void 0, void 0, function () {
2990
+ return __awaiter$o(this, void 0, void 0, function () {
2991
2991
  var data, res;
2992
2992
  return __generator(this, function (_a) {
2993
2993
  switch (_a.label) {
@@ -3011,7 +3011,7 @@
3011
3011
  });
3012
3012
  };
3013
3013
  Progresses.prototype.remove = function (id) {
3014
- return __awaiter$n(this, void 0, void 0, function () {
3014
+ return __awaiter$o(this, void 0, void 0, function () {
3015
3015
  return __generator(this, function (_a) {
3016
3016
  switch (_a.label) {
3017
3017
  case 0: return [4 /*yield*/, this.collection.deleteOne({ _id: new bson.ObjectId(id) })];
@@ -3023,7 +3023,7 @@
3023
3023
  });
3024
3024
  };
3025
3025
  Progresses.prototype.waitForProgress = function (id, cb, delay) {
3026
- return __awaiter$n(this, void 0, void 0, function () {
3026
+ return __awaiter$o(this, void 0, void 0, function () {
3027
3027
  var isFinished, progress, waitTime;
3028
3028
  return __generator(this, function (_a) {
3029
3029
  switch (_a.label) {
@@ -3060,13 +3060,13 @@
3060
3060
  };
3061
3061
  return Progresses;
3062
3062
  }());
3063
- exports.Progresses = __decorate$s([
3063
+ exports.Progresses = __decorate$t([
3064
3064
  tsyringe.injectable(),
3065
3065
  tsyringe.singleton(),
3066
3066
  __metadata$m("design:paramtypes", [exports.MongoConnector, exports.JobManager])
3067
3067
  ], exports.Progresses);
3068
3068
 
3069
- var __decorate$r = (this && this.__decorate) || function (decorators, target, key, desc) {
3069
+ var __decorate$s = (this && this.__decorate) || function (decorators, target, key, desc) {
3070
3070
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3071
3071
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3072
3072
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3080,7 +3080,7 @@
3080
3080
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3081
3081
  return Reflect.metadata(k, v);
3082
3082
  };
3083
- var __awaiter$m = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3083
+ var __awaiter$n = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3084
3084
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3085
3085
  return new (P || (P = Promise))(function (resolve, reject) {
3086
3086
  function fulfilled(value) { try {
@@ -3110,7 +3110,7 @@
3110
3110
  LazyAssets.prototype.create = function (jobType, jobParams, jobQue) {
3111
3111
  if (jobParams === void 0) { jobParams = {}; }
3112
3112
  if (jobQue === void 0) { jobQue = "main"; }
3113
- return __awaiter$m(this, void 0, void 0, function () {
3113
+ return __awaiter$n(this, void 0, void 0, function () {
3114
3114
  var jobName, data, existingAsset, res;
3115
3115
  return __generator(this, function (_a) {
3116
3116
  switch (_a.label) {
@@ -3135,14 +3135,14 @@
3135
3135
  });
3136
3136
  };
3137
3137
  LazyAssets.prototype.read = function (id) {
3138
- return __awaiter$m(this, void 0, void 0, function () {
3138
+ return __awaiter$n(this, void 0, void 0, function () {
3139
3139
  return __generator(this, function (_a) {
3140
3140
  return [2 /*return*/, !id ? null : this.find({ _id: new bson.ObjectId(id) })];
3141
3141
  });
3142
3142
  });
3143
3143
  };
3144
3144
  LazyAssets.prototype.find = function (where) {
3145
- return __awaiter$m(this, void 0, void 0, function () {
3145
+ return __awaiter$n(this, void 0, void 0, function () {
3146
3146
  var data;
3147
3147
  return __generator(this, function (_a) {
3148
3148
  switch (_a.label) {
@@ -3157,7 +3157,7 @@
3157
3157
  });
3158
3158
  };
3159
3159
  LazyAssets.prototype.unlink = function (id) {
3160
- return __awaiter$m(this, void 0, void 0, function () {
3160
+ return __awaiter$n(this, void 0, void 0, function () {
3161
3161
  var asset;
3162
3162
  return __generator(this, function (_a) {
3163
3163
  switch (_a.label) {
@@ -3173,7 +3173,7 @@
3173
3173
  };
3174
3174
  return LazyAssets;
3175
3175
  }());
3176
- exports.LazyAssets = __decorate$r([
3176
+ exports.LazyAssets = __decorate$s([
3177
3177
  tsyringe.injectable(),
3178
3178
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
3179
3179
  __metadata$l("design:paramtypes", [exports.MongoConnector,
@@ -3182,7 +3182,7 @@
3182
3182
  exports.JobManager])
3183
3183
  ], exports.LazyAssets);
3184
3184
 
3185
- var __decorate$q = (this && this.__decorate) || function (decorators, target, key, desc) {
3185
+ var __decorate$r = (this && this.__decorate) || function (decorators, target, key, desc) {
3186
3186
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3187
3187
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3188
3188
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3196,7 +3196,7 @@
3196
3196
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3197
3197
  return Reflect.metadata(k, v);
3198
3198
  };
3199
- var __awaiter$l = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3199
+ var __awaiter$m = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3200
3200
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3201
3201
  return new (P || (P = Promise))(function (resolve, reject) {
3202
3202
  function fulfilled(value) { try {
@@ -3222,7 +3222,7 @@
3222
3222
  }
3223
3223
  AssetResolver.prototype.resolve = function (id, lazy) {
3224
3224
  if (lazy === void 0) { lazy = false; }
3225
- return __awaiter$l(this, void 0, void 0, function () {
3225
+ return __awaiter$m(this, void 0, void 0, function () {
3226
3226
  var asset, lazyAsset, lazyAsset;
3227
3227
  return __generator(this, function (_a) {
3228
3228
  switch (_a.label) {
@@ -3252,13 +3252,13 @@
3252
3252
  };
3253
3253
  return AssetResolver;
3254
3254
  }());
3255
- exports.AssetResolver = __decorate$q([
3255
+ exports.AssetResolver = __decorate$r([
3256
3256
  tsyringe.injectable(),
3257
3257
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
3258
3258
  __metadata$k("design:paramtypes", [exports.Assets, exports.LazyAssets])
3259
3259
  ], exports.AssetResolver);
3260
3260
 
3261
- var __decorate$p = (this && this.__decorate) || function (decorators, target, key, desc) {
3261
+ var __decorate$q = (this && this.__decorate) || function (decorators, target, key, desc) {
3262
3262
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3263
3263
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3264
3264
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3290,13 +3290,13 @@
3290
3290
  });
3291
3291
  return BackendProvider;
3292
3292
  }());
3293
- exports.BackendProvider = __decorate$p([
3293
+ exports.BackendProvider = __decorate$q([
3294
3294
  tsyringe.injectable(),
3295
3295
  tsyringe.singleton(),
3296
3296
  __metadata$j("design:paramtypes", [])
3297
3297
  ], exports.BackendProvider);
3298
3298
 
3299
- var __decorate$o = (this && this.__decorate) || function (decorators, target, key, desc) {
3299
+ var __decorate$p = (this && this.__decorate) || function (decorators, target, key, desc) {
3300
3300
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3301
3301
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3302
3302
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3306,7 +3306,7 @@
3306
3306
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3307
3307
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3308
3308
  };
3309
- var __awaiter$k = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3309
+ var __awaiter$l = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3310
3310
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3311
3311
  return new (P || (P = Promise))(function (resolve, reject) {
3312
3312
  function fulfilled(value) { try {
@@ -3329,14 +3329,14 @@
3329
3329
  function CacheProcessor() {
3330
3330
  }
3331
3331
  CacheProcessor.prototype.serialize = function (data) {
3332
- return __awaiter$k(this, void 0, void 0, function () {
3332
+ return __awaiter$l(this, void 0, void 0, function () {
3333
3333
  return __generator(this, function (_a) {
3334
3334
  return [2 /*return*/, data];
3335
3335
  });
3336
3336
  });
3337
3337
  };
3338
3338
  CacheProcessor.prototype.deserialize = function (data) {
3339
- return __awaiter$k(this, void 0, void 0, function () {
3339
+ return __awaiter$l(this, void 0, void 0, function () {
3340
3340
  return __generator(this, function (_a) {
3341
3341
  return [2 /*return*/, data];
3342
3342
  });
@@ -3344,12 +3344,12 @@
3344
3344
  };
3345
3345
  return CacheProcessor;
3346
3346
  }());
3347
- exports.CacheProcessor = __decorate$o([
3347
+ exports.CacheProcessor = __decorate$p([
3348
3348
  tsyringe.injectable(),
3349
3349
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped)
3350
3350
  ], exports.CacheProcessor);
3351
3351
 
3352
- var __decorate$n = (this && this.__decorate) || function (decorators, target, key, desc) {
3352
+ var __decorate$o = (this && this.__decorate) || function (decorators, target, key, desc) {
3353
3353
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3354
3354
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3355
3355
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3363,7 +3363,7 @@
3363
3363
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3364
3364
  return Reflect.metadata(k, v);
3365
3365
  };
3366
- var __awaiter$j = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3366
+ var __awaiter$k = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3367
3367
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3368
3368
  return new (P || (P = Promise))(function (resolve, reject) {
3369
3369
  function fulfilled(value) { try {
@@ -3389,7 +3389,7 @@
3389
3389
  this.cacheProcessor = cacheProcessor;
3390
3390
  }
3391
3391
  Cache.prototype.prepare = function () {
3392
- return __awaiter$j(this, void 0, void 0, function () {
3392
+ return __awaiter$k(this, void 0, void 0, function () {
3393
3393
  return __generator(this, function (_a) {
3394
3394
  switch (_a.label) {
3395
3395
  case 0:
@@ -3410,7 +3410,7 @@
3410
3410
  Cache.prototype.set = function (key, value, ttl, expirationTimestamp, tags) {
3411
3411
  if (expirationTimestamp === void 0) { expirationTimestamp = null; }
3412
3412
  if (tags === void 0) { tags = {}; }
3413
- return __awaiter$j(this, void 0, void 0, function () {
3413
+ return __awaiter$k(this, void 0, void 0, function () {
3414
3414
  var item, _a, now;
3415
3415
  return __generator(this, function (_b) {
3416
3416
  switch (_b.label) {
@@ -3441,7 +3441,7 @@
3441
3441
  });
3442
3442
  };
3443
3443
  Cache.prototype.get = function (key) {
3444
- return __awaiter$j(this, void 0, void 0, function () {
3444
+ return __awaiter$k(this, void 0, void 0, function () {
3445
3445
  var item, now;
3446
3446
  return __generator(this, function (_a) {
3447
3447
  switch (_a.label) {
@@ -3467,7 +3467,7 @@
3467
3467
  Cache.prototype.getOrSet = function (key, valueCb, ttl, expirationTimestamp, tags) {
3468
3468
  if (expirationTimestamp === void 0) { expirationTimestamp = null; }
3469
3469
  if (tags === void 0) { tags = {}; }
3470
- return __awaiter$j(this, void 0, void 0, function () {
3470
+ return __awaiter$k(this, void 0, void 0, function () {
3471
3471
  var e_1, _a, _b;
3472
3472
  return __generator(this, function (_c) {
3473
3473
  switch (_c.label) {
@@ -3488,7 +3488,7 @@
3488
3488
  });
3489
3489
  };
3490
3490
  Cache.prototype.delete = function (key) {
3491
- return __awaiter$j(this, void 0, void 0, function () {
3491
+ return __awaiter$k(this, void 0, void 0, function () {
3492
3492
  return __generator(this, function (_a) {
3493
3493
  switch (_a.label) {
3494
3494
  case 0: return [4 /*yield*/, this.prepare()];
@@ -3504,13 +3504,13 @@
3504
3504
  };
3505
3505
  return Cache;
3506
3506
  }());
3507
- exports.Cache = __decorate$n([
3507
+ exports.Cache = __decorate$o([
3508
3508
  tsyringe.injectable(),
3509
3509
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
3510
3510
  __metadata$i("design:paramtypes", [exports.MongoConnector, exports.Configuration, exports.CacheProcessor])
3511
3511
  ], exports.Cache);
3512
3512
 
3513
- var __decorate$m = (this && this.__decorate) || function (decorators, target, key, desc) {
3513
+ var __decorate$n = (this && this.__decorate) || function (decorators, target, key, desc) {
3514
3514
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3515
3515
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3516
3516
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3520,7 +3520,7 @@
3520
3520
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3521
3521
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3522
3522
  };
3523
- var __awaiter$i = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3523
+ var __awaiter$j = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3524
3524
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3525
3525
  return new (P || (P = Promise))(function (resolve, reject) {
3526
3526
  function fulfilled(value) { try {
@@ -3543,7 +3543,7 @@
3543
3543
  function EndpointProvider() {
3544
3544
  }
3545
3545
  EndpointProvider.prototype.configure = function (app) {
3546
- return __awaiter$i(this, void 0, void 0, function () {
3546
+ return __awaiter$j(this, void 0, void 0, function () {
3547
3547
  return __generator(this, function (_a) {
3548
3548
  console.log("Express app is mounted to: " + app.mountpath);
3549
3549
  return [2 /*return*/];
@@ -3552,12 +3552,12 @@
3552
3552
  };
3553
3553
  return EndpointProvider;
3554
3554
  }());
3555
- exports.EndpointProvider = __decorate$m([
3555
+ exports.EndpointProvider = __decorate$n([
3556
3556
  tsyringe.injectable(),
3557
3557
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped)
3558
3558
  ], exports.EndpointProvider);
3559
3559
 
3560
- var __decorate$l = (this && this.__decorate) || function (decorators, target, key, desc) {
3560
+ var __decorate$m = (this && this.__decorate) || function (decorators, target, key, desc) {
3561
3561
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3562
3562
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3563
3563
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3574,7 +3574,7 @@
3574
3574
  var __param$6 = (this && this.__param) || function (paramIndex, decorator) {
3575
3575
  return function (target, key) { decorator(target, key, paramIndex); };
3576
3576
  };
3577
- var __awaiter$h = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3577
+ var __awaiter$i = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3578
3578
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3579
3579
  return new (P || (P = Promise))(function (resolve, reject) {
3580
3580
  function fulfilled(value) { try {
@@ -3598,7 +3598,7 @@
3598
3598
  this.fixtures = fixtures;
3599
3599
  }
3600
3600
  Fixtures.prototype.load = function () {
3601
- return __awaiter$h(this, void 0, void 0, function () {
3601
+ return __awaiter$i(this, void 0, void 0, function () {
3602
3602
  var _a, _b, fixture, e_1_1;
3603
3603
  var e_1, _c;
3604
3604
  return __generator(this, function (_d) {
@@ -3639,14 +3639,14 @@
3639
3639
  };
3640
3640
  return Fixtures;
3641
3641
  }());
3642
- exports.Fixtures = __decorate$l([
3642
+ exports.Fixtures = __decorate$m([
3643
3643
  tsyringe.injectable(),
3644
3644
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
3645
3645
  __param$6(0, tsyringe.injectAll(FIXTURE)),
3646
3646
  __metadata$h("design:paramtypes", [Array])
3647
3647
  ], exports.Fixtures);
3648
3648
 
3649
- var __awaiter$g = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3649
+ var __awaiter$h = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3650
3650
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3651
3651
  return new (P || (P = Promise))(function (resolve, reject) {
3652
3652
  function fulfilled(value) { try {
@@ -3677,7 +3677,7 @@
3677
3677
  this.targetSize = !size ? { width: thumbSize, height: thumbSize } : size;
3678
3678
  }
3679
3679
  GalleryImage.prototype.serve = function (id) {
3680
- return __awaiter$g(this, void 0, void 0, function () {
3680
+ return __awaiter$h(this, void 0, void 0, function () {
3681
3681
  var isThumb, original, _a, meta, ratio, sizeRatio, size, targetHeight, targetWidth, resized, buffer;
3682
3682
  return __generator(this, function (_b) {
3683
3683
  switch (_b.label) {
@@ -3720,7 +3720,7 @@
3720
3720
  return GalleryImage;
3721
3721
  }());
3722
3722
 
3723
- var __decorate$k = (this && this.__decorate) || function (decorators, target, key, desc) {
3723
+ var __decorate$l = (this && this.__decorate) || function (decorators, target, key, desc) {
3724
3724
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3725
3725
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3726
3726
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3753,13 +3753,13 @@
3753
3753
  };
3754
3754
  return GalleryCache;
3755
3755
  }());
3756
- exports.GalleryCache = __decorate$k([
3756
+ exports.GalleryCache = __decorate$l([
3757
3757
  tsyringe.injectable(),
3758
3758
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
3759
3759
  __metadata$g("design:paramtypes", [])
3760
3760
  ], exports.GalleryCache);
3761
3761
 
3762
- var __decorate$j = (this && this.__decorate) || function (decorators, target, key, desc) {
3762
+ var __decorate$k = (this && this.__decorate) || function (decorators, target, key, desc) {
3763
3763
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3764
3764
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3765
3765
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3773,7 +3773,7 @@
3773
3773
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3774
3774
  return Reflect.metadata(k, v);
3775
3775
  };
3776
- var __awaiter$f = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3776
+ var __awaiter$g = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3777
3777
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3778
3778
  return new (P || (P = Promise))(function (resolve, reject) {
3779
3779
  function fulfilled(value) { try {
@@ -3803,7 +3803,7 @@
3803
3803
  }
3804
3804
  Gallery.prototype.getFolder = function (folder, size) {
3805
3805
  if (size === void 0) { size = null; }
3806
- return __awaiter$f(this, void 0, void 0, function () {
3806
+ return __awaiter$g(this, void 0, void 0, function () {
3807
3807
  var _this = this;
3808
3808
  return __generator(this, function (_a) {
3809
3809
  this.cache[folder] = this.cache[folder] || new Promise(function (resolve) {
@@ -3828,7 +3828,7 @@
3828
3828
  return;
3829
3829
  }
3830
3830
  var promises = files.map(function (file) {
3831
- return new Promise(function (resolve) { return __awaiter$f(_this, void 0, void 0, function () {
3831
+ return new Promise(function (resolve) { return __awaiter$g(_this, void 0, void 0, function () {
3832
3832
  var filePath, absoluteFilePath;
3833
3833
  var _this = this;
3834
3834
  return __generator(this, function (_a) {
@@ -3864,7 +3864,7 @@
3864
3864
  });
3865
3865
  },
3866
3866
  writeResult: function (isThumb, buffer) {
3867
- return new Promise(function (res, rej) { return __awaiter$f(_this, void 0, void 0, function () {
3867
+ return new Promise(function (res, rej) { return __awaiter$g(_this, void 0, void 0, function () {
3868
3868
  var resultPath;
3869
3869
  return __generator(this, function (_a) {
3870
3870
  switch (_a.label) {
@@ -3918,13 +3918,13 @@
3918
3918
  };
3919
3919
  return Gallery;
3920
3920
  }());
3921
- exports.Gallery = __decorate$j([
3921
+ exports.Gallery = __decorate$k([
3922
3922
  tsyringe.injectable(),
3923
3923
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
3924
3924
  __metadata$f("design:paramtypes", [exports.Configuration, exports.GalleryCache])
3925
3925
  ], exports.Gallery);
3926
3926
 
3927
- var __decorate$i = (this && this.__decorate) || function (decorators, target, key, desc) {
3927
+ var __decorate$j = (this && this.__decorate) || function (decorators, target, key, desc) {
3928
3928
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3929
3929
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3930
3930
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3938,7 +3938,7 @@
3938
3938
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3939
3939
  return Reflect.metadata(k, v);
3940
3940
  };
3941
- var __awaiter$e = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3941
+ var __awaiter$f = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3942
3942
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3943
3943
  return new (P || (P = Promise))(function (resolve, reject) {
3944
3944
  function fulfilled(value) { try {
@@ -3966,7 +3966,7 @@
3966
3966
  this.parts = config.resolve("idParts");
3967
3967
  }
3968
3968
  IdGenerator.prototype.generate = function (checkCb) {
3969
- return __awaiter$e(this, void 0, void 0, function () {
3969
+ return __awaiter$f(this, void 0, void 0, function () {
3970
3970
  var id, tries, notGood;
3971
3971
  return __generator(this, function (_a) {
3972
3972
  switch (_a.label) {
@@ -4005,13 +4005,13 @@
4005
4005
  };
4006
4006
  return IdGenerator;
4007
4007
  }());
4008
- exports.IdGenerator = __decorate$i([
4008
+ exports.IdGenerator = __decorate$j([
4009
4009
  tsyringe.injectable(),
4010
4010
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
4011
4011
  __metadata$e("design:paramtypes", [exports.Configuration])
4012
4012
  ], exports.IdGenerator);
4013
4013
 
4014
- var __decorate$h = (this && this.__decorate) || function (decorators, target, key, desc) {
4014
+ var __decorate$i = (this && this.__decorate) || function (decorators, target, key, desc) {
4015
4015
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4016
4016
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4017
4017
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4038,13 +4038,13 @@
4038
4038
  };
4039
4039
  return TranslationProvider;
4040
4040
  }());
4041
- exports.TranslationProvider = __decorate$h([
4041
+ exports.TranslationProvider = __decorate$i([
4042
4042
  tsyringe.injectable(),
4043
4043
  tsyringe.singleton(),
4044
4044
  __metadata$d("design:paramtypes", [exports.Configuration])
4045
4045
  ], exports.TranslationProvider);
4046
4046
 
4047
- var __decorate$g = (this && this.__decorate) || function (decorators, target, key, desc) {
4047
+ var __decorate$h = (this && this.__decorate) || function (decorators, target, key, desc) {
4048
4048
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4049
4049
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4050
4050
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4058,7 +4058,7 @@
4058
4058
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
4059
4059
  return Reflect.metadata(k, v);
4060
4060
  };
4061
- var __awaiter$d = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4061
+ var __awaiter$e = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4062
4062
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4063
4063
  return new (P || (P = Promise))(function (resolve, reject) {
4064
4064
  function fulfilled(value) { try {
@@ -4083,7 +4083,7 @@
4083
4083
  this.cache = {};
4084
4084
  }
4085
4085
  Translator.prototype.getDictionary = function (language) {
4086
- return __awaiter$d(this, void 0, void 0, function () {
4086
+ return __awaiter$e(this, void 0, void 0, function () {
4087
4087
  var dictionary;
4088
4088
  return __generator(this, function (_a) {
4089
4089
  switch (_a.label) {
@@ -4148,13 +4148,13 @@
4148
4148
  };
4149
4149
  return Translator;
4150
4150
  }());
4151
- exports.Translator = __decorate$g([
4151
+ exports.Translator = __decorate$h([
4152
4152
  tsyringe.injectable(),
4153
4153
  tsyringe.singleton(),
4154
4154
  __metadata$c("design:paramtypes", [exports.TranslationProvider])
4155
4155
  ], exports.Translator);
4156
4156
 
4157
- var __decorate$f = (this && this.__decorate) || function (decorators, target, key, desc) {
4157
+ var __decorate$g = (this && this.__decorate) || function (decorators, target, key, desc) {
4158
4158
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4159
4159
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4160
4160
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4168,7 +4168,7 @@
4168
4168
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
4169
4169
  return Reflect.metadata(k, v);
4170
4170
  };
4171
- var __awaiter$c = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4171
+ var __awaiter$d = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4172
4172
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4173
4173
  return new (P || (P = Promise))(function (resolve, reject) {
4174
4174
  function fulfilled(value) { try {
@@ -4211,11 +4211,11 @@
4211
4211
  return this.initPromise;
4212
4212
  };
4213
4213
  TemplateRenderer.prototype.parseTemplates = function (dir, dirPath) {
4214
- return __awaiter$c(this, void 0, void 0, function () {
4214
+ return __awaiter$d(this, void 0, void 0, function () {
4215
4215
  var _this = this;
4216
4216
  return __generator(this, function (_a) {
4217
4217
  return [2 /*return*/, new Promise(function (resolve) {
4218
- fs.readdir(dir, function (err, files) { return __awaiter$c(_this, void 0, void 0, function () {
4218
+ fs.readdir(dir, function (err, files) { return __awaiter$d(_this, void 0, void 0, function () {
4219
4219
  var files_1, files_1_1, file, path$1, parts, name, fullName, content, e_1_1;
4220
4220
  var e_1, _a;
4221
4221
  return __generator(this, function (_b) {
@@ -4267,7 +4267,7 @@
4267
4267
  });
4268
4268
  };
4269
4269
  TemplateRenderer.prototype.render = function (template, language, context) {
4270
- return __awaiter$c(this, void 0, void 0, function () {
4270
+ return __awaiter$d(this, void 0, void 0, function () {
4271
4271
  var res, _a;
4272
4272
  return __generator(this, function (_b) {
4273
4273
  switch (_b.label) {
@@ -4297,13 +4297,13 @@
4297
4297
  };
4298
4298
  return TemplateRenderer;
4299
4299
  }());
4300
- exports.TemplateRenderer = __decorate$f([
4300
+ exports.TemplateRenderer = __decorate$g([
4301
4301
  tsyringe.injectable(),
4302
4302
  tsyringe.singleton(),
4303
4303
  __metadata$b("design:paramtypes", [exports.Translator, exports.Configuration])
4304
4304
  ], exports.TemplateRenderer);
4305
4305
 
4306
- var __decorate$e = (this && this.__decorate) || function (decorators, target, key, desc) {
4306
+ var __decorate$f = (this && this.__decorate) || function (decorators, target, key, desc) {
4307
4307
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4308
4308
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4309
4309
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4317,7 +4317,7 @@
4317
4317
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
4318
4318
  return Reflect.metadata(k, v);
4319
4319
  };
4320
- var __awaiter$b = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4320
+ var __awaiter$c = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4321
4321
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4322
4322
  return new (P || (P = Promise))(function (resolve, reject) {
4323
4323
  function fulfilled(value) { try {
@@ -4357,7 +4357,7 @@
4357
4357
  configurable: true
4358
4358
  });
4359
4359
  MailSender.prototype.sendMail = function (language, options) {
4360
- return __awaiter$b(this, void 0, void 0, function () {
4360
+ return __awaiter$c(this, void 0, void 0, function () {
4361
4361
  var subject, html;
4362
4362
  return __generator(this, function (_a) {
4363
4363
  switch (_a.label) {
@@ -4380,13 +4380,13 @@
4380
4380
  };
4381
4381
  return MailSender;
4382
4382
  }());
4383
- exports.MailSender = __decorate$e([
4383
+ exports.MailSender = __decorate$f([
4384
4384
  tsyringe.injectable(),
4385
4385
  tsyringe.singleton(),
4386
4386
  __metadata$a("design:paramtypes", [exports.Configuration, exports.TemplateRenderer])
4387
4387
  ], exports.MailSender);
4388
4388
 
4389
- var __decorate$d = (this && this.__decorate) || function (decorators, target, key, desc) {
4389
+ var __decorate$e = (this && this.__decorate) || function (decorators, target, key, desc) {
4390
4390
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4391
4391
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4392
4392
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4400,7 +4400,7 @@
4400
4400
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
4401
4401
  return Reflect.metadata(k, v);
4402
4402
  };
4403
- var __awaiter$a = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4403
+ var __awaiter$b = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4404
4404
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4405
4405
  return new (P || (P = Promise))(function (resolve, reject) {
4406
4406
  function fulfilled(value) { try {
@@ -4427,7 +4427,7 @@
4427
4427
  MemoryCache.prototype.set = function (key, value, ttl, expirationTimestamp, tags) {
4428
4428
  if (expirationTimestamp === void 0) { expirationTimestamp = null; }
4429
4429
  if (tags === void 0) { tags = {}; }
4430
- return __awaiter$a(this, void 0, void 0, function () {
4430
+ return __awaiter$b(this, void 0, void 0, function () {
4431
4431
  var now, expTimestamp;
4432
4432
  return __generator(this, function (_a) {
4433
4433
  now = Math.round(new Date().getTime() / 1000);
@@ -4443,7 +4443,7 @@
4443
4443
  });
4444
4444
  };
4445
4445
  MemoryCache.prototype.get = function (key) {
4446
- return __awaiter$a(this, void 0, void 0, function () {
4446
+ return __awaiter$b(this, void 0, void 0, function () {
4447
4447
  var item, now, expTimestamp, value;
4448
4448
  return __generator(this, function (_a) {
4449
4449
  switch (_a.label) {
@@ -4474,7 +4474,7 @@
4474
4474
  MemoryCache.prototype.getOrSet = function (key, valueCb, ttl, expirationTimestamp, tags) {
4475
4475
  if (expirationTimestamp === void 0) { expirationTimestamp = null; }
4476
4476
  if (tags === void 0) { tags = {}; }
4477
- return __awaiter$a(this, void 0, void 0, function () {
4477
+ return __awaiter$b(this, void 0, void 0, function () {
4478
4478
  var e_1, _a, _b;
4479
4479
  return __generator(this, function (_c) {
4480
4480
  switch (_c.label) {
@@ -4495,7 +4495,7 @@
4495
4495
  });
4496
4496
  };
4497
4497
  MemoryCache.prototype.delete = function (key) {
4498
- return __awaiter$a(this, void 0, void 0, function () {
4498
+ return __awaiter$b(this, void 0, void 0, function () {
4499
4499
  return __generator(this, function (_a) {
4500
4500
  switch (_a.label) {
4501
4501
  case 0:
@@ -4510,13 +4510,13 @@
4510
4510
  };
4511
4511
  return MemoryCache;
4512
4512
  }());
4513
- exports.MemoryCache = __decorate$d([
4513
+ exports.MemoryCache = __decorate$e([
4514
4514
  tsyringe.injectable(),
4515
4515
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
4516
4516
  __metadata$9("design:paramtypes", [exports.Cache])
4517
4517
  ], exports.MemoryCache);
4518
4518
 
4519
- var __decorate$c = (this && this.__decorate) || function (decorators, target, key, desc) {
4519
+ var __decorate$d = (this && this.__decorate) || function (decorators, target, key, desc) {
4520
4520
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4521
4521
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4522
4522
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4526,7 +4526,7 @@
4526
4526
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4527
4527
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4528
4528
  };
4529
- var __awaiter$9 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4529
+ var __awaiter$a = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4530
4530
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4531
4531
  return new (P || (P = Promise))(function (resolve, reject) {
4532
4532
  function fulfilled(value) { try {
@@ -4555,7 +4555,7 @@
4555
4555
  function UserManager() {
4556
4556
  }
4557
4557
  UserManager.prototype.getByCredentials = function (credentials) {
4558
- return __awaiter$9(this, void 0, void 0, function () {
4558
+ return __awaiter$a(this, void 0, void 0, function () {
4559
4559
  var _a;
4560
4560
  return __generator(this, function (_b) {
4561
4561
  switch (_b.label) {
@@ -4573,14 +4573,14 @@
4573
4573
  });
4574
4574
  };
4575
4575
  UserManager.prototype.getById = function (id) {
4576
- return __awaiter$9(this, void 0, void 0, function () {
4576
+ return __awaiter$a(this, void 0, void 0, function () {
4577
4577
  return __generator(this, function (_a) {
4578
4578
  return [2 /*return*/, (sampleUser.id == id) ? sampleUser : null];
4579
4579
  });
4580
4580
  });
4581
4581
  };
4582
4582
  UserManager.prototype.serialize = function (user) {
4583
- return __awaiter$9(this, void 0, void 0, function () {
4583
+ return __awaiter$a(this, void 0, void 0, function () {
4584
4584
  var res;
4585
4585
  return __generator(this, function (_a) {
4586
4586
  res = Object.assign({}, user);
@@ -4591,12 +4591,12 @@
4591
4591
  };
4592
4592
  return UserManager;
4593
4593
  }());
4594
- exports.UserManager = __decorate$c([
4594
+ exports.UserManager = __decorate$d([
4595
4595
  tsyringe.injectable(),
4596
4596
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped)
4597
4597
  ], exports.UserManager);
4598
4598
 
4599
- var __decorate$b = (this && this.__decorate) || function (decorators, target, key, desc) {
4599
+ var __decorate$c = (this && this.__decorate) || function (decorators, target, key, desc) {
4600
4600
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4601
4601
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4602
4602
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4624,54 +4624,54 @@
4624
4624
  }
4625
4625
  return AssetImageParams;
4626
4626
  }());
4627
- __decorate$b([
4627
+ __decorate$c([
4628
4628
  classValidator.Min(-360),
4629
4629
  classValidator.Max(360),
4630
4630
  classValidator.IsOptional(),
4631
4631
  __metadata$8("design:type", Number)
4632
4632
  ], AssetImageParams.prototype, "rotation", void 0);
4633
- __decorate$b([
4633
+ __decorate$c([
4634
4634
  classValidator.Min(0.0001),
4635
4635
  classValidator.IsOptional(),
4636
4636
  __metadata$8("design:type", Number)
4637
4637
  ], AssetImageParams.prototype, "canvasScaleX", void 0);
4638
- __decorate$b([
4638
+ __decorate$c([
4639
4639
  classValidator.Min(0.0001),
4640
4640
  classValidator.IsOptional(),
4641
4641
  __metadata$8("design:type", Number)
4642
4642
  ], AssetImageParams.prototype, "canvasScaleY", void 0);
4643
- __decorate$b([
4643
+ __decorate$c([
4644
4644
  classValidator.Min(0.0001),
4645
4645
  classValidator.IsOptional(),
4646
4646
  __metadata$8("design:type", Number)
4647
4647
  ], AssetImageParams.prototype, "scaleX", void 0);
4648
- __decorate$b([
4648
+ __decorate$c([
4649
4649
  classValidator.Min(0.0001),
4650
4650
  classValidator.IsOptional(),
4651
4651
  __metadata$8("design:type", Number)
4652
4652
  ], AssetImageParams.prototype, "scaleY", void 0);
4653
- __decorate$b([
4653
+ __decorate$c([
4654
4654
  classValidator.IsBoolean(),
4655
4655
  classValidator.IsOptional(),
4656
4656
  __metadata$8("design:type", Boolean)
4657
4657
  ], AssetImageParams.prototype, "lazy", void 0);
4658
- __decorate$b([
4658
+ __decorate$c([
4659
4659
  classValidator.IsBoolean(),
4660
4660
  classValidator.IsOptional(),
4661
4661
  __metadata$8("design:type", Boolean)
4662
4662
  ], AssetImageParams.prototype, "crop", void 0);
4663
- __decorate$b([
4663
+ __decorate$c([
4664
4664
  classValidator.IsBoolean(),
4665
4665
  classValidator.IsOptional(),
4666
4666
  __metadata$8("design:type", Boolean)
4667
4667
  ], AssetImageParams.prototype, "cropBefore", void 0);
4668
- __decorate$b([
4668
+ __decorate$c([
4669
4669
  classValidator.IsBoolean(),
4670
4670
  classValidator.IsOptional(),
4671
4671
  __metadata$8("design:type", Boolean)
4672
4672
  ], AssetImageParams.prototype, "cropAfter", void 0);
4673
4673
 
4674
- var __decorate$a = (this && this.__decorate) || function (decorators, target, key, desc) {
4674
+ var __decorate$b = (this && this.__decorate) || function (decorators, target, key, desc) {
4675
4675
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4676
4676
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4677
4677
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4688,7 +4688,7 @@
4688
4688
  var __param$5 = (this && this.__param) || function (paramIndex, decorator) {
4689
4689
  return function (target, key) { decorator(target, key, paramIndex); };
4690
4690
  };
4691
- var __awaiter$8 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4691
+ var __awaiter$9 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4692
4692
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4693
4693
  return new (P || (P = Promise))(function (resolve, reject) {
4694
4694
  function fulfilled(value) { try {
@@ -4713,7 +4713,7 @@
4713
4713
  this.assetResolver = assetResolver;
4714
4714
  }
4715
4715
  AssetsController.prototype.upload = function (file) {
4716
- return __awaiter$8(this, void 0, void 0, function () {
4716
+ return __awaiter$9(this, void 0, void 0, function () {
4717
4717
  var contentType, asset, e_1, msg;
4718
4718
  return __generator(this, function (_c) {
4719
4719
  switch (_c.label) {
@@ -4734,7 +4734,7 @@
4734
4734
  });
4735
4735
  };
4736
4736
  AssetsController.prototype.uploadUrl = function (body) {
4737
- return __awaiter$8(this, void 0, void 0, function () {
4737
+ return __awaiter$9(this, void 0, void 0, function () {
4738
4738
  var asset, e_2, msg;
4739
4739
  return __generator(this, function (_c) {
4740
4740
  switch (_c.label) {
@@ -4754,7 +4754,7 @@
4754
4754
  });
4755
4755
  };
4756
4756
  AssetsController.prototype.getFile = function (id, lazy, res) {
4757
- return __awaiter$8(this, void 0, void 0, function () {
4757
+ return __awaiter$9(this, void 0, void 0, function () {
4758
4758
  var asset;
4759
4759
  return __generator(this, function (_c) {
4760
4760
  switch (_c.label) {
@@ -4768,7 +4768,7 @@
4768
4768
  };
4769
4769
  AssetsController.prototype.getImageRotation = function (id, params, res, rotation) {
4770
4770
  if (rotation === void 0) { rotation = 0; }
4771
- return __awaiter$8(this, void 0, void 0, function () {
4771
+ return __awaiter$9(this, void 0, void 0, function () {
4772
4772
  var asset;
4773
4773
  return __generator(this, function (_c) {
4774
4774
  switch (_c.label) {
@@ -4784,14 +4784,14 @@
4784
4784
  });
4785
4785
  };
4786
4786
  AssetsController.prototype.getImage = function (id, params, res) {
4787
- return __awaiter$8(this, void 0, void 0, function () {
4787
+ return __awaiter$9(this, void 0, void 0, function () {
4788
4788
  return __generator(this, function (_c) {
4789
4789
  return [2 /*return*/, this.getImageRotation(id, params, res)];
4790
4790
  });
4791
4791
  });
4792
4792
  };
4793
4793
  AssetsController.prototype.getFileByName = function (name, res) {
4794
- return __awaiter$8(this, void 0, void 0, function () {
4794
+ return __awaiter$9(this, void 0, void 0, function () {
4795
4795
  var asset;
4796
4796
  return __generator(this, function (_c) {
4797
4797
  switch (_c.label) {
@@ -4804,7 +4804,7 @@
4804
4804
  });
4805
4805
  };
4806
4806
  AssetsController.prototype.getImageByName = function (name, params, res) {
4807
- return __awaiter$8(this, void 0, void 0, function () {
4807
+ return __awaiter$9(this, void 0, void 0, function () {
4808
4808
  var asset;
4809
4809
  return __generator(this, function (_c) {
4810
4810
  switch (_c.label) {
@@ -4830,7 +4830,7 @@
4830
4830
  }
4831
4831
  };
4832
4832
  AssetsController.prototype.getAsset = function (type, id, lazy, res) {
4833
- return __awaiter$8(this, void 0, void 0, function () {
4833
+ return __awaiter$9(this, void 0, void 0, function () {
4834
4834
  var asset;
4835
4835
  return __generator(this, function (_c) {
4836
4836
  switch (_c.label) {
@@ -4847,7 +4847,7 @@
4847
4847
  });
4848
4848
  };
4849
4849
  AssetsController.prototype.getAssetByName = function (type, filename, res) {
4850
- return __awaiter$8(this, void 0, void 0, function () {
4850
+ return __awaiter$9(this, void 0, void 0, function () {
4851
4851
  var asset;
4852
4852
  return __generator(this, function (_c) {
4853
4853
  switch (_c.label) {
@@ -4865,7 +4865,7 @@
4865
4865
  };
4866
4866
  return AssetsController;
4867
4867
  }());
4868
- __decorate$a([
4868
+ __decorate$b([
4869
4869
  routingControllers.Authorized(),
4870
4870
  routingControllers.Post(""),
4871
4871
  __param$5(0, routingControllers.UploadedFile("file")),
@@ -4873,7 +4873,7 @@
4873
4873
  __metadata$7("design:paramtypes", [Object]),
4874
4874
  __metadata$7("design:returntype", Promise)
4875
4875
  ], AssetsController.prototype, "upload", null);
4876
- __decorate$a([
4876
+ __decorate$b([
4877
4877
  routingControllers.Authorized(),
4878
4878
  routingControllers.Post("url"),
4879
4879
  __param$5(0, routingControllers.Body()),
@@ -4881,48 +4881,48 @@
4881
4881
  __metadata$7("design:paramtypes", [Object]),
4882
4882
  __metadata$7("design:returntype", Promise)
4883
4883
  ], AssetsController.prototype, "uploadUrl", null);
4884
- __decorate$a([
4884
+ __decorate$b([
4885
4885
  routingControllers.Get("/:id"),
4886
4886
  __param$5(0, routingControllers.Param("id")), __param$5(1, routingControllers.QueryParam("lazy")), __param$5(2, routingControllers.Res()),
4887
4887
  __metadata$7("design:type", Function),
4888
4888
  __metadata$7("design:paramtypes", [String, Boolean, Object]),
4889
4889
  __metadata$7("design:returntype", Promise)
4890
4890
  ], AssetsController.prototype, "getFile", null);
4891
- __decorate$a([
4891
+ __decorate$b([
4892
4892
  routingControllers.Get("/image/:id/:rotation"),
4893
4893
  __param$5(0, routingControllers.Param("id")), __param$5(1, routingControllers.QueryParams()), __param$5(2, routingControllers.Res()), __param$5(3, routingControllers.Param("rotation")),
4894
4894
  __metadata$7("design:type", Function),
4895
4895
  __metadata$7("design:paramtypes", [String, AssetImageParams, Object, Number]),
4896
4896
  __metadata$7("design:returntype", Promise)
4897
4897
  ], AssetsController.prototype, "getImageRotation", null);
4898
- __decorate$a([
4898
+ __decorate$b([
4899
4899
  routingControllers.Get("/image/:id"),
4900
4900
  __param$5(0, routingControllers.Param("id")), __param$5(1, routingControllers.QueryParams()), __param$5(2, routingControllers.Res()),
4901
4901
  __metadata$7("design:type", Function),
4902
4902
  __metadata$7("design:paramtypes", [String, AssetImageParams, Object]),
4903
4903
  __metadata$7("design:returntype", Promise)
4904
4904
  ], AssetsController.prototype, "getImage", null);
4905
- __decorate$a([
4905
+ __decorate$b([
4906
4906
  routingControllers.Get("/by-name/:name"),
4907
4907
  __param$5(0, routingControllers.Param("name")), __param$5(1, routingControllers.Res()),
4908
4908
  __metadata$7("design:type", Function),
4909
4909
  __metadata$7("design:paramtypes", [String, Object]),
4910
4910
  __metadata$7("design:returntype", Promise)
4911
4911
  ], AssetsController.prototype, "getFileByName", null);
4912
- __decorate$a([
4912
+ __decorate$b([
4913
4913
  routingControllers.Get("/by-name/image/:name"),
4914
4914
  __param$5(0, routingControllers.Param("name")), __param$5(1, routingControllers.QueryParams()), __param$5(2, routingControllers.Res()),
4915
4915
  __metadata$7("design:type", Function),
4916
4916
  __metadata$7("design:paramtypes", [String, AssetImageParams, Object]),
4917
4917
  __metadata$7("design:returntype", Promise)
4918
4918
  ], AssetsController.prototype, "getImageByName", null);
4919
- AssetsController = __decorate$a([
4919
+ AssetsController = __decorate$b([
4920
4920
  tsyringe.injectable(),
4921
4921
  routingControllers.Controller("/assets"),
4922
4922
  __metadata$7("design:paramtypes", [exports.Assets, exports.AssetResolver])
4923
4923
  ], AssetsController);
4924
4924
 
4925
- var __decorate$9 = (this && this.__decorate) || function (decorators, target, key, desc) {
4925
+ var __decorate$a = (this && this.__decorate) || function (decorators, target, key, desc) {
4926
4926
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4927
4927
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4928
4928
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4939,7 +4939,7 @@
4939
4939
  var __param$4 = (this && this.__param) || function (paramIndex, decorator) {
4940
4940
  return function (target, key) { decorator(target, key, paramIndex); };
4941
4941
  };
4942
- var __awaiter$7 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4942
+ var __awaiter$8 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4943
4943
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4944
4944
  return new (P || (P = Promise))(function (resolve, reject) {
4945
4945
  function fulfilled(value) { try {
@@ -4964,7 +4964,7 @@
4964
4964
  this.userManager = userManager;
4965
4965
  }
4966
4966
  AuthController.prototype.login = function (credentials, res) {
4967
- return __awaiter$7(this, void 0, void 0, function () {
4967
+ return __awaiter$8(this, void 0, void 0, function () {
4968
4968
  var user, reason_1, valid, _a, _b;
4969
4969
  return __generator(this, function (_c) {
4970
4970
  switch (_c.label) {
@@ -5007,14 +5007,14 @@
5007
5007
  };
5008
5008
  return AuthController;
5009
5009
  }());
5010
- __decorate$9([
5010
+ __decorate$a([
5011
5011
  routingControllers.Post("/login"),
5012
5012
  __param$4(0, routingControllers.Body()), __param$4(1, routingControllers.Res()),
5013
5013
  __metadata$6("design:type", Function),
5014
5014
  __metadata$6("design:paramtypes", [Object, Object]),
5015
5015
  __metadata$6("design:returntype", Promise)
5016
5016
  ], exports.AuthController.prototype, "login", null);
5017
- __decorate$9([
5017
+ __decorate$a([
5018
5018
  routingControllers.Authorized(),
5019
5019
  routingControllers.Get("/user"),
5020
5020
  __param$4(0, routingControllers.CurrentUser()),
@@ -5022,13 +5022,13 @@
5022
5022
  __metadata$6("design:paramtypes", [Object]),
5023
5023
  __metadata$6("design:returntype", void 0)
5024
5024
  ], exports.AuthController.prototype, "getProfile", null);
5025
- exports.AuthController = __decorate$9([
5025
+ exports.AuthController = __decorate$a([
5026
5026
  tsyringe.injectable(),
5027
5027
  routingControllers.Controller(),
5028
5028
  __metadata$6("design:paramtypes", [exports.Configuration, exports.UserManager])
5029
5029
  ], exports.AuthController);
5030
5030
 
5031
- var __decorate$8 = (this && this.__decorate) || function (decorators, target, key, desc) {
5031
+ var __decorate$9 = (this && this.__decorate) || function (decorators, target, key, desc) {
5032
5032
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5033
5033
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
5034
5034
  r = Reflect.decorate(decorators, target, key, desc);
@@ -5054,20 +5054,20 @@
5054
5054
  };
5055
5055
  return GalleryController;
5056
5056
  }());
5057
- __decorate$8([
5057
+ __decorate$9([
5058
5058
  routingControllers.Get("/:id"),
5059
5059
  __param$3(0, routingControllers.Param("id")),
5060
5060
  __metadata$5("design:type", Function),
5061
5061
  __metadata$5("design:paramtypes", [String]),
5062
5062
  __metadata$5("design:returntype", void 0)
5063
5063
  ], exports.GalleryController.prototype, "getFile", null);
5064
- exports.GalleryController = __decorate$8([
5064
+ exports.GalleryController = __decorate$9([
5065
5065
  tsyringe.injectable(),
5066
5066
  routingControllers.Controller("/gallery"),
5067
5067
  __metadata$5("design:paramtypes", [exports.GalleryCache])
5068
5068
  ], exports.GalleryController);
5069
5069
 
5070
- var __decorate$7 = (this && this.__decorate) || function (decorators, target, key, desc) {
5070
+ var __decorate$8 = (this && this.__decorate) || function (decorators, target, key, desc) {
5071
5071
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5072
5072
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
5073
5073
  r = Reflect.decorate(decorators, target, key, desc);
@@ -5084,7 +5084,7 @@
5084
5084
  var __param$2 = (this && this.__param) || function (paramIndex, decorator) {
5085
5085
  return function (target, key) { decorator(target, key, paramIndex); };
5086
5086
  };
5087
- var __awaiter$6 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5087
+ var __awaiter$7 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5088
5088
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5089
5089
  return new (P || (P = Promise))(function (resolve, reject) {
5090
5090
  function fulfilled(value) { try {
@@ -5111,7 +5111,7 @@
5111
5111
  this.connectionType = !mainEndpoint ? "polling" : "socket";
5112
5112
  }
5113
5113
  ProgressesController.prototype.getProgress = function (id) {
5114
- return __awaiter$6(this, void 0, void 0, function () {
5114
+ return __awaiter$7(this, void 0, void 0, function () {
5115
5115
  var progress, json;
5116
5116
  return __generator(this, function (_a) {
5117
5117
  switch (_a.label) {
@@ -5129,20 +5129,20 @@
5129
5129
  };
5130
5130
  return ProgressesController;
5131
5131
  }());
5132
- __decorate$7([
5132
+ __decorate$8([
5133
5133
  routingControllers.Get("/:id"),
5134
5134
  __param$2(0, routingControllers.Param("id")),
5135
5135
  __metadata$4("design:type", Function),
5136
5136
  __metadata$4("design:paramtypes", [String]),
5137
5137
  __metadata$4("design:returntype", Promise)
5138
5138
  ], ProgressesController.prototype, "getProgress", null);
5139
- ProgressesController = __decorate$7([
5139
+ ProgressesController = __decorate$8([
5140
5140
  tsyringe.injectable(),
5141
5141
  routingControllers.Controller("/progresses"),
5142
5142
  __metadata$4("design:paramtypes", [exports.Progresses, exports.Configuration])
5143
5143
  ], ProgressesController);
5144
5144
 
5145
- var __decorate$6 = (this && this.__decorate) || function (decorators, target, key, desc) {
5145
+ var __decorate$7 = (this && this.__decorate) || function (decorators, target, key, desc) {
5146
5146
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5147
5147
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
5148
5148
  r = Reflect.decorate(decorators, target, key, desc);
@@ -5156,7 +5156,7 @@
5156
5156
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
5157
5157
  return Reflect.metadata(k, v);
5158
5158
  };
5159
- var __awaiter$5 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5159
+ var __awaiter$6 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5160
5160
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5161
5161
  return new (P || (P = Promise))(function (resolve, reject) {
5162
5162
  function fulfilled(value) { try {
@@ -5188,7 +5188,7 @@
5188
5188
  configurable: true
5189
5189
  });
5190
5190
  ErrorHandlerMiddleware.prototype.error = function (error, req, res, next) {
5191
- return __awaiter$5(this, void 0, void 0, function () {
5191
+ return __awaiter$6(this, void 0, void 0, function () {
5192
5192
  var result;
5193
5193
  return __generator(this, function (_a) {
5194
5194
  switch (_a.label) {
@@ -5205,7 +5205,7 @@
5205
5205
  });
5206
5206
  };
5207
5207
  ErrorHandlerMiddleware.prototype.getResult = function (error, req, res) {
5208
- return __awaiter$5(this, void 0, void 0, function () {
5208
+ return __awaiter$6(this, void 0, void 0, function () {
5209
5209
  var result, _a, _b, _c;
5210
5210
  return __generator(this, function (_d) {
5211
5211
  switch (_d.label) {
@@ -5259,13 +5259,13 @@
5259
5259
  };
5260
5260
  return ErrorHandlerMiddleware;
5261
5261
  }());
5262
- exports.ErrorHandlerMiddleware = __decorate$6([
5262
+ exports.ErrorHandlerMiddleware = __decorate$7([
5263
5263
  tsyringe.injectable(),
5264
5264
  routingControllers.Middleware({ type: "after" }),
5265
5265
  __metadata$3("design:paramtypes", [exports.Configuration, exports.Translator])
5266
5266
  ], exports.ErrorHandlerMiddleware);
5267
5267
 
5268
- var __decorate$5 = (this && this.__decorate) || function (decorators, target, key, desc) {
5268
+ var __decorate$6 = (this && this.__decorate) || function (decorators, target, key, desc) {
5269
5269
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5270
5270
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
5271
5271
  r = Reflect.decorate(decorators, target, key, desc);
@@ -5292,14 +5292,14 @@
5292
5292
  };
5293
5293
  return ContainerMiddleware;
5294
5294
  }());
5295
- ContainerMiddleware = __decorate$5([
5295
+ ContainerMiddleware = __decorate$6([
5296
5296
  tsyringe.injectable(),
5297
5297
  routingControllers.Middleware({ type: "before" }),
5298
5298
  __param$1(0, tsyringe.inject(DI_CONTAINER)),
5299
5299
  __metadata$2("design:paramtypes", [Object])
5300
5300
  ], ContainerMiddleware);
5301
5301
 
5302
- var __decorate$4 = (this && this.__decorate) || function (decorators, target, key, desc) {
5302
+ var __decorate$5 = (this && this.__decorate) || function (decorators, target, key, desc) {
5303
5303
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5304
5304
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
5305
5305
  r = Reflect.decorate(decorators, target, key, desc);
@@ -5323,13 +5323,13 @@
5323
5323
  };
5324
5324
  return LanguageMiddleware;
5325
5325
  }());
5326
- exports.LanguageMiddleware = __decorate$4([
5326
+ exports.LanguageMiddleware = __decorate$5([
5327
5327
  tsyringe.injectable(),
5328
5328
  routingControllers.Middleware({ type: "before" }),
5329
5329
  __metadata$1("design:paramtypes", [exports.Configuration])
5330
5330
  ], exports.LanguageMiddleware);
5331
5331
 
5332
- var __decorate$3 = (this && this.__decorate) || function (decorators, target, key, desc) {
5332
+ var __decorate$4 = (this && this.__decorate) || function (decorators, target, key, desc) {
5333
5333
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5334
5334
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
5335
5335
  r = Reflect.decorate(decorators, target, key, desc);
@@ -5352,12 +5352,12 @@
5352
5352
  };
5353
5353
  return RequestEndedMiddleware;
5354
5354
  }());
5355
- RequestEndedMiddleware = __decorate$3([
5355
+ RequestEndedMiddleware = __decorate$4([
5356
5356
  tsyringe.injectable(),
5357
5357
  routingControllers.Middleware({ type: "after" })
5358
5358
  ], RequestEndedMiddleware);
5359
5359
 
5360
- var __decorate$2 = (this && this.__decorate) || function (decorators, target, key, desc) {
5360
+ var __decorate$3 = (this && this.__decorate) || function (decorators, target, key, desc) {
5361
5361
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5362
5362
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
5363
5363
  r = Reflect.decorate(decorators, target, key, desc);
@@ -5378,12 +5378,12 @@
5378
5378
  };
5379
5379
  return RequestStartedMiddleware;
5380
5380
  }());
5381
- RequestStartedMiddleware = __decorate$2([
5381
+ RequestStartedMiddleware = __decorate$3([
5382
5382
  tsyringe.injectable(),
5383
5383
  routingControllers.Middleware({ type: "before" })
5384
5384
  ], RequestStartedMiddleware);
5385
5385
 
5386
- var __decorate$1 = (this && this.__decorate) || function (decorators, target, key, desc) {
5386
+ var __decorate$2 = (this && this.__decorate) || function (decorators, target, key, desc) {
5387
5387
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5388
5388
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
5389
5389
  r = Reflect.decorate(decorators, target, key, desc);
@@ -5400,7 +5400,7 @@
5400
5400
  var __param = (this && this.__param) || function (paramIndex, decorator) {
5401
5401
  return function (target, key) { decorator(target, key, paramIndex); };
5402
5402
  };
5403
- var __awaiter$4 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5403
+ var __awaiter$5 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5404
5404
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5405
5405
  return new (P || (P = Promise))(function (resolve, reject) {
5406
5406
  function fulfilled(value) { try {
@@ -5425,7 +5425,7 @@
5425
5425
  this.socketServer = socketServer;
5426
5426
  }
5427
5427
  ProgressController.prototype.advanceProgress = function (client, progressId) {
5428
- return __awaiter$4(this, void 0, void 0, function () {
5428
+ return __awaiter$5(this, void 0, void 0, function () {
5429
5429
  var progress, json;
5430
5430
  return __generator(this, function (_a) {
5431
5431
  switch (_a.label) {
@@ -5447,7 +5447,7 @@
5447
5447
  });
5448
5448
  };
5449
5449
  ProgressController.prototype.setProgressInterest = function (client, progressId) {
5450
- return __awaiter$4(this, void 0, void 0, function () {
5450
+ return __awaiter$5(this, void 0, void 0, function () {
5451
5451
  var progress, json;
5452
5452
  return __generator(this, function (_a) {
5453
5453
  switch (_a.label) {
@@ -5470,28 +5470,28 @@
5470
5470
  };
5471
5471
  return ProgressController;
5472
5472
  }());
5473
- __decorate$1([
5473
+ __decorate$2([
5474
5474
  socketControllers.OnMessage("background-progress"),
5475
5475
  __param(0, socketControllers.ConnectedSocket()), __param(1, socketControllers.MessageBody()),
5476
5476
  __metadata("design:type", Function),
5477
5477
  __metadata("design:paramtypes", [Object, String]),
5478
5478
  __metadata("design:returntype", Promise)
5479
5479
  ], ProgressController.prototype, "advanceProgress", null);
5480
- __decorate$1([
5480
+ __decorate$2([
5481
5481
  socketControllers.OnMessage("background-progress-interest"),
5482
5482
  __param(0, socketControllers.ConnectedSocket()), __param(1, socketControllers.MessageBody()),
5483
5483
  __metadata("design:type", Function),
5484
5484
  __metadata("design:paramtypes", [Object, String]),
5485
5485
  __metadata("design:returntype", Promise)
5486
5486
  ], ProgressController.prototype, "setProgressInterest", null);
5487
- ProgressController = __decorate$1([
5487
+ ProgressController = __decorate$2([
5488
5488
  tsyringe.injectable(),
5489
5489
  socketControllers.SocketController(),
5490
5490
  __param(1, tsyringe.inject(SOCKET_SERVER)),
5491
5491
  __metadata("design:paramtypes", [exports.Progresses, Object])
5492
5492
  ], ProgressController);
5493
5493
 
5494
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
5494
+ var __decorate$1 = (this && this.__decorate) || function (decorators, target, key, desc) {
5495
5495
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5496
5496
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
5497
5497
  r = Reflect.decorate(decorators, target, key, desc);
@@ -5509,12 +5509,12 @@
5509
5509
  };
5510
5510
  return CompressionMiddleware;
5511
5511
  }());
5512
- CompressionMiddleware = __decorate([
5512
+ CompressionMiddleware = __decorate$1([
5513
5513
  tsyringe.injectable(),
5514
5514
  socketControllers.Middleware()
5515
5515
  ], CompressionMiddleware);
5516
5516
 
5517
- var __awaiter$3 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5517
+ var __awaiter$4 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5518
5518
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5519
5519
  return new (P || (P = Promise))(function (resolve, reject) {
5520
5520
  function fulfilled(value) { try {
@@ -5534,7 +5534,7 @@
5534
5534
  });
5535
5535
  };
5536
5536
  function setupStatic(rootFolder, container) {
5537
- return __awaiter$3(this, void 0, void 0, function () {
5537
+ return __awaiter$4(this, void 0, void 0, function () {
5538
5538
  var browserFolder, app, ep;
5539
5539
  return __generator(this, function (_a) {
5540
5540
  switch (_a.label) {
@@ -5579,7 +5579,6 @@
5579
5579
  };
5580
5580
  return BaseDoc;
5581
5581
  }());
5582
- // @ts-ignore
5583
5582
  var PrimitiveArray = mongoose.Types.Array;
5584
5583
  var DocumentArray = mongoose.Types.DocumentArray;
5585
5584
 
@@ -5805,6 +5804,52 @@
5805
5804
  return DiContainer;
5806
5805
  }());
5807
5806
 
5807
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
5808
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5809
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
5810
+ r = Reflect.decorate(decorators, target, key, desc);
5811
+ else
5812
+ for (var i = decorators.length - 1; i >= 0; i--)
5813
+ if (d = decorators[i])
5814
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5815
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
5816
+ };
5817
+ var __awaiter$3 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5818
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5819
+ return new (P || (P = Promise))(function (resolve, reject) {
5820
+ function fulfilled(value) { try {
5821
+ step(generator.next(value));
5822
+ }
5823
+ catch (e) {
5824
+ reject(e);
5825
+ } }
5826
+ function rejected(value) { try {
5827
+ step(generator["throw"](value));
5828
+ }
5829
+ catch (e) {
5830
+ reject(e);
5831
+ } }
5832
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
5833
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
5834
+ });
5835
+ };
5836
+ var EmptyJob = /** @class */ (function () {
5837
+ function EmptyJob() {
5838
+ }
5839
+ EmptyJob.prototype.process = function () {
5840
+ return __awaiter$3(this, void 0, void 0, function () {
5841
+ return __generator(this, function (_a) {
5842
+ return [2 /*return*/, null];
5843
+ });
5844
+ });
5845
+ };
5846
+ return EmptyJob;
5847
+ }());
5848
+ EmptyJob = __decorate([
5849
+ tsyringe.injectable(),
5850
+ tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped)
5851
+ ], EmptyJob);
5852
+
5808
5853
  var __awaiter$2 = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5809
5854
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5810
5855
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -6316,7 +6361,7 @@
6316
6361
  useValue: p
6317
6362
  };
6318
6363
  });
6319
- jobProviders = (config.jobs || []).map(function (jobType) {
6364
+ jobProviders = [EmptyJob].concat(config.jobs || []).map(function (jobType) {
6320
6365
  return {
6321
6366
  provide: JOB,
6322
6367
  useValue: jobType