@stemy/backend 3.5.3 → 3.5.6

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$C(decorators, target, key, desc) {
90
+ function __decorate$D(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);
@@ -100,11 +100,11 @@
100
100
  function __param$a(paramIndex, decorator) {
101
101
  return function (target, key) { decorator(target, key, paramIndex); };
102
102
  }
103
- function __metadata$v(metadataKey, metadataValue) {
103
+ function __metadata$w(metadataKey, metadataValue) {
104
104
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
105
105
  return Reflect.metadata(metadataKey, metadataValue);
106
106
  }
107
- function __awaiter$A(thisArg, _arguments, P, generator) {
107
+ function __awaiter$B(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 {
@@ -381,7 +381,7 @@
381
381
  return Parameter;
382
382
  }());
383
383
 
384
- var __decorate$B = (this && this.__decorate) || function (decorators, target, key, desc) {
384
+ var __decorate$C = (this && this.__decorate) || function (decorators, target, key, desc) {
385
385
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
386
386
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
387
387
  r = Reflect.decorate(decorators, target, key, desc);
@@ -391,7 +391,7 @@
391
391
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
392
392
  return c > 3 && r && Object.defineProperty(target, key, r), r;
393
393
  };
394
- var __awaiter$z = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
394
+ var __awaiter$A = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
395
395
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
396
396
  return new (P || (P = Promise))(function (resolve, reject) {
397
397
  function fulfilled(value) { try {
@@ -439,7 +439,7 @@
439
439
  };
440
440
  AssetProcessor.fileTypeFromBuffer = function (buffer) {
441
441
  var _a;
442
- return __awaiter$z(this, void 0, void 0, function () {
442
+ return __awaiter$A(this, void 0, void 0, function () {
443
443
  var type;
444
444
  return __generator(this, function (_b) {
445
445
  switch (_b.label) {
@@ -473,7 +473,7 @@
473
473
  return imageTypes.indexOf(contentType) >= 0;
474
474
  };
475
475
  AssetProcessor.copyImageMeta = function (buffer, metadata, fileType) {
476
- return __awaiter$z(this, void 0, void 0, function () {
476
+ return __awaiter$A(this, void 0, void 0, function () {
477
477
  var match, attrs, parts, output;
478
478
  return __generator(this, function (_b) {
479
479
  switch (_b.label) {
@@ -520,7 +520,7 @@
520
520
  });
521
521
  };
522
522
  AssetProcessor.prototype.process = function (buffer, metadata, fileType) {
523
- return __awaiter$z(this, void 0, void 0, function () {
523
+ return __awaiter$A(this, void 0, void 0, function () {
524
524
  return __generator(this, function (_b) {
525
525
  switch (_b.label) {
526
526
  case 0:
@@ -540,12 +540,12 @@
540
540
  };
541
541
  return AssetProcessor;
542
542
  }());
543
- exports.AssetProcessor = AssetProcessor_1 = __decorate$B([
543
+ exports.AssetProcessor = AssetProcessor_1 = __decorate$C([
544
544
  tsyringe.injectable(),
545
545
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped)
546
546
  ], exports.AssetProcessor);
547
547
 
548
- var __awaiter$y = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
548
+ var __awaiter$z = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
549
549
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
550
550
  return new (P || (P = Promise))(function (resolve, reject) {
551
551
  function fulfilled(value) { try {
@@ -745,7 +745,7 @@
745
745
  };
746
746
  }
747
747
  function toImage(src, params, meta) {
748
- return __awaiter$y(this, void 0, void 0, function () {
748
+ return __awaiter$z(this, void 0, void 0, function () {
749
749
  var crop, buffer, _a, cropBefore, cropAfter, img, _b, width, height, canvasScaleX, canvasScaleY, e_2;
750
750
  return __generator(this, function (_c) {
751
751
  switch (_c.label) {
@@ -906,7 +906,7 @@
906
906
  }
907
907
  function readAndDeleteFile(path, timeout) {
908
908
  if (timeout === void 0) { timeout = 5000; }
909
- return __awaiter$y(this, void 0, void 0, function () {
909
+ return __awaiter$z(this, void 0, void 0, function () {
910
910
  var data;
911
911
  return __generator(this, function (_a) {
912
912
  switch (_a.label) {
@@ -923,7 +923,7 @@
923
923
  });
924
924
  }
925
925
  function writeFile(path$1, data) {
926
- return __awaiter$y(this, void 0, void 0, function () {
926
+ return __awaiter$z(this, void 0, void 0, function () {
927
927
  return __generator(this, function (_a) {
928
928
  switch (_a.label) {
929
929
  case 0: return [4 /*yield*/, mkdirRecursive(path.dirname(path$1))];
@@ -1272,7 +1272,7 @@
1272
1272
  }, []);
1273
1273
  }
1274
1274
 
1275
- var __decorate$A = (this && this.__decorate) || function (decorators, target, key, desc) {
1275
+ var __decorate$B = (this && this.__decorate) || function (decorators, target, key, desc) {
1276
1276
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1277
1277
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1278
1278
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1282,7 +1282,7 @@
1282
1282
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1283
1283
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1284
1284
  };
1285
- var __metadata$u = (this && this.__metadata) || function (k, v) {
1285
+ var __metadata$v = (this && this.__metadata) || function (k, v) {
1286
1286
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1287
1287
  return Reflect.metadata(k, v);
1288
1288
  };
@@ -1331,13 +1331,13 @@
1331
1331
  };
1332
1332
  return Configuration;
1333
1333
  }());
1334
- exports.Configuration = __decorate$A([
1334
+ exports.Configuration = __decorate$B([
1335
1335
  tsyringe.singleton(),
1336
1336
  __param$9(0, tsyringe.injectAll(PARAMETER)),
1337
- __metadata$u("design:paramtypes", [Array])
1337
+ __metadata$v("design:paramtypes", [Array])
1338
1338
  ], exports.Configuration);
1339
1339
 
1340
- var __decorate$z = (this && this.__decorate) || function (decorators, target, key, desc) {
1340
+ var __decorate$A = (this && this.__decorate) || function (decorators, target, key, desc) {
1341
1341
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1342
1342
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1343
1343
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1347,11 +1347,11 @@
1347
1347
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1348
1348
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1349
1349
  };
1350
- var __metadata$t = (this && this.__metadata) || function (k, v) {
1350
+ var __metadata$u = (this && this.__metadata) || function (k, v) {
1351
1351
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1352
1352
  return Reflect.metadata(k, v);
1353
1353
  };
1354
- var __awaiter$x = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1354
+ var __awaiter$y = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1355
1355
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1356
1356
  return new (P || (P = Promise))(function (resolve, reject) {
1357
1357
  function fulfilled(value) { try {
@@ -1399,7 +1399,7 @@
1399
1399
  configurable: true
1400
1400
  });
1401
1401
  MongoConnector.prototype.connect = function () {
1402
- return __awaiter$x(this, void 0, void 0, function () {
1402
+ return __awaiter$y(this, void 0, void 0, function () {
1403
1403
  var _a;
1404
1404
  return __generator(this, function (_b) {
1405
1405
  switch (_b.label) {
@@ -1423,13 +1423,12 @@
1423
1423
  };
1424
1424
  return MongoConnector;
1425
1425
  }());
1426
- exports.MongoConnector = __decorate$z([
1427
- tsyringe.injectable(),
1426
+ exports.MongoConnector = __decorate$A([
1428
1427
  tsyringe.singleton(),
1429
- __metadata$t("design:paramtypes", [exports.Configuration])
1428
+ __metadata$u("design:paramtypes", [exports.Configuration])
1430
1429
  ], exports.MongoConnector);
1431
1430
 
1432
- var __awaiter$w = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1431
+ var __awaiter$x = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1433
1432
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1434
1433
  return new (P || (P = Promise))(function (resolve, reject) {
1435
1434
  function fulfilled(value) { try {
@@ -1465,7 +1464,7 @@
1465
1464
  return this.collection.updateOne({ _id: this.mId }, { $set: this.toJSON() });
1466
1465
  };
1467
1466
  BaseEntity.prototype.load = function () {
1468
- return __awaiter$w(this, void 0, void 0, function () {
1467
+ return __awaiter$x(this, void 0, void 0, function () {
1469
1468
  var res;
1470
1469
  return __generator(this, function (_a) {
1471
1470
  switch (_a.label) {
@@ -1488,7 +1487,7 @@
1488
1487
  return BaseEntity;
1489
1488
  }());
1490
1489
 
1491
- var __awaiter$v = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1490
+ var __awaiter$w = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1492
1491
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1493
1492
  return new (P || (P = Promise))(function (resolve, reject) {
1494
1493
  function fulfilled(value) { try {
@@ -1543,7 +1542,7 @@
1543
1542
  configurable: true
1544
1543
  });
1545
1544
  Asset.prototype.unlink = function () {
1546
- return __awaiter$v(this, void 0, void 0, function () {
1545
+ return __awaiter$w(this, void 0, void 0, function () {
1547
1546
  return __generator(this, function (_a) {
1548
1547
  return [2 /*return*/, deleteFromBucket(this.bucket, this.mId)];
1549
1548
  });
@@ -1553,7 +1552,7 @@
1553
1552
  return streamToBuffer(this.stream);
1554
1553
  };
1555
1554
  Asset.prototype.download = function (metadata) {
1556
- return __awaiter$v(this, void 0, void 0, function () {
1555
+ return __awaiter$w(this, void 0, void 0, function () {
1557
1556
  return __generator(this, function (_a) {
1558
1557
  switch (_a.label) {
1559
1558
  case 0:
@@ -1573,14 +1572,14 @@
1573
1572
  };
1574
1573
  Asset.prototype.getImage = function (params) {
1575
1574
  if (params === void 0) { params = null; }
1576
- return __awaiter$v(this, void 0, void 0, function () {
1575
+ return __awaiter$w(this, void 0, void 0, function () {
1577
1576
  return __generator(this, function (_a) {
1578
1577
  return [2 /*return*/, toImage(this.stream, params, this.metadata)];
1579
1578
  });
1580
1579
  });
1581
1580
  };
1582
1581
  Asset.prototype.downloadImage = function (params, metadata) {
1583
- return __awaiter$v(this, void 0, void 0, function () {
1582
+ return __awaiter$w(this, void 0, void 0, function () {
1584
1583
  var _a;
1585
1584
  return __generator(this, function (_b) {
1586
1585
  switch (_b.label) {
@@ -1595,7 +1594,7 @@
1595
1594
  return Asset;
1596
1595
  }(BaseEntity));
1597
1596
 
1598
- var __awaiter$u = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1597
+ var __awaiter$v = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1599
1598
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1600
1599
  return new (P || (P = Promise))(function (resolve, reject) {
1601
1600
  function fulfilled(value) { try {
@@ -1630,21 +1629,21 @@
1630
1629
  configurable: true
1631
1630
  });
1632
1631
  TempAsset.prototype.unlink = function () {
1633
- return __awaiter$u(this, void 0, void 0, function () {
1632
+ return __awaiter$v(this, void 0, void 0, function () {
1634
1633
  return __generator(this, function (_a) {
1635
1634
  throw new Error("Temp asset '" + this.id + "' can not be removed!");
1636
1635
  });
1637
1636
  });
1638
1637
  };
1639
1638
  TempAsset.prototype.getBuffer = function () {
1640
- return __awaiter$u(this, void 0, void 0, function () {
1639
+ return __awaiter$v(this, void 0, void 0, function () {
1641
1640
  return __generator(this, function (_a) {
1642
1641
  return [2 /*return*/, this.buffer];
1643
1642
  });
1644
1643
  });
1645
1644
  };
1646
1645
  TempAsset.prototype.download = function (metadata) {
1647
- return __awaiter$u(this, void 0, void 0, function () {
1646
+ return __awaiter$v(this, void 0, void 0, function () {
1648
1647
  return __generator(this, function (_a) {
1649
1648
  return [2 /*return*/, this.stream];
1650
1649
  });
@@ -1658,14 +1657,14 @@
1658
1657
  return this.downloadImage(params);
1659
1658
  };
1660
1659
  TempAsset.prototype.save = function () {
1661
- return __awaiter$u(this, void 0, void 0, function () {
1660
+ return __awaiter$v(this, void 0, void 0, function () {
1662
1661
  return __generator(this, function (_a) {
1663
1662
  return [2 /*return*/, this];
1664
1663
  });
1665
1664
  });
1666
1665
  };
1667
1666
  TempAsset.prototype.load = function () {
1668
- return __awaiter$u(this, void 0, void 0, function () {
1667
+ return __awaiter$v(this, void 0, void 0, function () {
1669
1668
  return __generator(this, function (_a) {
1670
1669
  return [2 /*return*/, this];
1671
1670
  });
@@ -1682,7 +1681,7 @@
1682
1681
  return TempAsset;
1683
1682
  }());
1684
1683
 
1685
- var __decorate$y = (this && this.__decorate) || function (decorators, target, key, desc) {
1684
+ var __decorate$z = (this && this.__decorate) || function (decorators, target, key, desc) {
1686
1685
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1687
1686
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1688
1687
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1692,11 +1691,11 @@
1692
1691
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1693
1692
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1694
1693
  };
1695
- var __metadata$s = (this && this.__metadata) || function (k, v) {
1694
+ var __metadata$t = (this && this.__metadata) || function (k, v) {
1696
1695
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1697
1696
  return Reflect.metadata(k, v);
1698
1697
  };
1699
- var __awaiter$t = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1698
+ var __awaiter$u = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1700
1699
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1701
1700
  return new (P || (P = Promise))(function (resolve, reject) {
1702
1701
  function fulfilled(value) { try {
@@ -1726,7 +1725,7 @@
1726
1725
  Assets.prototype.write = function (stream, contentType, metadata) {
1727
1726
  if (contentType === void 0) { contentType = null; }
1728
1727
  if (metadata === void 0) { metadata = null; }
1729
- return __awaiter$t(this, void 0, void 0, function () {
1728
+ return __awaiter$u(this, void 0, void 0, function () {
1730
1729
  var uploadStream, buffer, fileType, e_1;
1731
1730
  return __generator(this, function (_b) {
1732
1731
  switch (_b.label) {
@@ -1760,7 +1759,7 @@
1760
1759
  Assets.prototype.writeBuffer = function (buffer, metadata, contentType) {
1761
1760
  if (metadata === void 0) { metadata = null; }
1762
1761
  if (contentType === void 0) { contentType = null; }
1763
- return __awaiter$t(this, void 0, void 0, function () {
1762
+ return __awaiter$u(this, void 0, void 0, function () {
1764
1763
  var fileType, e_2;
1765
1764
  return __generator(this, function (_b) {
1766
1765
  switch (_b.label) {
@@ -1792,7 +1791,7 @@
1792
1791
  };
1793
1792
  Assets.prototype.writeUrl = function (url, metadata) {
1794
1793
  if (metadata === void 0) { metadata = null; }
1795
- return __awaiter$t(this, void 0, void 0, function () {
1794
+ return __awaiter$u(this, void 0, void 0, function () {
1796
1795
  var oneWeek, asset, buffer;
1797
1796
  return __generator(this, function (_b) {
1798
1797
  switch (_b.label) {
@@ -1816,7 +1815,7 @@
1816
1815
  };
1817
1816
  Assets.prototype.download = function (url, contentType) {
1818
1817
  if (contentType === void 0) { contentType = null; }
1819
- return __awaiter$t(this, void 0, void 0, function () {
1818
+ return __awaiter$u(this, void 0, void 0, function () {
1820
1819
  var buffer, fileType, e_3, metadata;
1821
1820
  return __generator(this, function (_b) {
1822
1821
  switch (_b.label) {
@@ -1852,14 +1851,14 @@
1852
1851
  });
1853
1852
  };
1854
1853
  Assets.prototype.read = function (id) {
1855
- return __awaiter$t(this, void 0, void 0, function () {
1854
+ return __awaiter$u(this, void 0, void 0, function () {
1856
1855
  return __generator(this, function (_b) {
1857
1856
  return [2 /*return*/, !id ? null : this.find({ _id: new bson.ObjectId(id) })];
1858
1857
  });
1859
1858
  });
1860
1859
  };
1861
1860
  Assets.prototype.find = function (where) {
1862
- return __awaiter$t(this, void 0, void 0, function () {
1861
+ return __awaiter$u(this, void 0, void 0, function () {
1863
1862
  var data;
1864
1863
  return __generator(this, function (_b) {
1865
1864
  switch (_b.label) {
@@ -1872,7 +1871,7 @@
1872
1871
  });
1873
1872
  };
1874
1873
  Assets.prototype.findMany = function (where) {
1875
- return __awaiter$t(this, void 0, void 0, function () {
1874
+ return __awaiter$u(this, void 0, void 0, function () {
1876
1875
  var cursor, items, result, items_1, items_1_1, item;
1877
1876
  var e_4, _b;
1878
1877
  return __generator(this, function (_c) {
@@ -1904,7 +1903,7 @@
1904
1903
  });
1905
1904
  };
1906
1905
  Assets.prototype.deleteMany = function (where) {
1907
- return __awaiter$t(this, void 0, void 0, function () {
1906
+ return __awaiter$u(this, void 0, void 0, function () {
1908
1907
  var assets;
1909
1908
  return __generator(this, function (_b) {
1910
1909
  switch (_b.label) {
@@ -1917,7 +1916,7 @@
1917
1916
  });
1918
1917
  };
1919
1918
  Assets.prototype.unlink = function (id) {
1920
- return __awaiter$t(this, void 0, void 0, function () {
1919
+ return __awaiter$u(this, void 0, void 0, function () {
1921
1920
  var asset;
1922
1921
  return __generator(this, function (_b) {
1923
1922
  switch (_b.label) {
@@ -1932,7 +1931,7 @@
1932
1931
  });
1933
1932
  };
1934
1933
  Assets.prototype.upload = function (stream, fileType, metadata) {
1935
- return __awaiter$t(this, void 0, void 0, function () {
1934
+ return __awaiter$u(this, void 0, void 0, function () {
1936
1935
  var contentType;
1937
1936
  var _this = this;
1938
1937
  return __generator(this, function (_b) {
@@ -1968,13 +1967,13 @@
1968
1967
  };
1969
1968
  return Assets;
1970
1969
  }());
1971
- exports.Assets = __decorate$y([
1970
+ exports.Assets = __decorate$z([
1972
1971
  tsyringe.injectable(),
1973
1972
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
1974
- __metadata$s("design:paramtypes", [exports.MongoConnector, exports.AssetProcessor])
1973
+ __metadata$t("design:paramtypes", [exports.MongoConnector, exports.AssetProcessor])
1975
1974
  ], exports.Assets);
1976
1975
 
1977
- var __awaiter$s = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1976
+ var __awaiter$t = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1978
1977
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1979
1978
  return new (P || (P = Promise))(function (resolve, reject) {
1980
1979
  function fulfilled(value) { try {
@@ -2038,7 +2037,7 @@
2038
2037
  configurable: true
2039
2038
  });
2040
2039
  LazyAsset.prototype.unlink = function () {
2041
- return __awaiter$s(this, void 0, void 0, function () {
2040
+ return __awaiter$t(this, void 0, void 0, function () {
2042
2041
  return __generator(this, function (_a) {
2043
2042
  switch (_a.label) {
2044
2043
  case 0: return [4 /*yield*/, this.load()];
@@ -2070,7 +2069,7 @@
2070
2069
  });
2071
2070
  };
2072
2071
  LazyAsset.prototype.loadAsset = function () {
2073
- return __awaiter$s(this, void 0, void 0, function () {
2072
+ return __awaiter$t(this, void 0, void 0, function () {
2074
2073
  return __generator(this, function (_a) {
2075
2074
  switch (_a.label) {
2076
2075
  case 0: return [4 /*yield*/, this.load()];
@@ -2095,7 +2094,7 @@
2095
2094
  });
2096
2095
  };
2097
2096
  LazyAsset.prototype.writeAsset = function (asset) {
2098
- return __awaiter$s(this, void 0, void 0, function () {
2097
+ return __awaiter$t(this, void 0, void 0, function () {
2099
2098
  return __generator(this, function (_a) {
2100
2099
  switch (_a.label) {
2101
2100
  case 0:
@@ -2109,7 +2108,7 @@
2109
2108
  });
2110
2109
  };
2111
2110
  LazyAsset.prototype.startWorkingOnAsset = function (fromLoad) {
2112
- return __awaiter$s(this, void 0, void 0, function () {
2111
+ return __awaiter$t(this, void 0, void 0, function () {
2113
2112
  var _a;
2114
2113
  return __generator(this, function (_b) {
2115
2114
  switch (_b.label) {
@@ -2133,7 +2132,7 @@
2133
2132
  return LazyAsset;
2134
2133
  }(BaseEntity));
2135
2134
 
2136
- var __decorate$x = (this && this.__decorate) || function (decorators, target, key, desc) {
2135
+ var __decorate$y = (this && this.__decorate) || function (decorators, target, key, desc) {
2137
2136
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2138
2137
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2139
2138
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2143,7 +2142,7 @@
2143
2142
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2144
2143
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2145
2144
  };
2146
- var __metadata$r = (this && this.__metadata) || function (k, v) {
2145
+ var __metadata$s = (this && this.__metadata) || function (k, v) {
2147
2146
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
2148
2147
  return Reflect.metadata(k, v);
2149
2148
  };
@@ -2164,12 +2163,12 @@
2164
2163
  };
2165
2164
  return Logger;
2166
2165
  }());
2167
- exports["ɵa"] = __decorate$x([
2166
+ exports["ɵa"] = __decorate$y([
2168
2167
  tsyringe.singleton(),
2169
- __metadata$r("design:paramtypes", [exports.Configuration])
2168
+ __metadata$s("design:paramtypes", [exports.Configuration])
2170
2169
  ], exports["ɵa"]);
2171
2170
 
2172
- var __decorate$w = (this && this.__decorate) || function (decorators, target, key, desc) {
2171
+ var __decorate$x = (this && this.__decorate) || function (decorators, target, key, desc) {
2173
2172
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2174
2173
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2175
2174
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2179,14 +2178,14 @@
2179
2178
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2180
2179
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2181
2180
  };
2182
- var __metadata$q = (this && this.__metadata) || function (k, v) {
2181
+ var __metadata$r = (this && this.__metadata) || function (k, v) {
2183
2182
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
2184
2183
  return Reflect.metadata(k, v);
2185
2184
  };
2186
2185
  var __param$8 = (this && this.__param) || function (paramIndex, decorator) {
2187
2186
  return function (target, key) { decorator(target, key, paramIndex); };
2188
2187
  };
2189
- var __awaiter$r = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2188
+ var __awaiter$s = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2190
2189
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2191
2190
  return new (P || (P = Promise))(function (resolve, reject) {
2192
2191
  function fulfilled(value) { try {
@@ -2238,7 +2237,7 @@
2238
2237
  };
2239
2238
  JobManager.prototype.process = function (jobType, params) {
2240
2239
  if (params === void 0) { params = {}; }
2241
- return __awaiter$r(this, void 0, void 0, function () {
2240
+ return __awaiter$s(this, void 0, void 0, function () {
2242
2241
  var instance, jobName;
2243
2242
  return __generator(this, function (_a) {
2244
2243
  instance = null;
@@ -2255,7 +2254,7 @@
2255
2254
  };
2256
2255
  JobManager.prototype.enqueueWithName = function (name, params) {
2257
2256
  if (params === void 0) { params = {}; }
2258
- return __awaiter$r(this, void 0, void 0, function () {
2257
+ return __awaiter$s(this, void 0, void 0, function () {
2259
2258
  return __generator(this, function (_a) {
2260
2259
  return [2 /*return*/, this.sendToWorkers(this.tryResolveFromName(name, params), params)];
2261
2260
  });
@@ -2263,7 +2262,7 @@
2263
2262
  };
2264
2263
  JobManager.prototype.enqueue = function (jobType, params) {
2265
2264
  if (params === void 0) { params = {}; }
2266
- return __awaiter$r(this, void 0, void 0, function () {
2265
+ return __awaiter$s(this, void 0, void 0, function () {
2267
2266
  return __generator(this, function (_a) {
2268
2267
  return [2 /*return*/, this.sendToWorkers(this.tryResolveAndInit(jobType, params), params)];
2269
2268
  });
@@ -2294,7 +2293,7 @@
2294
2293
  });
2295
2294
  };
2296
2295
  JobManager.prototype.startProcessing = function () {
2297
- return __awaiter$r(this, void 0, void 0, function () {
2296
+ return __awaiter$s(this, void 0, void 0, function () {
2298
2297
  var host, pushHost, pullHost;
2299
2298
  var _this = this;
2300
2299
  return __generator(this, function (_a) {
@@ -2320,7 +2319,7 @@
2320
2319
  case 2:
2321
2320
  _a.sent();
2322
2321
  this.logger.log("job-manager", "Worker consumer connected to: " + pullHost);
2323
- this.workerPull.on("message", function (name, args, uniqId) { return __awaiter$r(_this, void 0, void 0, function () {
2322
+ this.workerPull.on("message", function (name, args, uniqId) { return __awaiter$s(_this, void 0, void 0, function () {
2324
2323
  var jobName, jobParams, uniqueId, e_1, e_2;
2325
2324
  return __generator(this, function (_a) {
2326
2325
  switch (_a.label) {
@@ -2418,7 +2417,7 @@
2418
2417
  return container.resolve(jobType);
2419
2418
  };
2420
2419
  JobManager.prototype.sendToWorkers = function (jobName, params) {
2421
- return __awaiter$r(this, void 0, void 0, function () {
2420
+ return __awaiter$s(this, void 0, void 0, function () {
2422
2421
  var publisher, uniqueId;
2423
2422
  return __generator(this, function (_a) {
2424
2423
  switch (_a.label) {
@@ -2436,16 +2435,16 @@
2436
2435
  };
2437
2436
  return JobManager;
2438
2437
  }());
2439
- exports.JobManager = __decorate$w([
2438
+ exports.JobManager = __decorate$x([
2440
2439
  tsyringe.injectable(),
2441
2440
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
2442
2441
  __param$8(2, tsyringe.inject(DI_CONTAINER)),
2443
2442
  __param$8(3, tsyringe.injectAll(JOB)),
2444
- __metadata$q("design:paramtypes", [exports.Configuration,
2443
+ __metadata$r("design:paramtypes", [exports.Configuration,
2445
2444
  exports["ɵa"], Object, Array])
2446
2445
  ], exports.JobManager);
2447
2446
 
2448
- var __awaiter$q = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2447
+ var __awaiter$r = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2449
2448
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2450
2449
  return new (P || (P = Promise))(function (resolve, reject) {
2451
2450
  function fulfilled(value) { try {
@@ -2523,7 +2522,7 @@
2523
2522
  return this;
2524
2523
  };
2525
2524
  Progress.prototype.createSubProgress = function (progressValue, max, message) {
2526
- return __awaiter$q(this, void 0, void 0, function () {
2525
+ return __awaiter$r(this, void 0, void 0, function () {
2527
2526
  return __generator(this, function (_a) {
2528
2527
  switch (_a.label) {
2529
2528
  case 0:
@@ -2545,7 +2544,7 @@
2545
2544
  });
2546
2545
  };
2547
2546
  Progress.prototype.setMax = function (max) {
2548
- return __awaiter$q(this, void 0, void 0, function () {
2547
+ return __awaiter$r(this, void 0, void 0, function () {
2549
2548
  return __generator(this, function (_a) {
2550
2549
  switch (_a.label) {
2551
2550
  case 0:
@@ -2562,7 +2561,7 @@
2562
2561
  });
2563
2562
  };
2564
2563
  Progress.prototype.setMessage = function (message) {
2565
- return __awaiter$q(this, void 0, void 0, function () {
2564
+ return __awaiter$r(this, void 0, void 0, function () {
2566
2565
  return __generator(this, function (_a) {
2567
2566
  switch (_a.label) {
2568
2567
  case 0:
@@ -2576,7 +2575,7 @@
2576
2575
  });
2577
2576
  };
2578
2577
  Progress.prototype.setError = function (error) {
2579
- return __awaiter$q(this, void 0, void 0, function () {
2578
+ return __awaiter$r(this, void 0, void 0, function () {
2580
2579
  return __generator(this, function (_a) {
2581
2580
  switch (_a.label) {
2582
2581
  case 0:
@@ -2591,7 +2590,7 @@
2591
2590
  };
2592
2591
  Progress.prototype.advance = function (value) {
2593
2592
  if (value === void 0) { value = 1; }
2594
- return __awaiter$q(this, void 0, void 0, function () {
2593
+ return __awaiter$r(this, void 0, void 0, function () {
2595
2594
  return __generator(this, function (_a) {
2596
2595
  switch (_a.label) {
2597
2596
  case 0:
@@ -2613,7 +2612,7 @@
2613
2612
  });
2614
2613
  };
2615
2614
  Progress.prototype.cancel = function () {
2616
- return __awaiter$q(this, void 0, void 0, function () {
2615
+ return __awaiter$r(this, void 0, void 0, function () {
2617
2616
  return __generator(this, function (_a) {
2618
2617
  switch (_a.label) {
2619
2618
  case 0:
@@ -2712,7 +2711,7 @@
2712
2711
  return this;
2713
2712
  };
2714
2713
  SubProgress.prototype.createSubProgress = function (progressValue, max, message) {
2715
- return __awaiter$q(this, void 0, void 0, function () {
2714
+ return __awaiter$r(this, void 0, void 0, function () {
2716
2715
  return __generator(this, function (_a) {
2717
2716
  switch (_a.label) {
2718
2717
  case 0:
@@ -2733,7 +2732,7 @@
2733
2732
  });
2734
2733
  };
2735
2734
  SubProgress.prototype.setMax = function (max) {
2736
- return __awaiter$q(this, void 0, void 0, function () {
2735
+ return __awaiter$r(this, void 0, void 0, function () {
2737
2736
  return __generator(this, function (_a) {
2738
2737
  switch (_a.label) {
2739
2738
  case 0:
@@ -2750,7 +2749,7 @@
2750
2749
  });
2751
2750
  };
2752
2751
  SubProgress.prototype.setMessage = function (message) {
2753
- return __awaiter$q(this, void 0, void 0, function () {
2752
+ return __awaiter$r(this, void 0, void 0, function () {
2754
2753
  return __generator(this, function (_a) {
2755
2754
  switch (_a.label) {
2756
2755
  case 0:
@@ -2765,7 +2764,7 @@
2765
2764
  });
2766
2765
  };
2767
2766
  SubProgress.prototype.setError = function (error) {
2768
- return __awaiter$q(this, void 0, void 0, function () {
2767
+ return __awaiter$r(this, void 0, void 0, function () {
2769
2768
  return __generator(this, function (_a) {
2770
2769
  switch (_a.label) {
2771
2770
  case 0:
@@ -2781,7 +2780,7 @@
2781
2780
  };
2782
2781
  SubProgress.prototype.advance = function (value) {
2783
2782
  if (value === void 0) { value = 1; }
2784
- return __awaiter$q(this, void 0, void 0, function () {
2783
+ return __awaiter$r(this, void 0, void 0, function () {
2785
2784
  return __generator(this, function (_a) {
2786
2785
  switch (_a.label) {
2787
2786
  case 0:
@@ -2798,7 +2797,7 @@
2798
2797
  });
2799
2798
  };
2800
2799
  SubProgress.prototype.cancel = function () {
2801
- return __awaiter$q(this, void 0, void 0, function () {
2800
+ return __awaiter$r(this, void 0, void 0, function () {
2802
2801
  return __generator(this, function (_a) {
2803
2802
  switch (_a.label) {
2804
2803
  case 0:
@@ -2813,7 +2812,7 @@
2813
2812
  });
2814
2813
  };
2815
2814
  SubProgress.prototype.save = function () {
2816
- return __awaiter$q(this, void 0, void 0, function () {
2815
+ return __awaiter$r(this, void 0, void 0, function () {
2817
2816
  var ratio, newProgress, current;
2818
2817
  return __generator(this, function (_a) {
2819
2818
  switch (_a.label) {
@@ -2832,7 +2831,7 @@
2832
2831
  });
2833
2832
  };
2834
2833
  SubProgress.prototype.load = function () {
2835
- return __awaiter$q(this, void 0, void 0, function () {
2834
+ return __awaiter$r(this, void 0, void 0, function () {
2836
2835
  return __generator(this, function (_a) {
2837
2836
  return [2 /*return*/, null];
2838
2837
  });
@@ -2844,7 +2843,7 @@
2844
2843
  return SubProgress;
2845
2844
  }());
2846
2845
 
2847
- var __decorate$v = (this && this.__decorate) || function (decorators, target, key, desc) {
2846
+ var __decorate$w = (this && this.__decorate) || function (decorators, target, key, desc) {
2848
2847
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2849
2848
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2850
2849
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2854,11 +2853,11 @@
2854
2853
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2855
2854
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2856
2855
  };
2857
- var __metadata$p = (this && this.__metadata) || function (k, v) {
2856
+ var __metadata$q = (this && this.__metadata) || function (k, v) {
2858
2857
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
2859
2858
  return Reflect.metadata(k, v);
2860
2859
  };
2861
- var __awaiter$p = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2860
+ var __awaiter$q = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2862
2861
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2863
2862
  return new (P || (P = Promise))(function (resolve, reject) {
2864
2863
  function fulfilled(value) { try {
@@ -2890,11 +2889,11 @@
2890
2889
  });
2891
2890
  }
2892
2891
  Progresses.prototype.waitToFinish = function (id) {
2893
- return __awaiter$p(this, void 0, void 0, function () {
2892
+ return __awaiter$q(this, void 0, void 0, function () {
2894
2893
  var _this = this;
2895
2894
  return __generator(this, function (_a) {
2896
2895
  return [2 /*return*/, Promise.race([
2897
- this.waitForProgress(id, function () { return __awaiter$p(_this, void 0, void 0, function () {
2896
+ this.waitForProgress(id, function () { return __awaiter$q(_this, void 0, void 0, function () {
2898
2897
  var progress;
2899
2898
  return __generator(this, function (_a) {
2900
2899
  switch (_a.label) {
@@ -2913,7 +2912,7 @@
2913
2912
  }
2914
2913
  });
2915
2914
  }); }, 500),
2916
- this.waitForProgress(id, function () { return __awaiter$p(_this, void 0, void 0, function () {
2915
+ this.waitForProgress(id, function () { return __awaiter$q(_this, void 0, void 0, function () {
2917
2916
  return __generator(this, function (_a) {
2918
2917
  return [2 /*return*/, this.progresses[id] || null];
2919
2918
  });
@@ -2923,14 +2922,14 @@
2923
2922
  });
2924
2923
  };
2925
2924
  Progresses.prototype.get = function (id) {
2926
- return __awaiter$p(this, void 0, void 0, function () {
2925
+ return __awaiter$q(this, void 0, void 0, function () {
2927
2926
  return __generator(this, function (_a) {
2928
2927
  return [2 /*return*/, !id ? null : this.find({ _id: new bson.ObjectId(id) })];
2929
2928
  });
2930
2929
  });
2931
2930
  };
2932
2931
  Progresses.prototype.find = function (where) {
2933
- return __awaiter$p(this, void 0, void 0, function () {
2932
+ return __awaiter$q(this, void 0, void 0, function () {
2934
2933
  var data;
2935
2934
  return __generator(this, function (_a) {
2936
2935
  switch (_a.label) {
@@ -2944,7 +2943,7 @@
2944
2943
  };
2945
2944
  Progresses.prototype.create = function (max) {
2946
2945
  if (max === void 0) { max = 100; }
2947
- return __awaiter$p(this, void 0, void 0, function () {
2946
+ return __awaiter$q(this, void 0, void 0, function () {
2948
2947
  var data, res;
2949
2948
  return __generator(this, function (_a) {
2950
2949
  switch (_a.label) {
@@ -2968,7 +2967,7 @@
2968
2967
  });
2969
2968
  };
2970
2969
  Progresses.prototype.remove = function (id) {
2971
- return __awaiter$p(this, void 0, void 0, function () {
2970
+ return __awaiter$q(this, void 0, void 0, function () {
2972
2971
  return __generator(this, function (_a) {
2973
2972
  switch (_a.label) {
2974
2973
  case 0: return [4 /*yield*/, this.collection.deleteOne({ _id: new bson.ObjectId(id) })];
@@ -2980,7 +2979,7 @@
2980
2979
  });
2981
2980
  };
2982
2981
  Progresses.prototype.waitForProgress = function (id, cb, delay) {
2983
- return __awaiter$p(this, void 0, void 0, function () {
2982
+ return __awaiter$q(this, void 0, void 0, function () {
2984
2983
  var isFinished, progress, waitTime;
2985
2984
  return __generator(this, function (_a) {
2986
2985
  switch (_a.label) {
@@ -3017,13 +3016,12 @@
3017
3016
  };
3018
3017
  return Progresses;
3019
3018
  }());
3020
- exports.Progresses = __decorate$v([
3021
- tsyringe.injectable(),
3019
+ exports.Progresses = __decorate$w([
3022
3020
  tsyringe.singleton(),
3023
- __metadata$p("design:paramtypes", [exports.MongoConnector, exports.JobManager])
3021
+ __metadata$q("design:paramtypes", [exports.MongoConnector, exports.JobManager])
3024
3022
  ], exports.Progresses);
3025
3023
 
3026
- var __decorate$u = (this && this.__decorate) || function (decorators, target, key, desc) {
3024
+ var __decorate$v = (this && this.__decorate) || function (decorators, target, key, desc) {
3027
3025
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3028
3026
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3029
3027
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3033,11 +3031,11 @@
3033
3031
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3034
3032
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3035
3033
  };
3036
- var __metadata$o = (this && this.__metadata) || function (k, v) {
3034
+ var __metadata$p = (this && this.__metadata) || function (k, v) {
3037
3035
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3038
3036
  return Reflect.metadata(k, v);
3039
3037
  };
3040
- var __awaiter$o = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3038
+ var __awaiter$p = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3041
3039
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3042
3040
  return new (P || (P = Promise))(function (resolve, reject) {
3043
3041
  function fulfilled(value) { try {
@@ -3068,7 +3066,7 @@
3068
3066
  LazyAssets.prototype.create = function (jobType, jobParams, jobQue) {
3069
3067
  if (jobParams === void 0) { jobParams = {}; }
3070
3068
  if (jobQue === void 0) { jobQue = "main"; }
3071
- return __awaiter$o(this, void 0, void 0, function () {
3069
+ return __awaiter$p(this, void 0, void 0, function () {
3072
3070
  var jobName, data, existingAsset, res;
3073
3071
  return __generator(this, function (_a) {
3074
3072
  switch (_a.label) {
@@ -3093,14 +3091,14 @@
3093
3091
  });
3094
3092
  };
3095
3093
  LazyAssets.prototype.read = function (id) {
3096
- return __awaiter$o(this, void 0, void 0, function () {
3094
+ return __awaiter$p(this, void 0, void 0, function () {
3097
3095
  return __generator(this, function (_a) {
3098
3096
  return [2 /*return*/, !id ? null : this.find({ _id: new bson.ObjectId(id) })];
3099
3097
  });
3100
3098
  });
3101
3099
  };
3102
3100
  LazyAssets.prototype.find = function (where) {
3103
- return __awaiter$o(this, void 0, void 0, function () {
3101
+ return __awaiter$p(this, void 0, void 0, function () {
3104
3102
  var data;
3105
3103
  return __generator(this, function (_a) {
3106
3104
  switch (_a.label) {
@@ -3115,7 +3113,7 @@
3115
3113
  });
3116
3114
  };
3117
3115
  LazyAssets.prototype.unlink = function (id) {
3118
- return __awaiter$o(this, void 0, void 0, function () {
3116
+ return __awaiter$p(this, void 0, void 0, function () {
3119
3117
  var asset;
3120
3118
  return __generator(this, function (_a) {
3121
3119
  switch (_a.label) {
@@ -3131,17 +3129,17 @@
3131
3129
  };
3132
3130
  return LazyAssets;
3133
3131
  }());
3134
- exports.LazyAssets = __decorate$u([
3132
+ exports.LazyAssets = __decorate$v([
3135
3133
  tsyringe.injectable(),
3136
3134
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
3137
- __metadata$o("design:paramtypes", [exports.MongoConnector,
3135
+ __metadata$p("design:paramtypes", [exports.MongoConnector,
3138
3136
  exports.Assets,
3139
3137
  exports.Progresses,
3140
3138
  exports["ɵa"],
3141
3139
  exports.JobManager])
3142
3140
  ], exports.LazyAssets);
3143
3141
 
3144
- var __decorate$t = (this && this.__decorate) || function (decorators, target, key, desc) {
3142
+ var __decorate$u = (this && this.__decorate) || function (decorators, target, key, desc) {
3145
3143
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3146
3144
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3147
3145
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3151,11 +3149,11 @@
3151
3149
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3152
3150
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3153
3151
  };
3154
- var __metadata$n = (this && this.__metadata) || function (k, v) {
3152
+ var __metadata$o = (this && this.__metadata) || function (k, v) {
3155
3153
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3156
3154
  return Reflect.metadata(k, v);
3157
3155
  };
3158
- var __awaiter$n = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3156
+ var __awaiter$o = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3159
3157
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3160
3158
  return new (P || (P = Promise))(function (resolve, reject) {
3161
3159
  function fulfilled(value) { try {
@@ -3181,7 +3179,7 @@
3181
3179
  }
3182
3180
  AssetResolver.prototype.resolve = function (id, lazy) {
3183
3181
  if (lazy === void 0) { lazy = false; }
3184
- return __awaiter$n(this, void 0, void 0, function () {
3182
+ return __awaiter$o(this, void 0, void 0, function () {
3185
3183
  var asset, lazyAsset, lazyAsset;
3186
3184
  return __generator(this, function (_a) {
3187
3185
  switch (_a.label) {
@@ -3211,13 +3209,13 @@
3211
3209
  };
3212
3210
  return AssetResolver;
3213
3211
  }());
3214
- exports.AssetResolver = __decorate$t([
3212
+ exports.AssetResolver = __decorate$u([
3215
3213
  tsyringe.injectable(),
3216
3214
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
3217
- __metadata$n("design:paramtypes", [exports.Assets, exports.LazyAssets])
3215
+ __metadata$o("design:paramtypes", [exports.Assets, exports.LazyAssets])
3218
3216
  ], exports.AssetResolver);
3219
3217
 
3220
- var __decorate$s = (this && this.__decorate) || function (decorators, target, key, desc) {
3218
+ var __decorate$t = (this && this.__decorate) || function (decorators, target, key, desc) {
3221
3219
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3222
3220
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3223
3221
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3227,7 +3225,7 @@
3227
3225
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3228
3226
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3229
3227
  };
3230
- var __metadata$m = (this && this.__metadata) || function (k, v) {
3228
+ var __metadata$n = (this && this.__metadata) || function (k, v) {
3231
3229
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3232
3230
  return Reflect.metadata(k, v);
3233
3231
  };
@@ -3249,13 +3247,12 @@
3249
3247
  });
3250
3248
  return BackendProvider;
3251
3249
  }());
3252
- exports.BackendProvider = __decorate$s([
3253
- tsyringe.injectable(),
3250
+ exports.BackendProvider = __decorate$t([
3254
3251
  tsyringe.singleton(),
3255
- __metadata$m("design:paramtypes", [])
3252
+ __metadata$n("design:paramtypes", [])
3256
3253
  ], exports.BackendProvider);
3257
3254
 
3258
- var __decorate$r = (this && this.__decorate) || function (decorators, target, key, desc) {
3255
+ var __decorate$s = (this && this.__decorate) || function (decorators, target, key, desc) {
3259
3256
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3260
3257
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3261
3258
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3265,7 +3262,7 @@
3265
3262
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3266
3263
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3267
3264
  };
3268
- var __awaiter$m = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3265
+ var __awaiter$n = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3269
3266
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3270
3267
  return new (P || (P = Promise))(function (resolve, reject) {
3271
3268
  function fulfilled(value) { try {
@@ -3288,14 +3285,14 @@
3288
3285
  function CacheProcessor() {
3289
3286
  }
3290
3287
  CacheProcessor.prototype.serialize = function (data) {
3291
- return __awaiter$m(this, void 0, void 0, function () {
3288
+ return __awaiter$n(this, void 0, void 0, function () {
3292
3289
  return __generator(this, function (_a) {
3293
3290
  return [2 /*return*/, data];
3294
3291
  });
3295
3292
  });
3296
3293
  };
3297
3294
  CacheProcessor.prototype.deserialize = function (data) {
3298
- return __awaiter$m(this, void 0, void 0, function () {
3295
+ return __awaiter$n(this, void 0, void 0, function () {
3299
3296
  return __generator(this, function (_a) {
3300
3297
  return [2 /*return*/, data];
3301
3298
  });
@@ -3303,12 +3300,12 @@
3303
3300
  };
3304
3301
  return CacheProcessor;
3305
3302
  }());
3306
- exports.CacheProcessor = __decorate$r([
3303
+ exports.CacheProcessor = __decorate$s([
3307
3304
  tsyringe.injectable(),
3308
3305
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped)
3309
3306
  ], exports.CacheProcessor);
3310
3307
 
3311
- var __decorate$q = (this && this.__decorate) || function (decorators, target, key, desc) {
3308
+ var __decorate$r = (this && this.__decorate) || function (decorators, target, key, desc) {
3312
3309
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3313
3310
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3314
3311
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3318,11 +3315,11 @@
3318
3315
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3319
3316
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3320
3317
  };
3321
- var __metadata$l = (this && this.__metadata) || function (k, v) {
3318
+ var __metadata$m = (this && this.__metadata) || function (k, v) {
3322
3319
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3323
3320
  return Reflect.metadata(k, v);
3324
3321
  };
3325
- var __awaiter$l = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3322
+ var __awaiter$m = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3326
3323
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3327
3324
  return new (P || (P = Promise))(function (resolve, reject) {
3328
3325
  function fulfilled(value) { try {
@@ -3348,7 +3345,7 @@
3348
3345
  this.cacheProcessor = cacheProcessor;
3349
3346
  }
3350
3347
  Cache.prototype.prepare = function () {
3351
- return __awaiter$l(this, void 0, void 0, function () {
3348
+ return __awaiter$m(this, void 0, void 0, function () {
3352
3349
  return __generator(this, function (_a) {
3353
3350
  switch (_a.label) {
3354
3351
  case 0:
@@ -3369,7 +3366,7 @@
3369
3366
  Cache.prototype.set = function (key, value, ttl, expirationTimestamp, tags) {
3370
3367
  if (expirationTimestamp === void 0) { expirationTimestamp = null; }
3371
3368
  if (tags === void 0) { tags = {}; }
3372
- return __awaiter$l(this, void 0, void 0, function () {
3369
+ return __awaiter$m(this, void 0, void 0, function () {
3373
3370
  var item, _a, now;
3374
3371
  return __generator(this, function (_b) {
3375
3372
  switch (_b.label) {
@@ -3400,7 +3397,7 @@
3400
3397
  });
3401
3398
  };
3402
3399
  Cache.prototype.get = function (key) {
3403
- return __awaiter$l(this, void 0, void 0, function () {
3400
+ return __awaiter$m(this, void 0, void 0, function () {
3404
3401
  var item, now;
3405
3402
  return __generator(this, function (_a) {
3406
3403
  switch (_a.label) {
@@ -3426,7 +3423,7 @@
3426
3423
  Cache.prototype.getOrSet = function (key, valueCb, ttl, expirationTimestamp, tags) {
3427
3424
  if (expirationTimestamp === void 0) { expirationTimestamp = null; }
3428
3425
  if (tags === void 0) { tags = {}; }
3429
- return __awaiter$l(this, void 0, void 0, function () {
3426
+ return __awaiter$m(this, void 0, void 0, function () {
3430
3427
  var e_1, _a, _b;
3431
3428
  return __generator(this, function (_c) {
3432
3429
  switch (_c.label) {
@@ -3447,7 +3444,7 @@
3447
3444
  });
3448
3445
  };
3449
3446
  Cache.prototype.delete = function (key) {
3450
- return __awaiter$l(this, void 0, void 0, function () {
3447
+ return __awaiter$m(this, void 0, void 0, function () {
3451
3448
  return __generator(this, function (_a) {
3452
3449
  switch (_a.label) {
3453
3450
  case 0: return [4 /*yield*/, this.prepare()];
@@ -3463,13 +3460,13 @@
3463
3460
  };
3464
3461
  return Cache;
3465
3462
  }());
3466
- exports.Cache = __decorate$q([
3463
+ exports.Cache = __decorate$r([
3467
3464
  tsyringe.injectable(),
3468
3465
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
3469
- __metadata$l("design:paramtypes", [exports.MongoConnector, exports.Configuration, exports.CacheProcessor])
3466
+ __metadata$m("design:paramtypes", [exports.MongoConnector, exports.Configuration, exports.CacheProcessor])
3470
3467
  ], exports.Cache);
3471
3468
 
3472
- var __decorate$p = (this && this.__decorate) || function (decorators, target, key, desc) {
3469
+ var __decorate$q = (this && this.__decorate) || function (decorators, target, key, desc) {
3473
3470
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3474
3471
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3475
3472
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3479,7 +3476,7 @@
3479
3476
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3480
3477
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3481
3478
  };
3482
- var __awaiter$k = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3479
+ var __awaiter$l = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3483
3480
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3484
3481
  return new (P || (P = Promise))(function (resolve, reject) {
3485
3482
  function fulfilled(value) { try {
@@ -3502,7 +3499,7 @@
3502
3499
  function EndpointProvider() {
3503
3500
  }
3504
3501
  EndpointProvider.prototype.configure = function (app) {
3505
- return __awaiter$k(this, void 0, void 0, function () {
3502
+ return __awaiter$l(this, void 0, void 0, function () {
3506
3503
  return __generator(this, function (_a) {
3507
3504
  console.log("Express app is mounted to: " + app.mountpath);
3508
3505
  return [2 /*return*/];
@@ -3511,12 +3508,12 @@
3511
3508
  };
3512
3509
  return EndpointProvider;
3513
3510
  }());
3514
- exports.EndpointProvider = __decorate$p([
3511
+ exports.EndpointProvider = __decorate$q([
3515
3512
  tsyringe.injectable(),
3516
3513
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped)
3517
3514
  ], exports.EndpointProvider);
3518
3515
 
3519
- var __decorate$o = (this && this.__decorate) || function (decorators, target, key, desc) {
3516
+ var __decorate$p = (this && this.__decorate) || function (decorators, target, key, desc) {
3520
3517
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3521
3518
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3522
3519
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3526,14 +3523,14 @@
3526
3523
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3527
3524
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3528
3525
  };
3529
- var __metadata$k = (this && this.__metadata) || function (k, v) {
3526
+ var __metadata$l = (this && this.__metadata) || function (k, v) {
3530
3527
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3531
3528
  return Reflect.metadata(k, v);
3532
3529
  };
3533
3530
  var __param$7 = (this && this.__param) || function (paramIndex, decorator) {
3534
3531
  return function (target, key) { decorator(target, key, paramIndex); };
3535
3532
  };
3536
- var __awaiter$j = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3533
+ var __awaiter$k = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3537
3534
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3538
3535
  return new (P || (P = Promise))(function (resolve, reject) {
3539
3536
  function fulfilled(value) { try {
@@ -3557,7 +3554,7 @@
3557
3554
  this.fixtures = fixtures;
3558
3555
  }
3559
3556
  Fixtures.prototype.load = function () {
3560
- return __awaiter$j(this, void 0, void 0, function () {
3557
+ return __awaiter$k(this, void 0, void 0, function () {
3561
3558
  var _a, _b, fixture, e_1_1;
3562
3559
  var e_1, _c;
3563
3560
  return __generator(this, function (_d) {
@@ -3598,14 +3595,14 @@
3598
3595
  };
3599
3596
  return Fixtures;
3600
3597
  }());
3601
- exports.Fixtures = __decorate$o([
3598
+ exports.Fixtures = __decorate$p([
3602
3599
  tsyringe.injectable(),
3603
3600
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
3604
3601
  __param$7(0, tsyringe.injectAll(FIXTURE)),
3605
- __metadata$k("design:paramtypes", [Array])
3602
+ __metadata$l("design:paramtypes", [Array])
3606
3603
  ], exports.Fixtures);
3607
3604
 
3608
- var __awaiter$i = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3605
+ var __awaiter$j = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3609
3606
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3610
3607
  return new (P || (P = Promise))(function (resolve, reject) {
3611
3608
  function fulfilled(value) { try {
@@ -3636,7 +3633,7 @@
3636
3633
  this.targetSize = !size ? { width: thumbSize, height: thumbSize } : size;
3637
3634
  }
3638
3635
  GalleryImage.prototype.serve = function (id) {
3639
- return __awaiter$i(this, void 0, void 0, function () {
3636
+ return __awaiter$j(this, void 0, void 0, function () {
3640
3637
  var isThumb, original, _a, meta, ratio, sizeRatio, size, targetHeight, targetWidth, resized, buffer;
3641
3638
  return __generator(this, function (_b) {
3642
3639
  switch (_b.label) {
@@ -3679,7 +3676,7 @@
3679
3676
  return GalleryImage;
3680
3677
  }());
3681
3678
 
3682
- var __decorate$n = (this && this.__decorate) || function (decorators, target, key, desc) {
3679
+ var __decorate$o = (this && this.__decorate) || function (decorators, target, key, desc) {
3683
3680
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3684
3681
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3685
3682
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3689,7 +3686,7 @@
3689
3686
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3690
3687
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3691
3688
  };
3692
- var __metadata$j = (this && this.__metadata) || function (k, v) {
3689
+ var __metadata$k = (this && this.__metadata) || function (k, v) {
3693
3690
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3694
3691
  return Reflect.metadata(k, v);
3695
3692
  };
@@ -3712,13 +3709,13 @@
3712
3709
  };
3713
3710
  return GalleryCache;
3714
3711
  }());
3715
- exports.GalleryCache = __decorate$n([
3712
+ exports.GalleryCache = __decorate$o([
3716
3713
  tsyringe.injectable(),
3717
3714
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
3718
- __metadata$j("design:paramtypes", [])
3715
+ __metadata$k("design:paramtypes", [])
3719
3716
  ], exports.GalleryCache);
3720
3717
 
3721
- var __decorate$m = (this && this.__decorate) || function (decorators, target, key, desc) {
3718
+ var __decorate$n = (this && this.__decorate) || function (decorators, target, key, desc) {
3722
3719
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3723
3720
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3724
3721
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3728,11 +3725,11 @@
3728
3725
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3729
3726
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3730
3727
  };
3731
- var __metadata$i = (this && this.__metadata) || function (k, v) {
3728
+ var __metadata$j = (this && this.__metadata) || function (k, v) {
3732
3729
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3733
3730
  return Reflect.metadata(k, v);
3734
3731
  };
3735
- var __awaiter$h = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3732
+ var __awaiter$i = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3736
3733
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3737
3734
  return new (P || (P = Promise))(function (resolve, reject) {
3738
3735
  function fulfilled(value) { try {
@@ -3762,7 +3759,7 @@
3762
3759
  }
3763
3760
  Gallery.prototype.getFolder = function (folder, size) {
3764
3761
  if (size === void 0) { size = null; }
3765
- return __awaiter$h(this, void 0, void 0, function () {
3762
+ return __awaiter$i(this, void 0, void 0, function () {
3766
3763
  var _this = this;
3767
3764
  return __generator(this, function (_a) {
3768
3765
  this.cache[folder] = this.cache[folder] || new Promise(function (resolve) {
@@ -3787,7 +3784,7 @@
3787
3784
  return;
3788
3785
  }
3789
3786
  var promises = files.map(function (file) {
3790
- return new Promise(function (resolve) { return __awaiter$h(_this, void 0, void 0, function () {
3787
+ return new Promise(function (resolve) { return __awaiter$i(_this, void 0, void 0, function () {
3791
3788
  var filePath, absoluteFilePath;
3792
3789
  var _this = this;
3793
3790
  return __generator(this, function (_a) {
@@ -3823,7 +3820,7 @@
3823
3820
  });
3824
3821
  },
3825
3822
  writeResult: function (isThumb, buffer) {
3826
- return new Promise(function (res, rej) { return __awaiter$h(_this, void 0, void 0, function () {
3823
+ return new Promise(function (res, rej) { return __awaiter$i(_this, void 0, void 0, function () {
3827
3824
  var resultPath;
3828
3825
  return __generator(this, function (_a) {
3829
3826
  switch (_a.label) {
@@ -3877,13 +3874,13 @@
3877
3874
  };
3878
3875
  return Gallery;
3879
3876
  }());
3880
- exports.Gallery = __decorate$m([
3877
+ exports.Gallery = __decorate$n([
3881
3878
  tsyringe.injectable(),
3882
3879
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
3883
- __metadata$i("design:paramtypes", [exports.Configuration, exports.GalleryCache])
3880
+ __metadata$j("design:paramtypes", [exports.Configuration, exports.GalleryCache])
3884
3881
  ], exports.Gallery);
3885
3882
 
3886
- var __decorate$l = (this && this.__decorate) || function (decorators, target, key, desc) {
3883
+ var __decorate$m = (this && this.__decorate) || function (decorators, target, key, desc) {
3887
3884
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3888
3885
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3889
3886
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3893,11 +3890,11 @@
3893
3890
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3894
3891
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3895
3892
  };
3896
- var __metadata$h = (this && this.__metadata) || function (k, v) {
3893
+ var __metadata$i = (this && this.__metadata) || function (k, v) {
3897
3894
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3898
3895
  return Reflect.metadata(k, v);
3899
3896
  };
3900
- var __awaiter$g = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3897
+ var __awaiter$h = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3901
3898
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3902
3899
  return new (P || (P = Promise))(function (resolve, reject) {
3903
3900
  function fulfilled(value) { try {
@@ -3925,7 +3922,7 @@
3925
3922
  this.parts = config.resolve("idParts");
3926
3923
  }
3927
3924
  IdGenerator.prototype.generate = function (checkCb) {
3928
- return __awaiter$g(this, void 0, void 0, function () {
3925
+ return __awaiter$h(this, void 0, void 0, function () {
3929
3926
  var id, tries, notGood;
3930
3927
  return __generator(this, function (_a) {
3931
3928
  switch (_a.label) {
@@ -3964,13 +3961,13 @@
3964
3961
  };
3965
3962
  return IdGenerator;
3966
3963
  }());
3967
- exports.IdGenerator = __decorate$l([
3964
+ exports.IdGenerator = __decorate$m([
3968
3965
  tsyringe.injectable(),
3969
3966
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
3970
- __metadata$h("design:paramtypes", [exports.Configuration])
3967
+ __metadata$i("design:paramtypes", [exports.Configuration])
3971
3968
  ], exports.IdGenerator);
3972
3969
 
3973
- var __decorate$k = (this && this.__decorate) || function (decorators, target, key, desc) {
3970
+ var __decorate$l = (this && this.__decorate) || function (decorators, target, key, desc) {
3974
3971
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3975
3972
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3976
3973
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3980,7 +3977,7 @@
3980
3977
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3981
3978
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3982
3979
  };
3983
- var __metadata$g = (this && this.__metadata) || function (k, v) {
3980
+ var __metadata$h = (this && this.__metadata) || function (k, v) {
3984
3981
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3985
3982
  return Reflect.metadata(k, v);
3986
3983
  };
@@ -3997,13 +3994,12 @@
3997
3994
  };
3998
3995
  return TranslationProvider;
3999
3996
  }());
4000
- exports.TranslationProvider = __decorate$k([
4001
- tsyringe.injectable(),
3997
+ exports.TranslationProvider = __decorate$l([
4002
3998
  tsyringe.singleton(),
4003
- __metadata$g("design:paramtypes", [exports.Configuration])
3999
+ __metadata$h("design:paramtypes", [exports.Configuration])
4004
4000
  ], exports.TranslationProvider);
4005
4001
 
4006
- var __decorate$j = (this && this.__decorate) || function (decorators, target, key, desc) {
4002
+ var __decorate$k = (this && this.__decorate) || function (decorators, target, key, desc) {
4007
4003
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4008
4004
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4009
4005
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4013,11 +4009,11 @@
4013
4009
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4014
4010
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4015
4011
  };
4016
- var __metadata$f = (this && this.__metadata) || function (k, v) {
4012
+ var __metadata$g = (this && this.__metadata) || function (k, v) {
4017
4013
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
4018
4014
  return Reflect.metadata(k, v);
4019
4015
  };
4020
- var __awaiter$f = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4016
+ var __awaiter$g = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4021
4017
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4022
4018
  return new (P || (P = Promise))(function (resolve, reject) {
4023
4019
  function fulfilled(value) { try {
@@ -4042,7 +4038,7 @@
4042
4038
  this.cache = {};
4043
4039
  }
4044
4040
  Translator.prototype.getDictionary = function (language) {
4045
- return __awaiter$f(this, void 0, void 0, function () {
4041
+ return __awaiter$g(this, void 0, void 0, function () {
4046
4042
  var dictionary;
4047
4043
  return __generator(this, function (_a) {
4048
4044
  switch (_a.label) {
@@ -4107,13 +4103,13 @@
4107
4103
  };
4108
4104
  return Translator;
4109
4105
  }());
4110
- exports.Translator = __decorate$j([
4106
+ exports.Translator = __decorate$k([
4111
4107
  tsyringe.injectable(),
4112
4108
  tsyringe.singleton(),
4113
- __metadata$f("design:paramtypes", [exports.TranslationProvider])
4109
+ __metadata$g("design:paramtypes", [exports.TranslationProvider])
4114
4110
  ], exports.Translator);
4115
4111
 
4116
- var __decorate$i = (this && this.__decorate) || function (decorators, target, key, desc) {
4112
+ var __decorate$j = (this && this.__decorate) || function (decorators, target, key, desc) {
4117
4113
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4118
4114
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4119
4115
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4123,11 +4119,11 @@
4123
4119
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4124
4120
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4125
4121
  };
4126
- var __metadata$e = (this && this.__metadata) || function (k, v) {
4122
+ var __metadata$f = (this && this.__metadata) || function (k, v) {
4127
4123
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
4128
4124
  return Reflect.metadata(k, v);
4129
4125
  };
4130
- var __awaiter$e = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4126
+ var __awaiter$f = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4131
4127
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4132
4128
  return new (P || (P = Promise))(function (resolve, reject) {
4133
4129
  function fulfilled(value) { try {
@@ -4170,11 +4166,11 @@
4170
4166
  return this.initPromise;
4171
4167
  };
4172
4168
  TemplateRenderer.prototype.parseTemplates = function (dir, dirPath) {
4173
- return __awaiter$e(this, void 0, void 0, function () {
4169
+ return __awaiter$f(this, void 0, void 0, function () {
4174
4170
  var _this = this;
4175
4171
  return __generator(this, function (_a) {
4176
4172
  return [2 /*return*/, new Promise(function (resolve) {
4177
- fs.readdir(dir, function (err, files) { return __awaiter$e(_this, void 0, void 0, function () {
4173
+ fs.readdir(dir, function (err, files) { return __awaiter$f(_this, void 0, void 0, function () {
4178
4174
  var files_1, files_1_1, file, path$1, parts, name, fullName, content, e_1_1;
4179
4175
  var e_1, _a;
4180
4176
  return __generator(this, function (_b) {
@@ -4226,7 +4222,7 @@
4226
4222
  });
4227
4223
  };
4228
4224
  TemplateRenderer.prototype.render = function (template, language, context) {
4229
- return __awaiter$e(this, void 0, void 0, function () {
4225
+ return __awaiter$f(this, void 0, void 0, function () {
4230
4226
  var res, _a;
4231
4227
  return __generator(this, function (_b) {
4232
4228
  switch (_b.label) {
@@ -4256,13 +4252,13 @@
4256
4252
  };
4257
4253
  return TemplateRenderer;
4258
4254
  }());
4259
- exports.TemplateRenderer = __decorate$i([
4255
+ exports.TemplateRenderer = __decorate$j([
4260
4256
  tsyringe.injectable(),
4261
4257
  tsyringe.singleton(),
4262
- __metadata$e("design:paramtypes", [exports.Translator, exports.Configuration])
4258
+ __metadata$f("design:paramtypes", [exports.Translator, exports.Configuration])
4263
4259
  ], exports.TemplateRenderer);
4264
4260
 
4265
- var __decorate$h = (this && this.__decorate) || function (decorators, target, key, desc) {
4261
+ var __decorate$i = (this && this.__decorate) || function (decorators, target, key, desc) {
4266
4262
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4267
4263
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4268
4264
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4272,11 +4268,11 @@
4272
4268
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4273
4269
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4274
4270
  };
4275
- var __metadata$d = (this && this.__metadata) || function (k, v) {
4271
+ var __metadata$e = (this && this.__metadata) || function (k, v) {
4276
4272
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
4277
4273
  return Reflect.metadata(k, v);
4278
4274
  };
4279
- var __awaiter$d = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4275
+ var __awaiter$e = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4280
4276
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4281
4277
  return new (P || (P = Promise))(function (resolve, reject) {
4282
4278
  function fulfilled(value) { try {
@@ -4316,7 +4312,7 @@
4316
4312
  configurable: true
4317
4313
  });
4318
4314
  MailSender.prototype.sendMail = function (language, options) {
4319
- return __awaiter$d(this, void 0, void 0, function () {
4315
+ return __awaiter$e(this, void 0, void 0, function () {
4320
4316
  var subject, html;
4321
4317
  return __generator(this, function (_a) {
4322
4318
  switch (_a.label) {
@@ -4339,13 +4335,12 @@
4339
4335
  };
4340
4336
  return MailSender;
4341
4337
  }());
4342
- exports.MailSender = __decorate$h([
4343
- tsyringe.injectable(),
4338
+ exports.MailSender = __decorate$i([
4344
4339
  tsyringe.singleton(),
4345
- __metadata$d("design:paramtypes", [exports.Configuration, exports.TemplateRenderer])
4340
+ __metadata$e("design:paramtypes", [exports.Configuration, exports.TemplateRenderer])
4346
4341
  ], exports.MailSender);
4347
4342
 
4348
- var __decorate$g = (this && this.__decorate) || function (decorators, target, key, desc) {
4343
+ var __decorate$h = (this && this.__decorate) || function (decorators, target, key, desc) {
4349
4344
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4350
4345
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4351
4346
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4355,11 +4350,11 @@
4355
4350
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4356
4351
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4357
4352
  };
4358
- var __metadata$c = (this && this.__metadata) || function (k, v) {
4353
+ var __metadata$d = (this && this.__metadata) || function (k, v) {
4359
4354
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
4360
4355
  return Reflect.metadata(k, v);
4361
4356
  };
4362
- var __awaiter$c = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4357
+ var __awaiter$d = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4363
4358
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4364
4359
  return new (P || (P = Promise))(function (resolve, reject) {
4365
4360
  function fulfilled(value) { try {
@@ -4386,7 +4381,7 @@
4386
4381
  MemoryCache.prototype.set = function (key, value, ttl, expirationTimestamp, tags) {
4387
4382
  if (expirationTimestamp === void 0) { expirationTimestamp = null; }
4388
4383
  if (tags === void 0) { tags = {}; }
4389
- return __awaiter$c(this, void 0, void 0, function () {
4384
+ return __awaiter$d(this, void 0, void 0, function () {
4390
4385
  var now, expTimestamp;
4391
4386
  return __generator(this, function (_a) {
4392
4387
  now = Math.round(new Date().getTime() / 1000);
@@ -4402,7 +4397,7 @@
4402
4397
  });
4403
4398
  };
4404
4399
  MemoryCache.prototype.get = function (key) {
4405
- return __awaiter$c(this, void 0, void 0, function () {
4400
+ return __awaiter$d(this, void 0, void 0, function () {
4406
4401
  var item, now, expTimestamp, value;
4407
4402
  return __generator(this, function (_a) {
4408
4403
  switch (_a.label) {
@@ -4433,7 +4428,7 @@
4433
4428
  MemoryCache.prototype.getOrSet = function (key, valueCb, ttl, expirationTimestamp, tags) {
4434
4429
  if (expirationTimestamp === void 0) { expirationTimestamp = null; }
4435
4430
  if (tags === void 0) { tags = {}; }
4436
- return __awaiter$c(this, void 0, void 0, function () {
4431
+ return __awaiter$d(this, void 0, void 0, function () {
4437
4432
  var e_1, _a, _b;
4438
4433
  return __generator(this, function (_c) {
4439
4434
  switch (_c.label) {
@@ -4454,7 +4449,7 @@
4454
4449
  });
4455
4450
  };
4456
4451
  MemoryCache.prototype.delete = function (key) {
4457
- return __awaiter$c(this, void 0, void 0, function () {
4452
+ return __awaiter$d(this, void 0, void 0, function () {
4458
4453
  return __generator(this, function (_a) {
4459
4454
  switch (_a.label) {
4460
4455
  case 0:
@@ -4469,13 +4464,13 @@
4469
4464
  };
4470
4465
  return MemoryCache;
4471
4466
  }());
4472
- exports.MemoryCache = __decorate$g([
4467
+ exports.MemoryCache = __decorate$h([
4473
4468
  tsyringe.injectable(),
4474
4469
  tsyringe.scoped(tsyringe.Lifecycle.ContainerScoped),
4475
- __metadata$c("design:paramtypes", [exports.Cache])
4470
+ __metadata$d("design:paramtypes", [exports.Cache])
4476
4471
  ], exports.MemoryCache);
4477
4472
 
4478
- var __decorate$f = (this && this.__decorate) || function (decorators, target, key, desc) {
4473
+ var __decorate$g = (this && this.__decorate) || function (decorators, target, key, desc) {
4479
4474
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4480
4475
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4481
4476
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4516,7 +4511,7 @@
4516
4511
  };
4517
4512
  return IsFile;
4518
4513
  }());
4519
- exports.IsFile = __decorate$f([
4514
+ exports.IsFile = __decorate$g([
4520
4515
  classValidator.ValidatorConstraint()
4521
4516
  ], exports.IsFile);
4522
4517
  exports.IsObjectId = /** @class */ (function () {
@@ -4528,11 +4523,11 @@
4528
4523
  };
4529
4524
  return IsObjectId;
4530
4525
  }());
4531
- exports.IsObjectId = __decorate$f([
4526
+ exports.IsObjectId = __decorate$g([
4532
4527
  classValidator.ValidatorConstraint()
4533
4528
  ], exports.IsObjectId);
4534
4529
 
4535
- var __decorate$e = (this && this.__decorate) || function (decorators, target, key, desc) {
4530
+ var __decorate$f = (this && this.__decorate) || function (decorators, target, key, desc) {
4536
4531
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4537
4532
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4538
4533
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4542,14 +4537,14 @@
4542
4537
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4543
4538
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4544
4539
  };
4545
- var __metadata$b = (this && this.__metadata) || function (k, v) {
4540
+ var __metadata$c = (this && this.__metadata) || function (k, v) {
4546
4541
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
4547
4542
  return Reflect.metadata(k, v);
4548
4543
  };
4549
4544
  var __param$6 = (this && this.__param) || function (paramIndex, decorator) {
4550
4545
  return function (target, key) { decorator(target, key, paramIndex); };
4551
4546
  };
4552
- var __awaiter$b = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4547
+ var __awaiter$c = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4553
4548
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4554
4549
  return new (P || (P = Promise))(function (resolve, reject) {
4555
4550
  function fulfilled(value) { try {
@@ -4594,15 +4589,18 @@
4594
4589
  });
4595
4590
  OpenApi.prototype.schemaToExample = function (src, req) {
4596
4591
  var _a, _b, _c;
4597
- return __awaiter$b(this, void 0, void 0, function () {
4598
- var schemas, schema, result_1;
4592
+ return __awaiter$c(this, void 0, void 0, function () {
4593
+ var schemas, schema_1, schema, result_1;
4599
4594
  var _this = this;
4600
4595
  return __generator(this, function (_d) {
4601
4596
  switch (_d.label) {
4602
4597
  case 0:
4603
4598
  if (src.$ref) {
4604
4599
  schemas = this.apiDocs.components.schemas;
4605
- return [2 /*return*/, this.schemaToExample(schemas[src.$ref.replace("#/components/schemas/", "")], req)];
4600
+ schema_1 = src.$ref
4601
+ .replace("#/components/schemas/", "")
4602
+ .replace("#/definitions/", "");
4603
+ return [2 /*return*/, this.schemaToExample(schemas[schema_1], req)];
4606
4604
  }
4607
4605
  schema = src;
4608
4606
  if (schema.oneOf) {
@@ -4610,7 +4608,7 @@
4610
4608
  }
4611
4609
  if (!(schema.type === "object")) return [3 /*break*/, 2];
4612
4610
  result_1 = {};
4613
- return [4 /*yield*/, Promise.all(Object.keys(schema.properties).map(function (key) { return __awaiter$b(_this, void 0, void 0, function () {
4611
+ return [4 /*yield*/, Promise.all(Object.keys(schema.properties).map(function (key) { return __awaiter$c(_this, void 0, void 0, function () {
4614
4612
  var _d, _e;
4615
4613
  return __generator(this, function (_f) {
4616
4614
  switch (_f.label) {
@@ -4700,13 +4698,92 @@
4700
4698
  };
4701
4699
  return OpenApi;
4702
4700
  }());
4703
- exports.OpenApi = __decorate$e([
4701
+ exports.OpenApi = __decorate$f([
4704
4702
  tsyringe.singleton(),
4705
4703
  __param$6(0, tsyringe.inject(DI_CONTAINER)),
4706
4704
  __param$6(1, tsyringe.inject(OPENAPI_VALIDATION)),
4707
- __metadata$b("design:paramtypes", [Object, Object])
4705
+ __metadata$c("design:paramtypes", [Object, Object])
4708
4706
  ], exports.OpenApi);
4709
4707
 
4708
+ var __decorate$e = (this && this.__decorate) || function (decorators, target, key, desc) {
4709
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4710
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4711
+ r = Reflect.decorate(decorators, target, key, desc);
4712
+ else
4713
+ for (var i = decorators.length - 1; i >= 0; i--)
4714
+ if (d = decorators[i])
4715
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4716
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
4717
+ };
4718
+ var __metadata$b = (this && this.__metadata) || function (k, v) {
4719
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
4720
+ return Reflect.metadata(k, v);
4721
+ };
4722
+ var __awaiter$b = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4723
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4724
+ return new (P || (P = Promise))(function (resolve, reject) {
4725
+ function fulfilled(value) { try {
4726
+ step(generator.next(value));
4727
+ }
4728
+ catch (e) {
4729
+ reject(e);
4730
+ } }
4731
+ function rejected(value) { try {
4732
+ step(generator["throw"](value));
4733
+ }
4734
+ catch (e) {
4735
+ reject(e);
4736
+ } }
4737
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
4738
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
4739
+ });
4740
+ };
4741
+ exports.TokenGenerator = /** @class */ (function () {
4742
+ function TokenGenerator() {
4743
+ this.chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
4744
+ }
4745
+ TokenGenerator.prototype.generate = function (checkCb) {
4746
+ return __awaiter$b(this, void 0, void 0, function () {
4747
+ var token, tries, notGood;
4748
+ return __generator(this, function (_a) {
4749
+ switch (_a.label) {
4750
+ case 0:
4751
+ token = null;
4752
+ tries = 0;
4753
+ notGood = true;
4754
+ _a.label = 1;
4755
+ case 1:
4756
+ if (!(notGood && tries < 5)) return [3 /*break*/, 3];
4757
+ token = this.generateToken();
4758
+ return [4 /*yield*/, checkCb(token)];
4759
+ case 2:
4760
+ notGood = _a.sent();
4761
+ tries++;
4762
+ return [3 /*break*/, 1];
4763
+ case 3:
4764
+ if (notGood) {
4765
+ throw new Error("Couldn't generate an unique token..");
4766
+ }
4767
+ return [2 /*return*/, token];
4768
+ }
4769
+ });
4770
+ });
4771
+ };
4772
+ TokenGenerator.prototype.generateToken = function () {
4773
+ var s = "";
4774
+ for (var i = 0; i < 15; i++) {
4775
+ var ix = rand(0, this.chars.length - 1);
4776
+ s += this.chars[ix];
4777
+ }
4778
+ return s;
4779
+ };
4780
+ return TokenGenerator;
4781
+ }());
4782
+ exports.TokenGenerator = __decorate$e([
4783
+ tsyringe.singleton(),
4784
+ __metadata$b("design:paramtypes", [])
4785
+ ], exports.TokenGenerator);
4786
+
4710
4787
  var __decorate$d = (this && this.__decorate) || function (decorators, target, key, desc) {
4711
4788
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4712
4789
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -6056,32 +6133,42 @@
6056
6133
  var PrimitiveArray = mongoose.Types.Array;
6057
6134
  var DocumentArray = mongoose.Types.DocumentArray;
6058
6135
 
6059
- function IsDocumented(summary) {
6136
+ function IsDocumented(summary, paramDescriptions) {
6060
6137
  if (summary === void 0) { summary = null; }
6061
- return routingControllersOpenapi.OpenAPI(function (operation) {
6062
- operation.summary = summary || operation.summary;
6063
- operation.tags = ["Documented"].concat(operation.tags || []);
6064
- return operation;
6138
+ if (paramDescriptions === void 0) { paramDescriptions = {}; }
6139
+ return routingControllersOpenapi.OpenAPI(function (op) {
6140
+ var _a;
6141
+ op.summary = summary || op.summary;
6142
+ op.tags = ["Documented"].concat(op.tags || []);
6143
+ (_a = op.parameters) === null || _a === void 0 ? void 0 : _a.forEach(function (p) {
6144
+ if (p.$ref)
6145
+ return;
6146
+ var schema = p;
6147
+ schema.description = paramDescriptions[schema.name]
6148
+ || schema.description
6149
+ || ("param." + op.operationId + "." + schema.name).toLowerCase();
6150
+ });
6151
+ return op;
6065
6152
  });
6066
6153
  }
6067
6154
  function JsonResponse(description, statusCode) {
6068
6155
  if (description === void 0) { description = "Success"; }
6069
6156
  if (statusCode === void 0) { statusCode = null; }
6070
- return routingControllersOpenapi.OpenAPI(function (operation, route) {
6157
+ return routingControllersOpenapi.OpenAPI(function (op, route) {
6071
6158
  var status = statusCode !== null && statusCode !== void 0 ? statusCode : routingControllersOpenapi.getStatusCode(route) + "";
6072
- operation.responses = operation.responses || {};
6073
- operation.responses[status] = {
6159
+ op.responses = op.responses || {};
6160
+ op.responses[status] = {
6074
6161
  description: description,
6075
6162
  content: {
6076
6163
  "application/json": {}
6077
6164
  }
6078
6165
  };
6079
- return operation;
6166
+ return op;
6080
6167
  });
6081
6168
  }
6082
6169
  function ResponseType(type, options) {
6083
6170
  if (options === void 0) { options = {}; }
6084
- return routingControllersOpenapi.OpenAPI(function (operation, route) {
6171
+ return routingControllersOpenapi.OpenAPI(function (op, route) {
6085
6172
  var _b;
6086
6173
  var _a;
6087
6174
  var contentType = "application/json";
@@ -6092,8 +6179,8 @@
6092
6179
  var schema = options.isArray
6093
6180
  ? { items: reference, type: "array" }
6094
6181
  : reference;
6095
- operation.responses = operation.responses || {};
6096
- operation.responses[statusCode] = {
6182
+ op.responses = op.responses || {};
6183
+ op.responses[statusCode] = {
6097
6184
  description: options.description || "Success",
6098
6185
  content: (_b = {},
6099
6186
  _b[contentType] = {
@@ -6101,7 +6188,7 @@
6101
6188
  },
6102
6189
  _b)
6103
6190
  };
6104
- return operation;
6191
+ return op;
6105
6192
  });
6106
6193
  }
6107
6194
 
@@ -6582,6 +6669,7 @@
6582
6669
  exports.OpenApi,
6583
6670
  exports.Progresses,
6584
6671
  exports.TemplateRenderer,
6672
+ exports.TokenGenerator,
6585
6673
  exports.TranslationProvider,
6586
6674
  exports.Translator,
6587
6675
  exports.UserManager