@eluvio/elv-client-js 3.1.63 → 3.1.67
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 +13 -2
- package/dist/ElvClient-min.js +3 -3
- package/dist/ElvClient-node-min.js +3 -3
- package/dist/ElvFrameClient-min.js +1 -1
- package/dist/src/AuthorizationClient.js +21 -15
- package/dist/src/ElvClient.js +16 -4
- package/dist/src/FrameClient.js +1 -1
- package/dist/src/RemoteSigner.js +1 -0
- package/dist/src/client/ContentAccess.js +868 -818
- package/dist/src/client/NFT.js +11 -11
- package/package-lock.json +16 -11
- package/package.json +3 -1
- package/src/AuthorizationClient.js +6 -0
- package/src/ElvClient.js +11 -1
- package/src/FrameClient.js +1 -0
- package/src/RemoteSigner.js +2 -0
- package/src/client/ContentAccess.js +29 -0
- package/src/client/NFT.js +26 -23
- package/testScripts/InitializeTenant.js +32 -1
- package/testScripts/Test.js +19 -0
- package/typeSpecs/Default.js +80 -0
- package/typeSpecs/DropEventSite.js +673 -0
- package/typeSpecs/EventSite.js +776 -0
- package/typeSpecs/EventSiteExtras.js +59 -0
- package/typeSpecs/EventTenant.js +86 -0
- package/typeSpecs/LanguageCodes.js +221 -0
- package/typeSpecs/MainSite.js +279 -0
- package/typeSpecs/Marketplace.js +203 -0
- package/typeSpecs/NFTCollection.js +69 -0
- package/typeSpecs/NFTTemplate.js +269 -0
- package/utilities/ChannelCreate.js +205 -0
- package/utilities/ChannelStartVaLOffering.js +63 -29
- package/utilities/LibraryListObjects.js +26 -2
- package/utilities/MezUnifyAudioDrmKeys.js +69 -0
- package/utilities/lib/concerns/Logger.js +3 -2
- package/utilities/lib/models/PublicMetadataPath.js +19 -0
|
@@ -1170,6 +1170,56 @@ exports.ContentObjectOwner = function _callee16(_ref12) {
|
|
|
1170
1170
|
}
|
|
1171
1171
|
}, null, this);
|
|
1172
1172
|
};
|
|
1173
|
+
/**
|
|
1174
|
+
* Retrieve the tenant ID associated with the specified content object
|
|
1175
|
+
*
|
|
1176
|
+
* @methodGroup Content Objects
|
|
1177
|
+
*
|
|
1178
|
+
* @namedParams
|
|
1179
|
+
* @param {string=} objectId - ID of the object
|
|
1180
|
+
* @param {string=} versionHash - Version hash of the object
|
|
1181
|
+
*
|
|
1182
|
+
* @returns {Promise<string>} - Tenant ID of the object
|
|
1183
|
+
*/
|
|
1184
|
+
|
|
1185
|
+
|
|
1186
|
+
exports.ContentObjectTenantId = function _callee17(_ref13) {
|
|
1187
|
+
var objectId, versionHash;
|
|
1188
|
+
return _regeneratorRuntime.async(function _callee17$(_context17) {
|
|
1189
|
+
while (1) {
|
|
1190
|
+
switch (_context17.prev = _context17.next) {
|
|
1191
|
+
case 0:
|
|
1192
|
+
objectId = _ref13.objectId, versionHash = _ref13.versionHash;
|
|
1193
|
+
versionHash ? ValidateVersion(versionHash) : ValidateObject(objectId);
|
|
1194
|
+
|
|
1195
|
+
if (versionHash) {
|
|
1196
|
+
objectId = this.utils.DecodeVersionHash(versionHash).objectId;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
if (this.objectTenantIds[objectId]) {
|
|
1200
|
+
_context17.next = 7;
|
|
1201
|
+
break;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
_context17.next = 6;
|
|
1205
|
+
return _regeneratorRuntime.awrap(this.authClient.MakeElvMasterCall({
|
|
1206
|
+
methodName: "elv_getTenantById",
|
|
1207
|
+
params: [this.contentSpaceId, objectId]
|
|
1208
|
+
}));
|
|
1209
|
+
|
|
1210
|
+
case 6:
|
|
1211
|
+
this.objectTenantIds[objectId] = _context17.sent;
|
|
1212
|
+
|
|
1213
|
+
case 7:
|
|
1214
|
+
return _context17.abrupt("return", this.objectTenantIds[objectId]);
|
|
1215
|
+
|
|
1216
|
+
case 8:
|
|
1217
|
+
case "end":
|
|
1218
|
+
return _context17.stop();
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
}, null, this);
|
|
1222
|
+
};
|
|
1173
1223
|
/**
|
|
1174
1224
|
* Retrieve the library ID for the specified content object
|
|
1175
1225
|
*
|
|
@@ -1183,128 +1233,128 @@ exports.ContentObjectOwner = function _callee16(_ref12) {
|
|
|
1183
1233
|
*/
|
|
1184
1234
|
|
|
1185
1235
|
|
|
1186
|
-
exports.ContentObjectLibraryId = function
|
|
1236
|
+
exports.ContentObjectLibraryId = function _callee19(_ref14) {
|
|
1187
1237
|
var _this6 = this;
|
|
1188
1238
|
|
|
1189
1239
|
var objectId, versionHash;
|
|
1190
|
-
return _regeneratorRuntime.async(function
|
|
1240
|
+
return _regeneratorRuntime.async(function _callee19$(_context19) {
|
|
1191
1241
|
while (1) {
|
|
1192
|
-
switch (
|
|
1242
|
+
switch (_context19.prev = _context19.next) {
|
|
1193
1243
|
case 0:
|
|
1194
|
-
objectId =
|
|
1244
|
+
objectId = _ref14.objectId, versionHash = _ref14.versionHash;
|
|
1195
1245
|
versionHash ? ValidateVersion(versionHash) : ValidateObject(objectId);
|
|
1196
1246
|
|
|
1197
1247
|
if (versionHash) {
|
|
1198
1248
|
objectId = this.utils.DecodeVersionHash(versionHash).objectId;
|
|
1199
1249
|
}
|
|
1200
1250
|
|
|
1201
|
-
|
|
1251
|
+
_context19.next = 5;
|
|
1202
1252
|
return _regeneratorRuntime.awrap(this.authClient.AccessType(objectId));
|
|
1203
1253
|
|
|
1204
1254
|
case 5:
|
|
1205
|
-
|
|
1206
|
-
|
|
1255
|
+
_context19.t0 = _context19.sent;
|
|
1256
|
+
_context19.next = _context19.t0 === this.authClient.ACCESS_TYPES.LIBRARY ? 8 : _context19.t0 === this.authClient.ACCESS_TYPES.OBJECT ? 9 : _context19.t0 === this.authClient.ACCESS_TYPES.OTHER ? 20 : 21;
|
|
1207
1257
|
break;
|
|
1208
1258
|
|
|
1209
1259
|
case 8:
|
|
1210
|
-
return
|
|
1260
|
+
return _context19.abrupt("return", this.utils.AddressToLibraryId(this.utils.HashToAddress(objectId)));
|
|
1211
1261
|
|
|
1212
1262
|
case 9:
|
|
1213
1263
|
if (!this.objectLibraryIds[objectId]) {
|
|
1214
1264
|
this.Log("Retrieving content object library ID: ".concat(objectId || versionHash));
|
|
1215
|
-
this.objectLibraryIds[objectId] = new Promise(function
|
|
1216
|
-
return _regeneratorRuntime.async(function
|
|
1265
|
+
this.objectLibraryIds[objectId] = new Promise(function _callee18(resolve, reject) {
|
|
1266
|
+
return _regeneratorRuntime.async(function _callee18$(_context18) {
|
|
1217
1267
|
while (1) {
|
|
1218
|
-
switch (
|
|
1268
|
+
switch (_context18.prev = _context18.next) {
|
|
1219
1269
|
case 0:
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1270
|
+
_context18.prev = 0;
|
|
1271
|
+
_context18.t0 = resolve;
|
|
1272
|
+
_context18.t1 = _this6.utils;
|
|
1273
|
+
_context18.next = 5;
|
|
1224
1274
|
return _regeneratorRuntime.awrap(_this6.CallContractMethod({
|
|
1225
1275
|
contractAddress: _this6.utils.HashToAddress(objectId),
|
|
1226
1276
|
methodName: "libraryAddress"
|
|
1227
1277
|
}));
|
|
1228
1278
|
|
|
1229
1279
|
case 5:
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
(0,
|
|
1233
|
-
|
|
1280
|
+
_context18.t2 = _context18.sent;
|
|
1281
|
+
_context18.t3 = _context18.t1.AddressToLibraryId.call(_context18.t1, _context18.t2);
|
|
1282
|
+
(0, _context18.t0)(_context18.t3);
|
|
1283
|
+
_context18.next = 13;
|
|
1234
1284
|
break;
|
|
1235
1285
|
|
|
1236
1286
|
case 10:
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
reject(
|
|
1287
|
+
_context18.prev = 10;
|
|
1288
|
+
_context18.t4 = _context18["catch"](0);
|
|
1289
|
+
reject(_context18.t4);
|
|
1240
1290
|
|
|
1241
1291
|
case 13:
|
|
1242
1292
|
case "end":
|
|
1243
|
-
return
|
|
1293
|
+
return _context18.stop();
|
|
1244
1294
|
}
|
|
1245
1295
|
}
|
|
1246
1296
|
}, null, null, [[0, 10]]);
|
|
1247
1297
|
});
|
|
1248
1298
|
}
|
|
1249
1299
|
|
|
1250
|
-
|
|
1251
|
-
|
|
1300
|
+
_context19.prev = 10;
|
|
1301
|
+
_context19.next = 13;
|
|
1252
1302
|
return _regeneratorRuntime.awrap(this.objectLibraryIds[objectId]);
|
|
1253
1303
|
|
|
1254
1304
|
case 13:
|
|
1255
|
-
return
|
|
1305
|
+
return _context19.abrupt("return", _context19.sent);
|
|
1256
1306
|
|
|
1257
1307
|
case 16:
|
|
1258
|
-
|
|
1259
|
-
|
|
1308
|
+
_context19.prev = 16;
|
|
1309
|
+
_context19.t1 = _context19["catch"](10);
|
|
1260
1310
|
delete this.objectLibraryIds[objectId];
|
|
1261
|
-
throw
|
|
1311
|
+
throw _context19.t1;
|
|
1262
1312
|
|
|
1263
1313
|
case 20:
|
|
1264
1314
|
throw Error("Unable to retrieve library ID for ".concat(versionHash || objectId, ": Unknown type. (wrong network or deleted object?)"));
|
|
1265
1315
|
|
|
1266
1316
|
case 21:
|
|
1267
|
-
return
|
|
1317
|
+
return _context19.abrupt("return", this.contentSpaceLibraryId);
|
|
1268
1318
|
|
|
1269
1319
|
case 22:
|
|
1270
1320
|
case "end":
|
|
1271
|
-
return
|
|
1321
|
+
return _context19.stop();
|
|
1272
1322
|
}
|
|
1273
1323
|
}
|
|
1274
1324
|
}, null, this, [[10, 16]]);
|
|
1275
1325
|
};
|
|
1276
1326
|
|
|
1277
|
-
exports.ProduceMetadataLinks = function
|
|
1327
|
+
exports.ProduceMetadataLinks = function _callee22(_ref15) {
|
|
1278
1328
|
var _this7 = this;
|
|
1279
1329
|
|
|
1280
|
-
var libraryId, objectId, versionHash,
|
|
1330
|
+
var libraryId, objectId, versionHash, _ref15$path, path, metadata, authorizationToken, result;
|
|
1281
1331
|
|
|
1282
|
-
return _regeneratorRuntime.async(function
|
|
1332
|
+
return _regeneratorRuntime.async(function _callee22$(_context22) {
|
|
1283
1333
|
while (1) {
|
|
1284
|
-
switch (
|
|
1334
|
+
switch (_context22.prev = _context22.next) {
|
|
1285
1335
|
case 0:
|
|
1286
|
-
libraryId =
|
|
1336
|
+
libraryId = _ref15.libraryId, objectId = _ref15.objectId, versionHash = _ref15.versionHash, _ref15$path = _ref15.path, path = _ref15$path === void 0 ? "/" : _ref15$path, metadata = _ref15.metadata, authorizationToken = _ref15.authorizationToken;
|
|
1287
1337
|
|
|
1288
1338
|
if (!(!metadata || _typeof(metadata) !== "object")) {
|
|
1289
|
-
|
|
1339
|
+
_context22.next = 3;
|
|
1290
1340
|
break;
|
|
1291
1341
|
}
|
|
1292
1342
|
|
|
1293
|
-
return
|
|
1343
|
+
return _context22.abrupt("return", metadata);
|
|
1294
1344
|
|
|
1295
1345
|
case 3:
|
|
1296
1346
|
if (!Array.isArray(metadata)) {
|
|
1297
|
-
|
|
1347
|
+
_context22.next = 7;
|
|
1298
1348
|
break;
|
|
1299
1349
|
}
|
|
1300
1350
|
|
|
1301
|
-
|
|
1302
|
-
return _regeneratorRuntime.awrap(this.utils.LimitedMap(5, metadata, function
|
|
1303
|
-
return _regeneratorRuntime.async(function
|
|
1351
|
+
_context22.next = 6;
|
|
1352
|
+
return _regeneratorRuntime.awrap(this.utils.LimitedMap(5, metadata, function _callee20(entry, i) {
|
|
1353
|
+
return _regeneratorRuntime.async(function _callee20$(_context20) {
|
|
1304
1354
|
while (1) {
|
|
1305
|
-
switch (
|
|
1355
|
+
switch (_context20.prev = _context20.next) {
|
|
1306
1356
|
case 0:
|
|
1307
|
-
|
|
1357
|
+
_context20.next = 2;
|
|
1308
1358
|
return _regeneratorRuntime.awrap(_this7.ProduceMetadataLinks({
|
|
1309
1359
|
libraryId: libraryId,
|
|
1310
1360
|
objectId: objectId,
|
|
@@ -1315,29 +1365,29 @@ exports.ProduceMetadataLinks = function _callee21(_ref14) {
|
|
|
1315
1365
|
}));
|
|
1316
1366
|
|
|
1317
1367
|
case 2:
|
|
1318
|
-
return
|
|
1368
|
+
return _context20.abrupt("return", _context20.sent);
|
|
1319
1369
|
|
|
1320
1370
|
case 3:
|
|
1321
1371
|
case "end":
|
|
1322
|
-
return
|
|
1372
|
+
return _context20.stop();
|
|
1323
1373
|
}
|
|
1324
1374
|
}
|
|
1325
1375
|
});
|
|
1326
1376
|
}));
|
|
1327
1377
|
|
|
1328
1378
|
case 6:
|
|
1329
|
-
return
|
|
1379
|
+
return _context22.abrupt("return", _context22.sent);
|
|
1330
1380
|
|
|
1331
1381
|
case 7:
|
|
1332
1382
|
if (!(metadata["/"] && (metadata["/"].match(/\.\/(rep|files)\/.+/) || metadata["/"].match(/^\/?qfab\/([\w]+)\/?(rep|files)\/.+/)))) {
|
|
1333
|
-
|
|
1383
|
+
_context22.next = 16;
|
|
1334
1384
|
break;
|
|
1335
1385
|
}
|
|
1336
1386
|
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1387
|
+
_context22.t0 = _objectSpread;
|
|
1388
|
+
_context22.t1 = {};
|
|
1389
|
+
_context22.t2 = metadata;
|
|
1390
|
+
_context22.next = 13;
|
|
1341
1391
|
return _regeneratorRuntime.awrap(this.LinkUrl({
|
|
1342
1392
|
libraryId: libraryId,
|
|
1343
1393
|
objectId: objectId,
|
|
@@ -1347,21 +1397,21 @@ exports.ProduceMetadataLinks = function _callee21(_ref14) {
|
|
|
1347
1397
|
}));
|
|
1348
1398
|
|
|
1349
1399
|
case 13:
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
url:
|
|
1400
|
+
_context22.t3 = _context22.sent;
|
|
1401
|
+
_context22.t4 = {
|
|
1402
|
+
url: _context22.t3
|
|
1353
1403
|
};
|
|
1354
|
-
return
|
|
1404
|
+
return _context22.abrupt("return", (0, _context22.t0)(_context22.t1, _context22.t2, _context22.t4));
|
|
1355
1405
|
|
|
1356
1406
|
case 16:
|
|
1357
1407
|
result = {};
|
|
1358
|
-
|
|
1359
|
-
return _regeneratorRuntime.awrap(this.utils.LimitedMap(5, Object.keys(metadata), function
|
|
1360
|
-
return _regeneratorRuntime.async(function
|
|
1408
|
+
_context22.next = 19;
|
|
1409
|
+
return _regeneratorRuntime.awrap(this.utils.LimitedMap(5, Object.keys(metadata), function _callee21(key) {
|
|
1410
|
+
return _regeneratorRuntime.async(function _callee21$(_context21) {
|
|
1361
1411
|
while (1) {
|
|
1362
|
-
switch (
|
|
1412
|
+
switch (_context21.prev = _context21.next) {
|
|
1363
1413
|
case 0:
|
|
1364
|
-
|
|
1414
|
+
_context21.next = 2;
|
|
1365
1415
|
return _regeneratorRuntime.awrap(_this7.ProduceMetadataLinks({
|
|
1366
1416
|
libraryId: libraryId,
|
|
1367
1417
|
objectId: objectId,
|
|
@@ -1372,35 +1422,35 @@ exports.ProduceMetadataLinks = function _callee21(_ref14) {
|
|
|
1372
1422
|
}));
|
|
1373
1423
|
|
|
1374
1424
|
case 2:
|
|
1375
|
-
result[key] =
|
|
1425
|
+
result[key] = _context21.sent;
|
|
1376
1426
|
|
|
1377
1427
|
case 3:
|
|
1378
1428
|
case "end":
|
|
1379
|
-
return
|
|
1429
|
+
return _context21.stop();
|
|
1380
1430
|
}
|
|
1381
1431
|
}
|
|
1382
1432
|
});
|
|
1383
1433
|
}));
|
|
1384
1434
|
|
|
1385
1435
|
case 19:
|
|
1386
|
-
return
|
|
1436
|
+
return _context22.abrupt("return", result);
|
|
1387
1437
|
|
|
1388
1438
|
case 20:
|
|
1389
1439
|
case "end":
|
|
1390
|
-
return
|
|
1440
|
+
return _context22.stop();
|
|
1391
1441
|
}
|
|
1392
1442
|
}
|
|
1393
1443
|
}, null, this);
|
|
1394
1444
|
};
|
|
1395
1445
|
|
|
1396
|
-
exports.MetadataAuth = function
|
|
1397
|
-
var libraryId, objectId, versionHash,
|
|
1446
|
+
exports.MetadataAuth = function _callee23(_ref16) {
|
|
1447
|
+
var libraryId, objectId, versionHash, _ref16$path, path, _ref16$channelAuth, channelAuth, visibility, accessType, isPublic, noAuth, kmsAddress;
|
|
1398
1448
|
|
|
1399
|
-
return _regeneratorRuntime.async(function
|
|
1449
|
+
return _regeneratorRuntime.async(function _callee23$(_context23) {
|
|
1400
1450
|
while (1) {
|
|
1401
|
-
switch (
|
|
1451
|
+
switch (_context23.prev = _context23.next) {
|
|
1402
1452
|
case 0:
|
|
1403
|
-
libraryId =
|
|
1453
|
+
libraryId = _ref16.libraryId, objectId = _ref16.objectId, versionHash = _ref16.versionHash, _ref16$path = _ref16.path, path = _ref16$path === void 0 ? "/" : _ref16$path, _ref16$channelAuth = _ref16.channelAuth, channelAuth = _ref16$channelAuth === void 0 ? false : _ref16$channelAuth;
|
|
1404
1454
|
ValidateParameters({
|
|
1405
1455
|
libraryId: libraryId,
|
|
1406
1456
|
objectId: objectId,
|
|
@@ -1411,43 +1461,43 @@ exports.MetadataAuth = function _callee22(_ref15) {
|
|
|
1411
1461
|
objectId = this.utils.DecodeVersionHash(versionHash).objectId;
|
|
1412
1462
|
}
|
|
1413
1463
|
|
|
1414
|
-
|
|
1464
|
+
_context23.next = 5;
|
|
1415
1465
|
return _regeneratorRuntime.awrap(this.Visibility({
|
|
1416
1466
|
id: objectId
|
|
1417
1467
|
}));
|
|
1418
1468
|
|
|
1419
1469
|
case 5:
|
|
1420
|
-
visibility =
|
|
1421
|
-
|
|
1470
|
+
visibility = _context23.sent;
|
|
1471
|
+
_context23.next = 8;
|
|
1422
1472
|
return _regeneratorRuntime.awrap(this.AccessType({
|
|
1423
1473
|
id: objectId
|
|
1424
1474
|
}));
|
|
1425
1475
|
|
|
1426
1476
|
case 8:
|
|
1427
|
-
accessType =
|
|
1477
|
+
accessType = _context23.sent;
|
|
1428
1478
|
isPublic = (path || "").replace(/^\/+/, "").startsWith("public");
|
|
1429
1479
|
noAuth = visibility >= 10 || isPublic && visibility >= 1;
|
|
1430
1480
|
|
|
1431
1481
|
if (!this.oauthToken) {
|
|
1432
|
-
|
|
1482
|
+
_context23.next = 19;
|
|
1433
1483
|
break;
|
|
1434
1484
|
}
|
|
1435
1485
|
|
|
1436
|
-
|
|
1486
|
+
_context23.next = 14;
|
|
1437
1487
|
return _regeneratorRuntime.awrap(this.authClient.KMSAddress({
|
|
1438
1488
|
objectId: objectId,
|
|
1439
1489
|
versionHash: versionHash
|
|
1440
1490
|
}));
|
|
1441
1491
|
|
|
1442
1492
|
case 14:
|
|
1443
|
-
kmsAddress =
|
|
1493
|
+
kmsAddress = _context23.sent;
|
|
1444
1494
|
|
|
1445
1495
|
if (!(kmsAddress && !this.utils.EqualAddress(kmsAddress, this.utils.nullAddress))) {
|
|
1446
|
-
|
|
1496
|
+
_context23.next = 19;
|
|
1447
1497
|
break;
|
|
1448
1498
|
}
|
|
1449
1499
|
|
|
1450
|
-
|
|
1500
|
+
_context23.next = 18;
|
|
1451
1501
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
|
|
1452
1502
|
libraryId: libraryId,
|
|
1453
1503
|
objectId: objectId,
|
|
@@ -1457,58 +1507,58 @@ exports.MetadataAuth = function _callee22(_ref15) {
|
|
|
1457
1507
|
}));
|
|
1458
1508
|
|
|
1459
1509
|
case 18:
|
|
1460
|
-
return
|
|
1510
|
+
return _context23.abrupt("return", _context23.sent);
|
|
1461
1511
|
|
|
1462
1512
|
case 19:
|
|
1463
1513
|
if (!(!this.inaccessibleLibraries[libraryId] && isPublic && accessType === this.authClient.ACCESS_TYPES.OBJECT && !channelAuth)) {
|
|
1464
|
-
|
|
1514
|
+
_context23.next = 47;
|
|
1465
1515
|
break;
|
|
1466
1516
|
}
|
|
1467
1517
|
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1518
|
+
_context23.prev = 20;
|
|
1519
|
+
_context23.t0 = _regeneratorRuntime;
|
|
1520
|
+
_context23.t1 = this.authClient;
|
|
1521
|
+
_context23.t2 = libraryId;
|
|
1472
1522
|
|
|
1473
|
-
if (
|
|
1474
|
-
|
|
1523
|
+
if (_context23.t2) {
|
|
1524
|
+
_context23.next = 28;
|
|
1475
1525
|
break;
|
|
1476
1526
|
}
|
|
1477
1527
|
|
|
1478
|
-
|
|
1528
|
+
_context23.next = 27;
|
|
1479
1529
|
return _regeneratorRuntime.awrap(this.ContentObjectLibraryId({
|
|
1480
1530
|
objectId: objectId,
|
|
1481
1531
|
versionHash: versionHash
|
|
1482
1532
|
}));
|
|
1483
1533
|
|
|
1484
1534
|
case 27:
|
|
1485
|
-
|
|
1535
|
+
_context23.t2 = _context23.sent;
|
|
1486
1536
|
|
|
1487
1537
|
case 28:
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
libraryId:
|
|
1492
|
-
noAuth:
|
|
1538
|
+
_context23.t3 = _context23.t2;
|
|
1539
|
+
_context23.t4 = noAuth;
|
|
1540
|
+
_context23.t5 = {
|
|
1541
|
+
libraryId: _context23.t3,
|
|
1542
|
+
noAuth: _context23.t4
|
|
1493
1543
|
};
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
return
|
|
1544
|
+
_context23.t6 = _context23.t1.AuthorizationToken.call(_context23.t1, _context23.t5);
|
|
1545
|
+
_context23.next = 34;
|
|
1546
|
+
return _context23.t0.awrap.call(_context23.t0, _context23.t6);
|
|
1497
1547
|
|
|
1498
1548
|
case 34:
|
|
1499
|
-
return
|
|
1549
|
+
return _context23.abrupt("return", _context23.sent);
|
|
1500
1550
|
|
|
1501
1551
|
case 37:
|
|
1502
|
-
|
|
1503
|
-
|
|
1552
|
+
_context23.prev = 37;
|
|
1553
|
+
_context23.t7 = _context23["catch"](20);
|
|
1504
1554
|
|
|
1505
|
-
if (!(
|
|
1506
|
-
|
|
1555
|
+
if (!(_context23.t7.message && _context23.t7.message.toLowerCase().startsWith("access denied"))) {
|
|
1556
|
+
_context23.next = 44;
|
|
1507
1557
|
break;
|
|
1508
1558
|
}
|
|
1509
1559
|
|
|
1510
1560
|
this.inaccessibleLibraries[libraryId] = true;
|
|
1511
|
-
|
|
1561
|
+
_context23.next = 43;
|
|
1512
1562
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
|
|
1513
1563
|
libraryId: libraryId,
|
|
1514
1564
|
objectId: objectId,
|
|
@@ -1518,17 +1568,17 @@ exports.MetadataAuth = function _callee22(_ref15) {
|
|
|
1518
1568
|
}));
|
|
1519
1569
|
|
|
1520
1570
|
case 43:
|
|
1521
|
-
return
|
|
1571
|
+
return _context23.abrupt("return", _context23.sent);
|
|
1522
1572
|
|
|
1523
1573
|
case 44:
|
|
1524
|
-
throw
|
|
1574
|
+
throw _context23.t7;
|
|
1525
1575
|
|
|
1526
1576
|
case 45:
|
|
1527
|
-
|
|
1577
|
+
_context23.next = 50;
|
|
1528
1578
|
break;
|
|
1529
1579
|
|
|
1530
1580
|
case 47:
|
|
1531
|
-
|
|
1581
|
+
_context23.next = 49;
|
|
1532
1582
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
|
|
1533
1583
|
libraryId: libraryId,
|
|
1534
1584
|
objectId: objectId,
|
|
@@ -1538,11 +1588,11 @@ exports.MetadataAuth = function _callee22(_ref15) {
|
|
|
1538
1588
|
}));
|
|
1539
1589
|
|
|
1540
1590
|
case 49:
|
|
1541
|
-
return
|
|
1591
|
+
return _context23.abrupt("return", _context23.sent);
|
|
1542
1592
|
|
|
1543
1593
|
case 50:
|
|
1544
1594
|
case "end":
|
|
1545
|
-
return
|
|
1595
|
+
return _context23.stop();
|
|
1546
1596
|
}
|
|
1547
1597
|
}
|
|
1548
1598
|
}, null, this, [[20, 37]]);
|
|
@@ -1588,14 +1638,14 @@ exports.MetadataAuth = function _callee22(_ref15) {
|
|
|
1588
1638
|
*/
|
|
1589
1639
|
|
|
1590
1640
|
|
|
1591
|
-
exports.ContentObjectMetadata = function
|
|
1592
|
-
var libraryId, objectId, versionHash, writeToken,
|
|
1641
|
+
exports.ContentObjectMetadata = function _callee24(_ref17) {
|
|
1642
|
+
var libraryId, objectId, versionHash, writeToken, _ref17$metadataSubtre, metadataSubtree, _ref17$queryParams, queryParams, _ref17$select, select, _ref17$remove, remove, authorizationToken, _ref17$resolveLinks, resolveLinks, _ref17$resolveInclude, resolveIncludeSource, _ref17$resolveIgnoreE, resolveIgnoreErrors, _ref17$linkDepthLimit, linkDepthLimit, _ref17$produceLinkUrl, produceLinkUrls, path, defaultAuthToken, authTokens, metadata;
|
|
1593
1643
|
|
|
1594
|
-
return _regeneratorRuntime.async(function
|
|
1644
|
+
return _regeneratorRuntime.async(function _callee24$(_context24) {
|
|
1595
1645
|
while (1) {
|
|
1596
|
-
switch (
|
|
1646
|
+
switch (_context24.prev = _context24.next) {
|
|
1597
1647
|
case 0:
|
|
1598
|
-
libraryId =
|
|
1648
|
+
libraryId = _ref17.libraryId, objectId = _ref17.objectId, versionHash = _ref17.versionHash, writeToken = _ref17.writeToken, _ref17$metadataSubtre = _ref17.metadataSubtree, metadataSubtree = _ref17$metadataSubtre === void 0 ? "/" : _ref17$metadataSubtre, _ref17$queryParams = _ref17.queryParams, queryParams = _ref17$queryParams === void 0 ? {} : _ref17$queryParams, _ref17$select = _ref17.select, select = _ref17$select === void 0 ? [] : _ref17$select, _ref17$remove = _ref17.remove, remove = _ref17$remove === void 0 ? [] : _ref17$remove, authorizationToken = _ref17.authorizationToken, _ref17$resolveLinks = _ref17.resolveLinks, resolveLinks = _ref17$resolveLinks === void 0 ? false : _ref17$resolveLinks, _ref17$resolveInclude = _ref17.resolveIncludeSource, resolveIncludeSource = _ref17$resolveInclude === void 0 ? false : _ref17$resolveInclude, _ref17$resolveIgnoreE = _ref17.resolveIgnoreErrors, resolveIgnoreErrors = _ref17$resolveIgnoreE === void 0 ? false : _ref17$resolveIgnoreE, _ref17$linkDepthLimit = _ref17.linkDepthLimit, linkDepthLimit = _ref17$linkDepthLimit === void 0 ? 1 : _ref17$linkDepthLimit, _ref17$produceLinkUrl = _ref17.produceLinkUrls, produceLinkUrls = _ref17$produceLinkUrl === void 0 ? false : _ref17$produceLinkUrl;
|
|
1599
1649
|
ValidateParameters({
|
|
1600
1650
|
libraryId: libraryId,
|
|
1601
1651
|
objectId: objectId,
|
|
@@ -1610,7 +1660,7 @@ exports.ContentObjectMetadata = function _callee23(_ref16) {
|
|
|
1610
1660
|
|
|
1611
1661
|
path = UrlJoin("q", writeToken || versionHash || objectId, "meta", metadataSubtree); // Main authorization
|
|
1612
1662
|
|
|
1613
|
-
|
|
1663
|
+
_context24.next = 8;
|
|
1614
1664
|
return _regeneratorRuntime.awrap(this.MetadataAuth({
|
|
1615
1665
|
libraryId: libraryId,
|
|
1616
1666
|
objectId: objectId,
|
|
@@ -1619,14 +1669,14 @@ exports.ContentObjectMetadata = function _callee23(_ref16) {
|
|
|
1619
1669
|
}));
|
|
1620
1670
|
|
|
1621
1671
|
case 8:
|
|
1622
|
-
defaultAuthToken =
|
|
1672
|
+
defaultAuthToken = _context24.sent;
|
|
1623
1673
|
// All authorization
|
|
1624
1674
|
authTokens = [authorizationToken, queryParams.authorization, defaultAuthToken].flat().filter(function (token) {
|
|
1625
1675
|
return token;
|
|
1626
1676
|
});
|
|
1627
1677
|
delete queryParams.authorization;
|
|
1628
|
-
|
|
1629
|
-
|
|
1678
|
+
_context24.prev = 11;
|
|
1679
|
+
_context24.next = 14;
|
|
1630
1680
|
return _regeneratorRuntime.awrap(this.utils.ResponseToJson(this.HttpClient.Request({
|
|
1631
1681
|
headers: {
|
|
1632
1682
|
"Authorization": authTokens.map(function (token) {
|
|
@@ -1646,34 +1696,34 @@ exports.ContentObjectMetadata = function _callee23(_ref16) {
|
|
|
1646
1696
|
})));
|
|
1647
1697
|
|
|
1648
1698
|
case 14:
|
|
1649
|
-
metadata =
|
|
1650
|
-
|
|
1699
|
+
metadata = _context24.sent;
|
|
1700
|
+
_context24.next = 22;
|
|
1651
1701
|
break;
|
|
1652
1702
|
|
|
1653
1703
|
case 17:
|
|
1654
|
-
|
|
1655
|
-
|
|
1704
|
+
_context24.prev = 17;
|
|
1705
|
+
_context24.t0 = _context24["catch"](11);
|
|
1656
1706
|
|
|
1657
|
-
if (!(
|
|
1658
|
-
|
|
1707
|
+
if (!(_context24.t0.status !== 404)) {
|
|
1708
|
+
_context24.next = 21;
|
|
1659
1709
|
break;
|
|
1660
1710
|
}
|
|
1661
1711
|
|
|
1662
|
-
throw
|
|
1712
|
+
throw _context24.t0;
|
|
1663
1713
|
|
|
1664
1714
|
case 21:
|
|
1665
1715
|
metadata = metadataSubtree === "/" ? {} : undefined;
|
|
1666
1716
|
|
|
1667
1717
|
case 22:
|
|
1668
1718
|
if (produceLinkUrls) {
|
|
1669
|
-
|
|
1719
|
+
_context24.next = 24;
|
|
1670
1720
|
break;
|
|
1671
1721
|
}
|
|
1672
1722
|
|
|
1673
|
-
return
|
|
1723
|
+
return _context24.abrupt("return", metadata);
|
|
1674
1724
|
|
|
1675
1725
|
case 24:
|
|
1676
|
-
|
|
1726
|
+
_context24.next = 26;
|
|
1677
1727
|
return _regeneratorRuntime.awrap(this.ProduceMetadataLinks({
|
|
1678
1728
|
libraryId: libraryId,
|
|
1679
1729
|
objectId: objectId,
|
|
@@ -1684,11 +1734,11 @@ exports.ContentObjectMetadata = function _callee23(_ref16) {
|
|
|
1684
1734
|
}));
|
|
1685
1735
|
|
|
1686
1736
|
case 26:
|
|
1687
|
-
return
|
|
1737
|
+
return _context24.abrupt("return", _context24.sent);
|
|
1688
1738
|
|
|
1689
1739
|
case 27:
|
|
1690
1740
|
case "end":
|
|
1691
|
-
return
|
|
1741
|
+
return _context24.stop();
|
|
1692
1742
|
}
|
|
1693
1743
|
}
|
|
1694
1744
|
}, null, this, [[11, 17]]);
|
|
@@ -1717,16 +1767,16 @@ exports.ContentObjectMetadata = function _callee23(_ref16) {
|
|
|
1717
1767
|
*/
|
|
1718
1768
|
|
|
1719
1769
|
|
|
1720
|
-
exports.AssetMetadata = function
|
|
1770
|
+
exports.AssetMetadata = function _callee25(_ref18) {
|
|
1721
1771
|
var _this8 = this;
|
|
1722
1772
|
|
|
1723
|
-
var libraryId, objectId, versionHash, metadata, localization,
|
|
1773
|
+
var libraryId, objectId, versionHash, metadata, localization, _ref18$produceLinkUrl, produceLinkUrls, mergedMetadata;
|
|
1724
1774
|
|
|
1725
|
-
return _regeneratorRuntime.async(function
|
|
1775
|
+
return _regeneratorRuntime.async(function _callee25$(_context25) {
|
|
1726
1776
|
while (1) {
|
|
1727
|
-
switch (
|
|
1777
|
+
switch (_context25.prev = _context25.next) {
|
|
1728
1778
|
case 0:
|
|
1729
|
-
libraryId =
|
|
1779
|
+
libraryId = _ref18.libraryId, objectId = _ref18.objectId, versionHash = _ref18.versionHash, metadata = _ref18.metadata, localization = _ref18.localization, _ref18$produceLinkUrl = _ref18.produceLinkUrls, produceLinkUrls = _ref18$produceLinkUrl === void 0 ? false : _ref18$produceLinkUrl;
|
|
1730
1780
|
ValidateParameters({
|
|
1731
1781
|
libraryId: libraryId,
|
|
1732
1782
|
objectId: objectId,
|
|
@@ -1738,11 +1788,11 @@ exports.AssetMetadata = function _callee24(_ref17) {
|
|
|
1738
1788
|
}
|
|
1739
1789
|
|
|
1740
1790
|
if (metadata) {
|
|
1741
|
-
|
|
1791
|
+
_context25.next = 12;
|
|
1742
1792
|
break;
|
|
1743
1793
|
}
|
|
1744
1794
|
|
|
1745
|
-
|
|
1795
|
+
_context25.next = 6;
|
|
1746
1796
|
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
1747
1797
|
libraryId: libraryId,
|
|
1748
1798
|
objectId: objectId,
|
|
@@ -1755,27 +1805,27 @@ exports.AssetMetadata = function _callee24(_ref17) {
|
|
|
1755
1805
|
}));
|
|
1756
1806
|
|
|
1757
1807
|
case 6:
|
|
1758
|
-
|
|
1808
|
+
_context25.t0 = _context25.sent;
|
|
1759
1809
|
|
|
1760
|
-
if (
|
|
1761
|
-
|
|
1810
|
+
if (_context25.t0) {
|
|
1811
|
+
_context25.next = 9;
|
|
1762
1812
|
break;
|
|
1763
1813
|
}
|
|
1764
1814
|
|
|
1765
|
-
|
|
1815
|
+
_context25.t0 = {};
|
|
1766
1816
|
|
|
1767
1817
|
case 9:
|
|
1768
|
-
metadata =
|
|
1769
|
-
|
|
1818
|
+
metadata = _context25.t0;
|
|
1819
|
+
_context25.next = 16;
|
|
1770
1820
|
break;
|
|
1771
1821
|
|
|
1772
1822
|
case 12:
|
|
1773
1823
|
if (!produceLinkUrls) {
|
|
1774
|
-
|
|
1824
|
+
_context25.next = 16;
|
|
1775
1825
|
break;
|
|
1776
1826
|
}
|
|
1777
1827
|
|
|
1778
|
-
|
|
1828
|
+
_context25.next = 15;
|
|
1779
1829
|
return _regeneratorRuntime.awrap(this.ProduceMetadataLinks({
|
|
1780
1830
|
libraryId: libraryId,
|
|
1781
1831
|
objectId: objectId,
|
|
@@ -1785,7 +1835,7 @@ exports.AssetMetadata = function _callee24(_ref17) {
|
|
|
1785
1835
|
}));
|
|
1786
1836
|
|
|
1787
1837
|
case 15:
|
|
1788
|
-
metadata =
|
|
1838
|
+
metadata = _context25.sent;
|
|
1789
1839
|
|
|
1790
1840
|
case 16:
|
|
1791
1841
|
if (!metadata.info) {
|
|
@@ -1805,11 +1855,11 @@ exports.AssetMetadata = function _callee24(_ref17) {
|
|
|
1805
1855
|
});
|
|
1806
1856
|
}
|
|
1807
1857
|
|
|
1808
|
-
return
|
|
1858
|
+
return _context25.abrupt("return", mergedMetadata);
|
|
1809
1859
|
|
|
1810
1860
|
case 20:
|
|
1811
1861
|
case "end":
|
|
1812
|
-
return
|
|
1862
|
+
return _context25.stop();
|
|
1813
1863
|
}
|
|
1814
1864
|
}
|
|
1815
1865
|
}, null, this);
|
|
@@ -1826,41 +1876,41 @@ exports.AssetMetadata = function _callee24(_ref17) {
|
|
|
1826
1876
|
*/
|
|
1827
1877
|
|
|
1828
1878
|
|
|
1829
|
-
exports.ContentObjectVersions = function
|
|
1879
|
+
exports.ContentObjectVersions = function _callee26(_ref19) {
|
|
1830
1880
|
var libraryId, objectId, path;
|
|
1831
|
-
return _regeneratorRuntime.async(function
|
|
1881
|
+
return _regeneratorRuntime.async(function _callee26$(_context26) {
|
|
1832
1882
|
while (1) {
|
|
1833
|
-
switch (
|
|
1883
|
+
switch (_context26.prev = _context26.next) {
|
|
1834
1884
|
case 0:
|
|
1835
|
-
libraryId =
|
|
1885
|
+
libraryId = _ref19.libraryId, objectId = _ref19.objectId;
|
|
1836
1886
|
ValidateParameters({
|
|
1837
1887
|
libraryId: libraryId,
|
|
1838
1888
|
objectId: objectId
|
|
1839
1889
|
});
|
|
1840
1890
|
this.Log("Retrieving content object versions: ".concat(libraryId || "", " ").concat(objectId));
|
|
1841
1891
|
path = UrlJoin("qid", objectId);
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1892
|
+
_context26.t0 = this.utils;
|
|
1893
|
+
_context26.t1 = this.HttpClient;
|
|
1894
|
+
_context26.next = 8;
|
|
1845
1895
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationHeader({
|
|
1846
1896
|
libraryId: libraryId,
|
|
1847
1897
|
objectId: objectId
|
|
1848
1898
|
}));
|
|
1849
1899
|
|
|
1850
1900
|
case 8:
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
headers:
|
|
1901
|
+
_context26.t2 = _context26.sent;
|
|
1902
|
+
_context26.t3 = path;
|
|
1903
|
+
_context26.t4 = {
|
|
1904
|
+
headers: _context26.t2,
|
|
1855
1905
|
method: "GET",
|
|
1856
|
-
path:
|
|
1906
|
+
path: _context26.t3
|
|
1857
1907
|
};
|
|
1858
|
-
|
|
1859
|
-
return
|
|
1908
|
+
_context26.t5 = _context26.t1.Request.call(_context26.t1, _context26.t4);
|
|
1909
|
+
return _context26.abrupt("return", _context26.t0.ResponseToJson.call(_context26.t0, _context26.t5));
|
|
1860
1910
|
|
|
1861
1911
|
case 13:
|
|
1862
1912
|
case "end":
|
|
1863
|
-
return
|
|
1913
|
+
return _context26.stop();
|
|
1864
1914
|
}
|
|
1865
1915
|
}
|
|
1866
1916
|
}, null, this);
|
|
@@ -1877,59 +1927,59 @@ exports.ContentObjectVersions = function _callee25(_ref18) {
|
|
|
1877
1927
|
*/
|
|
1878
1928
|
|
|
1879
1929
|
|
|
1880
|
-
exports.LatestVersionHash = function
|
|
1930
|
+
exports.LatestVersionHash = function _callee27(_ref20) {
|
|
1881
1931
|
var objectId, versionHash, latestHash, versionCount;
|
|
1882
|
-
return _regeneratorRuntime.async(function
|
|
1932
|
+
return _regeneratorRuntime.async(function _callee27$(_context27) {
|
|
1883
1933
|
while (1) {
|
|
1884
|
-
switch (
|
|
1934
|
+
switch (_context27.prev = _context27.next) {
|
|
1885
1935
|
case 0:
|
|
1886
|
-
objectId =
|
|
1936
|
+
objectId = _ref20.objectId, versionHash = _ref20.versionHash;
|
|
1887
1937
|
|
|
1888
1938
|
if (versionHash) {
|
|
1889
1939
|
objectId = this.utils.DecodeVersionHash(versionHash).objectId;
|
|
1890
1940
|
}
|
|
1891
1941
|
|
|
1892
1942
|
ValidateObject(objectId);
|
|
1893
|
-
|
|
1894
|
-
|
|
1943
|
+
_context27.prev = 3;
|
|
1944
|
+
_context27.next = 6;
|
|
1895
1945
|
return _regeneratorRuntime.awrap(this.CallContractMethod({
|
|
1896
1946
|
contractAddress: this.utils.HashToAddress(objectId),
|
|
1897
1947
|
methodName: "objectHash"
|
|
1898
1948
|
}));
|
|
1899
1949
|
|
|
1900
1950
|
case 6:
|
|
1901
|
-
latestHash =
|
|
1902
|
-
|
|
1951
|
+
latestHash = _context27.sent;
|
|
1952
|
+
_context27.next = 11;
|
|
1903
1953
|
break;
|
|
1904
1954
|
|
|
1905
1955
|
case 9:
|
|
1906
|
-
|
|
1907
|
-
|
|
1956
|
+
_context27.prev = 9;
|
|
1957
|
+
_context27.t0 = _context27["catch"](3);
|
|
1908
1958
|
|
|
1909
1959
|
case 11:
|
|
1910
1960
|
if (latestHash) {
|
|
1911
|
-
|
|
1961
|
+
_context27.next = 20;
|
|
1912
1962
|
break;
|
|
1913
1963
|
}
|
|
1914
1964
|
|
|
1915
|
-
|
|
1965
|
+
_context27.next = 14;
|
|
1916
1966
|
return _regeneratorRuntime.awrap(this.CallContractMethod({
|
|
1917
1967
|
contractAddress: this.utils.HashToAddress(objectId),
|
|
1918
1968
|
methodName: "countVersionHashes"
|
|
1919
1969
|
}));
|
|
1920
1970
|
|
|
1921
1971
|
case 14:
|
|
1922
|
-
versionCount =
|
|
1972
|
+
versionCount = _context27.sent;
|
|
1923
1973
|
|
|
1924
1974
|
if (versionCount.toNumber()) {
|
|
1925
|
-
|
|
1975
|
+
_context27.next = 17;
|
|
1926
1976
|
break;
|
|
1927
1977
|
}
|
|
1928
1978
|
|
|
1929
1979
|
throw Error("Unable to determine latest version hash for ".concat(versionHash || objectId, " - Item deleted?"));
|
|
1930
1980
|
|
|
1931
1981
|
case 17:
|
|
1932
|
-
|
|
1982
|
+
_context27.next = 19;
|
|
1933
1983
|
return _regeneratorRuntime.awrap(this.CallContractMethod({
|
|
1934
1984
|
contractAddress: this.utils.HashToAddress(objectId),
|
|
1935
1985
|
methodName: "versionHashes",
|
|
@@ -1937,14 +1987,14 @@ exports.LatestVersionHash = function _callee26(_ref19) {
|
|
|
1937
1987
|
}));
|
|
1938
1988
|
|
|
1939
1989
|
case 19:
|
|
1940
|
-
latestHash =
|
|
1990
|
+
latestHash = _context27.sent;
|
|
1941
1991
|
|
|
1942
1992
|
case 20:
|
|
1943
|
-
return
|
|
1993
|
+
return _context27.abrupt("return", latestHash);
|
|
1944
1994
|
|
|
1945
1995
|
case 21:
|
|
1946
1996
|
case "end":
|
|
1947
|
-
return
|
|
1997
|
+
return _context27.stop();
|
|
1948
1998
|
}
|
|
1949
1999
|
}
|
|
1950
2000
|
}, null, this, [[3, 9]]);
|
|
@@ -1959,21 +2009,21 @@ exports.LatestVersionHash = function _callee26(_ref19) {
|
|
|
1959
2009
|
*/
|
|
1960
2010
|
|
|
1961
2011
|
|
|
1962
|
-
exports.AvailableDRMs = function
|
|
2012
|
+
exports.AvailableDRMs = function _callee28() {
|
|
1963
2013
|
var availableDRMs, info, version, major, minor, _version, _major, _minor, config;
|
|
1964
2014
|
|
|
1965
|
-
return _regeneratorRuntime.async(function
|
|
2015
|
+
return _regeneratorRuntime.async(function _callee28$(_context28) {
|
|
1966
2016
|
while (1) {
|
|
1967
|
-
switch (
|
|
2017
|
+
switch (_context28.prev = _context28.next) {
|
|
1968
2018
|
case 0:
|
|
1969
2019
|
availableDRMs = ["clear", "aes-128"];
|
|
1970
2020
|
|
|
1971
2021
|
if (!(typeof window === "undefined")) {
|
|
1972
|
-
|
|
2022
|
+
_context28.next = 3;
|
|
1973
2023
|
break;
|
|
1974
2024
|
}
|
|
1975
2025
|
|
|
1976
|
-
return
|
|
2026
|
+
return _context28.abrupt("return", availableDRMs);
|
|
1977
2027
|
|
|
1978
2028
|
case 3:
|
|
1979
2029
|
// Detect iOS > 13.1 or Safari > 13.1 and replace aes-128 with sample-aes
|
|
@@ -2009,14 +2059,14 @@ exports.AvailableDRMs = function _callee27() {
|
|
|
2009
2059
|
}
|
|
2010
2060
|
|
|
2011
2061
|
if (!(typeof window !== "undefined" && typeof window.navigator.requestMediaKeySystemAccess !== "function")) {
|
|
2012
|
-
|
|
2062
|
+
_context28.next = 6;
|
|
2013
2063
|
break;
|
|
2014
2064
|
}
|
|
2015
2065
|
|
|
2016
|
-
return
|
|
2066
|
+
return _context28.abrupt("return", availableDRMs);
|
|
2017
2067
|
|
|
2018
2068
|
case 6:
|
|
2019
|
-
|
|
2069
|
+
_context28.prev = 6;
|
|
2020
2070
|
config = [{
|
|
2021
2071
|
initDataTypes: ["cenc"],
|
|
2022
2072
|
audioCapabilities: [{
|
|
@@ -2026,75 +2076,75 @@ exports.AvailableDRMs = function _callee27() {
|
|
|
2026
2076
|
contentType: "video/mp4;codecs=\"avc1.42E01E\""
|
|
2027
2077
|
}]
|
|
2028
2078
|
}];
|
|
2029
|
-
|
|
2079
|
+
_context28.next = 10;
|
|
2030
2080
|
return _regeneratorRuntime.awrap(navigator.requestMediaKeySystemAccess("com.widevine.alpha", config));
|
|
2031
2081
|
|
|
2032
2082
|
case 10:
|
|
2033
2083
|
availableDRMs.push("widevine"); // eslint-disable-next-line no-empty
|
|
2034
2084
|
|
|
2035
|
-
|
|
2085
|
+
_context28.next = 15;
|
|
2036
2086
|
break;
|
|
2037
2087
|
|
|
2038
2088
|
case 13:
|
|
2039
|
-
|
|
2040
|
-
|
|
2089
|
+
_context28.prev = 13;
|
|
2090
|
+
_context28.t0 = _context28["catch"](6);
|
|
2041
2091
|
|
|
2042
2092
|
case 15:
|
|
2043
|
-
return
|
|
2093
|
+
return _context28.abrupt("return", availableDRMs);
|
|
2044
2094
|
|
|
2045
2095
|
case 16:
|
|
2046
2096
|
case "end":
|
|
2047
|
-
return
|
|
2097
|
+
return _context28.stop();
|
|
2048
2098
|
}
|
|
2049
2099
|
}
|
|
2050
2100
|
}, null, null, [[6, 13]]);
|
|
2051
2101
|
};
|
|
2052
2102
|
|
|
2053
|
-
exports.PlayoutPathResolution = function
|
|
2054
|
-
var libraryId, objectId, versionHash, writeToken, linkPath, handler,
|
|
2103
|
+
exports.PlayoutPathResolution = function _callee29(_ref21) {
|
|
2104
|
+
var libraryId, objectId, versionHash, writeToken, linkPath, handler, _ref21$offering, offering, _ref21$signedLink, signedLink, authorizationToken, path, linkTargetLibraryId, linkTargetId, linkTargetHash, multiOfferingLink, linkInfo;
|
|
2055
2105
|
|
|
2056
|
-
return _regeneratorRuntime.async(function
|
|
2106
|
+
return _regeneratorRuntime.async(function _callee29$(_context29) {
|
|
2057
2107
|
while (1) {
|
|
2058
|
-
switch (
|
|
2108
|
+
switch (_context29.prev = _context29.next) {
|
|
2059
2109
|
case 0:
|
|
2060
|
-
libraryId =
|
|
2110
|
+
libraryId = _ref21.libraryId, objectId = _ref21.objectId, versionHash = _ref21.versionHash, writeToken = _ref21.writeToken, linkPath = _ref21.linkPath, handler = _ref21.handler, _ref21$offering = _ref21.offering, offering = _ref21$offering === void 0 ? "" : _ref21$offering, _ref21$signedLink = _ref21.signedLink, signedLink = _ref21$signedLink === void 0 ? false : _ref21$signedLink, authorizationToken = _ref21.authorizationToken;
|
|
2061
2111
|
|
|
2062
2112
|
if (libraryId) {
|
|
2063
|
-
|
|
2113
|
+
_context29.next = 5;
|
|
2064
2114
|
break;
|
|
2065
2115
|
}
|
|
2066
2116
|
|
|
2067
|
-
|
|
2117
|
+
_context29.next = 4;
|
|
2068
2118
|
return _regeneratorRuntime.awrap(this.ContentObjectLibraryId({
|
|
2069
2119
|
objectId: objectId
|
|
2070
2120
|
}));
|
|
2071
2121
|
|
|
2072
2122
|
case 4:
|
|
2073
|
-
libraryId =
|
|
2123
|
+
libraryId = _context29.sent;
|
|
2074
2124
|
|
|
2075
2125
|
case 5:
|
|
2076
2126
|
if (versionHash) {
|
|
2077
|
-
|
|
2127
|
+
_context29.next = 9;
|
|
2078
2128
|
break;
|
|
2079
2129
|
}
|
|
2080
2130
|
|
|
2081
|
-
|
|
2131
|
+
_context29.next = 8;
|
|
2082
2132
|
return _regeneratorRuntime.awrap(this.LatestVersionHash({
|
|
2083
2133
|
objectId: objectId
|
|
2084
2134
|
}));
|
|
2085
2135
|
|
|
2086
2136
|
case 8:
|
|
2087
|
-
versionHash =
|
|
2137
|
+
versionHash = _context29.sent;
|
|
2088
2138
|
|
|
2089
2139
|
case 9:
|
|
2090
2140
|
path = UrlJoin("qlibs", libraryId, "q", writeToken || versionHash, "rep", handler, offering, "options.json");
|
|
2091
2141
|
|
|
2092
2142
|
if (!linkPath) {
|
|
2093
|
-
|
|
2143
|
+
_context29.next = 26;
|
|
2094
2144
|
break;
|
|
2095
2145
|
}
|
|
2096
2146
|
|
|
2097
|
-
|
|
2147
|
+
_context29.next = 13;
|
|
2098
2148
|
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
2099
2149
|
libraryId: libraryId,
|
|
2100
2150
|
objectId: objectId,
|
|
@@ -2108,17 +2158,17 @@ exports.PlayoutPathResolution = function _callee28(_ref20) {
|
|
|
2108
2158
|
}));
|
|
2109
2159
|
|
|
2110
2160
|
case 13:
|
|
2111
|
-
linkInfo =
|
|
2161
|
+
linkInfo = _context29.sent;
|
|
2112
2162
|
multiOfferingLink = !!linkInfo && !!linkInfo["/"] && !linkInfo["/"].endsWith("options.json"); // Default case: Use link path directly
|
|
2113
2163
|
|
|
2114
2164
|
path = UrlJoin("qlibs", libraryId, "q", writeToken || versionHash, "meta", linkPath);
|
|
2115
2165
|
|
|
2116
2166
|
if (signedLink) {
|
|
2117
|
-
|
|
2167
|
+
_context29.next = 25;
|
|
2118
2168
|
break;
|
|
2119
2169
|
}
|
|
2120
2170
|
|
|
2121
|
-
|
|
2171
|
+
_context29.next = 19;
|
|
2122
2172
|
return _regeneratorRuntime.awrap(this.LinkTarget({
|
|
2123
2173
|
libraryId: libraryId,
|
|
2124
2174
|
objectId: objectId,
|
|
@@ -2130,15 +2180,15 @@ exports.PlayoutPathResolution = function _callee28(_ref20) {
|
|
|
2130
2180
|
}));
|
|
2131
2181
|
|
|
2132
2182
|
case 19:
|
|
2133
|
-
linkTargetHash =
|
|
2183
|
+
linkTargetHash = _context29.sent;
|
|
2134
2184
|
linkTargetId = this.utils.DecodeVersionHash(linkTargetHash).objectId;
|
|
2135
|
-
|
|
2185
|
+
_context29.next = 23;
|
|
2136
2186
|
return _regeneratorRuntime.awrap(this.ContentObjectLibraryId({
|
|
2137
2187
|
objectId: linkTargetId
|
|
2138
2188
|
}));
|
|
2139
2189
|
|
|
2140
2190
|
case 23:
|
|
2141
|
-
linkTargetLibraryId =
|
|
2191
|
+
linkTargetLibraryId = _context29.sent;
|
|
2142
2192
|
|
|
2143
2193
|
if (!multiOfferingLink && !offering) {
|
|
2144
2194
|
// If the offering is not specified, the intent is to get available offerings. For a single offering link, must
|
|
@@ -2153,7 +2203,7 @@ exports.PlayoutPathResolution = function _callee28(_ref20) {
|
|
|
2153
2203
|
}
|
|
2154
2204
|
|
|
2155
2205
|
case 26:
|
|
2156
|
-
return
|
|
2206
|
+
return _context29.abrupt("return", {
|
|
2157
2207
|
path: path,
|
|
2158
2208
|
multiOfferingLink: multiOfferingLink,
|
|
2159
2209
|
linkTarget: {
|
|
@@ -2165,7 +2215,7 @@ exports.PlayoutPathResolution = function _callee28(_ref20) {
|
|
|
2165
2215
|
|
|
2166
2216
|
case 27:
|
|
2167
2217
|
case "end":
|
|
2168
|
-
return
|
|
2218
|
+
return _context29.stop();
|
|
2169
2219
|
}
|
|
2170
2220
|
}
|
|
2171
2221
|
}, null, this);
|
|
@@ -2187,54 +2237,54 @@ exports.PlayoutPathResolution = function _callee28(_ref20) {
|
|
|
2187
2237
|
*/
|
|
2188
2238
|
|
|
2189
2239
|
|
|
2190
|
-
exports.AvailableOfferings = function
|
|
2191
|
-
var objectId, versionHash, writeToken, linkPath, signedLink, directLink,
|
|
2240
|
+
exports.AvailableOfferings = function _callee30(_ref22) {
|
|
2241
|
+
var objectId, versionHash, writeToken, linkPath, signedLink, directLink, _ref22$handler, handler, authorizationToken, _ref23, path, authorization;
|
|
2192
2242
|
|
|
2193
|
-
return _regeneratorRuntime.async(function
|
|
2243
|
+
return _regeneratorRuntime.async(function _callee30$(_context30) {
|
|
2194
2244
|
while (1) {
|
|
2195
|
-
switch (
|
|
2245
|
+
switch (_context30.prev = _context30.next) {
|
|
2196
2246
|
case 0:
|
|
2197
|
-
objectId =
|
|
2247
|
+
objectId = _ref22.objectId, versionHash = _ref22.versionHash, writeToken = _ref22.writeToken, linkPath = _ref22.linkPath, signedLink = _ref22.signedLink, directLink = _ref22.directLink, _ref22$handler = _ref22.handler, handler = _ref22$handler === void 0 ? "playout" : _ref22$handler, authorizationToken = _ref22.authorizationToken;
|
|
2198
2248
|
|
|
2199
2249
|
if (!objectId) {
|
|
2200
2250
|
objectId = this.utils.DecodeVersionHash(versionHash).objectId;
|
|
2201
2251
|
}
|
|
2202
2252
|
|
|
2203
2253
|
if (!directLink) {
|
|
2204
|
-
|
|
2254
|
+
_context30.next = 17;
|
|
2205
2255
|
break;
|
|
2206
2256
|
}
|
|
2207
2257
|
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2258
|
+
_context30.t0 = _regeneratorRuntime;
|
|
2259
|
+
_context30.t1 = this;
|
|
2260
|
+
_context30.next = 7;
|
|
2211
2261
|
return _regeneratorRuntime.awrap(this.ContentObjectLibraryId({
|
|
2212
2262
|
objectId: objectId
|
|
2213
2263
|
}));
|
|
2214
2264
|
|
|
2215
2265
|
case 7:
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
libraryId:
|
|
2223
|
-
objectId:
|
|
2224
|
-
versionHash:
|
|
2225
|
-
metadataSubtree:
|
|
2266
|
+
_context30.t2 = _context30.sent;
|
|
2267
|
+
_context30.t3 = objectId;
|
|
2268
|
+
_context30.t4 = versionHash;
|
|
2269
|
+
_context30.t5 = linkPath;
|
|
2270
|
+
_context30.t6 = authorizationToken;
|
|
2271
|
+
_context30.t7 = {
|
|
2272
|
+
libraryId: _context30.t2,
|
|
2273
|
+
objectId: _context30.t3,
|
|
2274
|
+
versionHash: _context30.t4,
|
|
2275
|
+
metadataSubtree: _context30.t5,
|
|
2226
2276
|
resolveLinks: true,
|
|
2227
|
-
authorizationToken:
|
|
2277
|
+
authorizationToken: _context30.t6
|
|
2228
2278
|
};
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
return
|
|
2279
|
+
_context30.t8 = _context30.t1.ContentObjectMetadata.call(_context30.t1, _context30.t7);
|
|
2280
|
+
_context30.next = 16;
|
|
2281
|
+
return _context30.t0.awrap.call(_context30.t0, _context30.t8);
|
|
2232
2282
|
|
|
2233
2283
|
case 16:
|
|
2234
|
-
return
|
|
2284
|
+
return _context30.abrupt("return", _context30.sent);
|
|
2235
2285
|
|
|
2236
2286
|
case 17:
|
|
2237
|
-
|
|
2287
|
+
_context30.next = 19;
|
|
2238
2288
|
return _regeneratorRuntime.awrap(this.PlayoutPathResolution({
|
|
2239
2289
|
objectId: objectId,
|
|
2240
2290
|
versionHash: versionHash,
|
|
@@ -2246,11 +2296,11 @@ exports.AvailableOfferings = function _callee29(_ref21) {
|
|
|
2246
2296
|
}));
|
|
2247
2297
|
|
|
2248
2298
|
case 19:
|
|
2249
|
-
|
|
2250
|
-
path =
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2299
|
+
_ref23 = _context30.sent;
|
|
2300
|
+
path = _ref23.path;
|
|
2301
|
+
_context30.prev = 21;
|
|
2302
|
+
_context30.t9 = authorizationToken;
|
|
2303
|
+
_context30.next = 25;
|
|
2254
2304
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
|
|
2255
2305
|
objectId: objectId,
|
|
2256
2306
|
channelAuth: true,
|
|
@@ -2258,14 +2308,14 @@ exports.AvailableOfferings = function _callee29(_ref21) {
|
|
|
2258
2308
|
}));
|
|
2259
2309
|
|
|
2260
2310
|
case 25:
|
|
2261
|
-
|
|
2311
|
+
_context30.t10 = _context30.sent;
|
|
2262
2312
|
|
|
2263
|
-
|
|
2313
|
+
_context30.t11 = function (token) {
|
|
2264
2314
|
return token;
|
|
2265
2315
|
};
|
|
2266
2316
|
|
|
2267
|
-
authorization = [
|
|
2268
|
-
|
|
2317
|
+
authorization = [_context30.t9, _context30.t10].flat().filter(_context30.t11);
|
|
2318
|
+
_context30.next = 30;
|
|
2269
2319
|
return _regeneratorRuntime.awrap(this.utils.ResponseToJson(this.HttpClient.Request({
|
|
2270
2320
|
path: path,
|
|
2271
2321
|
method: "GET",
|
|
@@ -2275,25 +2325,25 @@ exports.AvailableOfferings = function _callee29(_ref21) {
|
|
|
2275
2325
|
})));
|
|
2276
2326
|
|
|
2277
2327
|
case 30:
|
|
2278
|
-
return
|
|
2328
|
+
return _context30.abrupt("return", _context30.sent);
|
|
2279
2329
|
|
|
2280
2330
|
case 33:
|
|
2281
|
-
|
|
2282
|
-
|
|
2331
|
+
_context30.prev = 33;
|
|
2332
|
+
_context30.t12 = _context30["catch"](21);
|
|
2283
2333
|
|
|
2284
|
-
if (!(
|
|
2285
|
-
|
|
2334
|
+
if (!(_context30.t12.status && parseInt(_context30.t12.status) === 500)) {
|
|
2335
|
+
_context30.next = 37;
|
|
2286
2336
|
break;
|
|
2287
2337
|
}
|
|
2288
2338
|
|
|
2289
|
-
return
|
|
2339
|
+
return _context30.abrupt("return", {});
|
|
2290
2340
|
|
|
2291
2341
|
case 37:
|
|
2292
|
-
throw
|
|
2342
|
+
throw _context30.t12;
|
|
2293
2343
|
|
|
2294
2344
|
case 38:
|
|
2295
2345
|
case "end":
|
|
2296
|
-
return
|
|
2346
|
+
return _context30.stop();
|
|
2297
2347
|
}
|
|
2298
2348
|
}
|
|
2299
2349
|
}, null, this, [[21, 33]]);
|
|
@@ -2327,19 +2377,19 @@ exports.AvailableOfferings = function _callee29(_ref21) {
|
|
|
2327
2377
|
*/
|
|
2328
2378
|
|
|
2329
2379
|
|
|
2330
|
-
exports.PlayoutOptions = function
|
|
2380
|
+
exports.PlayoutOptions = function _callee33(_ref24) {
|
|
2331
2381
|
var _this9 = this;
|
|
2332
2382
|
|
|
2333
|
-
var offeringURI, objectId, versionHash, writeToken, linkPath,
|
|
2383
|
+
var offeringURI, objectId, versionHash, writeToken, linkPath, _ref24$signedLink, signedLink, _ref24$protocols, protocols, _ref24$handler, handler, _ref24$offering, offering, playoutType, _ref24$drms, drms, context, _ref24$hlsjsProfile, hlsjsProfile, authorizationToken, uriInfo, libraryId, offeringPath, link, _ref25, path, linkTarget, audienceData, authorization, queryParams, playoutOptions, playoutMap, sessionId, multiview, i, option, protocol, drm, playoutPath, licenseServers, cert, method, certUrl, protocolMatch, drmMatch;
|
|
2334
2384
|
|
|
2335
|
-
return _regeneratorRuntime.async(function
|
|
2385
|
+
return _regeneratorRuntime.async(function _callee33$(_context33) {
|
|
2336
2386
|
while (1) {
|
|
2337
|
-
switch (
|
|
2387
|
+
switch (_context33.prev = _context33.next) {
|
|
2338
2388
|
case 0:
|
|
2339
|
-
offeringURI =
|
|
2389
|
+
offeringURI = _ref24.offeringURI, objectId = _ref24.objectId, versionHash = _ref24.versionHash, writeToken = _ref24.writeToken, linkPath = _ref24.linkPath, _ref24$signedLink = _ref24.signedLink, signedLink = _ref24$signedLink === void 0 ? false : _ref24$signedLink, _ref24$protocols = _ref24.protocols, protocols = _ref24$protocols === void 0 ? ["dash", "hls"] : _ref24$protocols, _ref24$handler = _ref24.handler, handler = _ref24$handler === void 0 ? "playout" : _ref24$handler, _ref24$offering = _ref24.offering, offering = _ref24$offering === void 0 ? "default" : _ref24$offering, playoutType = _ref24.playoutType, _ref24$drms = _ref24.drms, drms = _ref24$drms === void 0 ? [] : _ref24$drms, context = _ref24.context, _ref24$hlsjsProfile = _ref24.hlsjsProfile, hlsjsProfile = _ref24$hlsjsProfile === void 0 ? true : _ref24$hlsjsProfile, authorizationToken = _ref24.authorizationToken;
|
|
2340
2390
|
|
|
2341
2391
|
if (!offeringURI) {
|
|
2342
|
-
|
|
2392
|
+
_context33.next = 8;
|
|
2343
2393
|
break;
|
|
2344
2394
|
}
|
|
2345
2395
|
|
|
@@ -2349,7 +2399,7 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2349
2399
|
offering = uriInfo[3];
|
|
2350
2400
|
|
|
2351
2401
|
if (!(!versionHash || !handler || !offering)) {
|
|
2352
|
-
|
|
2402
|
+
_context33.next = 8;
|
|
2353
2403
|
break;
|
|
2354
2404
|
}
|
|
2355
2405
|
|
|
@@ -2365,45 +2415,45 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2365
2415
|
});
|
|
2366
2416
|
|
|
2367
2417
|
if (objectId) {
|
|
2368
|
-
|
|
2418
|
+
_context33.next = 15;
|
|
2369
2419
|
break;
|
|
2370
2420
|
}
|
|
2371
2421
|
|
|
2372
2422
|
objectId = this.utils.DecodeVersionHash(versionHash).objectId;
|
|
2373
|
-
|
|
2423
|
+
_context33.next = 19;
|
|
2374
2424
|
break;
|
|
2375
2425
|
|
|
2376
2426
|
case 15:
|
|
2377
2427
|
if (versionHash) {
|
|
2378
|
-
|
|
2428
|
+
_context33.next = 19;
|
|
2379
2429
|
break;
|
|
2380
2430
|
}
|
|
2381
2431
|
|
|
2382
|
-
|
|
2432
|
+
_context33.next = 18;
|
|
2383
2433
|
return _regeneratorRuntime.awrap(this.LatestVersionHash({
|
|
2384
2434
|
objectId: objectId
|
|
2385
2435
|
}));
|
|
2386
2436
|
|
|
2387
2437
|
case 18:
|
|
2388
|
-
versionHash =
|
|
2438
|
+
versionHash = _context33.sent;
|
|
2389
2439
|
|
|
2390
2440
|
case 19:
|
|
2391
|
-
|
|
2441
|
+
_context33.next = 21;
|
|
2392
2442
|
return _regeneratorRuntime.awrap(this.ContentObjectLibraryId({
|
|
2393
2443
|
objectId: objectId
|
|
2394
2444
|
}));
|
|
2395
2445
|
|
|
2396
2446
|
case 21:
|
|
2397
|
-
libraryId =
|
|
2398
|
-
|
|
2447
|
+
libraryId = _context33.sent;
|
|
2448
|
+
_context33.prev = 22;
|
|
2399
2449
|
|
|
2400
2450
|
if (linkPath) {
|
|
2401
|
-
|
|
2451
|
+
_context33.next = 29;
|
|
2402
2452
|
break;
|
|
2403
2453
|
}
|
|
2404
2454
|
|
|
2405
2455
|
offeringPath = UrlJoin("public", "asset_metadata", "sources", offering);
|
|
2406
|
-
|
|
2456
|
+
_context33.next = 27;
|
|
2407
2457
|
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
2408
2458
|
libraryId: libraryId,
|
|
2409
2459
|
objectId: objectId,
|
|
@@ -2413,22 +2463,22 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2413
2463
|
}));
|
|
2414
2464
|
|
|
2415
2465
|
case 27:
|
|
2416
|
-
link =
|
|
2466
|
+
link = _context33.sent;
|
|
2417
2467
|
|
|
2418
2468
|
if (link) {
|
|
2419
2469
|
linkPath = offeringPath;
|
|
2420
2470
|
}
|
|
2421
2471
|
|
|
2422
2472
|
case 29:
|
|
2423
|
-
|
|
2473
|
+
_context33.next = 33;
|
|
2424
2474
|
break;
|
|
2425
2475
|
|
|
2426
2476
|
case 31:
|
|
2427
|
-
|
|
2428
|
-
|
|
2477
|
+
_context33.prev = 31;
|
|
2478
|
+
_context33.t0 = _context33["catch"](22);
|
|
2429
2479
|
|
|
2430
2480
|
case 33:
|
|
2431
|
-
|
|
2481
|
+
_context33.next = 35;
|
|
2432
2482
|
return _regeneratorRuntime.awrap(this.PlayoutPathResolution({
|
|
2433
2483
|
libraryId: libraryId,
|
|
2434
2484
|
objectId: objectId,
|
|
@@ -2442,41 +2492,41 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2442
2492
|
}));
|
|
2443
2493
|
|
|
2444
2494
|
case 35:
|
|
2445
|
-
|
|
2446
|
-
path =
|
|
2447
|
-
linkTarget =
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
if (
|
|
2453
|
-
|
|
2495
|
+
_ref25 = _context33.sent;
|
|
2496
|
+
path = _ref25.path;
|
|
2497
|
+
linkTarget = _ref25.linkTarget;
|
|
2498
|
+
_context33.t1 = this.authClient;
|
|
2499
|
+
_context33.t2 = linkTarget.objectId || objectId;
|
|
2500
|
+
_context33.t3 = linkTarget.versionHash || versionHash;
|
|
2501
|
+
|
|
2502
|
+
if (_context33.t3) {
|
|
2503
|
+
_context33.next = 45;
|
|
2454
2504
|
break;
|
|
2455
2505
|
}
|
|
2456
2506
|
|
|
2457
|
-
|
|
2507
|
+
_context33.next = 44;
|
|
2458
2508
|
return _regeneratorRuntime.awrap(this.LatestVersionHash({
|
|
2459
2509
|
objectId: objectId
|
|
2460
2510
|
}));
|
|
2461
2511
|
|
|
2462
2512
|
case 44:
|
|
2463
|
-
|
|
2513
|
+
_context33.t3 = _context33.sent;
|
|
2464
2514
|
|
|
2465
2515
|
case 45:
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
objectId:
|
|
2472
|
-
versionHash:
|
|
2473
|
-
protocols:
|
|
2474
|
-
drms:
|
|
2475
|
-
context:
|
|
2516
|
+
_context33.t4 = _context33.t3;
|
|
2517
|
+
_context33.t5 = protocols;
|
|
2518
|
+
_context33.t6 = drms;
|
|
2519
|
+
_context33.t7 = context;
|
|
2520
|
+
_context33.t8 = {
|
|
2521
|
+
objectId: _context33.t2,
|
|
2522
|
+
versionHash: _context33.t4,
|
|
2523
|
+
protocols: _context33.t5,
|
|
2524
|
+
drms: _context33.t6,
|
|
2525
|
+
context: _context33.t7
|
|
2476
2526
|
};
|
|
2477
|
-
audienceData =
|
|
2478
|
-
|
|
2479
|
-
|
|
2527
|
+
audienceData = _context33.t1.AudienceData.call(_context33.t1, _context33.t8);
|
|
2528
|
+
_context33.t9 = authorizationToken;
|
|
2529
|
+
_context33.next = 54;
|
|
2480
2530
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
|
|
2481
2531
|
libraryId: libraryId,
|
|
2482
2532
|
objectId: objectId,
|
|
@@ -2486,19 +2536,19 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2486
2536
|
}));
|
|
2487
2537
|
|
|
2488
2538
|
case 54:
|
|
2489
|
-
|
|
2539
|
+
_context33.t10 = _context33.sent;
|
|
2490
2540
|
|
|
2491
|
-
|
|
2541
|
+
_context33.t11 = function (token) {
|
|
2492
2542
|
return token;
|
|
2493
2543
|
};
|
|
2494
2544
|
|
|
2495
|
-
authorization = [
|
|
2545
|
+
authorization = [_context33.t9, _context33.t10].flat().filter(_context33.t11);
|
|
2496
2546
|
queryParams = {
|
|
2497
2547
|
authorization: authorization,
|
|
2498
2548
|
resolve: !!linkPath
|
|
2499
2549
|
};
|
|
2500
|
-
|
|
2501
|
-
|
|
2550
|
+
_context33.t12 = Object;
|
|
2551
|
+
_context33.next = 61;
|
|
2502
2552
|
return _regeneratorRuntime.awrap(this.utils.ResponseToJson(this.HttpClient.Request({
|
|
2503
2553
|
path: path,
|
|
2504
2554
|
method: "GET",
|
|
@@ -2506,16 +2556,16 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2506
2556
|
})));
|
|
2507
2557
|
|
|
2508
2558
|
case 61:
|
|
2509
|
-
|
|
2510
|
-
playoutOptions =
|
|
2559
|
+
_context33.t13 = _context33.sent;
|
|
2560
|
+
playoutOptions = _context33.t12.values.call(_context33.t12, _context33.t13);
|
|
2511
2561
|
|
|
2512
2562
|
if (!(!signedLink && linkTarget.versionHash)) {
|
|
2513
|
-
|
|
2563
|
+
_context33.next = 70;
|
|
2514
2564
|
break;
|
|
2515
2565
|
}
|
|
2516
2566
|
|
|
2517
|
-
|
|
2518
|
-
|
|
2567
|
+
_context33.t14 = authorizationToken;
|
|
2568
|
+
_context33.next = 67;
|
|
2519
2569
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
|
|
2520
2570
|
libraryId: linkTarget.libraryId,
|
|
2521
2571
|
objectId: linkTarget.objectId,
|
|
@@ -2525,13 +2575,13 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2525
2575
|
}));
|
|
2526
2576
|
|
|
2527
2577
|
case 67:
|
|
2528
|
-
|
|
2578
|
+
_context33.t15 = _context33.sent;
|
|
2529
2579
|
|
|
2530
|
-
|
|
2580
|
+
_context33.t16 = function (token) {
|
|
2531
2581
|
return token;
|
|
2532
2582
|
};
|
|
2533
2583
|
|
|
2534
|
-
queryParams.authorization = [
|
|
2584
|
+
queryParams.authorization = [_context33.t14, _context33.t15].flat().filter(_context33.t16);
|
|
2535
2585
|
|
|
2536
2586
|
case 70:
|
|
2537
2587
|
playoutMap = {};
|
|
@@ -2539,7 +2589,7 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2539
2589
|
|
|
2540
2590
|
case 72:
|
|
2541
2591
|
if (!(i < playoutOptions.length)) {
|
|
2542
|
-
|
|
2592
|
+
_context33.next = 118;
|
|
2543
2593
|
break;
|
|
2544
2594
|
}
|
|
2545
2595
|
|
|
@@ -2568,22 +2618,22 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2568
2618
|
} // Create full playout URLs for this protocol / drm combo
|
|
2569
2619
|
|
|
2570
2620
|
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2621
|
+
_context33.t17 = _objectSpread;
|
|
2622
|
+
_context33.t18 = {};
|
|
2623
|
+
_context33.t19 = playoutMap[protocol] || {};
|
|
2624
|
+
_context33.t20 = _objectSpread;
|
|
2625
|
+
_context33.t21 = {};
|
|
2626
|
+
_context33.t22 = (playoutMap[protocol] || {}).playoutMethods || {};
|
|
2627
|
+
_context33.t23 = _defineProperty;
|
|
2628
|
+
_context33.t24 = {};
|
|
2629
|
+
_context33.t25 = drm || "clear";
|
|
2580
2630
|
|
|
2581
2631
|
if (!signedLink) {
|
|
2582
|
-
|
|
2632
|
+
_context33.next = 99;
|
|
2583
2633
|
break;
|
|
2584
2634
|
}
|
|
2585
2635
|
|
|
2586
|
-
|
|
2636
|
+
_context33.next = 96;
|
|
2587
2637
|
return _regeneratorRuntime.awrap(this.LinkUrl({
|
|
2588
2638
|
versionHash: versionHash,
|
|
2589
2639
|
linkPath: UrlJoin(linkPath, offering, playoutPath),
|
|
@@ -2592,12 +2642,12 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2592
2642
|
}));
|
|
2593
2643
|
|
|
2594
2644
|
case 96:
|
|
2595
|
-
|
|
2596
|
-
|
|
2645
|
+
_context33.t26 = _context33.sent;
|
|
2646
|
+
_context33.next = 102;
|
|
2597
2647
|
break;
|
|
2598
2648
|
|
|
2599
2649
|
case 99:
|
|
2600
|
-
|
|
2650
|
+
_context33.next = 101;
|
|
2601
2651
|
return _regeneratorRuntime.awrap(this.Rep({
|
|
2602
2652
|
libraryId: linkTarget.libraryId || libraryId,
|
|
2603
2653
|
objectId: linkTarget.objectId || objectId,
|
|
@@ -2608,24 +2658,24 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2608
2658
|
}));
|
|
2609
2659
|
|
|
2610
2660
|
case 101:
|
|
2611
|
-
|
|
2661
|
+
_context33.t26 = _context33.sent;
|
|
2612
2662
|
|
|
2613
2663
|
case 102:
|
|
2614
|
-
|
|
2615
|
-
|
|
2664
|
+
_context33.t27 = _context33.t26;
|
|
2665
|
+
_context33.t28 = drm ? _defineProperty({}, drm, {
|
|
2616
2666
|
licenseServers: licenseServers,
|
|
2617
2667
|
cert: cert
|
|
2618
2668
|
}) : undefined;
|
|
2619
|
-
|
|
2620
|
-
playoutUrl:
|
|
2621
|
-
drms:
|
|
2669
|
+
_context33.t29 = {
|
|
2670
|
+
playoutUrl: _context33.t27,
|
|
2671
|
+
drms: _context33.t28
|
|
2622
2672
|
};
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
playoutMethods:
|
|
2673
|
+
_context33.t30 = (0, _context33.t23)(_context33.t24, _context33.t25, _context33.t29);
|
|
2674
|
+
_context33.t31 = (0, _context33.t20)(_context33.t21, _context33.t22, _context33.t30);
|
|
2675
|
+
_context33.t32 = {
|
|
2676
|
+
playoutMethods: _context33.t31
|
|
2627
2677
|
};
|
|
2628
|
-
playoutMap[protocol] = (0,
|
|
2678
|
+
playoutMap[protocol] = (0, _context33.t17)(_context33.t18, _context33.t19, _context33.t32);
|
|
2629
2679
|
|
|
2630
2680
|
// Add .cert_url if playoutMap[protocol].playoutMethods[].drms[].cert is present
|
|
2631
2681
|
// (for clients that need cert supplied as a URL reference rather than as a string literal)
|
|
@@ -2643,11 +2693,11 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2643
2693
|
drmMatch = drms.includes(drm || "clear") || drms.length === 0 && !drm;
|
|
2644
2694
|
|
|
2645
2695
|
if (!(!protocolMatch || !drmMatch)) {
|
|
2646
|
-
|
|
2696
|
+
_context33.next = 114;
|
|
2647
2697
|
break;
|
|
2648
2698
|
}
|
|
2649
2699
|
|
|
2650
|
-
return
|
|
2700
|
+
return _context33.abrupt("continue", 115);
|
|
2651
2701
|
|
|
2652
2702
|
case 114:
|
|
2653
2703
|
// This protocol / DRM satisfies the specifications (prefer DRM over clear, if available)
|
|
@@ -2658,7 +2708,7 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2658
2708
|
|
|
2659
2709
|
case 115:
|
|
2660
2710
|
i++;
|
|
2661
|
-
|
|
2711
|
+
_context33.next = 72;
|
|
2662
2712
|
break;
|
|
2663
2713
|
|
|
2664
2714
|
case 118:
|
|
@@ -2667,14 +2717,14 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2667
2717
|
playoutMap.sessionId = sessionId;
|
|
2668
2718
|
playoutMap.multiview = true;
|
|
2669
2719
|
|
|
2670
|
-
playoutMap.AvailableViews = function
|
|
2671
|
-
return _regeneratorRuntime.async(function
|
|
2720
|
+
playoutMap.AvailableViews = function _callee31() {
|
|
2721
|
+
return _regeneratorRuntime.async(function _callee31$(_context31) {
|
|
2672
2722
|
while (1) {
|
|
2673
|
-
switch (
|
|
2723
|
+
switch (_context31.prev = _context31.next) {
|
|
2674
2724
|
case 0:
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2725
|
+
_context31.t0 = _regeneratorRuntime;
|
|
2726
|
+
_context31.t1 = _this9.utils;
|
|
2727
|
+
_context31.next = 4;
|
|
2678
2728
|
return _regeneratorRuntime.awrap(_this9.HttpClient.Request({
|
|
2679
2729
|
path: UrlJoin("q", linkTarget.versionHash || versionHash, "rep", handler, offering, "views.json"),
|
|
2680
2730
|
method: "GET",
|
|
@@ -2685,28 +2735,28 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2685
2735
|
}));
|
|
2686
2736
|
|
|
2687
2737
|
case 4:
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
return
|
|
2738
|
+
_context31.t2 = _context31.sent;
|
|
2739
|
+
_context31.t3 = _context31.t1.ResponseToFormat.call(_context31.t1, "json", _context31.t2);
|
|
2740
|
+
_context31.next = 8;
|
|
2741
|
+
return _context31.t0.awrap.call(_context31.t0, _context31.t3);
|
|
2692
2742
|
|
|
2693
2743
|
case 8:
|
|
2694
|
-
return
|
|
2744
|
+
return _context31.abrupt("return", _context31.sent);
|
|
2695
2745
|
|
|
2696
2746
|
case 9:
|
|
2697
2747
|
case "end":
|
|
2698
|
-
return
|
|
2748
|
+
return _context31.stop();
|
|
2699
2749
|
}
|
|
2700
2750
|
}
|
|
2701
2751
|
});
|
|
2702
2752
|
};
|
|
2703
2753
|
|
|
2704
|
-
playoutMap.SwitchView = function
|
|
2705
|
-
return _regeneratorRuntime.async(function
|
|
2754
|
+
playoutMap.SwitchView = function _callee32(view) {
|
|
2755
|
+
return _regeneratorRuntime.async(function _callee32$(_context32) {
|
|
2706
2756
|
while (1) {
|
|
2707
|
-
switch (
|
|
2757
|
+
switch (_context32.prev = _context32.next) {
|
|
2708
2758
|
case 0:
|
|
2709
|
-
|
|
2759
|
+
_context32.next = 2;
|
|
2710
2760
|
return _regeneratorRuntime.awrap(_this9.HttpClient.Request({
|
|
2711
2761
|
path: UrlJoin("q", linkTarget.versionHash || versionHash, "rep", handler, offering, "select_view"),
|
|
2712
2762
|
method: "POST",
|
|
@@ -2721,7 +2771,7 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2721
2771
|
|
|
2722
2772
|
case 2:
|
|
2723
2773
|
case "end":
|
|
2724
|
-
return
|
|
2774
|
+
return _context32.stop();
|
|
2725
2775
|
}
|
|
2726
2776
|
}
|
|
2727
2777
|
});
|
|
@@ -2729,11 +2779,11 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2729
2779
|
}
|
|
2730
2780
|
|
|
2731
2781
|
this.Log(playoutMap);
|
|
2732
|
-
return
|
|
2782
|
+
return _context33.abrupt("return", playoutMap);
|
|
2733
2783
|
|
|
2734
2784
|
case 121:
|
|
2735
2785
|
case "end":
|
|
2736
|
-
return
|
|
2786
|
+
return _context33.stop();
|
|
2737
2787
|
}
|
|
2738
2788
|
}
|
|
2739
2789
|
}, null, this, [[22, 31]]);
|
|
@@ -2763,21 +2813,21 @@ exports.PlayoutOptions = function _callee32(_ref23) {
|
|
|
2763
2813
|
*/
|
|
2764
2814
|
|
|
2765
2815
|
|
|
2766
|
-
exports.BitmovinPlayoutOptions = function
|
|
2767
|
-
var objectId, versionHash, writeToken, linkPath,
|
|
2816
|
+
exports.BitmovinPlayoutOptions = function _callee34(_ref27) {
|
|
2817
|
+
var objectId, versionHash, writeToken, linkPath, _ref27$signedLink, signedLink, _ref27$protocols, protocols, _ref27$drms, drms, _ref27$handler, handler, _ref27$offering, offering, playoutType, context, authorizationToken, playoutOptions, _ref28, linkTarget, authorization, config;
|
|
2768
2818
|
|
|
2769
|
-
return _regeneratorRuntime.async(function
|
|
2819
|
+
return _regeneratorRuntime.async(function _callee34$(_context34) {
|
|
2770
2820
|
while (1) {
|
|
2771
|
-
switch (
|
|
2821
|
+
switch (_context34.prev = _context34.next) {
|
|
2772
2822
|
case 0:
|
|
2773
|
-
objectId =
|
|
2823
|
+
objectId = _ref27.objectId, versionHash = _ref27.versionHash, writeToken = _ref27.writeToken, linkPath = _ref27.linkPath, _ref27$signedLink = _ref27.signedLink, signedLink = _ref27$signedLink === void 0 ? false : _ref27$signedLink, _ref27$protocols = _ref27.protocols, protocols = _ref27$protocols === void 0 ? ["dash", "hls"] : _ref27$protocols, _ref27$drms = _ref27.drms, drms = _ref27$drms === void 0 ? [] : _ref27$drms, _ref27$handler = _ref27.handler, handler = _ref27$handler === void 0 ? "playout" : _ref27$handler, _ref27$offering = _ref27.offering, offering = _ref27$offering === void 0 ? "default" : _ref27$offering, playoutType = _ref27.playoutType, context = _ref27.context, authorizationToken = _ref27.authorizationToken;
|
|
2774
2824
|
versionHash ? ValidateVersion(versionHash) : ValidateObject(objectId);
|
|
2775
2825
|
|
|
2776
2826
|
if (!objectId) {
|
|
2777
2827
|
objectId = this.utils.DecodeVersionHash(versionHash).objectId;
|
|
2778
2828
|
}
|
|
2779
2829
|
|
|
2780
|
-
|
|
2830
|
+
_context34.next = 5;
|
|
2781
2831
|
return _regeneratorRuntime.awrap(this.PlayoutOptions({
|
|
2782
2832
|
objectId: objectId,
|
|
2783
2833
|
versionHash: versionHash,
|
|
@@ -2795,9 +2845,9 @@ exports.BitmovinPlayoutOptions = function _callee33(_ref26) {
|
|
|
2795
2845
|
}));
|
|
2796
2846
|
|
|
2797
2847
|
case 5:
|
|
2798
|
-
playoutOptions =
|
|
2848
|
+
playoutOptions = _context34.sent;
|
|
2799
2849
|
delete playoutOptions.playoutMethods;
|
|
2800
|
-
|
|
2850
|
+
_context34.next = 9;
|
|
2801
2851
|
return _regeneratorRuntime.awrap(this.PlayoutPathResolution({
|
|
2802
2852
|
objectId: objectId,
|
|
2803
2853
|
versionHash: versionHash,
|
|
@@ -2810,8 +2860,8 @@ exports.BitmovinPlayoutOptions = function _callee33(_ref26) {
|
|
|
2810
2860
|
}));
|
|
2811
2861
|
|
|
2812
2862
|
case 9:
|
|
2813
|
-
|
|
2814
|
-
linkTarget =
|
|
2863
|
+
_ref28 = _context34.sent;
|
|
2864
|
+
linkTarget = _ref28.linkTarget;
|
|
2815
2865
|
authorization = [];
|
|
2816
2866
|
|
|
2817
2867
|
if (authorizationToken) {
|
|
@@ -2819,12 +2869,12 @@ exports.BitmovinPlayoutOptions = function _callee33(_ref26) {
|
|
|
2819
2869
|
}
|
|
2820
2870
|
|
|
2821
2871
|
if (!(signedLink || !linkTarget.versionHash)) {
|
|
2822
|
-
|
|
2872
|
+
_context34.next = 21;
|
|
2823
2873
|
break;
|
|
2824
2874
|
}
|
|
2825
2875
|
|
|
2826
|
-
|
|
2827
|
-
|
|
2876
|
+
_context34.t0 = authorization;
|
|
2877
|
+
_context34.next = 17;
|
|
2828
2878
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
|
|
2829
2879
|
objectId: objectId,
|
|
2830
2880
|
channelAuth: true,
|
|
@@ -2832,16 +2882,16 @@ exports.BitmovinPlayoutOptions = function _callee33(_ref26) {
|
|
|
2832
2882
|
}));
|
|
2833
2883
|
|
|
2834
2884
|
case 17:
|
|
2835
|
-
|
|
2885
|
+
_context34.t1 = _context34.sent;
|
|
2836
2886
|
|
|
2837
|
-
|
|
2887
|
+
_context34.t0.push.call(_context34.t0, _context34.t1);
|
|
2838
2888
|
|
|
2839
|
-
|
|
2889
|
+
_context34.next = 26;
|
|
2840
2890
|
break;
|
|
2841
2891
|
|
|
2842
2892
|
case 21:
|
|
2843
|
-
|
|
2844
|
-
|
|
2893
|
+
_context34.t2 = authorization;
|
|
2894
|
+
_context34.next = 24;
|
|
2845
2895
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
|
|
2846
2896
|
libraryId: linkTarget.libraryId,
|
|
2847
2897
|
objectId: linkTarget.objectId,
|
|
@@ -2850,9 +2900,9 @@ exports.BitmovinPlayoutOptions = function _callee33(_ref26) {
|
|
|
2850
2900
|
}));
|
|
2851
2901
|
|
|
2852
2902
|
case 24:
|
|
2853
|
-
|
|
2903
|
+
_context34.t3 = _context34.sent;
|
|
2854
2904
|
|
|
2855
|
-
|
|
2905
|
+
_context34.t2.push.call(_context34.t2, _context34.t3);
|
|
2856
2906
|
|
|
2857
2907
|
case 26:
|
|
2858
2908
|
config = {
|
|
@@ -2898,11 +2948,11 @@ exports.BitmovinPlayoutOptions = function _callee33(_ref26) {
|
|
|
2898
2948
|
});
|
|
2899
2949
|
}
|
|
2900
2950
|
});
|
|
2901
|
-
return
|
|
2951
|
+
return _context34.abrupt("return", config);
|
|
2902
2952
|
|
|
2903
2953
|
case 29:
|
|
2904
2954
|
case "end":
|
|
2905
|
-
return
|
|
2955
|
+
return _context34.stop();
|
|
2906
2956
|
}
|
|
2907
2957
|
}
|
|
2908
2958
|
}, null, this);
|
|
@@ -2928,14 +2978,14 @@ exports.BitmovinPlayoutOptions = function _callee33(_ref26) {
|
|
|
2928
2978
|
*/
|
|
2929
2979
|
|
|
2930
2980
|
|
|
2931
|
-
exports.CallBitcodeMethod = function
|
|
2932
|
-
var libraryId, objectId, versionHash, writeToken, method,
|
|
2981
|
+
exports.CallBitcodeMethod = function _callee35(_ref29) {
|
|
2982
|
+
var libraryId, objectId, versionHash, writeToken, method, _ref29$queryParams, queryParams, _ref29$body, body, _ref29$headers, headers, _ref29$constant, constant, _ref29$format, format, path, authHeader;
|
|
2933
2983
|
|
|
2934
|
-
return _regeneratorRuntime.async(function
|
|
2984
|
+
return _regeneratorRuntime.async(function _callee35$(_context35) {
|
|
2935
2985
|
while (1) {
|
|
2936
|
-
switch (
|
|
2986
|
+
switch (_context35.prev = _context35.next) {
|
|
2937
2987
|
case 0:
|
|
2938
|
-
libraryId =
|
|
2988
|
+
libraryId = _ref29.libraryId, objectId = _ref29.objectId, versionHash = _ref29.versionHash, writeToken = _ref29.writeToken, method = _ref29.method, _ref29$queryParams = _ref29.queryParams, queryParams = _ref29$queryParams === void 0 ? {} : _ref29$queryParams, _ref29$body = _ref29.body, body = _ref29$body === void 0 ? {} : _ref29$body, _ref29$headers = _ref29.headers, headers = _ref29$headers === void 0 ? {} : _ref29$headers, _ref29$constant = _ref29.constant, constant = _ref29$constant === void 0 ? true : _ref29$constant, _ref29$format = _ref29.format, format = _ref29$format === void 0 ? "json" : _ref29$format;
|
|
2939
2989
|
ValidateParameters({
|
|
2940
2990
|
libraryId: libraryId,
|
|
2941
2991
|
objectId: objectId,
|
|
@@ -2943,7 +2993,7 @@ exports.CallBitcodeMethod = function _callee34(_ref28) {
|
|
|
2943
2993
|
});
|
|
2944
2994
|
|
|
2945
2995
|
if (method) {
|
|
2946
|
-
|
|
2996
|
+
_context35.next = 4;
|
|
2947
2997
|
break;
|
|
2948
2998
|
}
|
|
2949
2999
|
|
|
@@ -2963,11 +3013,11 @@ exports.CallBitcodeMethod = function _callee34(_ref28) {
|
|
|
2963
3013
|
authHeader = headers.authorization || headers.Authorization;
|
|
2964
3014
|
|
|
2965
3015
|
if (authHeader) {
|
|
2966
|
-
|
|
3016
|
+
_context35.next = 12;
|
|
2967
3017
|
break;
|
|
2968
3018
|
}
|
|
2969
3019
|
|
|
2970
|
-
|
|
3020
|
+
_context35.next = 11;
|
|
2971
3021
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationHeader({
|
|
2972
3022
|
libraryId: libraryId,
|
|
2973
3023
|
objectId: objectId,
|
|
@@ -2975,13 +3025,13 @@ exports.CallBitcodeMethod = function _callee34(_ref28) {
|
|
|
2975
3025
|
}));
|
|
2976
3026
|
|
|
2977
3027
|
case 11:
|
|
2978
|
-
headers.Authorization =
|
|
3028
|
+
headers.Authorization = _context35.sent.Authorization;
|
|
2979
3029
|
|
|
2980
3030
|
case 12:
|
|
2981
3031
|
this.Log("Calling bitcode method: ".concat(libraryId || "", " ").concat(objectId || versionHash, " ").concat(writeToken || "", "\n ").concat(constant ? "GET" : "POST", " ").concat(path, "\n Query Params:\n ").concat(JSON.stringify(queryParams || ""), "\n Body:\n ").concat(JSON.stringify(body || ""), "\n Headers\n ").concat(JSON.stringify(headers || "")));
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
3032
|
+
_context35.t0 = this.utils;
|
|
3033
|
+
_context35.t1 = format;
|
|
3034
|
+
_context35.next = 17;
|
|
2985
3035
|
return _regeneratorRuntime.awrap(this.HttpClient.Request({
|
|
2986
3036
|
body: body,
|
|
2987
3037
|
headers: headers,
|
|
@@ -2992,12 +3042,12 @@ exports.CallBitcodeMethod = function _callee34(_ref28) {
|
|
|
2992
3042
|
}));
|
|
2993
3043
|
|
|
2994
3044
|
case 17:
|
|
2995
|
-
|
|
2996
|
-
return
|
|
3045
|
+
_context35.t2 = _context35.sent;
|
|
3046
|
+
return _context35.abrupt("return", _context35.t0.ResponseToFormat.call(_context35.t0, _context35.t1, _context35.t2));
|
|
2997
3047
|
|
|
2998
3048
|
case 19:
|
|
2999
3049
|
case "end":
|
|
3000
|
-
return
|
|
3050
|
+
return _context35.stop();
|
|
3001
3051
|
}
|
|
3002
3052
|
}
|
|
3003
3053
|
}, null, this);
|
|
@@ -3026,14 +3076,14 @@ exports.CallBitcodeMethod = function _callee34(_ref28) {
|
|
|
3026
3076
|
*/
|
|
3027
3077
|
|
|
3028
3078
|
|
|
3029
|
-
exports.Rep = function
|
|
3030
|
-
var libraryId, objectId, versionHash, rep,
|
|
3079
|
+
exports.Rep = function _callee36(_ref30) {
|
|
3080
|
+
var libraryId, objectId, versionHash, rep, _ref30$queryParams, queryParams, _ref30$channelAuth, channelAuth, _ref30$noAuth, noAuth, _ref30$noCache, noCache;
|
|
3031
3081
|
|
|
3032
|
-
return _regeneratorRuntime.async(function
|
|
3082
|
+
return _regeneratorRuntime.async(function _callee36$(_context36) {
|
|
3033
3083
|
while (1) {
|
|
3034
|
-
switch (
|
|
3084
|
+
switch (_context36.prev = _context36.next) {
|
|
3035
3085
|
case 0:
|
|
3036
|
-
libraryId =
|
|
3086
|
+
libraryId = _ref30.libraryId, objectId = _ref30.objectId, versionHash = _ref30.versionHash, rep = _ref30.rep, _ref30$queryParams = _ref30.queryParams, queryParams = _ref30$queryParams === void 0 ? {} : _ref30$queryParams, _ref30$channelAuth = _ref30.channelAuth, channelAuth = _ref30$channelAuth === void 0 ? false : _ref30$channelAuth, _ref30$noAuth = _ref30.noAuth, noAuth = _ref30$noAuth === void 0 ? false : _ref30$noAuth, _ref30$noCache = _ref30.noCache, noCache = _ref30$noCache === void 0 ? false : _ref30$noCache;
|
|
3037
3087
|
ValidateParameters({
|
|
3038
3088
|
libraryId: libraryId,
|
|
3039
3089
|
objectId: objectId,
|
|
@@ -3041,14 +3091,14 @@ exports.Rep = function _callee35(_ref29) {
|
|
|
3041
3091
|
});
|
|
3042
3092
|
|
|
3043
3093
|
if (rep) {
|
|
3044
|
-
|
|
3094
|
+
_context36.next = 4;
|
|
3045
3095
|
break;
|
|
3046
3096
|
}
|
|
3047
3097
|
|
|
3048
3098
|
throw "Rep not specified";
|
|
3049
3099
|
|
|
3050
3100
|
case 4:
|
|
3051
|
-
return
|
|
3101
|
+
return _context36.abrupt("return", this.FabricUrl({
|
|
3052
3102
|
libraryId: libraryId,
|
|
3053
3103
|
objectId: objectId,
|
|
3054
3104
|
versionHash: versionHash,
|
|
@@ -3061,7 +3111,7 @@ exports.Rep = function _callee35(_ref29) {
|
|
|
3061
3111
|
|
|
3062
3112
|
case 5:
|
|
3063
3113
|
case "end":
|
|
3064
|
-
return
|
|
3114
|
+
return _context36.stop();
|
|
3065
3115
|
}
|
|
3066
3116
|
}
|
|
3067
3117
|
}, null, this);
|
|
@@ -3085,14 +3135,14 @@ exports.Rep = function _callee35(_ref29) {
|
|
|
3085
3135
|
*/
|
|
3086
3136
|
|
|
3087
3137
|
|
|
3088
|
-
exports.PublicRep = function
|
|
3089
|
-
var libraryId, objectId, versionHash, rep,
|
|
3138
|
+
exports.PublicRep = function _callee37(_ref31) {
|
|
3139
|
+
var libraryId, objectId, versionHash, rep, _ref31$queryParams, queryParams;
|
|
3090
3140
|
|
|
3091
|
-
return _regeneratorRuntime.async(function
|
|
3141
|
+
return _regeneratorRuntime.async(function _callee37$(_context37) {
|
|
3092
3142
|
while (1) {
|
|
3093
|
-
switch (
|
|
3143
|
+
switch (_context37.prev = _context37.next) {
|
|
3094
3144
|
case 0:
|
|
3095
|
-
libraryId =
|
|
3145
|
+
libraryId = _ref31.libraryId, objectId = _ref31.objectId, versionHash = _ref31.versionHash, rep = _ref31.rep, _ref31$queryParams = _ref31.queryParams, queryParams = _ref31$queryParams === void 0 ? {} : _ref31$queryParams;
|
|
3096
3146
|
ValidateParameters({
|
|
3097
3147
|
libraryId: libraryId,
|
|
3098
3148
|
objectId: objectId,
|
|
@@ -3100,14 +3150,14 @@ exports.PublicRep = function _callee36(_ref30) {
|
|
|
3100
3150
|
});
|
|
3101
3151
|
|
|
3102
3152
|
if (rep) {
|
|
3103
|
-
|
|
3153
|
+
_context37.next = 4;
|
|
3104
3154
|
break;
|
|
3105
3155
|
}
|
|
3106
3156
|
|
|
3107
3157
|
throw "Rep not specified";
|
|
3108
3158
|
|
|
3109
3159
|
case 4:
|
|
3110
|
-
return
|
|
3160
|
+
return _context37.abrupt("return", this.FabricUrl({
|
|
3111
3161
|
libraryId: libraryId,
|
|
3112
3162
|
objectId: objectId,
|
|
3113
3163
|
versionHash: versionHash,
|
|
@@ -3118,7 +3168,7 @@ exports.PublicRep = function _callee36(_ref30) {
|
|
|
3118
3168
|
|
|
3119
3169
|
case 5:
|
|
3120
3170
|
case "end":
|
|
3121
|
-
return
|
|
3171
|
+
return _context37.stop();
|
|
3122
3172
|
}
|
|
3123
3173
|
}
|
|
3124
3174
|
}, null, this);
|
|
@@ -3147,14 +3197,14 @@ exports.PublicRep = function _callee36(_ref30) {
|
|
|
3147
3197
|
*/
|
|
3148
3198
|
|
|
3149
3199
|
|
|
3150
|
-
exports.FabricUrl = function
|
|
3151
|
-
var libraryId, objectId, versionHash, writeToken, partHash, rep, publicRep, call,
|
|
3200
|
+
exports.FabricUrl = function _callee38(_ref32) {
|
|
3201
|
+
var libraryId, objectId, versionHash, writeToken, partHash, rep, publicRep, call, _ref32$queryParams, queryParams, _ref32$channelAuth, channelAuth, _ref32$noAuth, noAuth, _ref32$noCache, noCache, authorization, path;
|
|
3152
3202
|
|
|
3153
|
-
return _regeneratorRuntime.async(function
|
|
3203
|
+
return _regeneratorRuntime.async(function _callee38$(_context38) {
|
|
3154
3204
|
while (1) {
|
|
3155
|
-
switch (
|
|
3205
|
+
switch (_context38.prev = _context38.next) {
|
|
3156
3206
|
case 0:
|
|
3157
|
-
libraryId =
|
|
3207
|
+
libraryId = _ref32.libraryId, objectId = _ref32.objectId, versionHash = _ref32.versionHash, writeToken = _ref32.writeToken, partHash = _ref32.partHash, rep = _ref32.rep, publicRep = _ref32.publicRep, call = _ref32.call, _ref32$queryParams = _ref32.queryParams, queryParams = _ref32$queryParams === void 0 ? {} : _ref32$queryParams, _ref32$channelAuth = _ref32.channelAuth, channelAuth = _ref32$channelAuth === void 0 ? false : _ref32$channelAuth, _ref32$noAuth = _ref32.noAuth, noAuth = _ref32$noAuth === void 0 ? false : _ref32$noAuth, _ref32$noCache = _ref32.noCache, noCache = _ref32$noCache === void 0 ? false : _ref32$noCache;
|
|
3158
3208
|
|
|
3159
3209
|
if (objectId || versionHash) {
|
|
3160
3210
|
ValidateParameters({
|
|
@@ -3176,12 +3226,12 @@ exports.FabricUrl = function _callee37(_ref31) {
|
|
|
3176
3226
|
}
|
|
3177
3227
|
|
|
3178
3228
|
if (noAuth && queryParams.authorization) {
|
|
3179
|
-
|
|
3229
|
+
_context38.next = 12;
|
|
3180
3230
|
break;
|
|
3181
3231
|
}
|
|
3182
3232
|
|
|
3183
|
-
|
|
3184
|
-
|
|
3233
|
+
_context38.t0 = authorization;
|
|
3234
|
+
_context38.next = 10;
|
|
3185
3235
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
|
|
3186
3236
|
libraryId: libraryId,
|
|
3187
3237
|
objectId: objectId,
|
|
@@ -3192,9 +3242,9 @@ exports.FabricUrl = function _callee37(_ref31) {
|
|
|
3192
3242
|
}));
|
|
3193
3243
|
|
|
3194
3244
|
case 10:
|
|
3195
|
-
|
|
3245
|
+
_context38.t1 = _context38.sent;
|
|
3196
3246
|
|
|
3197
|
-
|
|
3247
|
+
_context38.t0.push.call(_context38.t0, _context38.t1);
|
|
3198
3248
|
|
|
3199
3249
|
case 12:
|
|
3200
3250
|
// Clone queryParams to avoid modification of the original
|
|
@@ -3203,17 +3253,17 @@ exports.FabricUrl = function _callee37(_ref31) {
|
|
|
3203
3253
|
});
|
|
3204
3254
|
|
|
3205
3255
|
if (!((rep || publicRep) && objectId && !versionHash)) {
|
|
3206
|
-
|
|
3256
|
+
_context38.next = 17;
|
|
3207
3257
|
break;
|
|
3208
3258
|
}
|
|
3209
3259
|
|
|
3210
|
-
|
|
3260
|
+
_context38.next = 16;
|
|
3211
3261
|
return _regeneratorRuntime.awrap(this.LatestVersionHash({
|
|
3212
3262
|
objectId: objectId
|
|
3213
3263
|
}));
|
|
3214
3264
|
|
|
3215
3265
|
case 16:
|
|
3216
|
-
versionHash =
|
|
3266
|
+
versionHash = _context38.sent;
|
|
3217
3267
|
|
|
3218
3268
|
case 17:
|
|
3219
3269
|
path = "";
|
|
@@ -3238,14 +3288,14 @@ exports.FabricUrl = function _callee37(_ref31) {
|
|
|
3238
3288
|
path = UrlJoin(path, "call", call);
|
|
3239
3289
|
}
|
|
3240
3290
|
|
|
3241
|
-
return
|
|
3291
|
+
return _context38.abrupt("return", this.HttpClient.URL({
|
|
3242
3292
|
path: path,
|
|
3243
3293
|
queryParams: queryParams
|
|
3244
3294
|
}));
|
|
3245
3295
|
|
|
3246
3296
|
case 21:
|
|
3247
3297
|
case "end":
|
|
3248
|
-
return
|
|
3298
|
+
return _context38.stop();
|
|
3249
3299
|
}
|
|
3250
3300
|
}
|
|
3251
3301
|
}, null, this);
|
|
@@ -3268,14 +3318,14 @@ exports.FabricUrl = function _callee37(_ref31) {
|
|
|
3268
3318
|
*/
|
|
3269
3319
|
|
|
3270
3320
|
|
|
3271
|
-
exports.FileUrl = function
|
|
3272
|
-
var libraryId, objectId, versionHash, writeToken, filePath,
|
|
3321
|
+
exports.FileUrl = function _callee39(_ref33) {
|
|
3322
|
+
var libraryId, objectId, versionHash, writeToken, filePath, _ref33$queryParams, queryParams, _ref33$noCache, noCache, path, authorizationToken, fileInfo, encrypted;
|
|
3273
3323
|
|
|
3274
|
-
return _regeneratorRuntime.async(function
|
|
3324
|
+
return _regeneratorRuntime.async(function _callee39$(_context39) {
|
|
3275
3325
|
while (1) {
|
|
3276
|
-
switch (
|
|
3326
|
+
switch (_context39.prev = _context39.next) {
|
|
3277
3327
|
case 0:
|
|
3278
|
-
libraryId =
|
|
3328
|
+
libraryId = _ref33.libraryId, objectId = _ref33.objectId, versionHash = _ref33.versionHash, writeToken = _ref33.writeToken, filePath = _ref33.filePath, _ref33$queryParams = _ref33.queryParams, queryParams = _ref33$queryParams === void 0 ? {} : _ref33$queryParams, _ref33$noCache = _ref33.noCache, noCache = _ref33$noCache === void 0 ? false : _ref33$noCache;
|
|
3279
3329
|
ValidateParameters({
|
|
3280
3330
|
libraryId: libraryId,
|
|
3281
3331
|
objectId: objectId,
|
|
@@ -3283,7 +3333,7 @@ exports.FileUrl = function _callee38(_ref32) {
|
|
|
3283
3333
|
});
|
|
3284
3334
|
|
|
3285
3335
|
if (filePath) {
|
|
3286
|
-
|
|
3336
|
+
_context39.next = 4;
|
|
3287
3337
|
break;
|
|
3288
3338
|
}
|
|
3289
3339
|
|
|
@@ -3300,7 +3350,7 @@ exports.FileUrl = function _callee38(_ref32) {
|
|
|
3300
3350
|
path = UrlJoin("q", versionHash);
|
|
3301
3351
|
}
|
|
3302
3352
|
|
|
3303
|
-
|
|
3353
|
+
_context39.next = 8;
|
|
3304
3354
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
|
|
3305
3355
|
libraryId: libraryId,
|
|
3306
3356
|
objectId: objectId,
|
|
@@ -3308,11 +3358,11 @@ exports.FileUrl = function _callee38(_ref32) {
|
|
|
3308
3358
|
}));
|
|
3309
3359
|
|
|
3310
3360
|
case 8:
|
|
3311
|
-
authorizationToken =
|
|
3361
|
+
authorizationToken = _context39.sent;
|
|
3312
3362
|
queryParams = _objectSpread({}, queryParams, {
|
|
3313
3363
|
authorization: authorizationToken
|
|
3314
3364
|
});
|
|
3315
|
-
|
|
3365
|
+
_context39.next = 12;
|
|
3316
3366
|
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
3317
3367
|
libraryId: libraryId,
|
|
3318
3368
|
objectId: objectId,
|
|
@@ -3322,7 +3372,7 @@ exports.FileUrl = function _callee38(_ref32) {
|
|
|
3322
3372
|
}));
|
|
3323
3373
|
|
|
3324
3374
|
case 12:
|
|
3325
|
-
fileInfo =
|
|
3375
|
+
fileInfo = _context39.sent;
|
|
3326
3376
|
encrypted = fileInfo && fileInfo["."].encryption && fileInfo["."].encryption.scheme === "cgck";
|
|
3327
3377
|
|
|
3328
3378
|
if (encrypted) {
|
|
@@ -3332,14 +3382,14 @@ exports.FileUrl = function _callee38(_ref32) {
|
|
|
3332
3382
|
path = UrlJoin(path, "files", filePath);
|
|
3333
3383
|
}
|
|
3334
3384
|
|
|
3335
|
-
return
|
|
3385
|
+
return _context39.abrupt("return", this.HttpClient.URL({
|
|
3336
3386
|
path: path,
|
|
3337
3387
|
queryParams: queryParams
|
|
3338
3388
|
}));
|
|
3339
3389
|
|
|
3340
3390
|
case 16:
|
|
3341
3391
|
case "end":
|
|
3342
|
-
return
|
|
3392
|
+
return _context39.stop();
|
|
3343
3393
|
}
|
|
3344
3394
|
}
|
|
3345
3395
|
}, null, this);
|
|
@@ -3361,14 +3411,14 @@ exports.FileUrl = function _callee38(_ref32) {
|
|
|
3361
3411
|
*/
|
|
3362
3412
|
|
|
3363
3413
|
|
|
3364
|
-
exports.ContentObjectImageUrl = function
|
|
3365
|
-
var libraryId, objectId, versionHash, height,
|
|
3414
|
+
exports.ContentObjectImageUrl = function _callee40(_ref34) {
|
|
3415
|
+
var libraryId, objectId, versionHash, height, _ref34$imagePath, imagePath, imageMetadata, _queryParams;
|
|
3366
3416
|
|
|
3367
|
-
return _regeneratorRuntime.async(function
|
|
3417
|
+
return _regeneratorRuntime.async(function _callee40$(_context40) {
|
|
3368
3418
|
while (1) {
|
|
3369
|
-
switch (
|
|
3419
|
+
switch (_context40.prev = _context40.next) {
|
|
3370
3420
|
case 0:
|
|
3371
|
-
libraryId =
|
|
3421
|
+
libraryId = _ref34.libraryId, objectId = _ref34.objectId, versionHash = _ref34.versionHash, height = _ref34.height, _ref34$imagePath = _ref34.imagePath, imagePath = _ref34$imagePath === void 0 ? "public/display_image" : _ref34$imagePath;
|
|
3372
3422
|
ValidateParameters({
|
|
3373
3423
|
libraryId: libraryId,
|
|
3374
3424
|
objectId: objectId,
|
|
@@ -3376,53 +3426,53 @@ exports.ContentObjectImageUrl = function _callee39(_ref33) {
|
|
|
3376
3426
|
});
|
|
3377
3427
|
|
|
3378
3428
|
if (versionHash) {
|
|
3379
|
-
|
|
3429
|
+
_context40.next = 6;
|
|
3380
3430
|
break;
|
|
3381
3431
|
}
|
|
3382
3432
|
|
|
3383
|
-
|
|
3433
|
+
_context40.next = 5;
|
|
3384
3434
|
return _regeneratorRuntime.awrap(this.LatestVersionHash({
|
|
3385
3435
|
objectId: objectId
|
|
3386
3436
|
}));
|
|
3387
3437
|
|
|
3388
3438
|
case 5:
|
|
3389
|
-
versionHash =
|
|
3439
|
+
versionHash = _context40.sent;
|
|
3390
3440
|
|
|
3391
3441
|
case 6:
|
|
3392
3442
|
this.Log("Retrieving content object image url: ".concat(libraryId, " ").concat(objectId, " ").concat(versionHash));
|
|
3393
3443
|
|
|
3394
3444
|
if (this.objectImageUrls[versionHash]) {
|
|
3395
|
-
|
|
3445
|
+
_context40.next = 26;
|
|
3396
3446
|
break;
|
|
3397
3447
|
}
|
|
3398
3448
|
|
|
3399
|
-
|
|
3400
|
-
|
|
3449
|
+
_context40.prev = 8;
|
|
3450
|
+
_context40.next = 11;
|
|
3401
3451
|
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
3402
3452
|
versionHash: versionHash,
|
|
3403
3453
|
metadataSubtree: imagePath
|
|
3404
3454
|
}));
|
|
3405
3455
|
|
|
3406
3456
|
case 11:
|
|
3407
|
-
imageMetadata =
|
|
3457
|
+
imageMetadata = _context40.sent;
|
|
3408
3458
|
|
|
3409
3459
|
if (imageMetadata) {
|
|
3410
|
-
|
|
3460
|
+
_context40.next = 15;
|
|
3411
3461
|
break;
|
|
3412
3462
|
}
|
|
3413
3463
|
|
|
3414
3464
|
this.Log("No image url set: ".concat(libraryId, " ").concat(objectId, " ").concat(versionHash));
|
|
3415
|
-
return
|
|
3465
|
+
return _context40.abrupt("return");
|
|
3416
3466
|
|
|
3417
3467
|
case 15:
|
|
3418
|
-
|
|
3468
|
+
_context40.next = 21;
|
|
3419
3469
|
break;
|
|
3420
3470
|
|
|
3421
3471
|
case 17:
|
|
3422
|
-
|
|
3423
|
-
|
|
3472
|
+
_context40.prev = 17;
|
|
3473
|
+
_context40.t0 = _context40["catch"](8);
|
|
3424
3474
|
this.Log("Unable to query for image metadata: ".concat(libraryId, " ").concat(objectId, " ").concat(versionHash), true);
|
|
3425
|
-
this.Log(
|
|
3475
|
+
this.Log(_context40.t0, true);
|
|
3426
3476
|
|
|
3427
3477
|
case 21:
|
|
3428
3478
|
_queryParams = {};
|
|
@@ -3431,7 +3481,7 @@ exports.ContentObjectImageUrl = function _callee39(_ref33) {
|
|
|
3431
3481
|
_queryParams["height"] = parseInt(height);
|
|
3432
3482
|
}
|
|
3433
3483
|
|
|
3434
|
-
|
|
3484
|
+
_context40.next = 25;
|
|
3435
3485
|
return _regeneratorRuntime.awrap(this.LinkUrl({
|
|
3436
3486
|
versionHash: versionHash,
|
|
3437
3487
|
linkPath: imagePath,
|
|
@@ -3439,14 +3489,14 @@ exports.ContentObjectImageUrl = function _callee39(_ref33) {
|
|
|
3439
3489
|
}));
|
|
3440
3490
|
|
|
3441
3491
|
case 25:
|
|
3442
|
-
this.objectImageUrls[versionHash] =
|
|
3492
|
+
this.objectImageUrls[versionHash] = _context40.sent;
|
|
3443
3493
|
|
|
3444
3494
|
case 26:
|
|
3445
|
-
return
|
|
3495
|
+
return _context40.abrupt("return", this.objectImageUrls[versionHash]);
|
|
3446
3496
|
|
|
3447
3497
|
case 27:
|
|
3448
3498
|
case "end":
|
|
3449
|
-
return
|
|
3499
|
+
return _context40.stop();
|
|
3450
3500
|
}
|
|
3451
3501
|
}
|
|
3452
3502
|
}, null, this, [[8, 17]]);
|
|
@@ -3468,16 +3518,16 @@ exports.ContentObjectImageUrl = function _callee39(_ref33) {
|
|
|
3468
3518
|
*/
|
|
3469
3519
|
|
|
3470
3520
|
|
|
3471
|
-
exports.ContentObjectGraph = function
|
|
3521
|
+
exports.ContentObjectGraph = function _callee42(_ref35) {
|
|
3472
3522
|
var _this10 = this;
|
|
3473
3523
|
|
|
3474
|
-
var libraryId, objectId, versionHash,
|
|
3524
|
+
var libraryId, objectId, versionHash, _ref35$autoUpdate, autoUpdate, select, path, errorInfo, cycles, info;
|
|
3475
3525
|
|
|
3476
|
-
return _regeneratorRuntime.async(function
|
|
3526
|
+
return _regeneratorRuntime.async(function _callee42$(_context42) {
|
|
3477
3527
|
while (1) {
|
|
3478
|
-
switch (
|
|
3528
|
+
switch (_context42.prev = _context42.next) {
|
|
3479
3529
|
case 0:
|
|
3480
|
-
libraryId =
|
|
3530
|
+
libraryId = _ref35.libraryId, objectId = _ref35.objectId, versionHash = _ref35.versionHash, _ref35$autoUpdate = _ref35.autoUpdate, autoUpdate = _ref35$autoUpdate === void 0 ? false : _ref35$autoUpdate, select = _ref35.select;
|
|
3481
3531
|
ValidateParameters({
|
|
3482
3532
|
libraryId: libraryId,
|
|
3483
3533
|
objectId: objectId,
|
|
@@ -3490,11 +3540,11 @@ exports.ContentObjectGraph = function _callee41(_ref34) {
|
|
|
3490
3540
|
}
|
|
3491
3541
|
|
|
3492
3542
|
path = UrlJoin("q", versionHash || objectId, "links");
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3543
|
+
_context42.prev = 5;
|
|
3544
|
+
_context42.t0 = _regeneratorRuntime;
|
|
3545
|
+
_context42.t1 = this.utils;
|
|
3546
|
+
_context42.t2 = this.HttpClient;
|
|
3547
|
+
_context42.next = 11;
|
|
3498
3548
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationHeader({
|
|
3499
3549
|
libraryId: libraryId,
|
|
3500
3550
|
objectId: objectId,
|
|
@@ -3502,109 +3552,109 @@ exports.ContentObjectGraph = function _callee41(_ref34) {
|
|
|
3502
3552
|
}));
|
|
3503
3553
|
|
|
3504
3554
|
case 11:
|
|
3505
|
-
|
|
3506
|
-
|
|
3555
|
+
_context42.t3 = _context42.sent;
|
|
3556
|
+
_context42.t4 = {
|
|
3507
3557
|
auto_update: autoUpdate,
|
|
3508
3558
|
select: select
|
|
3509
3559
|
};
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
headers:
|
|
3513
|
-
queryParams:
|
|
3560
|
+
_context42.t5 = path;
|
|
3561
|
+
_context42.t6 = {
|
|
3562
|
+
headers: _context42.t3,
|
|
3563
|
+
queryParams: _context42.t4,
|
|
3514
3564
|
method: "GET",
|
|
3515
|
-
path:
|
|
3565
|
+
path: _context42.t5
|
|
3516
3566
|
};
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
return
|
|
3567
|
+
_context42.t7 = _context42.t2.Request.call(_context42.t2, _context42.t6);
|
|
3568
|
+
_context42.t8 = _context42.t1.ResponseToJson.call(_context42.t1, _context42.t7);
|
|
3569
|
+
_context42.next = 19;
|
|
3570
|
+
return _context42.t0.awrap.call(_context42.t0, _context42.t8);
|
|
3521
3571
|
|
|
3522
3572
|
case 19:
|
|
3523
|
-
return
|
|
3573
|
+
return _context42.abrupt("return", _context42.sent);
|
|
3524
3574
|
|
|
3525
3575
|
case 22:
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
cycles =
|
|
3576
|
+
_context42.prev = 22;
|
|
3577
|
+
_context42.t9 = _context42["catch"](5);
|
|
3578
|
+
_context42.prev = 24;
|
|
3579
|
+
cycles = _context42.t9.body.errors[0].cause.cause.cause.cycle;
|
|
3530
3580
|
|
|
3531
3581
|
if (!(!cycles || cycles.length === 0)) {
|
|
3532
|
-
|
|
3582
|
+
_context42.next = 28;
|
|
3533
3583
|
break;
|
|
3534
3584
|
}
|
|
3535
3585
|
|
|
3536
|
-
throw
|
|
3586
|
+
throw _context42.t9;
|
|
3537
3587
|
|
|
3538
3588
|
case 28:
|
|
3539
3589
|
info = {};
|
|
3540
|
-
|
|
3541
|
-
return _regeneratorRuntime.awrap(Promise.all(cycles.map(function
|
|
3590
|
+
_context42.next = 31;
|
|
3591
|
+
return _regeneratorRuntime.awrap(Promise.all(cycles.map(function _callee41(cycleHash) {
|
|
3542
3592
|
var cycleId, name;
|
|
3543
|
-
return _regeneratorRuntime.async(function
|
|
3593
|
+
return _regeneratorRuntime.async(function _callee41$(_context41) {
|
|
3544
3594
|
while (1) {
|
|
3545
|
-
switch (
|
|
3595
|
+
switch (_context41.prev = _context41.next) {
|
|
3546
3596
|
case 0:
|
|
3547
3597
|
if (!info[cycleHash]) {
|
|
3548
|
-
|
|
3598
|
+
_context41.next = 2;
|
|
3549
3599
|
break;
|
|
3550
3600
|
}
|
|
3551
3601
|
|
|
3552
|
-
return
|
|
3602
|
+
return _context41.abrupt("return");
|
|
3553
3603
|
|
|
3554
3604
|
case 2:
|
|
3555
3605
|
cycleId = _this10.utils.DecodeVersionHash(cycleHash).objectId;
|
|
3556
|
-
|
|
3606
|
+
_context41.next = 5;
|
|
3557
3607
|
return _regeneratorRuntime.awrap(_this10.ContentObjectMetadata({
|
|
3558
3608
|
versionHash: cycleHash,
|
|
3559
3609
|
metadataSubtree: "public/asset_metadata/display_title"
|
|
3560
3610
|
}));
|
|
3561
3611
|
|
|
3562
3612
|
case 5:
|
|
3563
|
-
|
|
3613
|
+
_context41.t2 = _context41.sent;
|
|
3564
3614
|
|
|
3565
|
-
if (
|
|
3566
|
-
|
|
3615
|
+
if (_context41.t2) {
|
|
3616
|
+
_context41.next = 10;
|
|
3567
3617
|
break;
|
|
3568
3618
|
}
|
|
3569
3619
|
|
|
3570
|
-
|
|
3620
|
+
_context41.next = 9;
|
|
3571
3621
|
return _regeneratorRuntime.awrap(_this10.ContentObjectMetadata({
|
|
3572
3622
|
versionHash: cycleHash,
|
|
3573
3623
|
metadataSubtree: "public/name"
|
|
3574
3624
|
}));
|
|
3575
3625
|
|
|
3576
3626
|
case 9:
|
|
3577
|
-
|
|
3627
|
+
_context41.t2 = _context41.sent;
|
|
3578
3628
|
|
|
3579
3629
|
case 10:
|
|
3580
|
-
|
|
3630
|
+
_context41.t1 = _context41.t2;
|
|
3581
3631
|
|
|
3582
|
-
if (
|
|
3583
|
-
|
|
3632
|
+
if (_context41.t1) {
|
|
3633
|
+
_context41.next = 15;
|
|
3584
3634
|
break;
|
|
3585
3635
|
}
|
|
3586
3636
|
|
|
3587
|
-
|
|
3637
|
+
_context41.next = 14;
|
|
3588
3638
|
return _regeneratorRuntime.awrap(_this10.ContentObjectMetadata({
|
|
3589
3639
|
versionHash: cycleHash,
|
|
3590
3640
|
metadataSubtree: "name"
|
|
3591
3641
|
}));
|
|
3592
3642
|
|
|
3593
3643
|
case 14:
|
|
3594
|
-
|
|
3644
|
+
_context41.t1 = _context41.sent;
|
|
3595
3645
|
|
|
3596
3646
|
case 15:
|
|
3597
|
-
|
|
3647
|
+
_context41.t0 = _context41.t1;
|
|
3598
3648
|
|
|
3599
|
-
if (
|
|
3600
|
-
|
|
3649
|
+
if (_context41.t0) {
|
|
3650
|
+
_context41.next = 18;
|
|
3601
3651
|
break;
|
|
3602
3652
|
}
|
|
3603
3653
|
|
|
3604
|
-
|
|
3654
|
+
_context41.t0 = cycleId;
|
|
3605
3655
|
|
|
3606
3656
|
case 18:
|
|
3607
|
-
name =
|
|
3657
|
+
name = _context41.t0;
|
|
3608
3658
|
info[cycleHash] = {
|
|
3609
3659
|
name: name,
|
|
3610
3660
|
objectId: cycleId
|
|
@@ -3612,7 +3662,7 @@ exports.ContentObjectGraph = function _callee41(_ref34) {
|
|
|
3612
3662
|
|
|
3613
3663
|
case 20:
|
|
3614
3664
|
case "end":
|
|
3615
|
-
return
|
|
3665
|
+
return _context41.stop();
|
|
3616
3666
|
}
|
|
3617
3667
|
}
|
|
3618
3668
|
});
|
|
@@ -3622,20 +3672,20 @@ exports.ContentObjectGraph = function _callee41(_ref34) {
|
|
|
3622
3672
|
errorInfo = cycles.map(function (cycleHash) {
|
|
3623
3673
|
return "".concat(info[cycleHash].name, " (").concat(info[cycleHash].objectId, ")");
|
|
3624
3674
|
});
|
|
3625
|
-
|
|
3675
|
+
_context42.next = 37;
|
|
3626
3676
|
break;
|
|
3627
3677
|
|
|
3628
3678
|
case 34:
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
throw
|
|
3679
|
+
_context42.prev = 34;
|
|
3680
|
+
_context42.t10 = _context42["catch"](24);
|
|
3681
|
+
throw _context42.t9;
|
|
3632
3682
|
|
|
3633
3683
|
case 37:
|
|
3634
3684
|
throw new Error("Cycle found in links: ".concat(errorInfo.join(" -> ")));
|
|
3635
3685
|
|
|
3636
3686
|
case 38:
|
|
3637
3687
|
case "end":
|
|
3638
|
-
return
|
|
3688
|
+
return _context42.stop();
|
|
3639
3689
|
}
|
|
3640
3690
|
}
|
|
3641
3691
|
}, null, this, [[5, 22], [24, 34]]);
|
|
@@ -3657,13 +3707,13 @@ exports.ContentObjectGraph = function _callee41(_ref34) {
|
|
|
3657
3707
|
*/
|
|
3658
3708
|
|
|
3659
3709
|
|
|
3660
|
-
exports.LinkTarget = function
|
|
3710
|
+
exports.LinkTarget = function _callee43(_ref36) {
|
|
3661
3711
|
var libraryId, objectId, versionHash, writeToken, linkPath, authorizationToken, linkInfo, targetHash, subPath;
|
|
3662
|
-
return _regeneratorRuntime.async(function
|
|
3712
|
+
return _regeneratorRuntime.async(function _callee43$(_context43) {
|
|
3663
3713
|
while (1) {
|
|
3664
|
-
switch (
|
|
3714
|
+
switch (_context43.prev = _context43.next) {
|
|
3665
3715
|
case 0:
|
|
3666
|
-
libraryId =
|
|
3716
|
+
libraryId = _ref36.libraryId, objectId = _ref36.objectId, versionHash = _ref36.versionHash, writeToken = _ref36.writeToken, linkPath = _ref36.linkPath, authorizationToken = _ref36.authorizationToken, linkInfo = _ref36.linkInfo;
|
|
3667
3717
|
ValidateParameters({
|
|
3668
3718
|
libraryId: libraryId,
|
|
3669
3719
|
objectId: objectId,
|
|
@@ -3679,25 +3729,25 @@ exports.LinkTarget = function _callee42(_ref35) {
|
|
|
3679
3729
|
}
|
|
3680
3730
|
|
|
3681
3731
|
if (!(writeToken && !libraryId)) {
|
|
3682
|
-
|
|
3732
|
+
_context43.next = 8;
|
|
3683
3733
|
break;
|
|
3684
3734
|
}
|
|
3685
3735
|
|
|
3686
|
-
|
|
3736
|
+
_context43.next = 7;
|
|
3687
3737
|
return _regeneratorRuntime.awrap(this.ContentObjectLibraryId({
|
|
3688
3738
|
objectId: objectId
|
|
3689
3739
|
}));
|
|
3690
3740
|
|
|
3691
3741
|
case 7:
|
|
3692
|
-
libraryId =
|
|
3742
|
+
libraryId = _context43.sent;
|
|
3693
3743
|
|
|
3694
3744
|
case 8:
|
|
3695
3745
|
if (linkInfo) {
|
|
3696
|
-
|
|
3746
|
+
_context43.next = 12;
|
|
3697
3747
|
break;
|
|
3698
3748
|
}
|
|
3699
3749
|
|
|
3700
|
-
|
|
3750
|
+
_context43.next = 11;
|
|
3701
3751
|
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
3702
3752
|
libraryId: libraryId,
|
|
3703
3753
|
objectId: objectId,
|
|
@@ -3711,11 +3761,11 @@ exports.LinkTarget = function _callee42(_ref35) {
|
|
|
3711
3761
|
}));
|
|
3712
3762
|
|
|
3713
3763
|
case 11:
|
|
3714
|
-
linkInfo =
|
|
3764
|
+
linkInfo = _context43.sent;
|
|
3715
3765
|
|
|
3716
3766
|
case 12:
|
|
3717
3767
|
if (!(linkInfo && linkInfo["/"])) {
|
|
3718
|
-
|
|
3768
|
+
_context43.next = 27;
|
|
3719
3769
|
break;
|
|
3720
3770
|
}
|
|
3721
3771
|
|
|
@@ -3727,41 +3777,41 @@ exports.LinkTarget = function _callee42(_ref35) {
|
|
|
3727
3777
|
}
|
|
3728
3778
|
|
|
3729
3779
|
if (!targetHash) {
|
|
3730
|
-
|
|
3780
|
+
_context43.next = 19;
|
|
3731
3781
|
break;
|
|
3732
3782
|
}
|
|
3733
3783
|
|
|
3734
|
-
return
|
|
3784
|
+
return _context43.abrupt("return", targetHash);
|
|
3735
3785
|
|
|
3736
3786
|
case 19:
|
|
3737
3787
|
if (!versionHash) {
|
|
3738
|
-
|
|
3788
|
+
_context43.next = 21;
|
|
3739
3789
|
break;
|
|
3740
3790
|
}
|
|
3741
3791
|
|
|
3742
|
-
return
|
|
3792
|
+
return _context43.abrupt("return", versionHash);
|
|
3743
3793
|
|
|
3744
3794
|
case 21:
|
|
3745
|
-
|
|
3795
|
+
_context43.t0 = versionHash;
|
|
3746
3796
|
|
|
3747
|
-
if (
|
|
3748
|
-
|
|
3797
|
+
if (_context43.t0) {
|
|
3798
|
+
_context43.next = 26;
|
|
3749
3799
|
break;
|
|
3750
3800
|
}
|
|
3751
3801
|
|
|
3752
|
-
|
|
3802
|
+
_context43.next = 25;
|
|
3753
3803
|
return _regeneratorRuntime.awrap(this.LatestVersionHash({
|
|
3754
3804
|
objectId: objectId
|
|
3755
3805
|
}));
|
|
3756
3806
|
|
|
3757
3807
|
case 25:
|
|
3758
|
-
|
|
3808
|
+
_context43.t0 = _context43.sent;
|
|
3759
3809
|
|
|
3760
3810
|
case 26:
|
|
3761
|
-
return
|
|
3811
|
+
return _context43.abrupt("return", _context43.t0);
|
|
3762
3812
|
|
|
3763
3813
|
case 27:
|
|
3764
|
-
|
|
3814
|
+
_context43.next = 29;
|
|
3765
3815
|
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
3766
3816
|
libraryId: libraryId,
|
|
3767
3817
|
objectId: objectId,
|
|
@@ -3773,65 +3823,65 @@ exports.LinkTarget = function _callee42(_ref35) {
|
|
|
3773
3823
|
}));
|
|
3774
3824
|
|
|
3775
3825
|
case 29:
|
|
3776
|
-
linkInfo =
|
|
3826
|
+
linkInfo = _context43.sent;
|
|
3777
3827
|
|
|
3778
3828
|
if (!(!linkInfo || !linkInfo["."])) {
|
|
3779
|
-
|
|
3829
|
+
_context43.next = 49;
|
|
3780
3830
|
break;
|
|
3781
3831
|
}
|
|
3782
3832
|
|
|
3783
3833
|
if (!(_typeof(linkInfo) === "object")) {
|
|
3784
|
-
|
|
3834
|
+
_context43.next = 38;
|
|
3785
3835
|
break;
|
|
3786
3836
|
}
|
|
3787
3837
|
|
|
3788
|
-
|
|
3838
|
+
_context43.t1 = versionHash;
|
|
3789
3839
|
|
|
3790
|
-
if (
|
|
3791
|
-
|
|
3840
|
+
if (_context43.t1) {
|
|
3841
|
+
_context43.next = 37;
|
|
3792
3842
|
break;
|
|
3793
3843
|
}
|
|
3794
3844
|
|
|
3795
|
-
|
|
3845
|
+
_context43.next = 36;
|
|
3796
3846
|
return _regeneratorRuntime.awrap(this.LatestVersionHash({
|
|
3797
3847
|
objectId: objectId
|
|
3798
3848
|
}));
|
|
3799
3849
|
|
|
3800
3850
|
case 36:
|
|
3801
|
-
|
|
3851
|
+
_context43.t1 = _context43.sent;
|
|
3802
3852
|
|
|
3803
3853
|
case 37:
|
|
3804
|
-
return
|
|
3854
|
+
return _context43.abrupt("return", _context43.t1);
|
|
3805
3855
|
|
|
3806
3856
|
case 38:
|
|
3807
3857
|
// linkPath is not a direct link, but points to a literal value - back up one path element to find the container
|
|
3808
3858
|
subPath = linkPath.split("/").slice(0, -1).join("/");
|
|
3809
3859
|
|
|
3810
3860
|
if (subPath) {
|
|
3811
|
-
|
|
3861
|
+
_context43.next = 46;
|
|
3812
3862
|
break;
|
|
3813
3863
|
}
|
|
3814
3864
|
|
|
3815
|
-
|
|
3865
|
+
_context43.t2 = versionHash;
|
|
3816
3866
|
|
|
3817
|
-
if (
|
|
3818
|
-
|
|
3867
|
+
if (_context43.t2) {
|
|
3868
|
+
_context43.next = 45;
|
|
3819
3869
|
break;
|
|
3820
3870
|
}
|
|
3821
3871
|
|
|
3822
|
-
|
|
3872
|
+
_context43.next = 44;
|
|
3823
3873
|
return _regeneratorRuntime.awrap(this.LatestVersionHash({
|
|
3824
3874
|
objectId: objectId
|
|
3825
3875
|
}));
|
|
3826
3876
|
|
|
3827
3877
|
case 44:
|
|
3828
|
-
|
|
3878
|
+
_context43.t2 = _context43.sent;
|
|
3829
3879
|
|
|
3830
3880
|
case 45:
|
|
3831
|
-
return
|
|
3881
|
+
return _context43.abrupt("return", _context43.t2);
|
|
3832
3882
|
|
|
3833
3883
|
case 46:
|
|
3834
|
-
|
|
3884
|
+
_context43.next = 48;
|
|
3835
3885
|
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
3836
3886
|
libraryId: libraryId,
|
|
3837
3887
|
objectId: objectId,
|
|
@@ -3843,14 +3893,14 @@ exports.LinkTarget = function _callee42(_ref35) {
|
|
|
3843
3893
|
}));
|
|
3844
3894
|
|
|
3845
3895
|
case 48:
|
|
3846
|
-
linkInfo =
|
|
3896
|
+
linkInfo = _context43.sent;
|
|
3847
3897
|
|
|
3848
3898
|
case 49:
|
|
3849
|
-
return
|
|
3899
|
+
return _context43.abrupt("return", linkInfo["."].source);
|
|
3850
3900
|
|
|
3851
3901
|
case 50:
|
|
3852
3902
|
case "end":
|
|
3853
|
-
return
|
|
3903
|
+
return _context43.stop();
|
|
3854
3904
|
}
|
|
3855
3905
|
}
|
|
3856
3906
|
}, null, this);
|
|
@@ -3875,14 +3925,14 @@ exports.LinkTarget = function _callee42(_ref35) {
|
|
|
3875
3925
|
*/
|
|
3876
3926
|
|
|
3877
3927
|
|
|
3878
|
-
exports.LinkUrl = function
|
|
3879
|
-
var libraryId, objectId, versionHash, writeToken, linkPath, mimeType, authorizationToken,
|
|
3928
|
+
exports.LinkUrl = function _callee44(_ref37) {
|
|
3929
|
+
var libraryId, objectId, versionHash, writeToken, linkPath, mimeType, authorizationToken, _ref37$queryParams, queryParams, _ref37$channelAuth, channelAuth, _ref37$noAuth, noAuth, path, authorization;
|
|
3880
3930
|
|
|
3881
|
-
return _regeneratorRuntime.async(function
|
|
3931
|
+
return _regeneratorRuntime.async(function _callee44$(_context44) {
|
|
3882
3932
|
while (1) {
|
|
3883
|
-
switch (
|
|
3933
|
+
switch (_context44.prev = _context44.next) {
|
|
3884
3934
|
case 0:
|
|
3885
|
-
libraryId =
|
|
3935
|
+
libraryId = _ref37.libraryId, objectId = _ref37.objectId, versionHash = _ref37.versionHash, writeToken = _ref37.writeToken, linkPath = _ref37.linkPath, mimeType = _ref37.mimeType, authorizationToken = _ref37.authorizationToken, _ref37$queryParams = _ref37.queryParams, queryParams = _ref37$queryParams === void 0 ? {} : _ref37$queryParams, _ref37$channelAuth = _ref37.channelAuth, channelAuth = _ref37$channelAuth === void 0 ? false : _ref37$channelAuth, _ref37$noAuth = _ref37.noAuth, noAuth = _ref37$noAuth === void 0 ? false : _ref37$noAuth;
|
|
3886
3936
|
ValidateParameters({
|
|
3887
3937
|
libraryId: libraryId,
|
|
3888
3938
|
objectId: objectId,
|
|
@@ -3894,7 +3944,7 @@ exports.LinkUrl = function _callee43(_ref36) {
|
|
|
3894
3944
|
}
|
|
3895
3945
|
|
|
3896
3946
|
if (linkPath) {
|
|
3897
|
-
|
|
3947
|
+
_context44.next = 5;
|
|
3898
3948
|
break;
|
|
3899
3949
|
}
|
|
3900
3950
|
|
|
@@ -3914,12 +3964,12 @@ exports.LinkUrl = function _callee43(_ref36) {
|
|
|
3914
3964
|
authorization = [authorizationToken];
|
|
3915
3965
|
|
|
3916
3966
|
if (noAuth) {
|
|
3917
|
-
|
|
3967
|
+
_context44.next = 14;
|
|
3918
3968
|
break;
|
|
3919
3969
|
}
|
|
3920
3970
|
|
|
3921
|
-
|
|
3922
|
-
|
|
3971
|
+
_context44.t0 = authorization;
|
|
3972
|
+
_context44.next = 12;
|
|
3923
3973
|
return _regeneratorRuntime.awrap(this.MetadataAuth({
|
|
3924
3974
|
libraryId: libraryId,
|
|
3925
3975
|
objectId: objectId,
|
|
@@ -3929,9 +3979,9 @@ exports.LinkUrl = function _callee43(_ref36) {
|
|
|
3929
3979
|
}));
|
|
3930
3980
|
|
|
3931
3981
|
case 12:
|
|
3932
|
-
|
|
3982
|
+
_context44.t1 = _context44.sent;
|
|
3933
3983
|
|
|
3934
|
-
|
|
3984
|
+
_context44.t0.push.call(_context44.t0, _context44.t1);
|
|
3935
3985
|
|
|
3936
3986
|
case 14:
|
|
3937
3987
|
if (queryParams.authorization) {
|
|
@@ -3949,14 +3999,14 @@ exports.LinkUrl = function _callee43(_ref36) {
|
|
|
3949
3999
|
queryParams["header-accept"] = mimeType;
|
|
3950
4000
|
}
|
|
3951
4001
|
|
|
3952
|
-
return
|
|
4002
|
+
return _context44.abrupt("return", this.HttpClient.URL({
|
|
3953
4003
|
path: path,
|
|
3954
4004
|
queryParams: queryParams
|
|
3955
4005
|
}));
|
|
3956
4006
|
|
|
3957
4007
|
case 18:
|
|
3958
4008
|
case "end":
|
|
3959
|
-
return
|
|
4009
|
+
return _context44.stop();
|
|
3960
4010
|
}
|
|
3961
4011
|
}
|
|
3962
4012
|
}, null, this);
|
|
@@ -3977,15 +4027,15 @@ exports.LinkUrl = function _callee43(_ref36) {
|
|
|
3977
4027
|
*/
|
|
3978
4028
|
|
|
3979
4029
|
|
|
3980
|
-
exports.LinkData = function
|
|
3981
|
-
var libraryId, objectId, versionHash, writeToken, linkPath,
|
|
4030
|
+
exports.LinkData = function _callee45(_ref38) {
|
|
4031
|
+
var libraryId, objectId, versionHash, writeToken, linkPath, _ref38$queryParams, queryParams, _ref38$format, format, channelAuth, linkUrl;
|
|
3982
4032
|
|
|
3983
|
-
return _regeneratorRuntime.async(function
|
|
4033
|
+
return _regeneratorRuntime.async(function _callee45$(_context45) {
|
|
3984
4034
|
while (1) {
|
|
3985
|
-
switch (
|
|
4035
|
+
switch (_context45.prev = _context45.next) {
|
|
3986
4036
|
case 0:
|
|
3987
|
-
libraryId =
|
|
3988
|
-
|
|
4037
|
+
libraryId = _ref38.libraryId, objectId = _ref38.objectId, versionHash = _ref38.versionHash, writeToken = _ref38.writeToken, linkPath = _ref38.linkPath, _ref38$queryParams = _ref38.queryParams, queryParams = _ref38$queryParams === void 0 ? {} : _ref38$queryParams, _ref38$format = _ref38.format, format = _ref38$format === void 0 ? "json" : _ref38$format, channelAuth = _ref38.channelAuth;
|
|
4038
|
+
_context45.next = 3;
|
|
3989
4039
|
return _regeneratorRuntime.awrap(this.LinkUrl({
|
|
3990
4040
|
libraryId: libraryId,
|
|
3991
4041
|
objectId: objectId,
|
|
@@ -3997,19 +4047,19 @@ exports.LinkData = function _callee44(_ref37) {
|
|
|
3997
4047
|
}));
|
|
3998
4048
|
|
|
3999
4049
|
case 3:
|
|
4000
|
-
linkUrl =
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4050
|
+
linkUrl = _context45.sent;
|
|
4051
|
+
_context45.t0 = this.utils;
|
|
4052
|
+
_context45.t1 = format;
|
|
4053
|
+
_context45.next = 8;
|
|
4004
4054
|
return _regeneratorRuntime.awrap(HttpClient.Fetch(linkUrl));
|
|
4005
4055
|
|
|
4006
4056
|
case 8:
|
|
4007
|
-
|
|
4008
|
-
return
|
|
4057
|
+
_context45.t2 = _context45.sent;
|
|
4058
|
+
return _context45.abrupt("return", _context45.t0.ResponseToFormat.call(_context45.t0, _context45.t1, _context45.t2));
|
|
4009
4059
|
|
|
4010
4060
|
case 10:
|
|
4011
4061
|
case "end":
|
|
4012
|
-
return
|
|
4062
|
+
return _context45.stop();
|
|
4013
4063
|
}
|
|
4014
4064
|
}
|
|
4015
4065
|
}, null, this);
|
|
@@ -4017,14 +4067,14 @@ exports.LinkData = function _callee44(_ref37) {
|
|
|
4017
4067
|
/* Encryption */
|
|
4018
4068
|
|
|
4019
4069
|
|
|
4020
|
-
exports.CreateEncryptionConk = function
|
|
4021
|
-
var libraryId, objectId, versionHash, writeToken,
|
|
4070
|
+
exports.CreateEncryptionConk = function _callee46(_ref39) {
|
|
4071
|
+
var libraryId, objectId, versionHash, writeToken, _ref39$createKMSConk, createKMSConk, capKey, existingUserCap, kmsAddress, kmsPublicKey, kmsCapKey, existingKMSCap;
|
|
4022
4072
|
|
|
4023
|
-
return _regeneratorRuntime.async(function
|
|
4073
|
+
return _regeneratorRuntime.async(function _callee46$(_context46) {
|
|
4024
4074
|
while (1) {
|
|
4025
|
-
switch (
|
|
4075
|
+
switch (_context46.prev = _context46.next) {
|
|
4026
4076
|
case 0:
|
|
4027
|
-
libraryId =
|
|
4077
|
+
libraryId = _ref39.libraryId, objectId = _ref39.objectId, versionHash = _ref39.versionHash, writeToken = _ref39.writeToken, _ref39$createKMSConk = _ref39.createKMSConk, createKMSConk = _ref39$createKMSConk === void 0 ? true : _ref39$createKMSConk;
|
|
4028
4078
|
ValidateParameters({
|
|
4029
4079
|
libraryId: libraryId,
|
|
4030
4080
|
objectId: objectId,
|
|
@@ -4037,21 +4087,21 @@ exports.CreateEncryptionConk = function _callee45(_ref38) {
|
|
|
4037
4087
|
}
|
|
4038
4088
|
|
|
4039
4089
|
if (libraryId) {
|
|
4040
|
-
|
|
4090
|
+
_context46.next = 8;
|
|
4041
4091
|
break;
|
|
4042
4092
|
}
|
|
4043
4093
|
|
|
4044
|
-
|
|
4094
|
+
_context46.next = 7;
|
|
4045
4095
|
return _regeneratorRuntime.awrap(this.ContentObjectLibraryId({
|
|
4046
4096
|
objectId: objectId
|
|
4047
4097
|
}));
|
|
4048
4098
|
|
|
4049
4099
|
case 7:
|
|
4050
|
-
libraryId =
|
|
4100
|
+
libraryId = _context46.sent;
|
|
4051
4101
|
|
|
4052
4102
|
case 8:
|
|
4053
4103
|
capKey = "eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address));
|
|
4054
|
-
|
|
4104
|
+
_context46.next = 11;
|
|
4055
4105
|
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
4056
4106
|
libraryId: libraryId,
|
|
4057
4107
|
objectId: objectId,
|
|
@@ -4060,75 +4110,75 @@ exports.CreateEncryptionConk = function _callee45(_ref38) {
|
|
|
4060
4110
|
}));
|
|
4061
4111
|
|
|
4062
4112
|
case 11:
|
|
4063
|
-
existingUserCap =
|
|
4113
|
+
existingUserCap = _context46.sent;
|
|
4064
4114
|
|
|
4065
4115
|
if (!existingUserCap) {
|
|
4066
|
-
|
|
4116
|
+
_context46.next = 18;
|
|
4067
4117
|
break;
|
|
4068
4118
|
}
|
|
4069
4119
|
|
|
4070
|
-
|
|
4120
|
+
_context46.next = 15;
|
|
4071
4121
|
return _regeneratorRuntime.awrap(this.Crypto.DecryptCap(existingUserCap, this.signer.signingKey.privateKey));
|
|
4072
4122
|
|
|
4073
4123
|
case 15:
|
|
4074
|
-
this.encryptionConks[objectId] =
|
|
4075
|
-
|
|
4124
|
+
this.encryptionConks[objectId] = _context46.sent;
|
|
4125
|
+
_context46.next = 34;
|
|
4076
4126
|
break;
|
|
4077
4127
|
|
|
4078
4128
|
case 18:
|
|
4079
|
-
|
|
4129
|
+
_context46.next = 20;
|
|
4080
4130
|
return _regeneratorRuntime.awrap(this.Crypto.GeneratePrimaryConk({
|
|
4081
4131
|
spaceId: this.contentSpaceId,
|
|
4082
4132
|
objectId: objectId
|
|
4083
4133
|
}));
|
|
4084
4134
|
|
|
4085
4135
|
case 20:
|
|
4086
|
-
this.encryptionConks[objectId] =
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4136
|
+
this.encryptionConks[objectId] = _context46.sent;
|
|
4137
|
+
_context46.t0 = _regeneratorRuntime;
|
|
4138
|
+
_context46.t1 = this;
|
|
4139
|
+
_context46.t2 = libraryId;
|
|
4140
|
+
_context46.t3 = objectId;
|
|
4141
|
+
_context46.t4 = writeToken;
|
|
4142
|
+
_context46.t5 = capKey;
|
|
4143
|
+
_context46.next = 29;
|
|
4094
4144
|
return _regeneratorRuntime.awrap(this.Crypto.EncryptConk(this.encryptionConks[objectId], this.signer.signingKey.publicKey));
|
|
4095
4145
|
|
|
4096
4146
|
case 29:
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
libraryId:
|
|
4100
|
-
objectId:
|
|
4101
|
-
writeToken:
|
|
4102
|
-
metadataSubtree:
|
|
4103
|
-
metadata:
|
|
4147
|
+
_context46.t6 = _context46.sent;
|
|
4148
|
+
_context46.t7 = {
|
|
4149
|
+
libraryId: _context46.t2,
|
|
4150
|
+
objectId: _context46.t3,
|
|
4151
|
+
writeToken: _context46.t4,
|
|
4152
|
+
metadataSubtree: _context46.t5,
|
|
4153
|
+
metadata: _context46.t6
|
|
4104
4154
|
};
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
return
|
|
4155
|
+
_context46.t8 = _context46.t1.ReplaceMetadata.call(_context46.t1, _context46.t7);
|
|
4156
|
+
_context46.next = 34;
|
|
4157
|
+
return _context46.t0.awrap.call(_context46.t0, _context46.t8);
|
|
4108
4158
|
|
|
4109
4159
|
case 34:
|
|
4110
4160
|
if (!createKMSConk) {
|
|
4111
|
-
|
|
4161
|
+
_context46.next = 66;
|
|
4112
4162
|
break;
|
|
4113
4163
|
}
|
|
4114
4164
|
|
|
4115
|
-
|
|
4116
|
-
|
|
4165
|
+
_context46.prev = 35;
|
|
4166
|
+
_context46.next = 38;
|
|
4117
4167
|
return _regeneratorRuntime.awrap(this.authClient.KMSAddress({
|
|
4118
4168
|
objectId: objectId
|
|
4119
4169
|
}));
|
|
4120
4170
|
|
|
4121
4171
|
case 38:
|
|
4122
|
-
kmsAddress =
|
|
4123
|
-
|
|
4172
|
+
kmsAddress = _context46.sent;
|
|
4173
|
+
_context46.next = 41;
|
|
4124
4174
|
return _regeneratorRuntime.awrap(this.authClient.KMSInfo({
|
|
4125
4175
|
objectId: objectId
|
|
4126
4176
|
}));
|
|
4127
4177
|
|
|
4128
4178
|
case 41:
|
|
4129
|
-
kmsPublicKey =
|
|
4179
|
+
kmsPublicKey = _context46.sent.publicKey;
|
|
4130
4180
|
kmsCapKey = "eluv.caps.ikms".concat(this.utils.AddressToHash(kmsAddress));
|
|
4131
|
-
|
|
4181
|
+
_context46.next = 45;
|
|
4132
4182
|
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
4133
4183
|
libraryId: libraryId,
|
|
4134
4184
|
// Cap may only exist in draft
|
|
@@ -4138,53 +4188,53 @@ exports.CreateEncryptionConk = function _callee45(_ref38) {
|
|
|
4138
4188
|
}));
|
|
4139
4189
|
|
|
4140
4190
|
case 45:
|
|
4141
|
-
existingKMSCap =
|
|
4191
|
+
existingKMSCap = _context46.sent;
|
|
4142
4192
|
|
|
4143
4193
|
if (existingKMSCap) {
|
|
4144
|
-
|
|
4194
|
+
_context46.next = 60;
|
|
4145
4195
|
break;
|
|
4146
4196
|
}
|
|
4147
4197
|
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4198
|
+
_context46.t9 = _regeneratorRuntime;
|
|
4199
|
+
_context46.t10 = this;
|
|
4200
|
+
_context46.t11 = libraryId;
|
|
4201
|
+
_context46.t12 = objectId;
|
|
4202
|
+
_context46.t13 = writeToken;
|
|
4203
|
+
_context46.t14 = kmsCapKey;
|
|
4204
|
+
_context46.next = 55;
|
|
4155
4205
|
return _regeneratorRuntime.awrap(this.Crypto.EncryptConk(this.encryptionConks[objectId], kmsPublicKey));
|
|
4156
4206
|
|
|
4157
4207
|
case 55:
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
libraryId:
|
|
4161
|
-
objectId:
|
|
4162
|
-
writeToken:
|
|
4163
|
-
metadataSubtree:
|
|
4164
|
-
metadata:
|
|
4208
|
+
_context46.t15 = _context46.sent;
|
|
4209
|
+
_context46.t16 = {
|
|
4210
|
+
libraryId: _context46.t11,
|
|
4211
|
+
objectId: _context46.t12,
|
|
4212
|
+
writeToken: _context46.t13,
|
|
4213
|
+
metadataSubtree: _context46.t14,
|
|
4214
|
+
metadata: _context46.t15
|
|
4165
4215
|
};
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
return
|
|
4216
|
+
_context46.t17 = _context46.t10.ReplaceMetadata.call(_context46.t10, _context46.t16);
|
|
4217
|
+
_context46.next = 60;
|
|
4218
|
+
return _context46.t9.awrap.call(_context46.t9, _context46.t17);
|
|
4169
4219
|
|
|
4170
4220
|
case 60:
|
|
4171
|
-
|
|
4221
|
+
_context46.next = 66;
|
|
4172
4222
|
break;
|
|
4173
4223
|
|
|
4174
4224
|
case 62:
|
|
4175
|
-
|
|
4176
|
-
|
|
4225
|
+
_context46.prev = 62;
|
|
4226
|
+
_context46.t18 = _context46["catch"](35);
|
|
4177
4227
|
// eslint-disable-next-line no-console
|
|
4178
4228
|
console.error("Failed to create encryption cap for KMS:"); // eslint-disable-next-line no-console
|
|
4179
4229
|
|
|
4180
|
-
console.error(
|
|
4230
|
+
console.error(_context46.t18);
|
|
4181
4231
|
|
|
4182
4232
|
case 66:
|
|
4183
|
-
return
|
|
4233
|
+
return _context46.abrupt("return", this.encryptionConks[objectId]);
|
|
4184
4234
|
|
|
4185
4235
|
case 67:
|
|
4186
4236
|
case "end":
|
|
4187
|
-
return
|
|
4237
|
+
return _context46.stop();
|
|
4188
4238
|
}
|
|
4189
4239
|
}
|
|
4190
4240
|
}, null, this, [[35, 62]]);
|
|
@@ -4208,14 +4258,14 @@ exports.CreateEncryptionConk = function _callee45(_ref38) {
|
|
|
4208
4258
|
*/
|
|
4209
4259
|
|
|
4210
4260
|
|
|
4211
|
-
exports.EncryptionConk = function
|
|
4212
|
-
var libraryId, objectId, versionHash, writeToken,
|
|
4261
|
+
exports.EncryptionConk = function _callee47(_ref40) {
|
|
4262
|
+
var libraryId, objectId, versionHash, writeToken, _ref40$download, download, owner, capKey, existingUserCap;
|
|
4213
4263
|
|
|
4214
|
-
return _regeneratorRuntime.async(function
|
|
4264
|
+
return _regeneratorRuntime.async(function _callee47$(_context47) {
|
|
4215
4265
|
while (1) {
|
|
4216
|
-
switch (
|
|
4266
|
+
switch (_context47.prev = _context47.next) {
|
|
4217
4267
|
case 0:
|
|
4218
|
-
libraryId =
|
|
4268
|
+
libraryId = _ref40.libraryId, objectId = _ref40.objectId, versionHash = _ref40.versionHash, writeToken = _ref40.writeToken, _ref40$download = _ref40.download, download = _ref40$download === void 0 ? false : _ref40$download;
|
|
4219
4269
|
ValidateParameters({
|
|
4220
4270
|
libraryId: libraryId,
|
|
4221
4271
|
objectId: objectId,
|
|
@@ -4230,25 +4280,25 @@ exports.EncryptionConk = function _callee46(_ref39) {
|
|
|
4230
4280
|
objectId = client.DecodeVersionHash(versionHash).objectId;
|
|
4231
4281
|
}
|
|
4232
4282
|
|
|
4233
|
-
|
|
4283
|
+
_context47.next = 6;
|
|
4234
4284
|
return _regeneratorRuntime.awrap(this.authClient.Owner({
|
|
4235
4285
|
id: objectId
|
|
4236
4286
|
}));
|
|
4237
4287
|
|
|
4238
4288
|
case 6:
|
|
4239
|
-
owner =
|
|
4289
|
+
owner = _context47.sent;
|
|
4240
4290
|
|
|
4241
4291
|
if (this.utils.EqualAddress(owner, this.signer.address)) {
|
|
4242
|
-
|
|
4292
|
+
_context47.next = 17;
|
|
4243
4293
|
break;
|
|
4244
4294
|
}
|
|
4245
4295
|
|
|
4246
4296
|
if (!download) {
|
|
4247
|
-
|
|
4297
|
+
_context47.next = 14;
|
|
4248
4298
|
break;
|
|
4249
4299
|
}
|
|
4250
4300
|
|
|
4251
|
-
|
|
4301
|
+
_context47.next = 11;
|
|
4252
4302
|
return _regeneratorRuntime.awrap(this.authClient.ReEncryptionConk({
|
|
4253
4303
|
libraryId: libraryId,
|
|
4254
4304
|
objectId: objectId,
|
|
@@ -4256,10 +4306,10 @@ exports.EncryptionConk = function _callee46(_ref39) {
|
|
|
4256
4306
|
}));
|
|
4257
4307
|
|
|
4258
4308
|
case 11:
|
|
4259
|
-
return
|
|
4309
|
+
return _context47.abrupt("return", _context47.sent);
|
|
4260
4310
|
|
|
4261
4311
|
case 14:
|
|
4262
|
-
|
|
4312
|
+
_context47.next = 16;
|
|
4263
4313
|
return _regeneratorRuntime.awrap(this.authClient.EncryptionConk({
|
|
4264
4314
|
libraryId: libraryId,
|
|
4265
4315
|
objectId: objectId,
|
|
@@ -4267,16 +4317,16 @@ exports.EncryptionConk = function _callee46(_ref39) {
|
|
|
4267
4317
|
}));
|
|
4268
4318
|
|
|
4269
4319
|
case 16:
|
|
4270
|
-
return
|
|
4320
|
+
return _context47.abrupt("return", _context47.sent);
|
|
4271
4321
|
|
|
4272
4322
|
case 17:
|
|
4273
4323
|
if (this.encryptionConks[objectId]) {
|
|
4274
|
-
|
|
4324
|
+
_context47.next = 34;
|
|
4275
4325
|
break;
|
|
4276
4326
|
}
|
|
4277
4327
|
|
|
4278
4328
|
capKey = "eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address));
|
|
4279
|
-
|
|
4329
|
+
_context47.next = 21;
|
|
4280
4330
|
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
4281
4331
|
libraryId: libraryId,
|
|
4282
4332
|
objectId: objectId,
|
|
@@ -4287,28 +4337,28 @@ exports.EncryptionConk = function _callee46(_ref39) {
|
|
|
4287
4337
|
}));
|
|
4288
4338
|
|
|
4289
4339
|
case 21:
|
|
4290
|
-
existingUserCap =
|
|
4340
|
+
existingUserCap = _context47.sent;
|
|
4291
4341
|
|
|
4292
4342
|
if (!existingUserCap) {
|
|
4293
|
-
|
|
4343
|
+
_context47.next = 28;
|
|
4294
4344
|
break;
|
|
4295
4345
|
}
|
|
4296
4346
|
|
|
4297
|
-
|
|
4347
|
+
_context47.next = 25;
|
|
4298
4348
|
return _regeneratorRuntime.awrap(this.Crypto.DecryptCap(existingUserCap, this.signer.signingKey.privateKey));
|
|
4299
4349
|
|
|
4300
4350
|
case 25:
|
|
4301
|
-
this.encryptionConks[objectId] =
|
|
4302
|
-
|
|
4351
|
+
this.encryptionConks[objectId] = _context47.sent;
|
|
4352
|
+
_context47.next = 34;
|
|
4303
4353
|
break;
|
|
4304
4354
|
|
|
4305
4355
|
case 28:
|
|
4306
4356
|
if (!writeToken) {
|
|
4307
|
-
|
|
4357
|
+
_context47.next = 33;
|
|
4308
4358
|
break;
|
|
4309
4359
|
}
|
|
4310
4360
|
|
|
4311
|
-
|
|
4361
|
+
_context47.next = 31;
|
|
4312
4362
|
return _regeneratorRuntime.awrap(this.CreateEncryptionConk({
|
|
4313
4363
|
libraryId: libraryId,
|
|
4314
4364
|
objectId: objectId,
|
|
@@ -4318,18 +4368,18 @@ exports.EncryptionConk = function _callee46(_ref39) {
|
|
|
4318
4368
|
}));
|
|
4319
4369
|
|
|
4320
4370
|
case 31:
|
|
4321
|
-
|
|
4371
|
+
_context47.next = 34;
|
|
4322
4372
|
break;
|
|
4323
4373
|
|
|
4324
4374
|
case 33:
|
|
4325
4375
|
throw "No encryption conk present for " + objectId;
|
|
4326
4376
|
|
|
4327
4377
|
case 34:
|
|
4328
|
-
return
|
|
4378
|
+
return _context47.abrupt("return", this.encryptionConks[objectId]);
|
|
4329
4379
|
|
|
4330
4380
|
case 35:
|
|
4331
4381
|
case "end":
|
|
4332
|
-
return
|
|
4382
|
+
return _context47.stop();
|
|
4333
4383
|
}
|
|
4334
4384
|
}
|
|
4335
4385
|
}, null, this);
|
|
@@ -4349,18 +4399,18 @@ exports.EncryptionConk = function _callee46(_ref39) {
|
|
|
4349
4399
|
*/
|
|
4350
4400
|
|
|
4351
4401
|
|
|
4352
|
-
exports.Encrypt = function
|
|
4402
|
+
exports.Encrypt = function _callee48(_ref41) {
|
|
4353
4403
|
var libraryId, objectId, writeToken, chunk, conk, data;
|
|
4354
|
-
return _regeneratorRuntime.async(function
|
|
4404
|
+
return _regeneratorRuntime.async(function _callee48$(_context48) {
|
|
4355
4405
|
while (1) {
|
|
4356
|
-
switch (
|
|
4406
|
+
switch (_context48.prev = _context48.next) {
|
|
4357
4407
|
case 0:
|
|
4358
|
-
libraryId =
|
|
4408
|
+
libraryId = _ref41.libraryId, objectId = _ref41.objectId, writeToken = _ref41.writeToken, chunk = _ref41.chunk;
|
|
4359
4409
|
ValidateParameters({
|
|
4360
4410
|
libraryId: libraryId,
|
|
4361
4411
|
objectId: objectId
|
|
4362
4412
|
});
|
|
4363
|
-
|
|
4413
|
+
_context48.next = 4;
|
|
4364
4414
|
return _regeneratorRuntime.awrap(this.EncryptionConk({
|
|
4365
4415
|
libraryId: libraryId,
|
|
4366
4416
|
objectId: objectId,
|
|
@@ -4368,17 +4418,17 @@ exports.Encrypt = function _callee47(_ref40) {
|
|
|
4368
4418
|
}));
|
|
4369
4419
|
|
|
4370
4420
|
case 4:
|
|
4371
|
-
conk =
|
|
4372
|
-
|
|
4421
|
+
conk = _context48.sent;
|
|
4422
|
+
_context48.next = 7;
|
|
4373
4423
|
return _regeneratorRuntime.awrap(this.Crypto.Encrypt(conk, chunk));
|
|
4374
4424
|
|
|
4375
4425
|
case 7:
|
|
4376
|
-
data =
|
|
4377
|
-
return
|
|
4426
|
+
data = _context48.sent;
|
|
4427
|
+
return _context48.abrupt("return", data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength));
|
|
4378
4428
|
|
|
4379
4429
|
case 9:
|
|
4380
4430
|
case "end":
|
|
4381
|
-
return
|
|
4431
|
+
return _context48.stop();
|
|
4382
4432
|
}
|
|
4383
4433
|
}
|
|
4384
4434
|
}, null, this);
|
|
@@ -4398,18 +4448,18 @@ exports.Encrypt = function _callee47(_ref40) {
|
|
|
4398
4448
|
*/
|
|
4399
4449
|
|
|
4400
4450
|
|
|
4401
|
-
exports.Decrypt = function
|
|
4451
|
+
exports.Decrypt = function _callee49(_ref42) {
|
|
4402
4452
|
var libraryId, objectId, writeToken, chunk, conk, data;
|
|
4403
|
-
return _regeneratorRuntime.async(function
|
|
4453
|
+
return _regeneratorRuntime.async(function _callee49$(_context49) {
|
|
4404
4454
|
while (1) {
|
|
4405
|
-
switch (
|
|
4455
|
+
switch (_context49.prev = _context49.next) {
|
|
4406
4456
|
case 0:
|
|
4407
|
-
libraryId =
|
|
4457
|
+
libraryId = _ref42.libraryId, objectId = _ref42.objectId, writeToken = _ref42.writeToken, chunk = _ref42.chunk;
|
|
4408
4458
|
ValidateParameters({
|
|
4409
4459
|
libraryId: libraryId,
|
|
4410
4460
|
objectId: objectId
|
|
4411
4461
|
});
|
|
4412
|
-
|
|
4462
|
+
_context49.next = 4;
|
|
4413
4463
|
return _regeneratorRuntime.awrap(this.EncryptionConk({
|
|
4414
4464
|
libraryId: libraryId,
|
|
4415
4465
|
objectId: objectId,
|
|
@@ -4418,17 +4468,17 @@ exports.Decrypt = function _callee48(_ref41) {
|
|
|
4418
4468
|
}));
|
|
4419
4469
|
|
|
4420
4470
|
case 4:
|
|
4421
|
-
conk =
|
|
4422
|
-
|
|
4471
|
+
conk = _context49.sent;
|
|
4472
|
+
_context49.next = 7;
|
|
4423
4473
|
return _regeneratorRuntime.awrap(this.Crypto.Decrypt(conk, chunk));
|
|
4424
4474
|
|
|
4425
4475
|
case 7:
|
|
4426
|
-
data =
|
|
4427
|
-
return
|
|
4476
|
+
data = _context49.sent;
|
|
4477
|
+
return _context49.abrupt("return", data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength));
|
|
4428
4478
|
|
|
4429
4479
|
case 9:
|
|
4430
4480
|
case "end":
|
|
4431
|
-
return
|
|
4481
|
+
return _context49.stop();
|
|
4432
4482
|
}
|
|
4433
4483
|
}
|
|
4434
4484
|
}, null, this);
|
|
@@ -4446,22 +4496,22 @@ exports.Decrypt = function _callee48(_ref41) {
|
|
|
4446
4496
|
*/
|
|
4447
4497
|
|
|
4448
4498
|
|
|
4449
|
-
exports.AccessType = function
|
|
4499
|
+
exports.AccessType = function _callee50(_ref43) {
|
|
4450
4500
|
var id;
|
|
4451
|
-
return _regeneratorRuntime.async(function
|
|
4501
|
+
return _regeneratorRuntime.async(function _callee50$(_context50) {
|
|
4452
4502
|
while (1) {
|
|
4453
|
-
switch (
|
|
4503
|
+
switch (_context50.prev = _context50.next) {
|
|
4454
4504
|
case 0:
|
|
4455
|
-
id =
|
|
4456
|
-
|
|
4505
|
+
id = _ref43.id;
|
|
4506
|
+
_context50.next = 3;
|
|
4457
4507
|
return _regeneratorRuntime.awrap(this.authClient.AccessType(id));
|
|
4458
4508
|
|
|
4459
4509
|
case 3:
|
|
4460
|
-
return
|
|
4510
|
+
return _context50.abrupt("return", _context50.sent);
|
|
4461
4511
|
|
|
4462
4512
|
case 4:
|
|
4463
4513
|
case "end":
|
|
4464
|
-
return
|
|
4514
|
+
return _context50.stop();
|
|
4465
4515
|
}
|
|
4466
4516
|
}
|
|
4467
4517
|
}, null, this);
|
|
@@ -4479,13 +4529,13 @@ exports.AccessType = function _callee49(_ref42) {
|
|
|
4479
4529
|
* @return {Promise<Object>} - Info about the access charge and whether or not the object is accessible to the current user */
|
|
4480
4530
|
|
|
4481
4531
|
|
|
4482
|
-
exports.AccessInfo = function
|
|
4532
|
+
exports.AccessInfo = function _callee51(_ref44) {
|
|
4483
4533
|
var objectId, args, info;
|
|
4484
|
-
return _regeneratorRuntime.async(function
|
|
4534
|
+
return _regeneratorRuntime.async(function _callee51$(_context51) {
|
|
4485
4535
|
while (1) {
|
|
4486
|
-
switch (
|
|
4536
|
+
switch (_context51.prev = _context51.next) {
|
|
4487
4537
|
case 0:
|
|
4488
|
-
objectId =
|
|
4538
|
+
objectId = _ref44.objectId, args = _ref44.args;
|
|
4489
4539
|
ValidateObject(objectId);
|
|
4490
4540
|
|
|
4491
4541
|
if (!args) {
|
|
@@ -4496,7 +4546,7 @@ exports.AccessInfo = function _callee50(_ref43) {
|
|
|
4496
4546
|
}
|
|
4497
4547
|
|
|
4498
4548
|
this.Log("Retrieving access info: ".concat(objectId));
|
|
4499
|
-
|
|
4549
|
+
_context51.next = 6;
|
|
4500
4550
|
return _regeneratorRuntime.awrap(this.ethClient.CallContractMethod({
|
|
4501
4551
|
contractAddress: this.utils.HashToAddress(objectId),
|
|
4502
4552
|
methodName: "getAccessInfo",
|
|
@@ -4504,9 +4554,9 @@ exports.AccessInfo = function _callee50(_ref43) {
|
|
|
4504
4554
|
}));
|
|
4505
4555
|
|
|
4506
4556
|
case 6:
|
|
4507
|
-
info =
|
|
4557
|
+
info = _context51.sent;
|
|
4508
4558
|
this.Log(info);
|
|
4509
|
-
return
|
|
4559
|
+
return _context51.abrupt("return", {
|
|
4510
4560
|
visibilityCode: info[0],
|
|
4511
4561
|
visible: info[0] >= 1,
|
|
4512
4562
|
accessible: info[0] >= 10,
|
|
@@ -4518,7 +4568,7 @@ exports.AccessInfo = function _callee50(_ref43) {
|
|
|
4518
4568
|
|
|
4519
4569
|
case 9:
|
|
4520
4570
|
case "end":
|
|
4521
|
-
return
|
|
4571
|
+
return _context51.stop();
|
|
4522
4572
|
}
|
|
4523
4573
|
}
|
|
4524
4574
|
}, null, this);
|
|
@@ -4548,14 +4598,14 @@ exports.AccessInfo = function _callee50(_ref43) {
|
|
|
4548
4598
|
*/
|
|
4549
4599
|
|
|
4550
4600
|
|
|
4551
|
-
exports.AccessRequest = function
|
|
4552
|
-
var libraryId, objectId, versionHash,
|
|
4601
|
+
exports.AccessRequest = function _callee52(_ref45) {
|
|
4602
|
+
var libraryId, objectId, versionHash, _ref45$args, args, _ref45$update, update, _ref45$noCache, noCache;
|
|
4553
4603
|
|
|
4554
|
-
return _regeneratorRuntime.async(function
|
|
4604
|
+
return _regeneratorRuntime.async(function _callee52$(_context52) {
|
|
4555
4605
|
while (1) {
|
|
4556
|
-
switch (
|
|
4606
|
+
switch (_context52.prev = _context52.next) {
|
|
4557
4607
|
case 0:
|
|
4558
|
-
libraryId =
|
|
4608
|
+
libraryId = _ref45.libraryId, objectId = _ref45.objectId, versionHash = _ref45.versionHash, _ref45$args = _ref45.args, args = _ref45$args === void 0 ? [] : _ref45$args, _ref45$update = _ref45.update, update = _ref45$update === void 0 ? false : _ref45$update, _ref45$noCache = _ref45.noCache, noCache = _ref45$noCache === void 0 ? false : _ref45$noCache;
|
|
4559
4609
|
ValidateParameters({
|
|
4560
4610
|
libraryId: libraryId,
|
|
4561
4611
|
objectId: objectId,
|
|
@@ -4566,7 +4616,7 @@ exports.AccessRequest = function _callee51(_ref44) {
|
|
|
4566
4616
|
objectId = this.utils.DecodeVersionHash(versionHash).objectId;
|
|
4567
4617
|
}
|
|
4568
4618
|
|
|
4569
|
-
|
|
4619
|
+
_context52.next = 5;
|
|
4570
4620
|
return _regeneratorRuntime.awrap(this.authClient.MakeAccessRequest({
|
|
4571
4621
|
libraryId: libraryId,
|
|
4572
4622
|
objectId: objectId,
|
|
@@ -4578,11 +4628,11 @@ exports.AccessRequest = function _callee51(_ref44) {
|
|
|
4578
4628
|
}));
|
|
4579
4629
|
|
|
4580
4630
|
case 5:
|
|
4581
|
-
return
|
|
4631
|
+
return _context52.abrupt("return", _context52.sent);
|
|
4582
4632
|
|
|
4583
4633
|
case 6:
|
|
4584
4634
|
case "end":
|
|
4585
|
-
return
|
|
4635
|
+
return _context52.stop();
|
|
4586
4636
|
}
|
|
4587
4637
|
}
|
|
4588
4638
|
}, null, this);
|
|
@@ -4597,8 +4647,8 @@ exports.AccessRequest = function _callee51(_ref44) {
|
|
|
4597
4647
|
*/
|
|
4598
4648
|
|
|
4599
4649
|
|
|
4600
|
-
exports.SetAuthContext = function (
|
|
4601
|
-
var context =
|
|
4650
|
+
exports.SetAuthContext = function (_ref46) {
|
|
4651
|
+
var context = _ref46.context;
|
|
4602
4652
|
|
|
4603
4653
|
if (context && Object.values(context).find(function (value) {
|
|
4604
4654
|
return typeof value !== "string";
|
|
@@ -4624,42 +4674,42 @@ exports.SetAuthContext = function (_ref45) {
|
|
|
4624
4674
|
*/
|
|
4625
4675
|
|
|
4626
4676
|
|
|
4627
|
-
exports.GenerateStateChannelToken = function
|
|
4628
|
-
var objectId, versionHash, context,
|
|
4677
|
+
exports.GenerateStateChannelToken = function _callee53(_ref47) {
|
|
4678
|
+
var objectId, versionHash, context, _ref47$noCache, noCache;
|
|
4629
4679
|
|
|
4630
|
-
return _regeneratorRuntime.async(function
|
|
4680
|
+
return _regeneratorRuntime.async(function _callee53$(_context53) {
|
|
4631
4681
|
while (1) {
|
|
4632
|
-
switch (
|
|
4682
|
+
switch (_context53.prev = _context53.next) {
|
|
4633
4683
|
case 0:
|
|
4634
|
-
objectId =
|
|
4684
|
+
objectId = _ref47.objectId, versionHash = _ref47.versionHash, context = _ref47.context, _ref47$noCache = _ref47.noCache, noCache = _ref47$noCache === void 0 ? false : _ref47$noCache;
|
|
4635
4685
|
versionHash ? ValidateVersion(versionHash) : ValidateObject(objectId);
|
|
4636
4686
|
|
|
4637
4687
|
if (!versionHash) {
|
|
4638
|
-
|
|
4688
|
+
_context53.next = 6;
|
|
4639
4689
|
break;
|
|
4640
4690
|
}
|
|
4641
4691
|
|
|
4642
4692
|
objectId = this.utils.DecodeVersionHash(versionHash).objectId;
|
|
4643
|
-
|
|
4693
|
+
_context53.next = 10;
|
|
4644
4694
|
break;
|
|
4645
4695
|
|
|
4646
4696
|
case 6:
|
|
4647
4697
|
if (this.stateChannelAccess[objectId]) {
|
|
4648
|
-
|
|
4698
|
+
_context53.next = 10;
|
|
4649
4699
|
break;
|
|
4650
4700
|
}
|
|
4651
4701
|
|
|
4652
|
-
|
|
4702
|
+
_context53.next = 9;
|
|
4653
4703
|
return _regeneratorRuntime.awrap(this.LatestVersionHash({
|
|
4654
4704
|
objectId: objectId
|
|
4655
4705
|
}));
|
|
4656
4706
|
|
|
4657
4707
|
case 9:
|
|
4658
|
-
versionHash =
|
|
4708
|
+
versionHash = _context53.sent;
|
|
4659
4709
|
|
|
4660
4710
|
case 10:
|
|
4661
4711
|
this.stateChannelAccess[objectId] = versionHash;
|
|
4662
|
-
|
|
4712
|
+
_context53.next = 13;
|
|
4663
4713
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
|
|
4664
4714
|
objectId: objectId,
|
|
4665
4715
|
channelAuth: true,
|
|
@@ -4669,11 +4719,11 @@ exports.GenerateStateChannelToken = function _callee52(_ref46) {
|
|
|
4669
4719
|
}));
|
|
4670
4720
|
|
|
4671
4721
|
case 13:
|
|
4672
|
-
return
|
|
4722
|
+
return _context53.abrupt("return", _context53.sent);
|
|
4673
4723
|
|
|
4674
4724
|
case 14:
|
|
4675
4725
|
case "end":
|
|
4676
|
-
return
|
|
4726
|
+
return _context53.stop();
|
|
4677
4727
|
}
|
|
4678
4728
|
}
|
|
4679
4729
|
}, null, this);
|
|
@@ -4689,46 +4739,46 @@ exports.GenerateStateChannelToken = function _callee52(_ref46) {
|
|
|
4689
4739
|
*/
|
|
4690
4740
|
|
|
4691
4741
|
|
|
4692
|
-
exports.FinalizeStateChannelAccess = function
|
|
4742
|
+
exports.FinalizeStateChannelAccess = function _callee54(_ref48) {
|
|
4693
4743
|
var objectId, versionHash, percentComplete;
|
|
4694
|
-
return _regeneratorRuntime.async(function
|
|
4744
|
+
return _regeneratorRuntime.async(function _callee54$(_context54) {
|
|
4695
4745
|
while (1) {
|
|
4696
|
-
switch (
|
|
4746
|
+
switch (_context54.prev = _context54.next) {
|
|
4697
4747
|
case 0:
|
|
4698
|
-
objectId =
|
|
4748
|
+
objectId = _ref48.objectId, versionHash = _ref48.versionHash, percentComplete = _ref48.percentComplete;
|
|
4699
4749
|
versionHash ? ValidateVersion(versionHash) : ValidateObject(objectId);
|
|
4700
4750
|
|
|
4701
4751
|
if (!versionHash) {
|
|
4702
|
-
|
|
4752
|
+
_context54.next = 6;
|
|
4703
4753
|
break;
|
|
4704
4754
|
}
|
|
4705
4755
|
|
|
4706
4756
|
objectId = this.utils.DecodeVersionHash(versionHash).objectId;
|
|
4707
|
-
|
|
4757
|
+
_context54.next = 13;
|
|
4708
4758
|
break;
|
|
4709
4759
|
|
|
4710
4760
|
case 6:
|
|
4711
4761
|
if (!this.stateChannelAccess[objectId]) {
|
|
4712
|
-
|
|
4762
|
+
_context54.next = 10;
|
|
4713
4763
|
break;
|
|
4714
4764
|
}
|
|
4715
4765
|
|
|
4716
4766
|
versionHash = this.stateChannelAccess[objectId];
|
|
4717
|
-
|
|
4767
|
+
_context54.next = 13;
|
|
4718
4768
|
break;
|
|
4719
4769
|
|
|
4720
4770
|
case 10:
|
|
4721
|
-
|
|
4771
|
+
_context54.next = 12;
|
|
4722
4772
|
return _regeneratorRuntime.awrap(this.LatestVersionHash({
|
|
4723
4773
|
objectId: objectId
|
|
4724
4774
|
}));
|
|
4725
4775
|
|
|
4726
4776
|
case 12:
|
|
4727
|
-
versionHash =
|
|
4777
|
+
versionHash = _context54.sent;
|
|
4728
4778
|
|
|
4729
4779
|
case 13:
|
|
4730
4780
|
this.stateChannelAccess[objectId] = undefined;
|
|
4731
|
-
|
|
4781
|
+
_context54.next = 16;
|
|
4732
4782
|
return _regeneratorRuntime.awrap(this.authClient.ChannelContentFinalize({
|
|
4733
4783
|
objectId: objectId,
|
|
4734
4784
|
versionHash: versionHash,
|
|
@@ -4737,7 +4787,7 @@ exports.FinalizeStateChannelAccess = function _callee53(_ref47) {
|
|
|
4737
4787
|
|
|
4738
4788
|
case 16:
|
|
4739
4789
|
case "end":
|
|
4740
|
-
return
|
|
4790
|
+
return _context54.stop();
|
|
4741
4791
|
}
|
|
4742
4792
|
}
|
|
4743
4793
|
}, null, this);
|
|
@@ -4756,36 +4806,36 @@ exports.FinalizeStateChannelAccess = function _callee53(_ref47) {
|
|
|
4756
4806
|
*/
|
|
4757
4807
|
|
|
4758
4808
|
|
|
4759
|
-
exports.ContentObjectAccessComplete = function
|
|
4760
|
-
var objectId,
|
|
4809
|
+
exports.ContentObjectAccessComplete = function _callee55(_ref49) {
|
|
4810
|
+
var objectId, _ref49$score, score;
|
|
4761
4811
|
|
|
4762
|
-
return _regeneratorRuntime.async(function
|
|
4812
|
+
return _regeneratorRuntime.async(function _callee55$(_context55) {
|
|
4763
4813
|
while (1) {
|
|
4764
|
-
switch (
|
|
4814
|
+
switch (_context55.prev = _context55.next) {
|
|
4765
4815
|
case 0:
|
|
4766
|
-
objectId =
|
|
4816
|
+
objectId = _ref49.objectId, _ref49$score = _ref49.score, score = _ref49$score === void 0 ? 100 : _ref49$score;
|
|
4767
4817
|
ValidateObject(objectId);
|
|
4768
4818
|
|
|
4769
4819
|
if (!(score < 0 || score > 100)) {
|
|
4770
|
-
|
|
4820
|
+
_context55.next = 4;
|
|
4771
4821
|
break;
|
|
4772
4822
|
}
|
|
4773
4823
|
|
|
4774
4824
|
throw Error("Invalid AccessComplete score: " + score);
|
|
4775
4825
|
|
|
4776
4826
|
case 4:
|
|
4777
|
-
|
|
4827
|
+
_context55.next = 6;
|
|
4778
4828
|
return _regeneratorRuntime.awrap(this.authClient.AccessComplete({
|
|
4779
4829
|
id: objectId,
|
|
4780
4830
|
score: score
|
|
4781
4831
|
}));
|
|
4782
4832
|
|
|
4783
4833
|
case 6:
|
|
4784
|
-
return
|
|
4834
|
+
return _context55.abrupt("return", _context55.sent);
|
|
4785
4835
|
|
|
4786
4836
|
case 7:
|
|
4787
4837
|
case "end":
|
|
4788
|
-
return
|
|
4838
|
+
return _context55.stop();
|
|
4789
4839
|
}
|
|
4790
4840
|
}
|
|
4791
4841
|
}, null, this);
|
|
@@ -4809,17 +4859,17 @@ exports.ContentObjectAccessComplete = function _callee54(_ref48) {
|
|
|
4809
4859
|
*/
|
|
4810
4860
|
|
|
4811
4861
|
|
|
4812
|
-
exports.Collection = function
|
|
4862
|
+
exports.Collection = function _callee56(_ref50) {
|
|
4813
4863
|
var collectionType, validCollectionTypes, walletAddress;
|
|
4814
|
-
return _regeneratorRuntime.async(function
|
|
4864
|
+
return _regeneratorRuntime.async(function _callee56$(_context56) {
|
|
4815
4865
|
while (1) {
|
|
4816
|
-
switch (
|
|
4866
|
+
switch (_context56.prev = _context56.next) {
|
|
4817
4867
|
case 0:
|
|
4818
|
-
collectionType =
|
|
4868
|
+
collectionType = _ref50.collectionType;
|
|
4819
4869
|
validCollectionTypes = ["accessGroups", "contentObjects", "contentTypes", "contracts", "libraries"];
|
|
4820
4870
|
|
|
4821
4871
|
if (validCollectionTypes.includes(collectionType)) {
|
|
4822
|
-
|
|
4872
|
+
_context56.next = 4;
|
|
4823
4873
|
break;
|
|
4824
4874
|
}
|
|
4825
4875
|
|
|
@@ -4827,26 +4877,26 @@ exports.Collection = function _callee55(_ref49) {
|
|
|
4827
4877
|
|
|
4828
4878
|
case 4:
|
|
4829
4879
|
if (!this.signer) {
|
|
4830
|
-
|
|
4880
|
+
_context56.next = 10;
|
|
4831
4881
|
break;
|
|
4832
4882
|
}
|
|
4833
4883
|
|
|
4834
|
-
|
|
4884
|
+
_context56.next = 7;
|
|
4835
4885
|
return _regeneratorRuntime.awrap(this.userProfileClient.WalletAddress());
|
|
4836
4886
|
|
|
4837
4887
|
case 7:
|
|
4838
|
-
|
|
4839
|
-
|
|
4888
|
+
_context56.t0 = _context56.sent;
|
|
4889
|
+
_context56.next = 11;
|
|
4840
4890
|
break;
|
|
4841
4891
|
|
|
4842
4892
|
case 10:
|
|
4843
|
-
|
|
4893
|
+
_context56.t0 = undefined;
|
|
4844
4894
|
|
|
4845
4895
|
case 11:
|
|
4846
|
-
walletAddress =
|
|
4896
|
+
walletAddress = _context56.t0;
|
|
4847
4897
|
|
|
4848
4898
|
if (walletAddress) {
|
|
4849
|
-
|
|
4899
|
+
_context56.next = 14;
|
|
4850
4900
|
break;
|
|
4851
4901
|
}
|
|
4852
4902
|
|
|
@@ -4854,28 +4904,28 @@ exports.Collection = function _callee55(_ref49) {
|
|
|
4854
4904
|
|
|
4855
4905
|
case 14:
|
|
4856
4906
|
this.Log("Retrieving ".concat(collectionType, " contract collection for user ").concat(this.signer.address));
|
|
4857
|
-
|
|
4907
|
+
_context56.next = 17;
|
|
4858
4908
|
return _regeneratorRuntime.awrap(this.ethClient.MakeProviderCall({
|
|
4859
4909
|
methodName: "send",
|
|
4860
4910
|
args: ["elv_getWalletCollection", [this.contentSpaceId, "iusr".concat(this.utils.AddressToHash(this.signer.address)), collectionType]]
|
|
4861
4911
|
}));
|
|
4862
4912
|
|
|
4863
4913
|
case 17:
|
|
4864
|
-
|
|
4914
|
+
_context56.t1 = _context56.sent;
|
|
4865
4915
|
|
|
4866
|
-
if (
|
|
4867
|
-
|
|
4916
|
+
if (_context56.t1) {
|
|
4917
|
+
_context56.next = 20;
|
|
4868
4918
|
break;
|
|
4869
4919
|
}
|
|
4870
4920
|
|
|
4871
|
-
|
|
4921
|
+
_context56.t1 = [];
|
|
4872
4922
|
|
|
4873
4923
|
case 20:
|
|
4874
|
-
return
|
|
4924
|
+
return _context56.abrupt("return", _context56.t1);
|
|
4875
4925
|
|
|
4876
4926
|
case 21:
|
|
4877
4927
|
case "end":
|
|
4878
|
-
return
|
|
4928
|
+
return _context56.stop();
|
|
4879
4929
|
}
|
|
4880
4930
|
}
|
|
4881
4931
|
}, null, this);
|
|
@@ -4895,19 +4945,19 @@ exports.Collection = function _callee55(_ref49) {
|
|
|
4895
4945
|
*/
|
|
4896
4946
|
|
|
4897
4947
|
|
|
4898
|
-
exports.VerifyContentObject = function
|
|
4948
|
+
exports.VerifyContentObject = function _callee57(_ref51) {
|
|
4899
4949
|
var libraryId, objectId, versionHash;
|
|
4900
|
-
return _regeneratorRuntime.async(function
|
|
4950
|
+
return _regeneratorRuntime.async(function _callee57$(_context57) {
|
|
4901
4951
|
while (1) {
|
|
4902
|
-
switch (
|
|
4952
|
+
switch (_context57.prev = _context57.next) {
|
|
4903
4953
|
case 0:
|
|
4904
|
-
libraryId =
|
|
4954
|
+
libraryId = _ref51.libraryId, objectId = _ref51.objectId, versionHash = _ref51.versionHash;
|
|
4905
4955
|
ValidateParameters({
|
|
4906
4956
|
libraryId: libraryId,
|
|
4907
4957
|
objectId: objectId,
|
|
4908
4958
|
versionHash: versionHash
|
|
4909
4959
|
});
|
|
4910
|
-
|
|
4960
|
+
_context57.next = 4;
|
|
4911
4961
|
return _regeneratorRuntime.awrap(ContentObjectVerification.VerifyContentObject({
|
|
4912
4962
|
client: this,
|
|
4913
4963
|
libraryId: libraryId,
|
|
@@ -4916,11 +4966,11 @@ exports.VerifyContentObject = function _callee56(_ref50) {
|
|
|
4916
4966
|
}));
|
|
4917
4967
|
|
|
4918
4968
|
case 4:
|
|
4919
|
-
return
|
|
4969
|
+
return _context57.abrupt("return", _context57.sent);
|
|
4920
4970
|
|
|
4921
4971
|
case 5:
|
|
4922
4972
|
case "end":
|
|
4923
|
-
return
|
|
4973
|
+
return _context57.stop();
|
|
4924
4974
|
}
|
|
4925
4975
|
}
|
|
4926
4976
|
}, null, this);
|
|
@@ -4939,13 +4989,13 @@ exports.VerifyContentObject = function _callee56(_ref50) {
|
|
|
4939
4989
|
*/
|
|
4940
4990
|
|
|
4941
4991
|
|
|
4942
|
-
exports.Proofs = function
|
|
4992
|
+
exports.Proofs = function _callee58(_ref52) {
|
|
4943
4993
|
var libraryId, objectId, versionHash, partHash, path;
|
|
4944
|
-
return _regeneratorRuntime.async(function
|
|
4994
|
+
return _regeneratorRuntime.async(function _callee58$(_context58) {
|
|
4945
4995
|
while (1) {
|
|
4946
|
-
switch (
|
|
4996
|
+
switch (_context58.prev = _context58.next) {
|
|
4947
4997
|
case 0:
|
|
4948
|
-
libraryId =
|
|
4998
|
+
libraryId = _ref52.libraryId, objectId = _ref52.objectId, versionHash = _ref52.versionHash, partHash = _ref52.partHash;
|
|
4949
4999
|
ValidateParameters({
|
|
4950
5000
|
libraryId: libraryId,
|
|
4951
5001
|
objectId: objectId,
|
|
@@ -4958,9 +5008,9 @@ exports.Proofs = function _callee57(_ref51) {
|
|
|
4958
5008
|
}
|
|
4959
5009
|
|
|
4960
5010
|
path = UrlJoin("q", versionHash || objectId, "data", partHash, "proofs");
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
5011
|
+
_context58.t0 = this.utils;
|
|
5012
|
+
_context58.t1 = this.HttpClient;
|
|
5013
|
+
_context58.next = 9;
|
|
4964
5014
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationHeader({
|
|
4965
5015
|
libraryId: libraryId,
|
|
4966
5016
|
objectId: objectId,
|
|
@@ -4968,19 +5018,19 @@ exports.Proofs = function _callee57(_ref51) {
|
|
|
4968
5018
|
}));
|
|
4969
5019
|
|
|
4970
5020
|
case 9:
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
headers:
|
|
5021
|
+
_context58.t2 = _context58.sent;
|
|
5022
|
+
_context58.t3 = path;
|
|
5023
|
+
_context58.t4 = {
|
|
5024
|
+
headers: _context58.t2,
|
|
4975
5025
|
method: "GET",
|
|
4976
|
-
path:
|
|
5026
|
+
path: _context58.t3
|
|
4977
5027
|
};
|
|
4978
|
-
|
|
4979
|
-
return
|
|
5028
|
+
_context58.t5 = _context58.t1.Request.call(_context58.t1, _context58.t4);
|
|
5029
|
+
return _context58.abrupt("return", _context58.t0.ResponseToJson.call(_context58.t0, _context58.t5));
|
|
4980
5030
|
|
|
4981
5031
|
case 14:
|
|
4982
5032
|
case "end":
|
|
4983
|
-
return
|
|
5033
|
+
return _context58.stop();
|
|
4984
5034
|
}
|
|
4985
5035
|
}
|
|
4986
5036
|
}, null, this);
|
|
@@ -4999,14 +5049,14 @@ exports.Proofs = function _callee57(_ref51) {
|
|
|
4999
5049
|
*/
|
|
5000
5050
|
|
|
5001
5051
|
|
|
5002
|
-
exports.QParts = function
|
|
5003
|
-
var libraryId, objectId, partHash,
|
|
5052
|
+
exports.QParts = function _callee59(_ref53) {
|
|
5053
|
+
var libraryId, objectId, partHash, _ref53$format, format, path;
|
|
5004
5054
|
|
|
5005
|
-
return _regeneratorRuntime.async(function
|
|
5055
|
+
return _regeneratorRuntime.async(function _callee59$(_context59) {
|
|
5006
5056
|
while (1) {
|
|
5007
|
-
switch (
|
|
5057
|
+
switch (_context59.prev = _context59.next) {
|
|
5008
5058
|
case 0:
|
|
5009
|
-
libraryId =
|
|
5059
|
+
libraryId = _ref53.libraryId, objectId = _ref53.objectId, partHash = _ref53.partHash, _ref53$format = _ref53.format, format = _ref53$format === void 0 ? "blob" : _ref53$format;
|
|
5010
5060
|
ValidateParameters({
|
|
5011
5061
|
libraryId: libraryId,
|
|
5012
5062
|
objectId: objectId,
|
|
@@ -5014,10 +5064,10 @@ exports.QParts = function _callee58(_ref52) {
|
|
|
5014
5064
|
});
|
|
5015
5065
|
ValidatePartHash(partHash);
|
|
5016
5066
|
path = UrlJoin("qparts", partHash);
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5067
|
+
_context59.t0 = this.utils;
|
|
5068
|
+
_context59.t1 = format;
|
|
5069
|
+
_context59.t2 = this.HttpClient;
|
|
5070
|
+
_context59.next = 9;
|
|
5021
5071
|
return _regeneratorRuntime.awrap(this.authClient.AuthorizationHeader({
|
|
5022
5072
|
libraryId: libraryId,
|
|
5023
5073
|
objectId: objectId,
|
|
@@ -5025,19 +5075,19 @@ exports.QParts = function _callee58(_ref52) {
|
|
|
5025
5075
|
}));
|
|
5026
5076
|
|
|
5027
5077
|
case 9:
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
headers:
|
|
5078
|
+
_context59.t3 = _context59.sent;
|
|
5079
|
+
_context59.t4 = path;
|
|
5080
|
+
_context59.t5 = {
|
|
5081
|
+
headers: _context59.t3,
|
|
5032
5082
|
method: "GET",
|
|
5033
|
-
path:
|
|
5083
|
+
path: _context59.t4
|
|
5034
5084
|
};
|
|
5035
|
-
|
|
5036
|
-
return
|
|
5085
|
+
_context59.t6 = _context59.t2.Request.call(_context59.t2, _context59.t5);
|
|
5086
|
+
return _context59.abrupt("return", _context59.t0.ResponseToFormat.call(_context59.t0, _context59.t1, _context59.t6));
|
|
5037
5087
|
|
|
5038
5088
|
case 14:
|
|
5039
5089
|
case "end":
|
|
5040
|
-
return
|
|
5090
|
+
return _context59.stop();
|
|
5041
5091
|
}
|
|
5042
5092
|
}
|
|
5043
5093
|
}, null, this);
|