cod-dicomweb-server 1.3.4 → 1.3.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.
- package/README.md +4 -1
- package/dist/cjs/main.js +629 -101
- package/dist/esm/classes/CodDicomWebServer.d.ts +1 -0
- package/dist/esm/classes/CodDicomWebServer.js +9 -4
- package/dist/esm/constants/dataRetrieval.d.ts +4 -0
- package/dist/esm/constants/dataRetrieval.js +4 -0
- package/dist/esm/dataRetrieval/scripts/filePartial.d.ts +1 -0
- package/dist/esm/dataRetrieval/scripts/filePartial.js +16 -2
- package/dist/esm/dataRetrieval/scripts/fileStreaming.d.ts +1 -0
- package/dist/esm/dataRetrieval/scripts/fileStreaming.js +13 -1
- package/dist/esm/fileAccessSystemUtils.d.ts +12 -0
- package/dist/esm/fileAccessSystemUtils.js +84 -0
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +3 -2
- package/dist/esm/metadataManager.d.ts +2 -2
- package/dist/esm/metadataManager.js +15 -11
- package/dist/esm/types/codDicomWebServerOptions.d.ts +2 -1
- package/dist/umd/563.js +19 -0
- package/dist/umd/563.js.map +1 -0
- package/dist/umd/846.js +19 -0
- package/dist/umd/846.js.map +1 -0
- package/dist/umd/main.js +4 -4
- package/dist/umd/main.js.map +1 -1
- package/package.json +4 -3
- package/dist/umd/614.js +0 -19
- package/dist/umd/614.js.map +0 -1
- package/dist/umd/66.js +0 -19
- package/dist/umd/66.js.map +0 -1
package/dist/cjs/main.js
CHANGED
|
@@ -132,6 +132,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
132
132
|
__webpack_require__.d(__webpack_exports__, {
|
|
133
133
|
CodDicomWebServer: () => (/* reexport */ classes_CodDicomWebServer),
|
|
134
134
|
FetchType: () => (/* reexport */ FetchType),
|
|
135
|
+
clearPartialFiles: () => (/* reexport */ clearPartialFiles),
|
|
135
136
|
"default": () => (/* binding */ src)
|
|
136
137
|
});
|
|
137
138
|
|
|
@@ -159,6 +160,8 @@ __webpack_require__.r(dataRetrieval_namespaceObject);
|
|
|
159
160
|
__webpack_require__.d(dataRetrieval_namespaceObject, {
|
|
160
161
|
FILE_PARTIAL_WORKER_NAME: () => (FILE_PARTIAL_WORKER_NAME),
|
|
161
162
|
FILE_STREAMING_WORKER_NAME: () => (FILE_STREAMING_WORKER_NAME),
|
|
163
|
+
FILE_SYSTEM_ROUTES: () => (FILE_SYSTEM_ROUTES),
|
|
164
|
+
IDB_DIR_HANDLE_KEY: () => (IDB_DIR_HANDLE_KEY),
|
|
162
165
|
THRESHOLD: () => (THRESHOLD)
|
|
163
166
|
});
|
|
164
167
|
|
|
@@ -238,6 +241,10 @@ var URL_VALIDATION_STRING = '/dicomweb/';
|
|
|
238
241
|
var FILE_PARTIAL_WORKER_NAME = 'filePartial';
|
|
239
242
|
var FILE_STREAMING_WORKER_NAME = 'fileStreaming';
|
|
240
243
|
var THRESHOLD = 10000;
|
|
244
|
+
var IDB_DIR_HANDLE_KEY = 'indexed_db_directory_handle_key';
|
|
245
|
+
var FILE_SYSTEM_ROUTES = {
|
|
246
|
+
Partial: 'partial'
|
|
247
|
+
};
|
|
241
248
|
;// ./src/constants/index.ts
|
|
242
249
|
|
|
243
250
|
|
|
@@ -1015,6 +1022,12 @@ var FileManager = /*#__PURE__*/function () {
|
|
|
1015
1022
|
}();
|
|
1016
1023
|
/* harmony default export */ const fileManager = (FileManager);
|
|
1017
1024
|
;// ./src/classes/utils.ts
|
|
1025
|
+
function utils_slicedToArray(r, e) { return utils_arrayWithHoles(r) || utils_iterableToArrayLimit(r, e) || utils_unsupportedIterableToArray(r, e) || utils_nonIterableRest(); }
|
|
1026
|
+
function utils_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
1027
|
+
function utils_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return utils_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? utils_arrayLikeToArray(r, a) : void 0; } }
|
|
1028
|
+
function utils_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1029
|
+
function utils_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
1030
|
+
function utils_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
1018
1031
|
|
|
1019
1032
|
|
|
1020
1033
|
function parseWadorsURL(url, domain) {
|
|
@@ -1064,7 +1077,7 @@ function parseWadorsURL(url, domain) {
|
|
|
1064
1077
|
};
|
|
1065
1078
|
}
|
|
1066
1079
|
function getFrameDetailsFromMetadata(seriesMetadata, sopInstanceUID, frameIndex, bucketDetails) {
|
|
1067
|
-
var _seriesMetadata$cod;
|
|
1080
|
+
var _seriesMetadata$cod, _Object$entries$find;
|
|
1068
1081
|
if (!seriesMetadata || !((_seriesMetadata$cod = seriesMetadata.cod) !== null && _seriesMetadata$cod !== void 0 && _seriesMetadata$cod.instances)) {
|
|
1069
1082
|
throw new CustomError('Invalid seriesMetadata provided.');
|
|
1070
1083
|
}
|
|
@@ -1079,10 +1092,12 @@ function getFrameDetailsFromMetadata(seriesMetadata, sopInstanceUID, frameIndex,
|
|
|
1079
1092
|
var thumbnailGsUtilUri = seriesMetadata.thumbnail.uri;
|
|
1080
1093
|
thumbnailUrl = "".concat(domain, "/").concat(thumbnailGsUtilUri.split('gs://')[1]);
|
|
1081
1094
|
}
|
|
1082
|
-
var instanceFound = Object.
|
|
1083
|
-
var
|
|
1084
|
-
|
|
1085
|
-
|
|
1095
|
+
var instanceFound = (_Object$entries$find = Object.entries(seriesMetadata.cod.instances).find(function (_ref) {
|
|
1096
|
+
var _ref2 = utils_slicedToArray(_ref, 2),
|
|
1097
|
+
key = _ref2[0],
|
|
1098
|
+
instance = _ref2[1];
|
|
1099
|
+
return key === sopInstanceUID;
|
|
1100
|
+
})) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[1];
|
|
1086
1101
|
if (!instanceFound) {
|
|
1087
1102
|
return {
|
|
1088
1103
|
thumbnailUrl: thumbnailUrl
|
|
@@ -1156,7 +1171,7 @@ function metadataManager_toPrimitive(t, r) { if ("object" != metadataManager_typ
|
|
|
1156
1171
|
var MetadataManager = /*#__PURE__*/function () {
|
|
1157
1172
|
function MetadataManager() {
|
|
1158
1173
|
metadataManager_classCallCheck(this, MetadataManager);
|
|
1159
|
-
metadataManager_defineProperty(this, "
|
|
1174
|
+
metadataManager_defineProperty(this, "metadataPromises", {});
|
|
1160
1175
|
}
|
|
1161
1176
|
return metadataManager_createClass(MetadataManager, [{
|
|
1162
1177
|
key: "addDeidMetadata",
|
|
@@ -1184,13 +1199,14 @@ var MetadataManager = /*#__PURE__*/function () {
|
|
|
1184
1199
|
}, {
|
|
1185
1200
|
key: "getMetadataFromCache",
|
|
1186
1201
|
value: function getMetadataFromCache(url) {
|
|
1187
|
-
return this.
|
|
1202
|
+
return this.metadataPromises[url];
|
|
1188
1203
|
}
|
|
1189
1204
|
}, {
|
|
1190
1205
|
key: "getMetadata",
|
|
1191
1206
|
value: function () {
|
|
1192
1207
|
var _getMetadata = metadataManager_asyncToGenerator(/*#__PURE__*/metadataManager_regeneratorRuntime().mark(function _callee(params, headers) {
|
|
1193
|
-
var
|
|
1208
|
+
var _this = this;
|
|
1209
|
+
var url, cachedMetadata;
|
|
1194
1210
|
return metadataManager_regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1195
1211
|
while (1) switch (_context.prev = _context.next) {
|
|
1196
1212
|
case 0:
|
|
@@ -1203,41 +1219,40 @@ var MetadataManager = /*#__PURE__*/function () {
|
|
|
1203
1219
|
case 3:
|
|
1204
1220
|
cachedMetadata = this.getMetadataFromCache(url);
|
|
1205
1221
|
if (!cachedMetadata) {
|
|
1206
|
-
_context.next =
|
|
1222
|
+
_context.next = 8;
|
|
1207
1223
|
break;
|
|
1208
1224
|
}
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
_context.
|
|
1213
|
-
|
|
1225
|
+
_context.next = 7;
|
|
1226
|
+
return cachedMetadata;
|
|
1227
|
+
case 7:
|
|
1228
|
+
return _context.abrupt("return", _context.sent);
|
|
1229
|
+
case 8:
|
|
1230
|
+
_context.prev = 8;
|
|
1231
|
+
this.metadataPromises[url] = fetch(url, {
|
|
1214
1232
|
headers: headers
|
|
1233
|
+
}).then(function (response) {
|
|
1234
|
+
if (!response.ok) {
|
|
1235
|
+
throw new CustomError("Failed to fetch metadata: ".concat(response.statusText));
|
|
1236
|
+
}
|
|
1237
|
+
return response.json();
|
|
1238
|
+
}).then(function (data) {
|
|
1239
|
+
_this.addDeidMetadata(data);
|
|
1240
|
+
return data;
|
|
1215
1241
|
});
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
if (response.ok) {
|
|
1219
|
-
_context.next = 12;
|
|
1220
|
-
break;
|
|
1221
|
-
}
|
|
1222
|
-
throw new CustomError("Failed to fetch metadata: ".concat(response.statusText));
|
|
1242
|
+
_context.next = 12;
|
|
1243
|
+
return this.metadataPromises[url];
|
|
1223
1244
|
case 12:
|
|
1224
|
-
_context.
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
this.addDeidMetadata(data);
|
|
1229
|
-
this.metadata[url] = data;
|
|
1230
|
-
return _context.abrupt("return", data);
|
|
1231
|
-
case 20:
|
|
1232
|
-
_context.prev = 20;
|
|
1233
|
-
_context.t0 = _context["catch"](6);
|
|
1245
|
+
return _context.abrupt("return", _context.sent);
|
|
1246
|
+
case 15:
|
|
1247
|
+
_context.prev = 15;
|
|
1248
|
+
_context.t0 = _context["catch"](8);
|
|
1234
1249
|
console.error(_context.t0);
|
|
1235
1250
|
throw _context.t0;
|
|
1236
|
-
case
|
|
1251
|
+
case 19:
|
|
1237
1252
|
case "end":
|
|
1238
1253
|
return _context.stop();
|
|
1239
1254
|
}
|
|
1240
|
-
}, _callee, this, [[
|
|
1255
|
+
}, _callee, this, [[8, 15]]);
|
|
1241
1256
|
}));
|
|
1242
1257
|
function getMetadata(_x, _x2) {
|
|
1243
1258
|
return _getMetadata.apply(this, arguments);
|
|
@@ -1247,34 +1262,496 @@ var MetadataManager = /*#__PURE__*/function () {
|
|
|
1247
1262
|
}]);
|
|
1248
1263
|
}();
|
|
1249
1264
|
/* harmony default export */ const metadataManager = (MetadataManager);
|
|
1265
|
+
;// ./node_modules/idb-keyval/dist/index.js
|
|
1266
|
+
function promisifyRequest(request) {
|
|
1267
|
+
return new Promise((resolve, reject) => {
|
|
1268
|
+
// @ts-ignore - file size hacks
|
|
1269
|
+
request.oncomplete = request.onsuccess = () => resolve(request.result);
|
|
1270
|
+
// @ts-ignore - file size hacks
|
|
1271
|
+
request.onabort = request.onerror = () => reject(request.error);
|
|
1272
|
+
});
|
|
1273
|
+
}
|
|
1274
|
+
function createStore(dbName, storeName) {
|
|
1275
|
+
let dbp;
|
|
1276
|
+
const getDB = () => {
|
|
1277
|
+
if (dbp)
|
|
1278
|
+
return dbp;
|
|
1279
|
+
const request = indexedDB.open(dbName);
|
|
1280
|
+
request.onupgradeneeded = () => request.result.createObjectStore(storeName);
|
|
1281
|
+
dbp = promisifyRequest(request);
|
|
1282
|
+
dbp.then((db) => {
|
|
1283
|
+
// It seems like Safari sometimes likes to just close the connection.
|
|
1284
|
+
// It's supposed to fire this event when that happens. Let's hope it does!
|
|
1285
|
+
db.onclose = () => (dbp = undefined);
|
|
1286
|
+
}, () => { });
|
|
1287
|
+
return dbp;
|
|
1288
|
+
};
|
|
1289
|
+
return (txMode, callback) => getDB().then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
|
|
1290
|
+
}
|
|
1291
|
+
let defaultGetStoreFunc;
|
|
1292
|
+
function defaultGetStore() {
|
|
1293
|
+
if (!defaultGetStoreFunc) {
|
|
1294
|
+
defaultGetStoreFunc = createStore('keyval-store', 'keyval');
|
|
1295
|
+
}
|
|
1296
|
+
return defaultGetStoreFunc;
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* Get a value by its key.
|
|
1300
|
+
*
|
|
1301
|
+
* @param key
|
|
1302
|
+
* @param customStore Method to get a custom store. Use with caution (see the docs).
|
|
1303
|
+
*/
|
|
1304
|
+
function get(key, customStore = defaultGetStore()) {
|
|
1305
|
+
return customStore('readonly', (store) => promisifyRequest(store.get(key)));
|
|
1306
|
+
}
|
|
1307
|
+
/**
|
|
1308
|
+
* Set a value with a key.
|
|
1309
|
+
*
|
|
1310
|
+
* @param key
|
|
1311
|
+
* @param value
|
|
1312
|
+
* @param customStore Method to get a custom store. Use with caution (see the docs).
|
|
1313
|
+
*/
|
|
1314
|
+
function set(key, value, customStore = defaultGetStore()) {
|
|
1315
|
+
return customStore('readwrite', (store) => {
|
|
1316
|
+
store.put(value, key);
|
|
1317
|
+
return promisifyRequest(store.transaction);
|
|
1318
|
+
});
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* Set multiple values at once. This is faster than calling set() multiple times.
|
|
1322
|
+
* It's also atomic – if one of the pairs can't be added, none will be added.
|
|
1323
|
+
*
|
|
1324
|
+
* @param entries Array of entries, where each entry is an array of `[key, value]`.
|
|
1325
|
+
* @param customStore Method to get a custom store. Use with caution (see the docs).
|
|
1326
|
+
*/
|
|
1327
|
+
function setMany(entries, customStore = defaultGetStore()) {
|
|
1328
|
+
return customStore('readwrite', (store) => {
|
|
1329
|
+
entries.forEach((entry) => store.put(entry[1], entry[0]));
|
|
1330
|
+
return promisifyRequest(store.transaction);
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
/**
|
|
1334
|
+
* Get multiple values by their keys
|
|
1335
|
+
*
|
|
1336
|
+
* @param keys
|
|
1337
|
+
* @param customStore Method to get a custom store. Use with caution (see the docs).
|
|
1338
|
+
*/
|
|
1339
|
+
function getMany(keys, customStore = defaultGetStore()) {
|
|
1340
|
+
return customStore('readonly', (store) => Promise.all(keys.map((key) => promisifyRequest(store.get(key)))));
|
|
1341
|
+
}
|
|
1342
|
+
/**
|
|
1343
|
+
* Update a value. This lets you see the old value and update it as an atomic operation.
|
|
1344
|
+
*
|
|
1345
|
+
* @param key
|
|
1346
|
+
* @param updater A callback that takes the old value and returns a new value.
|
|
1347
|
+
* @param customStore Method to get a custom store. Use with caution (see the docs).
|
|
1348
|
+
*/
|
|
1349
|
+
function update(key, updater, customStore = defaultGetStore()) {
|
|
1350
|
+
return customStore('readwrite', (store) =>
|
|
1351
|
+
// Need to create the promise manually.
|
|
1352
|
+
// If I try to chain promises, the transaction closes in browsers
|
|
1353
|
+
// that use a promise polyfill (IE10/11).
|
|
1354
|
+
new Promise((resolve, reject) => {
|
|
1355
|
+
store.get(key).onsuccess = function () {
|
|
1356
|
+
try {
|
|
1357
|
+
store.put(updater(this.result), key);
|
|
1358
|
+
resolve(promisifyRequest(store.transaction));
|
|
1359
|
+
}
|
|
1360
|
+
catch (err) {
|
|
1361
|
+
reject(err);
|
|
1362
|
+
}
|
|
1363
|
+
};
|
|
1364
|
+
}));
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* Delete a particular key from the store.
|
|
1368
|
+
*
|
|
1369
|
+
* @param key
|
|
1370
|
+
* @param customStore Method to get a custom store. Use with caution (see the docs).
|
|
1371
|
+
*/
|
|
1372
|
+
function del(key, customStore = defaultGetStore()) {
|
|
1373
|
+
return customStore('readwrite', (store) => {
|
|
1374
|
+
store.delete(key);
|
|
1375
|
+
return promisifyRequest(store.transaction);
|
|
1376
|
+
});
|
|
1377
|
+
}
|
|
1378
|
+
/**
|
|
1379
|
+
* Delete multiple keys at once.
|
|
1380
|
+
*
|
|
1381
|
+
* @param keys List of keys to delete.
|
|
1382
|
+
* @param customStore Method to get a custom store. Use with caution (see the docs).
|
|
1383
|
+
*/
|
|
1384
|
+
function delMany(keys, customStore = defaultGetStore()) {
|
|
1385
|
+
return customStore('readwrite', (store) => {
|
|
1386
|
+
keys.forEach((key) => store.delete(key));
|
|
1387
|
+
return promisifyRequest(store.transaction);
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
/**
|
|
1391
|
+
* Clear all values in the store.
|
|
1392
|
+
*
|
|
1393
|
+
* @param customStore Method to get a custom store. Use with caution (see the docs).
|
|
1394
|
+
*/
|
|
1395
|
+
function clear(customStore = defaultGetStore()) {
|
|
1396
|
+
return customStore('readwrite', (store) => {
|
|
1397
|
+
store.clear();
|
|
1398
|
+
return promisifyRequest(store.transaction);
|
|
1399
|
+
});
|
|
1400
|
+
}
|
|
1401
|
+
function eachCursor(store, callback) {
|
|
1402
|
+
store.openCursor().onsuccess = function () {
|
|
1403
|
+
if (!this.result)
|
|
1404
|
+
return;
|
|
1405
|
+
callback(this.result);
|
|
1406
|
+
this.result.continue();
|
|
1407
|
+
};
|
|
1408
|
+
return promisifyRequest(store.transaction);
|
|
1409
|
+
}
|
|
1410
|
+
/**
|
|
1411
|
+
* Get all keys in the store.
|
|
1412
|
+
*
|
|
1413
|
+
* @param customStore Method to get a custom store. Use with caution (see the docs).
|
|
1414
|
+
*/
|
|
1415
|
+
function keys(customStore = defaultGetStore()) {
|
|
1416
|
+
return customStore('readonly', (store) => {
|
|
1417
|
+
// Fast path for modern browsers
|
|
1418
|
+
if (store.getAllKeys) {
|
|
1419
|
+
return promisifyRequest(store.getAllKeys());
|
|
1420
|
+
}
|
|
1421
|
+
const items = [];
|
|
1422
|
+
return eachCursor(store, (cursor) => items.push(cursor.key)).then(() => items);
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
/**
|
|
1426
|
+
* Get all values in the store.
|
|
1427
|
+
*
|
|
1428
|
+
* @param customStore Method to get a custom store. Use with caution (see the docs).
|
|
1429
|
+
*/
|
|
1430
|
+
function values(customStore = defaultGetStore()) {
|
|
1431
|
+
return customStore('readonly', (store) => {
|
|
1432
|
+
// Fast path for modern browsers
|
|
1433
|
+
if (store.getAll) {
|
|
1434
|
+
return promisifyRequest(store.getAll());
|
|
1435
|
+
}
|
|
1436
|
+
const items = [];
|
|
1437
|
+
return eachCursor(store, (cursor) => items.push(cursor.value)).then(() => items);
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
/**
|
|
1441
|
+
* Get all entries in the store. Each entry is an array of `[key, value]`.
|
|
1442
|
+
*
|
|
1443
|
+
* @param customStore Method to get a custom store. Use with caution (see the docs).
|
|
1444
|
+
*/
|
|
1445
|
+
function entries(customStore = defaultGetStore()) {
|
|
1446
|
+
return customStore('readonly', (store) => {
|
|
1447
|
+
// Fast path for modern browsers
|
|
1448
|
+
// (although, hopefully we'll get a simpler path some day)
|
|
1449
|
+
if (store.getAll && store.getAllKeys) {
|
|
1450
|
+
return Promise.all([
|
|
1451
|
+
promisifyRequest(store.getAllKeys()),
|
|
1452
|
+
promisifyRequest(store.getAll()),
|
|
1453
|
+
]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));
|
|
1454
|
+
}
|
|
1455
|
+
const items = [];
|
|
1456
|
+
return customStore('readonly', (store) => eachCursor(store, (cursor) => items.push([cursor.key, cursor.value])).then(() => items));
|
|
1457
|
+
});
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
|
|
1461
|
+
|
|
1462
|
+
;// ./src/fileAccessSystemUtils.ts
|
|
1463
|
+
function fileAccessSystemUtils_typeof(o) { "@babel/helpers - typeof"; return fileAccessSystemUtils_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, fileAccessSystemUtils_typeof(o); }
|
|
1464
|
+
function fileAccessSystemUtils_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ fileAccessSystemUtils_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == fileAccessSystemUtils_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(fileAccessSystemUtils_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
1465
|
+
function fileAccessSystemUtils_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
1466
|
+
function fileAccessSystemUtils_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { fileAccessSystemUtils_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { fileAccessSystemUtils_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
1467
|
+
|
|
1468
|
+
|
|
1469
|
+
var directoryHandle;
|
|
1470
|
+
function getDirectoryHandle() {
|
|
1471
|
+
return _getDirectoryHandle.apply(this, arguments);
|
|
1472
|
+
}
|
|
1473
|
+
function _getDirectoryHandle() {
|
|
1474
|
+
_getDirectoryHandle = fileAccessSystemUtils_asyncToGenerator(/*#__PURE__*/fileAccessSystemUtils_regeneratorRuntime().mark(function _callee() {
|
|
1475
|
+
return fileAccessSystemUtils_regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1476
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1477
|
+
case 0:
|
|
1478
|
+
_context.prev = 0;
|
|
1479
|
+
if (directoryHandle) {
|
|
1480
|
+
_context.next = 5;
|
|
1481
|
+
break;
|
|
1482
|
+
}
|
|
1483
|
+
_context.next = 4;
|
|
1484
|
+
return get(IDB_DIR_HANDLE_KEY);
|
|
1485
|
+
case 4:
|
|
1486
|
+
directoryHandle = _context.sent;
|
|
1487
|
+
case 5:
|
|
1488
|
+
if (directoryHandle) {
|
|
1489
|
+
_context.next = 9;
|
|
1490
|
+
break;
|
|
1491
|
+
}
|
|
1492
|
+
_context.next = 8;
|
|
1493
|
+
return navigator.storage.getDirectory();
|
|
1494
|
+
case 8:
|
|
1495
|
+
directoryHandle = _context.sent;
|
|
1496
|
+
case 9:
|
|
1497
|
+
return _context.abrupt("return", directoryHandle);
|
|
1498
|
+
case 12:
|
|
1499
|
+
_context.prev = 12;
|
|
1500
|
+
_context.t0 = _context["catch"](0);
|
|
1501
|
+
console.warn("Error getting directoryhandle: ".concat(_context.t0.message));
|
|
1502
|
+
case 15:
|
|
1503
|
+
case "end":
|
|
1504
|
+
return _context.stop();
|
|
1505
|
+
}
|
|
1506
|
+
}, _callee, null, [[0, 12]]);
|
|
1507
|
+
}));
|
|
1508
|
+
return _getDirectoryHandle.apply(this, arguments);
|
|
1509
|
+
}
|
|
1510
|
+
function readFile(_x, _x2, _x3) {
|
|
1511
|
+
return _readFile.apply(this, arguments);
|
|
1512
|
+
}
|
|
1513
|
+
function _readFile() {
|
|
1514
|
+
_readFile = fileAccessSystemUtils_asyncToGenerator(/*#__PURE__*/fileAccessSystemUtils_regeneratorRuntime().mark(function _callee2(directoryHandle, name, offsets) {
|
|
1515
|
+
var pathParts, currentDir, i, fileName, fileHandle, seriesInstanceUID, _i, _fileHandle, fileArraybuffer;
|
|
1516
|
+
return fileAccessSystemUtils_regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1517
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1518
|
+
case 0:
|
|
1519
|
+
if (name) {
|
|
1520
|
+
_context2.next = 2;
|
|
1521
|
+
break;
|
|
1522
|
+
}
|
|
1523
|
+
return _context2.abrupt("return");
|
|
1524
|
+
case 2:
|
|
1525
|
+
pathParts = name.split('/');
|
|
1526
|
+
currentDir = directoryHandle;
|
|
1527
|
+
_context2.prev = 4;
|
|
1528
|
+
i = 0;
|
|
1529
|
+
case 6:
|
|
1530
|
+
if (!(i < pathParts.length - 1)) {
|
|
1531
|
+
_context2.next = 13;
|
|
1532
|
+
break;
|
|
1533
|
+
}
|
|
1534
|
+
_context2.next = 9;
|
|
1535
|
+
return currentDir.getDirectoryHandle(pathParts[i]);
|
|
1536
|
+
case 9:
|
|
1537
|
+
currentDir = _context2.sent;
|
|
1538
|
+
case 10:
|
|
1539
|
+
i++;
|
|
1540
|
+
_context2.next = 6;
|
|
1541
|
+
break;
|
|
1542
|
+
case 13:
|
|
1543
|
+
fileName = pathParts.at(-1);
|
|
1544
|
+
_context2.next = 16;
|
|
1545
|
+
return currentDir.getFileHandle(fileName);
|
|
1546
|
+
case 16:
|
|
1547
|
+
fileHandle = _context2.sent;
|
|
1548
|
+
_context2.next = 19;
|
|
1549
|
+
return fileHandle.getFile().then(function (file) {
|
|
1550
|
+
return file.arrayBuffer();
|
|
1551
|
+
});
|
|
1552
|
+
case 19:
|
|
1553
|
+
return _context2.abrupt("return", _context2.sent);
|
|
1554
|
+
case 22:
|
|
1555
|
+
_context2.prev = 22;
|
|
1556
|
+
_context2.t0 = _context2["catch"](4);
|
|
1557
|
+
console.warn("Error reading the file ".concat(name, ": ").concat(_context2.t0.message));
|
|
1558
|
+
if (!(offsets && pathParts[0] === FILE_SYSTEM_ROUTES.Partial)) {
|
|
1559
|
+
_context2.next = 49;
|
|
1560
|
+
break;
|
|
1561
|
+
}
|
|
1562
|
+
_context2.prev = 26;
|
|
1563
|
+
seriesInstanceUID = pathParts.at(-1).slice(0, name.lastIndexOf('.')).split('_')[0];
|
|
1564
|
+
pathParts = pathParts.slice(1);
|
|
1565
|
+
_i = 0;
|
|
1566
|
+
case 30:
|
|
1567
|
+
if (!(_i < pathParts.length - 1)) {
|
|
1568
|
+
_context2.next = 37;
|
|
1569
|
+
break;
|
|
1570
|
+
}
|
|
1571
|
+
_context2.next = 33;
|
|
1572
|
+
return currentDir.getDirectoryHandle(pathParts[_i]);
|
|
1573
|
+
case 33:
|
|
1574
|
+
currentDir = _context2.sent;
|
|
1575
|
+
case 34:
|
|
1576
|
+
_i++;
|
|
1577
|
+
_context2.next = 30;
|
|
1578
|
+
break;
|
|
1579
|
+
case 37:
|
|
1580
|
+
_context2.next = 39;
|
|
1581
|
+
return directoryHandle.getFileHandle(seriesInstanceUID + '.tar');
|
|
1582
|
+
case 39:
|
|
1583
|
+
_fileHandle = _context2.sent;
|
|
1584
|
+
_context2.next = 42;
|
|
1585
|
+
return _fileHandle.getFile().then(function (file) {
|
|
1586
|
+
return file.arrayBuffer();
|
|
1587
|
+
});
|
|
1588
|
+
case 42:
|
|
1589
|
+
fileArraybuffer = _context2.sent;
|
|
1590
|
+
return _context2.abrupt("return", fileArraybuffer.slice(offsets.startByte, offsets.endByte));
|
|
1591
|
+
case 46:
|
|
1592
|
+
_context2.prev = 46;
|
|
1593
|
+
_context2.t1 = _context2["catch"](26);
|
|
1594
|
+
console.warn("Error reading the file ".concat(name, ": ").concat(_context2.t1.message));
|
|
1595
|
+
case 49:
|
|
1596
|
+
case "end":
|
|
1597
|
+
return _context2.stop();
|
|
1598
|
+
}
|
|
1599
|
+
}, _callee2, null, [[4, 22], [26, 46]]);
|
|
1600
|
+
}));
|
|
1601
|
+
return _readFile.apply(this, arguments);
|
|
1602
|
+
}
|
|
1603
|
+
function writeFile(_x4, _x5, _x6) {
|
|
1604
|
+
return _writeFile.apply(this, arguments);
|
|
1605
|
+
}
|
|
1606
|
+
function _writeFile() {
|
|
1607
|
+
_writeFile = fileAccessSystemUtils_asyncToGenerator(/*#__PURE__*/fileAccessSystemUtils_regeneratorRuntime().mark(function _callee3(directoryHandle, name, file) {
|
|
1608
|
+
var pathParts, currentDir, i, fileName, fileHandle, fileWritable;
|
|
1609
|
+
return fileAccessSystemUtils_regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1610
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
1611
|
+
case 0:
|
|
1612
|
+
_context3.prev = 0;
|
|
1613
|
+
pathParts = name.split('/');
|
|
1614
|
+
currentDir = directoryHandle;
|
|
1615
|
+
i = 0;
|
|
1616
|
+
case 4:
|
|
1617
|
+
if (!(i < pathParts.length - 1)) {
|
|
1618
|
+
_context3.next = 11;
|
|
1619
|
+
break;
|
|
1620
|
+
}
|
|
1621
|
+
_context3.next = 7;
|
|
1622
|
+
return currentDir.getDirectoryHandle(pathParts[i], {
|
|
1623
|
+
create: true
|
|
1624
|
+
});
|
|
1625
|
+
case 7:
|
|
1626
|
+
currentDir = _context3.sent;
|
|
1627
|
+
case 8:
|
|
1628
|
+
i++;
|
|
1629
|
+
_context3.next = 4;
|
|
1630
|
+
break;
|
|
1631
|
+
case 11:
|
|
1632
|
+
fileName = pathParts[pathParts.length - 1];
|
|
1633
|
+
_context3.next = 14;
|
|
1634
|
+
return currentDir.getFileHandle(fileName, {
|
|
1635
|
+
create: true
|
|
1636
|
+
});
|
|
1637
|
+
case 14:
|
|
1638
|
+
fileHandle = _context3.sent;
|
|
1639
|
+
_context3.next = 17;
|
|
1640
|
+
return fileHandle.createWritable();
|
|
1641
|
+
case 17:
|
|
1642
|
+
fileWritable = _context3.sent;
|
|
1643
|
+
_context3.next = 20;
|
|
1644
|
+
return fileWritable.write(file);
|
|
1645
|
+
case 20:
|
|
1646
|
+
_context3.next = 22;
|
|
1647
|
+
return fileWritable.close();
|
|
1648
|
+
case 22:
|
|
1649
|
+
_context3.next = 27;
|
|
1650
|
+
break;
|
|
1651
|
+
case 24:
|
|
1652
|
+
_context3.prev = 24;
|
|
1653
|
+
_context3.t0 = _context3["catch"](0);
|
|
1654
|
+
console.warn("Error writing the file ".concat(name, ": ").concat(_context3.t0.message));
|
|
1655
|
+
case 27:
|
|
1656
|
+
case "end":
|
|
1657
|
+
return _context3.stop();
|
|
1658
|
+
}
|
|
1659
|
+
}, _callee3, null, [[0, 24]]);
|
|
1660
|
+
}));
|
|
1661
|
+
return _writeFile.apply(this, arguments);
|
|
1662
|
+
}
|
|
1663
|
+
function clearPartialFiles() {
|
|
1664
|
+
return _clearPartialFiles.apply(this, arguments);
|
|
1665
|
+
}
|
|
1666
|
+
function _clearPartialFiles() {
|
|
1667
|
+
_clearPartialFiles = fileAccessSystemUtils_asyncToGenerator(/*#__PURE__*/fileAccessSystemUtils_regeneratorRuntime().mark(function _callee4() {
|
|
1668
|
+
return fileAccessSystemUtils_regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
1669
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
1670
|
+
case 0:
|
|
1671
|
+
_context4.prev = 0;
|
|
1672
|
+
_context4.next = 3;
|
|
1673
|
+
return directoryHandle.removeEntry(FILE_SYSTEM_ROUTES.Partial, {
|
|
1674
|
+
recursive: true
|
|
1675
|
+
});
|
|
1676
|
+
case 3:
|
|
1677
|
+
_context4.next = 8;
|
|
1678
|
+
break;
|
|
1679
|
+
case 5:
|
|
1680
|
+
_context4.prev = 5;
|
|
1681
|
+
_context4.t0 = _context4["catch"](0);
|
|
1682
|
+
console.warn("Error clearing partial files: ".concat(_context4.t0.message));
|
|
1683
|
+
case 8:
|
|
1684
|
+
case "end":
|
|
1685
|
+
return _context4.stop();
|
|
1686
|
+
}
|
|
1687
|
+
}, _callee4, null, [[0, 5]]);
|
|
1688
|
+
}));
|
|
1689
|
+
return _clearPartialFiles.apply(this, arguments);
|
|
1690
|
+
}
|
|
1691
|
+
function createStreamingFileName(url) {
|
|
1692
|
+
return url.split('series/')[1];
|
|
1693
|
+
}
|
|
1694
|
+
function createPartialFileName(url, offsets) {
|
|
1695
|
+
var seriesInstanceUID = url.split('series/')[1].split('.tar')[0];
|
|
1696
|
+
var offsetPart = "".concat(offsets ? "_".concat(offsets === null || offsets === void 0 ? void 0 : offsets.startByte, "_").concat(offsets === null || offsets === void 0 ? void 0 : offsets.endByte) : '');
|
|
1697
|
+
return "".concat(FILE_SYSTEM_ROUTES.Partial, "/").concat(seriesInstanceUID).concat(offsetPart, ".dcm");
|
|
1698
|
+
}
|
|
1250
1699
|
;// ./src/dataRetrieval/scripts/filePartial.ts
|
|
1251
1700
|
function filePartial_typeof(o) { "@babel/helpers - typeof"; return filePartial_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, filePartial_typeof(o); }
|
|
1252
1701
|
function filePartial_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ filePartial_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == filePartial_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(filePartial_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
1253
1702
|
function filePartial_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
1254
1703
|
function filePartial_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { filePartial_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { filePartial_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
1255
1704
|
|
|
1705
|
+
|
|
1256
1706
|
var filePartial = {
|
|
1257
1707
|
partial: function partial(args, callBack) {
|
|
1258
1708
|
return filePartial_asyncToGenerator(/*#__PURE__*/filePartial_regeneratorRuntime().mark(function _callee() {
|
|
1259
|
-
var url, headers;
|
|
1709
|
+
var url, offsets, headers, directoryHandle, storageName, file;
|
|
1260
1710
|
return filePartial_regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1261
1711
|
while (1) switch (_context.prev = _context.next) {
|
|
1262
1712
|
case 0:
|
|
1263
|
-
url = args.url, headers = args.headers;
|
|
1264
|
-
|
|
1713
|
+
url = args.url, offsets = args.offsets, headers = args.headers, directoryHandle = args.directoryHandle;
|
|
1714
|
+
if (offsets !== null && offsets !== void 0 && offsets.startByte && offsets !== null && offsets !== void 0 && offsets.endByte) {
|
|
1715
|
+
headers['Range'] = "bytes=".concat(offsets.startByte, "-").concat(offsets.endByte - 1);
|
|
1716
|
+
}
|
|
1717
|
+
storageName = createPartialFileName(url, offsets);
|
|
1718
|
+
if (!directoryHandle) {
|
|
1719
|
+
_context.next = 10;
|
|
1720
|
+
break;
|
|
1721
|
+
}
|
|
1722
|
+
_context.next = 6;
|
|
1723
|
+
return readFile(directoryHandle, storageName, offsets);
|
|
1724
|
+
case 6:
|
|
1725
|
+
file = _context.sent;
|
|
1726
|
+
if (!file) {
|
|
1727
|
+
_context.next = 10;
|
|
1728
|
+
break;
|
|
1729
|
+
}
|
|
1730
|
+
callBack({
|
|
1731
|
+
url: url,
|
|
1732
|
+
fileArraybuffer: new Uint8Array(file),
|
|
1733
|
+
offsets: offsets
|
|
1734
|
+
});
|
|
1735
|
+
return _context.abrupt("return");
|
|
1736
|
+
case 10:
|
|
1737
|
+
_context.next = 12;
|
|
1265
1738
|
return fetch(url, {
|
|
1266
1739
|
headers: headers
|
|
1267
1740
|
}).then(function (response) {
|
|
1268
1741
|
return response.arrayBuffer();
|
|
1269
1742
|
}).then(function (data) {
|
|
1270
|
-
|
|
1743
|
+
callBack({
|
|
1271
1744
|
url: url,
|
|
1272
|
-
fileArraybuffer: new Uint8Array(data)
|
|
1745
|
+
fileArraybuffer: new Uint8Array(data),
|
|
1746
|
+
offsets: offsets
|
|
1273
1747
|
});
|
|
1748
|
+
if (directoryHandle) {
|
|
1749
|
+
writeFile(directoryHandle, storageName, data);
|
|
1750
|
+
}
|
|
1274
1751
|
})["catch"](function (error) {
|
|
1275
1752
|
throw new CustomError('filePartial.ts: Error when fetching file: ' + (error === null || error === void 0 ? void 0 : error.message));
|
|
1276
1753
|
});
|
|
1277
|
-
case
|
|
1754
|
+
case 12:
|
|
1278
1755
|
case "end":
|
|
1279
1756
|
return _context.stop();
|
|
1280
1757
|
}
|
|
@@ -1294,6 +1771,7 @@ function fileStreaming_toPrimitive(t, r) { if ("object" != fileStreaming_typeof(
|
|
|
1294
1771
|
function fileStreaming_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
1295
1772
|
function fileStreaming_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { fileStreaming_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { fileStreaming_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
1296
1773
|
|
|
1774
|
+
|
|
1297
1775
|
var fileStreaming = {
|
|
1298
1776
|
maxFetchSize: 4 * 1024 * 1024 * 1024,
|
|
1299
1777
|
// 4GB
|
|
@@ -1311,60 +1789,80 @@ var fileStreaming = {
|
|
|
1311
1789
|
stream: function stream(args, callBack) {
|
|
1312
1790
|
var _this = this;
|
|
1313
1791
|
return fileStreaming_asyncToGenerator(/*#__PURE__*/fileStreaming_regeneratorRuntime().mark(function _callee() {
|
|
1314
|
-
var url, headers, useSharedArrayBuffer, controller, sharedArraybuffer, fileArraybuffer, _response$body, response, reader, result, completed, totalLength, firstChunk, position, chunk, streamingError;
|
|
1792
|
+
var url, headers, useSharedArrayBuffer, directoryHandle, controller, sharedArraybuffer, fileArraybuffer, _response$body, fileName, file, response, reader, result, completed, totalLength, firstChunk, position, chunk, streamingError;
|
|
1315
1793
|
return fileStreaming_regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1316
1794
|
while (1) switch (_context.prev = _context.next) {
|
|
1317
1795
|
case 0:
|
|
1318
|
-
url = args.url, headers = args.headers, useSharedArrayBuffer = args.useSharedArrayBuffer;
|
|
1796
|
+
url = args.url, headers = args.headers, useSharedArrayBuffer = args.useSharedArrayBuffer, directoryHandle = args.directoryHandle;
|
|
1319
1797
|
controller = new AbortController();
|
|
1320
1798
|
sharedArraybuffer = null;
|
|
1321
1799
|
fileArraybuffer = null;
|
|
1322
1800
|
_context.prev = 4;
|
|
1323
|
-
|
|
1801
|
+
fileName = createStreamingFileName(url);
|
|
1802
|
+
if (!directoryHandle) {
|
|
1803
|
+
_context.next = 13;
|
|
1804
|
+
break;
|
|
1805
|
+
}
|
|
1806
|
+
_context.next = 9;
|
|
1807
|
+
return readFile(directoryHandle, fileName);
|
|
1808
|
+
case 9:
|
|
1809
|
+
file = _context.sent;
|
|
1810
|
+
if (!file) {
|
|
1811
|
+
_context.next = 13;
|
|
1812
|
+
break;
|
|
1813
|
+
}
|
|
1814
|
+
callBack({
|
|
1815
|
+
url: url,
|
|
1816
|
+
position: file.byteLength,
|
|
1817
|
+
fileArraybuffer: new Uint8Array(file)
|
|
1818
|
+
});
|
|
1819
|
+
return _context.abrupt("return");
|
|
1820
|
+
case 13:
|
|
1821
|
+
_context.next = 15;
|
|
1324
1822
|
return fetch(url, {
|
|
1325
1823
|
headers: _objectSpread({}, headers),
|
|
1326
1824
|
signal: controller.signal
|
|
1327
1825
|
});
|
|
1328
|
-
case
|
|
1826
|
+
case 15:
|
|
1329
1827
|
response = _context.sent;
|
|
1330
1828
|
if (response.ok) {
|
|
1331
|
-
_context.next =
|
|
1829
|
+
_context.next = 18;
|
|
1332
1830
|
break;
|
|
1333
1831
|
}
|
|
1334
1832
|
throw new CustomError("HTTP error! status: ".concat(response.status));
|
|
1335
|
-
case
|
|
1833
|
+
case 18:
|
|
1336
1834
|
reader = (_response$body = response.body) === null || _response$body === void 0 ? void 0 : _response$body.getReader();
|
|
1337
1835
|
if (reader) {
|
|
1338
|
-
_context.next =
|
|
1836
|
+
_context.next = 21;
|
|
1339
1837
|
break;
|
|
1340
1838
|
}
|
|
1341
1839
|
throw new CustomError('Failed to get reader from response body');
|
|
1342
|
-
case
|
|
1840
|
+
case 21:
|
|
1343
1841
|
completed = false;
|
|
1344
1842
|
totalLength = parseInt(response.headers.get('Content-Length') || '0', 10);
|
|
1345
|
-
_context.next =
|
|
1843
|
+
_context.next = 25;
|
|
1346
1844
|
return reader.read();
|
|
1347
|
-
case
|
|
1845
|
+
case 25:
|
|
1348
1846
|
firstChunk = _context.sent;
|
|
1349
1847
|
completed = firstChunk.done;
|
|
1350
1848
|
if (firstChunk.value) {
|
|
1351
|
-
_context.next =
|
|
1849
|
+
_context.next = 29;
|
|
1352
1850
|
break;
|
|
1353
1851
|
}
|
|
1354
1852
|
throw new CustomError('The fetched chunks does not have value');
|
|
1355
|
-
case
|
|
1853
|
+
case 29:
|
|
1356
1854
|
if (completed) {
|
|
1357
|
-
_context.next =
|
|
1855
|
+
_context.next = 58;
|
|
1358
1856
|
break;
|
|
1359
1857
|
}
|
|
1360
1858
|
position = firstChunk.value.length;
|
|
1361
1859
|
if (!(_this.fetchedSize + position > _this.maxFetchSize)) {
|
|
1362
|
-
_context.next =
|
|
1860
|
+
_context.next = 34;
|
|
1363
1861
|
break;
|
|
1364
1862
|
}
|
|
1365
1863
|
controller.abort();
|
|
1366
1864
|
throw new CustomError("Maximum size(".concat(_this.maxFetchSize, ") for fetching files reached"));
|
|
1367
|
-
case
|
|
1865
|
+
case 34:
|
|
1368
1866
|
_this.fetchedSize += position;
|
|
1369
1867
|
if (useSharedArrayBuffer) {
|
|
1370
1868
|
sharedArraybuffer = new SharedArrayBuffer(totalLength);
|
|
@@ -1378,32 +1876,32 @@ var fileStreaming = {
|
|
|
1378
1876
|
position: position,
|
|
1379
1877
|
fileArraybuffer: fileArraybuffer
|
|
1380
1878
|
});
|
|
1381
|
-
case
|
|
1879
|
+
case 38:
|
|
1382
1880
|
if (completed) {
|
|
1383
|
-
_context.next =
|
|
1881
|
+
_context.next = 57;
|
|
1384
1882
|
break;
|
|
1385
1883
|
}
|
|
1386
|
-
_context.next =
|
|
1884
|
+
_context.next = 41;
|
|
1387
1885
|
return reader.read();
|
|
1388
|
-
case
|
|
1886
|
+
case 41:
|
|
1389
1887
|
result = _context.sent;
|
|
1390
1888
|
if (!result.done) {
|
|
1391
|
-
_context.next =
|
|
1889
|
+
_context.next = 45;
|
|
1392
1890
|
break;
|
|
1393
1891
|
}
|
|
1394
1892
|
completed = true;
|
|
1395
|
-
return _context.abrupt("continue",
|
|
1396
|
-
case
|
|
1893
|
+
return _context.abrupt("continue", 38);
|
|
1894
|
+
case 45:
|
|
1397
1895
|
chunk = result.value;
|
|
1398
1896
|
if (!(_this.fetchedSize + chunk.length > _this.maxFetchSize)) {
|
|
1399
|
-
_context.next =
|
|
1897
|
+
_context.next = 51;
|
|
1400
1898
|
break;
|
|
1401
1899
|
}
|
|
1402
1900
|
sharedArraybuffer = null;
|
|
1403
1901
|
fileArraybuffer = null;
|
|
1404
1902
|
controller.abort();
|
|
1405
1903
|
throw new CustomError("Maximum size(".concat(_this.maxFetchSize, ") for fetching files reached"));
|
|
1406
|
-
case
|
|
1904
|
+
case 51:
|
|
1407
1905
|
_this.fetchedSize += chunk.length;
|
|
1408
1906
|
fileArraybuffer.set(chunk, position);
|
|
1409
1907
|
position += chunk.length;
|
|
@@ -1413,28 +1911,32 @@ var fileStreaming = {
|
|
|
1413
1911
|
position: position,
|
|
1414
1912
|
chunk: !useSharedArrayBuffer ? chunk : undefined
|
|
1415
1913
|
});
|
|
1416
|
-
_context.next =
|
|
1914
|
+
_context.next = 38;
|
|
1417
1915
|
break;
|
|
1418
|
-
case
|
|
1419
|
-
|
|
1916
|
+
case 57:
|
|
1917
|
+
if (directoryHandle) {
|
|
1918
|
+
writeFile(directoryHandle, fileName, fileArraybuffer.slice().buffer);
|
|
1919
|
+
}
|
|
1920
|
+
case 58:
|
|
1921
|
+
_context.next = 65;
|
|
1420
1922
|
break;
|
|
1421
|
-
case
|
|
1422
|
-
_context.prev =
|
|
1923
|
+
case 60:
|
|
1924
|
+
_context.prev = 60;
|
|
1423
1925
|
_context.t0 = _context["catch"](4);
|
|
1424
1926
|
streamingError = new CustomError('fileStreaming.ts: ' + _context.t0.message || 0);
|
|
1425
1927
|
console.error(streamingError.message, _context.t0);
|
|
1426
1928
|
throw streamingError;
|
|
1427
|
-
case
|
|
1428
|
-
_context.prev =
|
|
1929
|
+
case 65:
|
|
1930
|
+
_context.prev = 65;
|
|
1429
1931
|
sharedArraybuffer = null;
|
|
1430
1932
|
fileArraybuffer = null;
|
|
1431
1933
|
controller.abort();
|
|
1432
|
-
return _context.finish(
|
|
1433
|
-
case
|
|
1934
|
+
return _context.finish(65);
|
|
1935
|
+
case 70:
|
|
1434
1936
|
case "end":
|
|
1435
1937
|
return _context.stop();
|
|
1436
1938
|
}
|
|
1437
|
-
}, _callee, null, [[4,
|
|
1939
|
+
}, _callee, null, [[4, 60, 65, 70]]);
|
|
1438
1940
|
}))();
|
|
1439
1941
|
}
|
|
1440
1942
|
};
|
|
@@ -1472,6 +1974,12 @@ function register(workerNames, maxFetchSize) {
|
|
|
1472
1974
|
}
|
|
1473
1975
|
;// ./src/classes/CodDicomWebServer.ts
|
|
1474
1976
|
function CodDicomWebServer_typeof(o) { "@babel/helpers - typeof"; return CodDicomWebServer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, CodDicomWebServer_typeof(o); }
|
|
1977
|
+
function CodDicomWebServer_slicedToArray(r, e) { return CodDicomWebServer_arrayWithHoles(r) || CodDicomWebServer_iterableToArrayLimit(r, e) || CodDicomWebServer_unsupportedIterableToArray(r, e) || CodDicomWebServer_nonIterableRest(); }
|
|
1978
|
+
function CodDicomWebServer_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
1979
|
+
function CodDicomWebServer_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return CodDicomWebServer_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? CodDicomWebServer_arrayLikeToArray(r, a) : void 0; } }
|
|
1980
|
+
function CodDicomWebServer_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1981
|
+
function CodDicomWebServer_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
1982
|
+
function CodDicomWebServer_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
1475
1983
|
function CodDicomWebServer_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ CodDicomWebServer_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == CodDicomWebServer_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(CodDicomWebServer_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
1476
1984
|
function CodDicomWebServer_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
1477
1985
|
function CodDicomWebServer_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { CodDicomWebServer_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { CodDicomWebServer_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
@@ -1490,6 +1998,7 @@ function CodDicomWebServer_toPrimitive(t, r) { if ("object" != CodDicomWebServer
|
|
|
1490
1998
|
|
|
1491
1999
|
|
|
1492
2000
|
|
|
2001
|
+
|
|
1493
2002
|
var CodDicomWebServer = /*#__PURE__*/function () {
|
|
1494
2003
|
function CodDicomWebServer() {
|
|
1495
2004
|
var _this = this;
|
|
@@ -1498,7 +2007,8 @@ var CodDicomWebServer = /*#__PURE__*/function () {
|
|
|
1498
2007
|
CodDicomWebServer_defineProperty(this, "filePromises", {});
|
|
1499
2008
|
CodDicomWebServer_defineProperty(this, "options", {
|
|
1500
2009
|
maxWorkerFetchSize: Infinity,
|
|
1501
|
-
domain: src_constants.url.DOMAIN
|
|
2010
|
+
domain: src_constants.url.DOMAIN,
|
|
2011
|
+
enableLocalCache: false
|
|
1502
2012
|
});
|
|
1503
2013
|
CodDicomWebServer_defineProperty(this, "fileManager", void 0);
|
|
1504
2014
|
CodDicomWebServer_defineProperty(this, "metadataManager", void 0);
|
|
@@ -1515,9 +2025,11 @@ var CodDicomWebServer = /*#__PURE__*/function () {
|
|
|
1515
2025
|
});
|
|
1516
2026
|
var maxWorkerFetchSize = args.maxWorkerFetchSize,
|
|
1517
2027
|
domain = args.domain,
|
|
1518
|
-
disableWorker = args.disableWorker
|
|
2028
|
+
disableWorker = args.disableWorker,
|
|
2029
|
+
enableLocalCache = args.enableLocalCache;
|
|
1519
2030
|
this.options.maxWorkerFetchSize = maxWorkerFetchSize || this.options.maxWorkerFetchSize;
|
|
1520
2031
|
this.options.domain = domain || this.options.domain;
|
|
2032
|
+
this.options.enableLocalCache = !!enableLocalCache;
|
|
1521
2033
|
var fileStreamingScriptName = src_constants.dataRetrieval.FILE_STREAMING_WORKER_NAME;
|
|
1522
2034
|
var filePartialScriptName = src_constants.dataRetrieval.FILE_PARTIAL_WORKER_NAME;
|
|
1523
2035
|
this.fileManager = new fileManager({
|
|
@@ -1726,6 +2238,7 @@ var CodDicomWebServer = /*#__PURE__*/function () {
|
|
|
1726
2238
|
fetchType,
|
|
1727
2239
|
isBytesOptimized,
|
|
1728
2240
|
extractedFile,
|
|
2241
|
+
directoryHandle,
|
|
1729
2242
|
_this$getOptions,
|
|
1730
2243
|
maxWorkerFetchSize,
|
|
1731
2244
|
dataRetrievalManager,
|
|
@@ -1753,6 +2266,17 @@ var CodDicomWebServer = /*#__PURE__*/function () {
|
|
|
1753
2266
|
}
|
|
1754
2267
|
}));
|
|
1755
2268
|
case 5:
|
|
2269
|
+
_context2.t0 = this.options.enableLocalCache;
|
|
2270
|
+
if (!_context2.t0) {
|
|
2271
|
+
_context2.next = 10;
|
|
2272
|
+
break;
|
|
2273
|
+
}
|
|
2274
|
+
_context2.next = 9;
|
|
2275
|
+
return getDirectoryHandle();
|
|
2276
|
+
case 9:
|
|
2277
|
+
_context2.t0 = _context2.sent;
|
|
2278
|
+
case 10:
|
|
2279
|
+
directoryHandle = _context2.t0;
|
|
1756
2280
|
_this$getOptions = this.getOptions(), maxWorkerFetchSize = _this$getOptions.maxWorkerFetchSize;
|
|
1757
2281
|
dataRetrievalManager = getDataRetrievalManager();
|
|
1758
2282
|
_constants$dataRetrie = src_constants.dataRetrieval, FILE_STREAMING_WORKER_NAME = _constants$dataRetrie.FILE_STREAMING_WORKER_NAME, FILE_PARTIAL_WORKER_NAME = _constants$dataRetrie.FILE_PARTIAL_WORKER_NAME, THRESHOLD = _constants$dataRetrie.THRESHOLD;
|
|
@@ -1784,13 +2308,10 @@ var CodDicomWebServer = /*#__PURE__*/function () {
|
|
|
1784
2308
|
dataRetrievalManager.executeTask(FILE_STREAMING_WORKER_NAME, 'stream', {
|
|
1785
2309
|
url: fileUrl,
|
|
1786
2310
|
headers: headers,
|
|
1787
|
-
useSharedArrayBuffer: useSharedArrayBuffer
|
|
2311
|
+
useSharedArrayBuffer: useSharedArrayBuffer,
|
|
2312
|
+
directoryHandle: directoryHandle
|
|
1788
2313
|
}).then(function () {
|
|
1789
|
-
|
|
1790
|
-
resolveFile();
|
|
1791
|
-
} else {
|
|
1792
|
-
rejectFile(new CustomError("File - ".concat(fileUrl, " not found")));
|
|
1793
|
-
}
|
|
2314
|
+
resolveFile();
|
|
1794
2315
|
})["catch"](function (error) {
|
|
1795
2316
|
rejectFile(error);
|
|
1796
2317
|
}).then(function () {
|
|
@@ -1800,7 +2321,6 @@ var CodDicomWebServer = /*#__PURE__*/function () {
|
|
|
1800
2321
|
} else if (fetchType === FetchTypeEnum.BYTES_OPTIMIZED && offsets) {
|
|
1801
2322
|
var startByte = offsets.startByte,
|
|
1802
2323
|
endByte = offsets.endByte;
|
|
1803
|
-
headers['Range'] = "bytes=".concat(startByte, "-").concat(endByte - 1);
|
|
1804
2324
|
var bytesRemovedUrl = fileUrl.split('?bytes=')[0];
|
|
1805
2325
|
var _handleSlice = function handleSlice(evt) {
|
|
1806
2326
|
if (evt instanceof CustomErrorEvent) {
|
|
@@ -1809,26 +2329,26 @@ var CodDicomWebServer = /*#__PURE__*/function () {
|
|
|
1809
2329
|
}
|
|
1810
2330
|
var _evt$data2 = evt.data,
|
|
1811
2331
|
url = _evt$data2.url,
|
|
1812
|
-
fileArraybuffer = _evt$data2.fileArraybuffer
|
|
1813
|
-
|
|
2332
|
+
fileArraybuffer = _evt$data2.fileArraybuffer,
|
|
2333
|
+
offsets = _evt$data2.offsets;
|
|
2334
|
+
if (url === bytesRemovedUrl && offsets.startByte === startByte && offsets.endByte === endByte) {
|
|
1814
2335
|
_this3.fileManager.set(fileUrl, {
|
|
1815
2336
|
data: fileArraybuffer,
|
|
1816
2337
|
position: fileArraybuffer.length
|
|
1817
2338
|
});
|
|
1818
2339
|
dataRetrievalManager.removeEventListener(FILE_PARTIAL_WORKER_NAME, 'message', _handleSlice);
|
|
2340
|
+
resolveFile();
|
|
1819
2341
|
}
|
|
1820
2342
|
};
|
|
1821
2343
|
dataRetrievalManager.addEventListener(FILE_PARTIAL_WORKER_NAME, 'message', _handleSlice);
|
|
1822
2344
|
dataRetrievalManager.executeTask(FILE_PARTIAL_WORKER_NAME, 'partial', {
|
|
1823
2345
|
url: bytesRemovedUrl,
|
|
2346
|
+
offsets: {
|
|
2347
|
+
startByte: startByte,
|
|
2348
|
+
endByte: endByte
|
|
2349
|
+
},
|
|
1824
2350
|
headers: headers,
|
|
1825
|
-
|
|
1826
|
-
}).then(function () {
|
|
1827
|
-
if (_this3.fileManager.getPosition(fileUrl)) {
|
|
1828
|
-
resolveFile();
|
|
1829
|
-
} else {
|
|
1830
|
-
rejectFile(new CustomError("File - ".concat(fileUrl, " not found")));
|
|
1831
|
-
}
|
|
2351
|
+
directoryHandle: directoryHandle
|
|
1832
2352
|
})["catch"](function (error) {
|
|
1833
2353
|
rejectFile(error);
|
|
1834
2354
|
}).then(function () {
|
|
@@ -1877,9 +2397,13 @@ var CodDicomWebServer = /*#__PURE__*/function () {
|
|
|
1877
2397
|
}
|
|
1878
2398
|
tarPromise.then(function () {
|
|
1879
2399
|
if (!requestResolved) {
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
2400
|
+
if (_this3.fileManager.getPosition(fileUrl)) {
|
|
2401
|
+
var file = _this3.fileManager.get(fileUrl, isBytesOptimized ? undefined : offsets);
|
|
2402
|
+
requestResolved = true;
|
|
2403
|
+
resolveRequest(file === null || file === void 0 ? void 0 : file.buffer);
|
|
2404
|
+
} else {
|
|
2405
|
+
rejectRequest(new CustomError("File - ".concat(fileUrl, " not found")));
|
|
2406
|
+
}
|
|
1883
2407
|
}
|
|
1884
2408
|
})["catch"](function (error) {
|
|
1885
2409
|
rejectRequest(error);
|
|
@@ -1887,7 +2411,7 @@ var CodDicomWebServer = /*#__PURE__*/function () {
|
|
|
1887
2411
|
dataRetrievalManager.removeEventListener(FILE_STREAMING_WORKER_NAME, 'message', handleChunkAppend);
|
|
1888
2412
|
});
|
|
1889
2413
|
}));
|
|
1890
|
-
case
|
|
2414
|
+
case 16:
|
|
1891
2415
|
case "end":
|
|
1892
2416
|
return _context2.stop();
|
|
1893
2417
|
}
|
|
@@ -1925,11 +2449,13 @@ var CodDicomWebServer = /*#__PURE__*/function () {
|
|
|
1925
2449
|
key: "parseMetadata",
|
|
1926
2450
|
value: function parseMetadata(metadata, type, sopInstanceUID) {
|
|
1927
2451
|
if (type === RequestType.INSTANCE_METADATA) {
|
|
1928
|
-
var _Object$
|
|
1929
|
-
return (_Object$
|
|
1930
|
-
var
|
|
1931
|
-
|
|
1932
|
-
|
|
2452
|
+
var _Object$entries$find;
|
|
2453
|
+
return (_Object$entries$find = Object.entries(metadata.cod.instances).find(function (_ref3) {
|
|
2454
|
+
var _ref4 = CodDicomWebServer_slicedToArray(_ref3, 2),
|
|
2455
|
+
key = _ref4[0],
|
|
2456
|
+
instance = _ref4[1];
|
|
2457
|
+
return key === sopInstanceUID;
|
|
2458
|
+
})) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[1].metadata;
|
|
1933
2459
|
} else {
|
|
1934
2460
|
return Object.values(metadata.cod.instances).map(function (instance) {
|
|
1935
2461
|
return instance.metadata;
|
|
@@ -1946,9 +2472,11 @@ var CodDicomWebServer = /*#__PURE__*/function () {
|
|
|
1946
2472
|
|
|
1947
2473
|
|
|
1948
2474
|
|
|
2475
|
+
|
|
1949
2476
|
/* harmony default export */ const src = ({
|
|
1950
2477
|
FetchType: FetchType,
|
|
1951
|
-
CodDicomWebServer: classes_CodDicomWebServer
|
|
2478
|
+
CodDicomWebServer: classes_CodDicomWebServer,
|
|
2479
|
+
clearPartialFiles: clearPartialFiles
|
|
1952
2480
|
});
|
|
1953
2481
|
})();
|
|
1954
2482
|
|