@super-protocol/sdk-js 0.15.0 → 0.15.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/build/TIIGenerator.js +129 -239
  2. package/build/connectors/BaseConnector.js +17 -47
  3. package/build/connectors/BlockchainConnector.js +222 -348
  4. package/build/connectors/BlockchainEventsListener.js +38 -92
  5. package/build/contracts/app.json +466 -35
  6. package/build/crypto/Crypto.js +63 -135
  7. package/build/crypto/index.js +1 -1
  8. package/build/crypto/nodejs/AES.js +62 -119
  9. package/build/crypto/nodejs/ARIA.js +61 -118
  10. package/build/crypto/nodejs/ECIES.js +51 -87
  11. package/build/crypto/nodejs/NativeCrypto.js +64 -118
  12. package/build/crypto/nodejs/RSA-Hybrid.js +54 -113
  13. package/build/index.d.ts +5 -0
  14. package/build/index.js +14 -2
  15. package/build/logger.d.ts +3 -1
  16. package/build/logger.js +2 -2
  17. package/build/models/EtlModel.js +65 -114
  18. package/build/models/Offer.js +227 -462
  19. package/build/models/Order.d.ts +4 -0
  20. package/build/models/Order.js +326 -559
  21. package/build/models/Provider.d.ts +2 -0
  22. package/build/models/Provider.js +74 -153
  23. package/build/models/TCB.js +67 -171
  24. package/build/models/TeeOffer.d.ts +1 -0
  25. package/build/models/TeeOffer.js +389 -731
  26. package/build/proto/Compression.js +20 -21
  27. package/build/proto/TRI.js +46 -50
  28. package/build/proto/TeeProperties.js +60 -66
  29. package/build/providers/storage/ChunksDownloadDecorator.d.ts +1 -1
  30. package/build/providers/storage/ChunksDownloadDecorator.js +125 -235
  31. package/build/providers/storage/IStorageProvider.d.ts +1 -1
  32. package/build/providers/storage/S3StorageProvider.js +173 -298
  33. package/build/providers/storage/StorageAdapter.d.ts +60 -0
  34. package/build/providers/storage/StorageAdapter.js +322 -0
  35. package/build/providers/storage/StorageContentWriter.d.ts +46 -0
  36. package/build/providers/storage/StorageContentWriter.js +182 -0
  37. package/build/providers/storage/StorageKeyValueAdapter.d.ts +23 -0
  38. package/build/providers/storage/StorageKeyValueAdapter.js +157 -0
  39. package/build/providers/storage/StorageMetadataReader.d.ts +20 -0
  40. package/build/providers/storage/StorageMetadataReader.js +67 -0
  41. package/build/providers/storage/StorjAdapter.d.ts +19 -0
  42. package/build/providers/storage/StorjAdapter.js +73 -0
  43. package/build/providers/storage/StorjStorageProvider.js +138 -315
  44. package/build/providers/storage/getStorageProvider.js +7 -7
  45. package/build/providers/storage/types.d.ts +7 -0
  46. package/build/providers/storage/types.js +2 -0
  47. package/build/staticModels/ActiveOffers.js +32 -100
  48. package/build/staticModels/ActiveOrders.js +42 -120
  49. package/build/staticModels/BaseStaticModel.js +7 -10
  50. package/build/staticModels/Consensus.d.ts +4 -1
  51. package/build/staticModels/Consensus.js +164 -220
  52. package/build/staticModels/Deposits.js +109 -201
  53. package/build/staticModels/Marks.js +21 -82
  54. package/build/staticModels/ModelPackager.js +34 -84
  55. package/build/staticModels/Offers.js +140 -266
  56. package/build/staticModels/Orders.d.ts +1 -0
  57. package/build/staticModels/Orders.js +286 -429
  58. package/build/staticModels/ProviderRegistry.js +114 -225
  59. package/build/staticModels/Superpro.js +17 -63
  60. package/build/staticModels/SuperproToken.js +90 -169
  61. package/build/staticModels/TeeOffers.js +220 -416
  62. package/build/store.js +2 -2
  63. package/build/types/HardwareInfo.js +2 -2
  64. package/build/types/Order.js +4 -4
  65. package/build/types/Provider.js +1 -1
  66. package/build/types/TeeOfferInfo.js +1 -1
  67. package/build/types/TeeOfferOption.js +2 -2
  68. package/build/types/TeeOfferSlot.js +2 -2
  69. package/build/types/ValueOfferSlot.js +3 -3
  70. package/build/utils/Monitoring.js +24 -28
  71. package/build/utils/NonceTracker.js +56 -121
  72. package/build/utils/PubSub.d.ts +9 -0
  73. package/build/utils/PubSub.js +36 -0
  74. package/build/utils/TxManager.js +121 -215
  75. package/build/utils/compressors/GzipCompressor.js +13 -50
  76. package/build/utils/compressors/UncompressedCompressor.js +10 -13
  77. package/build/utils/helpers/tryWithInterval.js +34 -78
  78. package/build/utils/resourceLoaders/BaseResourceLoader.js +26 -78
  79. package/build/utils/resourceLoaders/StorageProviderLoader.js +33 -97
  80. package/build/utils/resourceLoaders/UrlResourceLoader.js +29 -93
  81. package/build/utils/resourceLoaders/getResourceLoader.js +6 -6
  82. package/build/utils.js +60 -105
  83. package/package.json +4 -1
@@ -1,19 +1,4 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -23,33 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
24
9
  });
25
10
  };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
11
  var __asyncValues = (this && this.__asyncValues) || function (o) {
54
12
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
55
13
  var m = o[Symbol.asyncIterator], i;
@@ -59,228 +17,160 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
59
17
  };
60
18
  Object.defineProperty(exports, "__esModule", { value: true });
61
19
  exports.DownloadDecorator = exports.createDownloadChunkMethodWithRetry = exports.downloadChunkMethod = void 0;
62
- var stream_1 = require("stream");
63
- function generateChunks(dataSize, chunkSize, startOffset) {
64
- var chunk, offset;
65
- if (startOffset === void 0) { startOffset = BigInt(0); }
66
- return __generator(this, function (_a) {
67
- switch (_a.label) {
68
- case 0:
69
- chunk = 0;
70
- offset = startOffset;
71
- _a.label = 1;
72
- case 1:
73
- if (!(dataSize > offset)) return [3 /*break*/, 3];
74
- return [4 /*yield*/, {
75
- offset: offset,
76
- length: chunkSize > dataSize - offset ? Number(dataSize - offset) : chunkSize,
77
- dataSize: dataSize,
78
- chunk: chunk++,
79
- chunksCount: Math.ceil(Number(dataSize / BigInt(chunkSize))),
80
- }];
81
- case 2:
82
- _a.sent();
83
- offset += BigInt(chunkSize);
84
- return [3 /*break*/, 1];
85
- case 3: return [2 /*return*/];
86
- }
87
- });
20
+ const stream_1 = require("stream");
21
+ function* generateChunks(dataSize, chunkSize, startOffset = BigInt(0)) {
22
+ let chunk = 0;
23
+ let offset = startOffset;
24
+ while (dataSize > offset) {
25
+ yield {
26
+ offset,
27
+ length: chunkSize > dataSize - offset ? Number(dataSize - offset) : chunkSize,
28
+ dataSize,
29
+ chunk: chunk++,
30
+ chunksCount: Math.ceil(Number(dataSize / BigInt(chunkSize))),
31
+ };
32
+ offset += BigInt(chunkSize);
33
+ }
88
34
  }
89
- var ChunkedReadableTransform = /** @class */ (function (_super) {
90
- __extends(ChunkedReadableTransform, _super);
91
- function ChunkedReadableTransform(downloadChunk, params) {
92
- var _this = _super.call(this, {
35
+ class ChunkedReadableTransform extends stream_1.Transform {
36
+ constructor(downloadChunk, params) {
37
+ super({
93
38
  objectMode: true,
94
39
  highWaterMark: params.concurrency,
95
- }) || this;
96
- _this.downloadChunk = downloadChunk;
97
- return _this;
40
+ });
41
+ this.downloadChunk = downloadChunk;
98
42
  }
99
- ChunkedReadableTransform.prototype._transform = function (chunk, encoding, callback) {
100
- var resultPromise = this.downloadChunk(chunk);
43
+ _transform(chunk, encoding, callback) {
44
+ const resultPromise = this.downloadChunk(chunk);
101
45
  callback(null, {
102
- resultPromise: resultPromise,
103
- chunk: chunk,
46
+ resultPromise,
47
+ chunk,
104
48
  });
105
- };
106
- return ChunkedReadableTransform;
107
- }(stream_1.Transform));
108
- var ChainedChunksReadableTransform = /** @class */ (function (_super) {
109
- __extends(ChainedChunksReadableTransform, _super);
110
- function ChainedChunksReadableTransform(progressListener) {
111
- var _this = _super.call(this, {
49
+ }
50
+ }
51
+ class ChainedChunksReadableTransform extends stream_1.Transform {
52
+ constructor(progressListener) {
53
+ super({
112
54
  objectMode: true,
113
55
  highWaterMark: 1,
114
- }) || this;
115
- _this.progressListener = progressListener;
116
- return _this;
56
+ });
57
+ this.progressListener = progressListener;
117
58
  }
118
- ChainedChunksReadableTransform.prototype._transform = function (obj, encoding, callback) {
119
- var _this = this;
120
- obj.resultPromise.then(function (data) {
59
+ _transform(obj, encoding, callback) {
60
+ obj.resultPromise.then((data) => {
121
61
  callback(null, data);
122
- if (_this.progressListener) {
123
- _this.progressListener(Number(obj.chunk.dataSize), Number(obj.chunk.offset) + obj.chunk.length);
62
+ if (this.progressListener) {
63
+ this.progressListener(Number(obj.chunk.dataSize), Number(obj.chunk.offset) + obj.chunk.length);
124
64
  }
125
- }, function (err) {
65
+ }, (err) => {
126
66
  callback(err);
127
67
  });
128
- };
129
- return ChainedChunksReadableTransform;
130
- }(stream_1.Transform));
131
- var downloadChunkMethod = function (provider, objectPath, chunk) { return __awaiter(void 0, void 0, void 0, function () {
132
- var position, buffer, dataStream, _a, dataStream_1, dataStream_1_1, data, e_1_1;
133
- var _b, e_1, _c, _d;
134
- return __generator(this, function (_e) {
135
- switch (_e.label) {
136
- case 0:
137
- position = 0;
138
- buffer = Buffer.alloc(chunk.length);
139
- return [4 /*yield*/, provider.downloadFile(objectPath, {
140
- offset: Number(chunk.offset),
141
- length: chunk.length,
142
- })];
143
- case 1:
144
- dataStream = _e.sent();
145
- _e.label = 2;
146
- case 2:
147
- _e.trys.push([2, 7, 8, 13]);
148
- _a = true, dataStream_1 = __asyncValues(dataStream);
149
- _e.label = 3;
150
- case 3: return [4 /*yield*/, dataStream_1.next()];
151
- case 4:
152
- if (!(dataStream_1_1 = _e.sent(), _b = dataStream_1_1.done, !_b)) return [3 /*break*/, 6];
153
- _d = dataStream_1_1.value;
154
- _a = false;
155
- try {
156
- data = _d;
157
- data.copy(buffer, position);
158
- position += data.length;
159
- if (position > chunk.length) {
160
- throw new Error("Chunk buffer is overflow, read data is more than requested for chunk");
161
- }
162
- }
163
- finally {
164
- _a = true;
68
+ }
69
+ }
70
+ const downloadChunkMethod = (provider, objectPath, chunk) => __awaiter(void 0, void 0, void 0, function* () {
71
+ var _a, e_1, _b, _c;
72
+ let position = 0;
73
+ const buffer = Buffer.alloc(chunk.length);
74
+ const dataStream = yield provider.downloadFile(objectPath, {
75
+ offset: Number(chunk.offset),
76
+ length: chunk.length,
77
+ });
78
+ try {
79
+ for (var _d = true, dataStream_1 = __asyncValues(dataStream), dataStream_1_1; dataStream_1_1 = yield dataStream_1.next(), _a = dataStream_1_1.done, !_a;) {
80
+ _c = dataStream_1_1.value;
81
+ _d = false;
82
+ try {
83
+ const data = _c;
84
+ data.copy(buffer, position);
85
+ position += data.length;
86
+ if (position > chunk.length) {
87
+ throw new Error("Chunk buffer is overflow, read data is more than requested for chunk");
165
88
  }
166
- _e.label = 5;
167
- case 5: return [3 /*break*/, 3];
168
- case 6: return [3 /*break*/, 13];
169
- case 7:
170
- e_1_1 = _e.sent();
171
- e_1 = { error: e_1_1 };
172
- return [3 /*break*/, 13];
173
- case 8:
174
- _e.trys.push([8, , 11, 12]);
175
- if (!(!_a && !_b && (_c = dataStream_1.return))) return [3 /*break*/, 10];
176
- return [4 /*yield*/, _c.call(dataStream_1)];
177
- case 9:
178
- _e.sent();
179
- _e.label = 10;
180
- case 10: return [3 /*break*/, 12];
181
- case 11:
182
- if (e_1) throw e_1.error;
183
- return [7 /*endfinally*/];
184
- case 12: return [7 /*endfinally*/];
185
- case 13: return [2 /*return*/, buffer];
89
+ }
90
+ finally {
91
+ _d = true;
92
+ }
186
93
  }
187
- });
188
- }); };
94
+ }
95
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
96
+ finally {
97
+ try {
98
+ if (!_d && !_a && (_b = dataStream_1.return)) yield _b.call(dataStream_1);
99
+ }
100
+ finally { if (e_1) throw e_1.error; }
101
+ }
102
+ return buffer;
103
+ });
189
104
  exports.downloadChunkMethod = downloadChunkMethod;
190
- var createDownloadChunkMethodWithRetry = function (downloadChunkMethod, _a) {
191
- var _b = _a === void 0 ? {} : _a, _c = _b.retryMaxCount, retryMaxCount = _c === void 0 ? 3 : _c, _d = _b.retryWaitTimeFactory, retryWaitTimeFactory = _d === void 0 ? function () { return function () { return 1000; }; } : _d, onRetry = _b.onRetry;
192
- return function (provider, objectPath, chunk) { return __awaiter(void 0, void 0, void 0, function () {
193
- var retryWaitTime, retryCount, error_1;
194
- return __generator(this, function (_a) {
195
- switch (_a.label) {
196
- case 0:
197
- retryWaitTime = retryWaitTimeFactory();
198
- retryCount = retryMaxCount;
199
- _a.label = 1;
200
- case 1:
201
- if (!(retryCount > 0)) return [3 /*break*/, 8];
202
- _a.label = 2;
203
- case 2:
204
- _a.trys.push([2, 4, , 5]);
205
- return [4 /*yield*/, downloadChunkMethod(provider, objectPath, chunk)];
206
- case 3: return [2 /*return*/, _a.sent()];
207
- case 4:
208
- error_1 = _a.sent();
209
- return [3 /*break*/, 5];
210
- case 5:
211
- retryCount--;
212
- if (onRetry) {
213
- onRetry(null, chunk, retryCount);
214
- }
215
- if (!(retryCount !== 0)) return [3 /*break*/, 7];
216
- return [4 /*yield*/, new Promise(function (resolve, reject) { return setTimeout(resolve, retryWaitTime()); })];
217
- case 6:
218
- _a.sent();
219
- _a.label = 7;
220
- case 7: return [3 /*break*/, 1];
221
- case 8: throw new Error("Max retry attempts was reached for object path ".concat(objectPath, ", offset ").concat(chunk.offset, ", length ").concat(chunk.length
222
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
223
- ));
105
+ const createDownloadChunkMethodWithRetry = (downloadChunkMethod, { retryMaxCount = 3, retryWaitTimeFactory = () => () => 1000, onRetry } = {}) => {
106
+ return (provider, objectPath, chunk) => __awaiter(void 0, void 0, void 0, function* () {
107
+ const retryWaitTime = retryWaitTimeFactory();
108
+ //let lastError: unknown = null;
109
+ let retryCount = retryMaxCount;
110
+ while (retryCount > 0) {
111
+ try {
112
+ return yield downloadChunkMethod(provider, objectPath, chunk);
224
113
  }
225
- });
226
- }); };
114
+ catch (error) {
115
+ //lastError = error;
116
+ }
117
+ retryCount--;
118
+ if (onRetry) {
119
+ onRetry(null, chunk, retryCount);
120
+ }
121
+ if (retryCount !== 0) {
122
+ yield new Promise((resolve, reject) => setTimeout(resolve, retryWaitTime()));
123
+ }
124
+ }
125
+ throw new Error(`Max retry attempts was reached for object path ${objectPath}, offset ${chunk.offset}, length ${chunk.length
126
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
127
+ }`);
128
+ });
227
129
  };
228
130
  exports.createDownloadChunkMethodWithRetry = createDownloadChunkMethodWithRetry;
229
- var DownloadDecorator = /** @class */ (function () {
230
- function DownloadDecorator(provider, chunkDownloaderMethod, options) {
131
+ class DownloadDecorator {
132
+ constructor(provider, chunkDownloaderMethod, options) {
231
133
  this.provider = provider;
232
134
  this.chunkDownloaderMethod = chunkDownloaderMethod;
233
135
  this.options = options;
234
136
  }
235
- DownloadDecorator.prototype.uploadFile = function (inputStream, remotePath, contentLength, progressListener) {
137
+ uploadFile(inputStream, remotePath, contentLength, progressListener) {
236
138
  return this.provider.uploadFile(inputStream, remotePath, contentLength, progressListener);
237
- };
238
- DownloadDecorator.prototype.downloadFile = function (remotePath, config, progressListener) {
139
+ }
140
+ downloadFile(remotePath, config, progressListener) {
239
141
  var _a;
240
- return __awaiter(this, void 0, void 0, function () {
241
- var offset, objectSize, chunksStream, downloadStream, chainedStream;
242
- var _this = this;
243
- return __generator(this, function (_b) {
244
- switch (_b.label) {
245
- case 0:
246
- if (config === null || config === void 0 ? void 0 : config.length) {
247
- return [2 /*return*/, this.provider.downloadFile(remotePath, config, progressListener)];
248
- }
249
- offset = BigInt((_a = this.options.offset) !== null && _a !== void 0 ? _a : 0);
250
- return [4 /*yield*/, this.provider.getObjectSize(remotePath)];
251
- case 1:
252
- objectSize = _b.sent();
253
- chunksStream = stream_1.Readable.from(generateChunks(BigInt(objectSize), this.options.chunkSize, offset));
254
- downloadStream = new ChunkedReadableTransform(function (chunk) { return __awaiter(_this, void 0, void 0, function () {
255
- return __generator(this, function (_a) {
256
- return [2 /*return*/, this.chunkDownloaderMethod(this.provider, remotePath, chunk)];
257
- });
258
- }); }, {
259
- concurrency: this.options.concurrency,
260
- });
261
- chainedStream = new ChainedChunksReadableTransform(progressListener);
262
- return [2 /*return*/, chunksStream
263
- .pipe(downloadStream)
264
- .on("error", function (error) {
265
- chainedStream.emit("error", error);
266
- })
267
- .pipe(chainedStream)];
268
- }
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ if (config === null || config === void 0 ? void 0 : config.length) {
144
+ return this.provider.downloadFile(remotePath, config, progressListener);
145
+ }
146
+ const offset = BigInt((_a = this.options.offset) !== null && _a !== void 0 ? _a : 0);
147
+ const objectSize = yield this.provider.getObjectSize(remotePath);
148
+ const chunksStream = stream_1.Readable.from(generateChunks(BigInt(objectSize), this.options.chunkSize, offset));
149
+ const downloadStream = new ChunkedReadableTransform((chunk) => __awaiter(this, void 0, void 0, function* () {
150
+ return this.chunkDownloaderMethod(this.provider, remotePath, chunk);
151
+ }), {
152
+ concurrency: this.options.concurrency,
269
153
  });
154
+ const chainedStream = new ChainedChunksReadableTransform(progressListener);
155
+ return chunksStream
156
+ .pipe(downloadStream)
157
+ .on("error", (error) => {
158
+ chainedStream.emit("error", error);
159
+ })
160
+ .pipe(chainedStream);
270
161
  });
271
- };
272
- DownloadDecorator.prototype.deleteObject = function (remotePath) {
162
+ }
163
+ deleteObject(remotePath) {
273
164
  return this.provider.deleteObject(remotePath);
274
- };
275
- DownloadDecorator.prototype.listObjects = function (remotePath) {
165
+ }
166
+ listObjects(remotePath) {
276
167
  return this.provider.listObjects(remotePath);
277
- };
278
- DownloadDecorator.prototype.getObjectSize = function (remotePath) {
168
+ }
169
+ getObjectSize(remotePath) {
279
170
  return this.provider.getObjectSize(remotePath);
280
- };
281
- DownloadDecorator.prototype.getLastModified = function (remotePath) {
171
+ }
172
+ getLastModified(remotePath) {
282
173
  return this.provider.getLastModified(remotePath);
283
- };
284
- return DownloadDecorator;
285
- }());
174
+ }
175
+ }
286
176
  exports.DownloadDecorator = DownloadDecorator;
@@ -11,5 +11,5 @@ export default interface IStorageProvider {
11
11
  deleteObject(remotePath: string): Promise<void>;
12
12
  listObjects(remotePath: string): Promise<StorageObject[]>;
13
13
  getObjectSize(remotePath: string): Promise<number>;
14
- getLastModified(remotePath: string): Promise<Date>;
14
+ getLastModified(remotePath: string): Promise<Date | null>;
15
15
  }