@eluvio/elv-client-js 4.0.47 → 4.0.48

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.
@@ -3245,175 +3245,6 @@ exports.ContentObjectImageUrl = /*#__PURE__*/function () {
3245
3245
  };
3246
3246
  }();
3247
3247
 
3248
- /**
3249
- * Get an embed URL for the specified object
3250
- *
3251
- * @methodGroup URL Generation
3252
- * @namedParams
3253
- * @param {string} objectId - ID of the object
3254
- * @param {string} versionHash - Version hash of the object
3255
- * @param {number} duration - Time until the token expires, in milliseconds (1 day = 24 * 60 * 60 * 1000 = 86400000)
3256
- * @param {Object} options - Additional video/player options
3257
- * autoplay - If enabled, video will autoplay
3258
- * capLevelToPlayerSize - Caps video quality to player size
3259
- * clipEnd - End time for the video
3260
- * clipStart - Start time for the video
3261
- * controls - Sets the player control visibility. Values: browserDefault | autoHide | show | hide | hideWithVolume. Defaults to autoHide
3262
- * description - Sets the page description
3263
- * directLink - If enabled, sets direct link
3264
- * linkPath - Video link path
3265
- * loop - If enabled, video will loop
3266
- * muted - Mutes the player
3267
- * offerings - Offerings to play, as an array
3268
- * posterUrl - URL of the player poster image
3269
- * protocols - Video protocols, as an array
3270
- * showShare - Show social media share buttons
3271
- * showTitle - Shows the video title, which is set from the title option (if set) or the metadata
3272
- * title - Sets the page title
3273
- * viewRecordKey - Contains record key
3274
- *
3275
- * @returns {Promise<string>} - Will return an embed URL
3276
- */
3277
- exports.EmbedUrl = /*#__PURE__*/function () {
3278
- var _ref73 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(_ref72) {
3279
- var objectId, versionHash, _ref72$duration, duration, _ref72$options, options, controlsMap, embedUrl, networkInfo, networkName, permission, data, _i, _Object$keys, option, token;
3280
- return _regeneratorRuntime.wrap(function _callee41$(_context41) {
3281
- while (1) switch (_context41.prev = _context41.next) {
3282
- case 0:
3283
- objectId = _ref72.objectId, versionHash = _ref72.versionHash, _ref72$duration = _ref72.duration, duration = _ref72$duration === void 0 ? 86400000 : _ref72$duration, _ref72$options = _ref72.options, options = _ref72$options === void 0 ? {} : _ref72$options;
3284
- if (versionHash) {
3285
- ValidateVersion(versionHash);
3286
- } else if (objectId) {
3287
- ValidateObject(objectId);
3288
- }
3289
-
3290
- // Default options
3291
- options.controls = options.controls === undefined ? "autoHide" : options.controls;
3292
- controlsMap = {
3293
- autoHide: "h",
3294
- browserDefault: "d",
3295
- show: "s",
3296
- hideWithVolume: "hv"
3297
- };
3298
- embedUrl = new URL("https://embed.v3.contentfabric.io");
3299
- _context41.next = 7;
3300
- return this.NetworkInfo();
3301
- case 7:
3302
- networkInfo = _context41.sent;
3303
- networkName = networkInfo.name === "demov3" ? "demo" : networkInfo.name === "test" && networkInfo.id === 955205 ? "testv4" : networkInfo.name;
3304
- _context41.next = 11;
3305
- return this.Permission({
3306
- objectId: objectId ? objectId : this.utils.DecodeVersionHash(versionHash).objectId
3307
- });
3308
- case 11:
3309
- permission = _context41.sent;
3310
- embedUrl.searchParams.set("p", "");
3311
- embedUrl.searchParams.set("net", networkName);
3312
- if (versionHash) {
3313
- embedUrl.searchParams.set("vid", versionHash);
3314
- } else if (objectId) {
3315
- embedUrl.searchParams.set("oid", objectId);
3316
- }
3317
- data = {};
3318
- _i = 0, _Object$keys = Object.keys(options);
3319
- case 17:
3320
- if (!(_i < _Object$keys.length)) {
3321
- _context41.next = 59;
3322
- break;
3323
- }
3324
- option = _Object$keys[_i];
3325
- _context41.t0 = option;
3326
- _context41.next = _context41.t0 === "autoplay" ? 22 : _context41.t0 === "capLevelToPlayerSize" ? 24 : _context41.t0 === "clipEnd" ? 26 : _context41.t0 === "clipStart" ? 28 : _context41.t0 === "controls" ? 30 : _context41.t0 === "description" ? 32 : _context41.t0 === "directLink" ? 34 : _context41.t0 === "linkPath" ? 36 : _context41.t0 === "loop" ? 38 : _context41.t0 === "muted" ? 40 : _context41.t0 === "offerings" ? 42 : _context41.t0 === "posterUrl" ? 44 : _context41.t0 === "protocols" ? 46 : _context41.t0 === "showShare" ? 48 : _context41.t0 === "showTitle" ? 50 : _context41.t0 === "title" ? 52 : _context41.t0 === "viewRecordKey" ? 54 : 56;
3327
- break;
3328
- case 22:
3329
- embedUrl.searchParams.set("ap", "");
3330
- return _context41.abrupt("break", 56);
3331
- case 24:
3332
- embedUrl.searchParams.set("cap", "");
3333
- return _context41.abrupt("break", 56);
3334
- case 26:
3335
- embedUrl.searchParams.set("end", options.clipEnd);
3336
- return _context41.abrupt("break", 56);
3337
- case 28:
3338
- embedUrl.searchParams.set("start", options.clipStart);
3339
- return _context41.abrupt("break", 56);
3340
- case 30:
3341
- if (options.controls !== "hide") {
3342
- embedUrl.searchParams.set("ct", controlsMap[options.controls]);
3343
- }
3344
- return _context41.abrupt("break", 56);
3345
- case 32:
3346
- data["og:description"] = options.description;
3347
- return _context41.abrupt("break", 56);
3348
- case 34:
3349
- embedUrl.searchParams.set("dr", "");
3350
- return _context41.abrupt("break", 56);
3351
- case 36:
3352
- embedUrl.searchParams.set("ln", this.utils.B64(options.linkPath));
3353
- return _context41.abrupt("break", 56);
3354
- case 38:
3355
- embedUrl.searchParams.set("lp", "");
3356
- return _context41.abrupt("break", 56);
3357
- case 40:
3358
- embedUrl.searchParams.set("m", "");
3359
- return _context41.abrupt("break", 56);
3360
- case 42:
3361
- embedUrl.searchParams.set("off", options.offerings.join(","));
3362
- return _context41.abrupt("break", 56);
3363
- case 44:
3364
- embedUrl.searchParams.set("pst", options.posterUrl);
3365
- return _context41.abrupt("break", 56);
3366
- case 46:
3367
- embedUrl.searchParams.set("ptc", options.protocols.join(","));
3368
- return _context41.abrupt("break", 56);
3369
- case 48:
3370
- embedUrl.searchParams.set("sh", "");
3371
- return _context41.abrupt("break", 56);
3372
- case 50:
3373
- embedUrl.searchParams.set("st", "");
3374
- return _context41.abrupt("break", 56);
3375
- case 52:
3376
- data["og:title"] = options.title;
3377
- return _context41.abrupt("break", 56);
3378
- case 54:
3379
- embedUrl.searchParams.set("vrk", options.viewRecordKey);
3380
- return _context41.abrupt("break", 56);
3381
- case 56:
3382
- _i++;
3383
- _context41.next = 17;
3384
- break;
3385
- case 59:
3386
- if (Object.keys(data).length > 0) {
3387
- embedUrl.searchParams.set("data", this.utils.B64(JSON.stringify({
3388
- meta_tags: data
3389
- })));
3390
- }
3391
- if (!["owner", "editable", "viewable"].includes(permission)) {
3392
- _context41.next = 65;
3393
- break;
3394
- }
3395
- _context41.next = 63;
3396
- return this.CreateSignedToken({
3397
- objectId: objectId,
3398
- versionHash: versionHash,
3399
- duration: duration
3400
- });
3401
- case 63:
3402
- token = _context41.sent;
3403
- embedUrl.searchParams.set("ath", token);
3404
- case 65:
3405
- return _context41.abrupt("return", embedUrl.toString());
3406
- case 66:
3407
- case "end":
3408
- return _context41.stop();
3409
- }
3410
- }, _callee41, this);
3411
- }));
3412
- return function (_x40) {
3413
- return _ref73.apply(this, arguments);
3414
- };
3415
- }();
3416
-
3417
3248
  /* Links */
3418
3249
 
3419
3250
  /**
@@ -3430,13 +3261,13 @@ exports.EmbedUrl = /*#__PURE__*/function () {
3430
3261
  * @returns {Promise<Object>} - Description of created object
3431
3262
  */
3432
3263
  exports.ContentObjectGraph = /*#__PURE__*/function () {
3433
- var _ref75 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(_ref74) {
3264
+ var _ref73 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(_ref72) {
3434
3265
  var _this10 = this;
3435
- var libraryId, objectId, versionHash, _ref74$autoUpdate, autoUpdate, select, path, errorInfo, cycles, info;
3436
- return _regeneratorRuntime.wrap(function _callee43$(_context43) {
3437
- while (1) switch (_context43.prev = _context43.next) {
3266
+ var libraryId, objectId, versionHash, _ref72$autoUpdate, autoUpdate, select, path, errorInfo, cycles, info;
3267
+ return _regeneratorRuntime.wrap(function _callee42$(_context42) {
3268
+ while (1) switch (_context42.prev = _context42.next) {
3438
3269
  case 0:
3439
- libraryId = _ref74.libraryId, objectId = _ref74.objectId, versionHash = _ref74.versionHash, _ref74$autoUpdate = _ref74.autoUpdate, autoUpdate = _ref74$autoUpdate === void 0 ? false : _ref74$autoUpdate, select = _ref74.select;
3270
+ libraryId = _ref72.libraryId, objectId = _ref72.objectId, versionHash = _ref72.versionHash, _ref72$autoUpdate = _ref72.autoUpdate, autoUpdate = _ref72$autoUpdate === void 0 ? false : _ref72$autoUpdate, select = _ref72.select;
3440
3271
  ValidateParameters({
3441
3272
  libraryId: libraryId,
3442
3273
  objectId: objectId,
@@ -3447,133 +3278,133 @@ exports.ContentObjectGraph = /*#__PURE__*/function () {
3447
3278
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
3448
3279
  }
3449
3280
  path = UrlJoin("q", versionHash || objectId, "links");
3450
- _context43.prev = 5;
3451
- _context43.t0 = this.utils;
3452
- _context43.t1 = this.HttpClient;
3453
- _context43.next = 10;
3281
+ _context42.prev = 5;
3282
+ _context42.t0 = this.utils;
3283
+ _context42.t1 = this.HttpClient;
3284
+ _context42.next = 10;
3454
3285
  return this.authClient.AuthorizationHeader({
3455
3286
  libraryId: libraryId,
3456
3287
  objectId: objectId,
3457
3288
  versionHash: versionHash
3458
3289
  });
3459
3290
  case 10:
3460
- _context43.t2 = _context43.sent;
3461
- _context43.t3 = {
3291
+ _context42.t2 = _context42.sent;
3292
+ _context42.t3 = {
3462
3293
  auto_update: autoUpdate,
3463
3294
  select: select
3464
3295
  };
3465
- _context43.t4 = path;
3466
- _context43.t5 = {
3467
- headers: _context43.t2,
3468
- queryParams: _context43.t3,
3296
+ _context42.t4 = path;
3297
+ _context42.t5 = {
3298
+ headers: _context42.t2,
3299
+ queryParams: _context42.t3,
3469
3300
  method: "GET",
3470
- path: _context43.t4
3301
+ path: _context42.t4
3471
3302
  };
3472
- _context43.t6 = _context43.t1.Request.call(_context43.t1, _context43.t5);
3473
- _context43.next = 17;
3474
- return _context43.t0.ResponseToJson.call(_context43.t0, _context43.t6);
3303
+ _context42.t6 = _context42.t1.Request.call(_context42.t1, _context42.t5);
3304
+ _context42.next = 17;
3305
+ return _context42.t0.ResponseToJson.call(_context42.t0, _context42.t6);
3475
3306
  case 17:
3476
- return _context43.abrupt("return", _context43.sent);
3307
+ return _context42.abrupt("return", _context42.sent);
3477
3308
  case 20:
3478
- _context43.prev = 20;
3479
- _context43.t7 = _context43["catch"](5);
3480
- _context43.prev = 22;
3481
- cycles = _context43.t7.body.errors[0].cause.cause.cause.cycle;
3309
+ _context42.prev = 20;
3310
+ _context42.t7 = _context42["catch"](5);
3311
+ _context42.prev = 22;
3312
+ cycles = _context42.t7.body.errors[0].cause.cause.cause.cycle;
3482
3313
  if (!(!cycles || cycles.length === 0)) {
3483
- _context43.next = 26;
3314
+ _context42.next = 26;
3484
3315
  break;
3485
3316
  }
3486
- throw _context43.t7;
3317
+ throw _context42.t7;
3487
3318
  case 26:
3488
3319
  info = {};
3489
- _context43.next = 29;
3320
+ _context42.next = 29;
3490
3321
  return Promise.all(cycles.map( /*#__PURE__*/function () {
3491
- var _ref76 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(cycleHash) {
3322
+ var _ref74 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(cycleHash) {
3492
3323
  var cycleId, name;
3493
- return _regeneratorRuntime.wrap(function _callee42$(_context42) {
3494
- while (1) switch (_context42.prev = _context42.next) {
3324
+ return _regeneratorRuntime.wrap(function _callee41$(_context41) {
3325
+ while (1) switch (_context41.prev = _context41.next) {
3495
3326
  case 0:
3496
3327
  if (!info[cycleHash]) {
3497
- _context42.next = 2;
3328
+ _context41.next = 2;
3498
3329
  break;
3499
3330
  }
3500
- return _context42.abrupt("return");
3331
+ return _context41.abrupt("return");
3501
3332
  case 2:
3502
3333
  cycleId = _this10.utils.DecodeVersionHash(cycleHash).objectId;
3503
- _context42.next = 5;
3334
+ _context41.next = 5;
3504
3335
  return _this10.ContentObjectMetadata({
3505
3336
  versionHash: cycleHash,
3506
3337
  metadataSubtree: "public/asset_metadata/display_title"
3507
3338
  });
3508
3339
  case 5:
3509
- _context42.t2 = _context42.sent;
3510
- if (_context42.t2) {
3511
- _context42.next = 10;
3340
+ _context41.t2 = _context41.sent;
3341
+ if (_context41.t2) {
3342
+ _context41.next = 10;
3512
3343
  break;
3513
3344
  }
3514
- _context42.next = 9;
3345
+ _context41.next = 9;
3515
3346
  return _this10.ContentObjectMetadata({
3516
3347
  versionHash: cycleHash,
3517
3348
  metadataSubtree: "public/name"
3518
3349
  });
3519
3350
  case 9:
3520
- _context42.t2 = _context42.sent;
3351
+ _context41.t2 = _context41.sent;
3521
3352
  case 10:
3522
- _context42.t1 = _context42.t2;
3523
- if (_context42.t1) {
3524
- _context42.next = 15;
3353
+ _context41.t1 = _context41.t2;
3354
+ if (_context41.t1) {
3355
+ _context41.next = 15;
3525
3356
  break;
3526
3357
  }
3527
- _context42.next = 14;
3358
+ _context41.next = 14;
3528
3359
  return _this10.ContentObjectMetadata({
3529
3360
  versionHash: cycleHash,
3530
3361
  metadataSubtree: "name"
3531
3362
  });
3532
3363
  case 14:
3533
- _context42.t1 = _context42.sent;
3364
+ _context41.t1 = _context41.sent;
3534
3365
  case 15:
3535
- _context42.t0 = _context42.t1;
3536
- if (_context42.t0) {
3537
- _context42.next = 18;
3366
+ _context41.t0 = _context41.t1;
3367
+ if (_context41.t0) {
3368
+ _context41.next = 18;
3538
3369
  break;
3539
3370
  }
3540
- _context42.t0 = cycleId;
3371
+ _context41.t0 = cycleId;
3541
3372
  case 18:
3542
- name = _context42.t0;
3373
+ name = _context41.t0;
3543
3374
  info[cycleHash] = {
3544
3375
  name: name,
3545
3376
  objectId: cycleId
3546
3377
  };
3547
3378
  case 20:
3548
3379
  case "end":
3549
- return _context42.stop();
3380
+ return _context41.stop();
3550
3381
  }
3551
- }, _callee42);
3382
+ }, _callee41);
3552
3383
  }));
3553
- return function (_x42) {
3554
- return _ref76.apply(this, arguments);
3384
+ return function (_x41) {
3385
+ return _ref74.apply(this, arguments);
3555
3386
  };
3556
3387
  }()));
3557
3388
  case 29:
3558
3389
  errorInfo = cycles.map(function (cycleHash) {
3559
3390
  return "".concat(info[cycleHash].name, " (").concat(info[cycleHash].objectId, ")");
3560
3391
  });
3561
- _context43.next = 35;
3392
+ _context42.next = 35;
3562
3393
  break;
3563
3394
  case 32:
3564
- _context43.prev = 32;
3565
- _context43.t8 = _context43["catch"](22);
3566
- throw _context43.t7;
3395
+ _context42.prev = 32;
3396
+ _context42.t8 = _context42["catch"](22);
3397
+ throw _context42.t7;
3567
3398
  case 35:
3568
3399
  throw new Error("Cycle found in links: ".concat(errorInfo.join(" -> ")));
3569
3400
  case 36:
3570
3401
  case "end":
3571
- return _context43.stop();
3402
+ return _context42.stop();
3572
3403
  }
3573
- }, _callee43, this, [[5, 20], [22, 32]]);
3404
+ }, _callee42, this, [[5, 20], [22, 32]]);
3574
3405
  }));
3575
- return function (_x41) {
3576
- return _ref75.apply(this, arguments);
3406
+ return function (_x40) {
3407
+ return _ref73.apply(this, arguments);
3577
3408
  };
3578
3409
  }();
3579
3410
 
@@ -3593,12 +3424,12 @@ exports.ContentObjectGraph = /*#__PURE__*/function () {
3593
3424
  * @returns {Promise<string>} - Version hash of the link's target
3594
3425
  */
3595
3426
  exports.LinkTarget = /*#__PURE__*/function () {
3596
- var _ref78 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(_ref77) {
3427
+ var _ref76 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(_ref75) {
3597
3428
  var libraryId, objectId, versionHash, writeToken, linkPath, authorizationToken, linkInfo, targetHash, subPath;
3598
- return _regeneratorRuntime.wrap(function _callee44$(_context44) {
3599
- while (1) switch (_context44.prev = _context44.next) {
3429
+ return _regeneratorRuntime.wrap(function _callee43$(_context43) {
3430
+ while (1) switch (_context43.prev = _context43.next) {
3600
3431
  case 0:
3601
- libraryId = _ref77.libraryId, objectId = _ref77.objectId, versionHash = _ref77.versionHash, writeToken = _ref77.writeToken, linkPath = _ref77.linkPath, authorizationToken = _ref77.authorizationToken, linkInfo = _ref77.linkInfo;
3432
+ libraryId = _ref75.libraryId, objectId = _ref75.objectId, versionHash = _ref75.versionHash, writeToken = _ref75.writeToken, linkPath = _ref75.linkPath, authorizationToken = _ref75.authorizationToken, linkInfo = _ref75.linkInfo;
3602
3433
  ValidateParameters({
3603
3434
  libraryId: libraryId,
3604
3435
  objectId: objectId,
@@ -3611,21 +3442,21 @@ exports.LinkTarget = /*#__PURE__*/function () {
3611
3442
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
3612
3443
  }
3613
3444
  if (!(writeToken && !libraryId)) {
3614
- _context44.next = 8;
3445
+ _context43.next = 8;
3615
3446
  break;
3616
3447
  }
3617
- _context44.next = 7;
3448
+ _context43.next = 7;
3618
3449
  return this.ContentObjectLibraryId({
3619
3450
  objectId: objectId
3620
3451
  });
3621
3452
  case 7:
3622
- libraryId = _context44.sent;
3453
+ libraryId = _context43.sent;
3623
3454
  case 8:
3624
3455
  if (linkInfo) {
3625
- _context44.next = 12;
3456
+ _context43.next = 12;
3626
3457
  break;
3627
3458
  }
3628
- _context44.next = 11;
3459
+ _context43.next = 11;
3629
3460
  return this.ContentObjectMetadata({
3630
3461
  libraryId: libraryId,
3631
3462
  objectId: objectId,
@@ -3638,10 +3469,10 @@ exports.LinkTarget = /*#__PURE__*/function () {
3638
3469
  authorizationToken: authorizationToken
3639
3470
  });
3640
3471
  case 11:
3641
- linkInfo = _context44.sent;
3472
+ linkInfo = _context43.sent;
3642
3473
  case 12:
3643
3474
  if (!(linkInfo && linkInfo["/"])) {
3644
- _context44.next = 27;
3475
+ _context43.next = 27;
3645
3476
  break;
3646
3477
  }
3647
3478
  /* For absolute links - extract the hash from the link itself. Otherwise use "container" */
@@ -3650,32 +3481,32 @@ exports.LinkTarget = /*#__PURE__*/function () {
3650
3481
  targetHash = linkInfo["."].container;
3651
3482
  }
3652
3483
  if (!targetHash) {
3653
- _context44.next = 19;
3484
+ _context43.next = 19;
3654
3485
  break;
3655
3486
  }
3656
- return _context44.abrupt("return", targetHash);
3487
+ return _context43.abrupt("return", targetHash);
3657
3488
  case 19:
3658
3489
  if (!versionHash) {
3659
- _context44.next = 21;
3490
+ _context43.next = 21;
3660
3491
  break;
3661
3492
  }
3662
- return _context44.abrupt("return", versionHash);
3493
+ return _context43.abrupt("return", versionHash);
3663
3494
  case 21:
3664
- _context44.t0 = versionHash;
3665
- if (_context44.t0) {
3666
- _context44.next = 26;
3495
+ _context43.t0 = versionHash;
3496
+ if (_context43.t0) {
3497
+ _context43.next = 26;
3667
3498
  break;
3668
3499
  }
3669
- _context44.next = 25;
3500
+ _context43.next = 25;
3670
3501
  return this.LatestVersionHash({
3671
3502
  objectId: objectId
3672
3503
  });
3673
3504
  case 25:
3674
- _context44.t0 = _context44.sent;
3505
+ _context43.t0 = _context43.sent;
3675
3506
  case 26:
3676
- return _context44.abrupt("return", _context44.t0);
3507
+ return _context43.abrupt("return", _context43.t0);
3677
3508
  case 27:
3678
- _context44.next = 29;
3509
+ _context43.next = 29;
3679
3510
  return this.ContentObjectMetadata({
3680
3511
  libraryId: libraryId,
3681
3512
  objectId: objectId,
@@ -3686,50 +3517,50 @@ exports.LinkTarget = /*#__PURE__*/function () {
3686
3517
  authorizationToken: authorizationToken
3687
3518
  });
3688
3519
  case 29:
3689
- linkInfo = _context44.sent;
3520
+ linkInfo = _context43.sent;
3690
3521
  if (!(!linkInfo || !linkInfo["."])) {
3691
- _context44.next = 49;
3522
+ _context43.next = 49;
3692
3523
  break;
3693
3524
  }
3694
3525
  if (!(_typeof(linkInfo) === "object")) {
3695
- _context44.next = 38;
3526
+ _context43.next = 38;
3696
3527
  break;
3697
3528
  }
3698
- _context44.t1 = versionHash;
3699
- if (_context44.t1) {
3700
- _context44.next = 37;
3529
+ _context43.t1 = versionHash;
3530
+ if (_context43.t1) {
3531
+ _context43.next = 37;
3701
3532
  break;
3702
3533
  }
3703
- _context44.next = 36;
3534
+ _context43.next = 36;
3704
3535
  return this.LatestVersionHash({
3705
3536
  objectId: objectId
3706
3537
  });
3707
3538
  case 36:
3708
- _context44.t1 = _context44.sent;
3539
+ _context43.t1 = _context43.sent;
3709
3540
  case 37:
3710
- return _context44.abrupt("return", _context44.t1);
3541
+ return _context43.abrupt("return", _context43.t1);
3711
3542
  case 38:
3712
3543
  // linkPath is not a direct link, but points to a literal value - back up one path element to find the container
3713
3544
  subPath = linkPath.split("/").slice(0, -1).join("/");
3714
3545
  if (subPath) {
3715
- _context44.next = 46;
3546
+ _context43.next = 46;
3716
3547
  break;
3717
3548
  }
3718
- _context44.t2 = versionHash;
3719
- if (_context44.t2) {
3720
- _context44.next = 45;
3549
+ _context43.t2 = versionHash;
3550
+ if (_context43.t2) {
3551
+ _context43.next = 45;
3721
3552
  break;
3722
3553
  }
3723
- _context44.next = 44;
3554
+ _context43.next = 44;
3724
3555
  return this.LatestVersionHash({
3725
3556
  objectId: objectId
3726
3557
  });
3727
3558
  case 44:
3728
- _context44.t2 = _context44.sent;
3559
+ _context43.t2 = _context43.sent;
3729
3560
  case 45:
3730
- return _context44.abrupt("return", _context44.t2);
3561
+ return _context43.abrupt("return", _context43.t2);
3731
3562
  case 46:
3732
- _context44.next = 48;
3563
+ _context43.next = 48;
3733
3564
  return this.ContentObjectMetadata({
3734
3565
  libraryId: libraryId,
3735
3566
  objectId: objectId,
@@ -3740,17 +3571,17 @@ exports.LinkTarget = /*#__PURE__*/function () {
3740
3571
  authorizationToken: authorizationToken
3741
3572
  });
3742
3573
  case 48:
3743
- linkInfo = _context44.sent;
3574
+ linkInfo = _context43.sent;
3744
3575
  case 49:
3745
- return _context44.abrupt("return", linkInfo["."].source);
3576
+ return _context43.abrupt("return", linkInfo["."].source);
3746
3577
  case 50:
3747
3578
  case "end":
3748
- return _context44.stop();
3579
+ return _context43.stop();
3749
3580
  }
3750
- }, _callee44, this);
3581
+ }, _callee43, this);
3751
3582
  }));
3752
- return function (_x43) {
3753
- return _ref78.apply(this, arguments);
3583
+ return function (_x42) {
3584
+ return _ref76.apply(this, arguments);
3754
3585
  };
3755
3586
  }();
3756
3587
 
@@ -3773,12 +3604,12 @@ exports.LinkTarget = /*#__PURE__*/function () {
3773
3604
  * @returns {Promise<string>} - URL to the specified file with authorization token
3774
3605
  */
3775
3606
  exports.LinkUrl = /*#__PURE__*/function () {
3776
- var _ref80 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(_ref79) {
3777
- var libraryId, objectId, versionHash, writeToken, linkPath, mimeType, authorizationToken, _ref79$queryParams, queryParams, _ref79$channelAuth, channelAuth, _ref79$noAuth, noAuth, path, authorization;
3778
- return _regeneratorRuntime.wrap(function _callee45$(_context45) {
3779
- while (1) switch (_context45.prev = _context45.next) {
3607
+ var _ref78 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(_ref77) {
3608
+ var libraryId, objectId, versionHash, writeToken, linkPath, mimeType, authorizationToken, _ref77$queryParams, queryParams, _ref77$channelAuth, channelAuth, _ref77$noAuth, noAuth, path, authorization;
3609
+ return _regeneratorRuntime.wrap(function _callee44$(_context44) {
3610
+ while (1) switch (_context44.prev = _context44.next) {
3780
3611
  case 0:
3781
- libraryId = _ref79.libraryId, objectId = _ref79.objectId, versionHash = _ref79.versionHash, writeToken = _ref79.writeToken, linkPath = _ref79.linkPath, mimeType = _ref79.mimeType, authorizationToken = _ref79.authorizationToken, _ref79$queryParams = _ref79.queryParams, queryParams = _ref79$queryParams === void 0 ? {} : _ref79$queryParams, _ref79$channelAuth = _ref79.channelAuth, channelAuth = _ref79$channelAuth === void 0 ? false : _ref79$channelAuth, _ref79$noAuth = _ref79.noAuth, noAuth = _ref79$noAuth === void 0 ? false : _ref79$noAuth;
3612
+ libraryId = _ref77.libraryId, objectId = _ref77.objectId, versionHash = _ref77.versionHash, writeToken = _ref77.writeToken, linkPath = _ref77.linkPath, mimeType = _ref77.mimeType, authorizationToken = _ref77.authorizationToken, _ref77$queryParams = _ref77.queryParams, queryParams = _ref77$queryParams === void 0 ? {} : _ref77$queryParams, _ref77$channelAuth = _ref77.channelAuth, channelAuth = _ref77$channelAuth === void 0 ? false : _ref77$channelAuth, _ref77$noAuth = _ref77.noAuth, noAuth = _ref77$noAuth === void 0 ? false : _ref77$noAuth;
3782
3613
  ValidateParameters({
3783
3614
  libraryId: libraryId,
3784
3615
  objectId: objectId,
@@ -3788,7 +3619,7 @@ exports.LinkUrl = /*#__PURE__*/function () {
3788
3619
  ValidateWriteToken(writeToken);
3789
3620
  }
3790
3621
  if (linkPath) {
3791
- _context45.next = 5;
3622
+ _context44.next = 5;
3792
3623
  break;
3793
3624
  }
3794
3625
  throw Error("Link path not specified");
@@ -3802,8 +3633,8 @@ exports.LinkUrl = /*#__PURE__*/function () {
3802
3633
  path = UrlJoin("q", versionHash, "meta", linkPath);
3803
3634
  }
3804
3635
  authorization = [authorizationToken];
3805
- _context45.t0 = authorization;
3806
- _context45.next = 11;
3636
+ _context44.t0 = authorization;
3637
+ _context44.next = 11;
3807
3638
  return this.MetadataAuth({
3808
3639
  libraryId: libraryId,
3809
3640
  objectId: objectId,
@@ -3813,8 +3644,8 @@ exports.LinkUrl = /*#__PURE__*/function () {
3813
3644
  noAuth: noAuth
3814
3645
  });
3815
3646
  case 11:
3816
- _context45.t1 = _context45.sent;
3817
- _context45.t0.push.call(_context45.t0, _context45.t1);
3647
+ _context44.t1 = _context44.sent;
3648
+ _context44.t0.push.call(_context44.t0, _context44.t1);
3818
3649
  if (queryParams.authorization) {
3819
3650
  authorization.push(queryParams.authorization);
3820
3651
  }
@@ -3827,18 +3658,18 @@ exports.LinkUrl = /*#__PURE__*/function () {
3827
3658
  if (mimeType) {
3828
3659
  queryParams["header-accept"] = mimeType;
3829
3660
  }
3830
- return _context45.abrupt("return", this.HttpClient.URL({
3661
+ return _context44.abrupt("return", this.HttpClient.URL({
3831
3662
  path: path,
3832
3663
  queryParams: queryParams
3833
3664
  }));
3834
3665
  case 17:
3835
3666
  case "end":
3836
- return _context45.stop();
3667
+ return _context44.stop();
3837
3668
  }
3838
- }, _callee45, this);
3669
+ }, _callee44, this);
3839
3670
  }));
3840
- return function (_x44) {
3841
- return _ref80.apply(this, arguments);
3671
+ return function (_x43) {
3672
+ return _ref78.apply(this, arguments);
3842
3673
  };
3843
3674
  }();
3844
3675
 
@@ -3857,13 +3688,13 @@ exports.LinkUrl = /*#__PURE__*/function () {
3857
3688
  * @param {boolean=} channelAuth=false - If specified, state channel authorization will be performed instead of access request authorization
3858
3689
  */
3859
3690
  exports.LinkData = /*#__PURE__*/function () {
3860
- var _ref82 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(_ref81) {
3861
- var libraryId, objectId, versionHash, writeToken, linkPath, _ref81$queryParams, queryParams, _ref81$format, format, channelAuth, linkUrl;
3862
- return _regeneratorRuntime.wrap(function _callee46$(_context46) {
3863
- while (1) switch (_context46.prev = _context46.next) {
3691
+ var _ref80 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(_ref79) {
3692
+ var libraryId, objectId, versionHash, writeToken, linkPath, _ref79$queryParams, queryParams, _ref79$format, format, channelAuth, linkUrl;
3693
+ return _regeneratorRuntime.wrap(function _callee45$(_context45) {
3694
+ while (1) switch (_context45.prev = _context45.next) {
3864
3695
  case 0:
3865
- libraryId = _ref81.libraryId, objectId = _ref81.objectId, versionHash = _ref81.versionHash, writeToken = _ref81.writeToken, linkPath = _ref81.linkPath, _ref81$queryParams = _ref81.queryParams, queryParams = _ref81$queryParams === void 0 ? {} : _ref81$queryParams, _ref81$format = _ref81.format, format = _ref81$format === void 0 ? "json" : _ref81$format, channelAuth = _ref81.channelAuth;
3866
- _context46.next = 3;
3696
+ libraryId = _ref79.libraryId, objectId = _ref79.objectId, versionHash = _ref79.versionHash, writeToken = _ref79.writeToken, linkPath = _ref79.linkPath, _ref79$queryParams = _ref79.queryParams, queryParams = _ref79$queryParams === void 0 ? {} : _ref79$queryParams, _ref79$format = _ref79.format, format = _ref79$format === void 0 ? "json" : _ref79$format, channelAuth = _ref79.channelAuth;
3697
+ _context45.next = 3;
3867
3698
  return this.LinkUrl({
3868
3699
  libraryId: libraryId,
3869
3700
  objectId: objectId,
@@ -3874,39 +3705,39 @@ exports.LinkData = /*#__PURE__*/function () {
3874
3705
  channelAuth: channelAuth
3875
3706
  });
3876
3707
  case 3:
3877
- linkUrl = _context46.sent;
3878
- _context46.t0 = this.utils;
3879
- _context46.t1 = format;
3880
- _context46.next = 8;
3708
+ linkUrl = _context45.sent;
3709
+ _context45.t0 = this.utils;
3710
+ _context45.t1 = format;
3711
+ _context45.next = 8;
3881
3712
  return HttpClient.Fetch(linkUrl);
3882
3713
  case 8:
3883
- _context46.t2 = _context46.sent;
3884
- return _context46.abrupt("return", _context46.t0.ResponseToFormat.call(_context46.t0, _context46.t1, _context46.t2));
3714
+ _context45.t2 = _context45.sent;
3715
+ return _context45.abrupt("return", _context45.t0.ResponseToFormat.call(_context45.t0, _context45.t1, _context45.t2));
3885
3716
  case 10:
3886
3717
  case "end":
3887
- return _context46.stop();
3718
+ return _context45.stop();
3888
3719
  }
3889
- }, _callee46, this);
3720
+ }, _callee45, this);
3890
3721
  }));
3891
- return function (_x45) {
3892
- return _ref82.apply(this, arguments);
3722
+ return function (_x44) {
3723
+ return _ref80.apply(this, arguments);
3893
3724
  };
3894
3725
  }();
3895
3726
 
3896
3727
  /* Encryption */
3897
3728
 
3898
3729
  exports.CreateEncryptionConk = /*#__PURE__*/function () {
3899
- var _ref84 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(_ref83) {
3900
- var libraryId, objectId, versionHash, writeToken, _ref83$createKMSConk, createKMSConk, capKey, existingUserCap, kmsAddress, kmsPublicKey, kmsCapKey, existingKMSCap;
3901
- return _regeneratorRuntime.wrap(function _callee47$(_context47) {
3902
- while (1) switch (_context47.prev = _context47.next) {
3730
+ var _ref82 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(_ref81) {
3731
+ var libraryId, objectId, versionHash, writeToken, _ref81$createKMSConk, createKMSConk, capKey, existingUserCap, kmsAddress, kmsPublicKey, kmsCapKey, existingKMSCap;
3732
+ return _regeneratorRuntime.wrap(function _callee46$(_context46) {
3733
+ while (1) switch (_context46.prev = _context46.next) {
3903
3734
  case 0:
3904
- libraryId = _ref83.libraryId, objectId = _ref83.objectId, versionHash = _ref83.versionHash, writeToken = _ref83.writeToken, _ref83$createKMSConk = _ref83.createKMSConk, createKMSConk = _ref83$createKMSConk === void 0 ? true : _ref83$createKMSConk;
3735
+ libraryId = _ref81.libraryId, objectId = _ref81.objectId, versionHash = _ref81.versionHash, writeToken = _ref81.writeToken, _ref81$createKMSConk = _ref81.createKMSConk, createKMSConk = _ref81$createKMSConk === void 0 ? true : _ref81$createKMSConk;
3905
3736
  if (!this.signer.remoteSigner) {
3906
- _context47.next = 3;
3737
+ _context46.next = 3;
3907
3738
  break;
3908
3739
  }
3909
- return _context47.abrupt("return");
3740
+ return _context46.abrupt("return");
3910
3741
  case 3:
3911
3742
  ValidateParameters({
3912
3743
  libraryId: libraryId,
@@ -3918,18 +3749,18 @@ exports.CreateEncryptionConk = /*#__PURE__*/function () {
3918
3749
  objectId = client.DecodeVersionHash(versionHash).objectId;
3919
3750
  }
3920
3751
  if (libraryId) {
3921
- _context47.next = 10;
3752
+ _context46.next = 10;
3922
3753
  break;
3923
3754
  }
3924
- _context47.next = 9;
3755
+ _context46.next = 9;
3925
3756
  return this.ContentObjectLibraryId({
3926
3757
  objectId: objectId
3927
3758
  });
3928
3759
  case 9:
3929
- libraryId = _context47.sent;
3760
+ libraryId = _context46.sent;
3930
3761
  case 10:
3931
3762
  capKey = "eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address));
3932
- _context47.next = 13;
3763
+ _context46.next = 13;
3933
3764
  return this.ContentObjectMetadata({
3934
3765
  libraryId: libraryId,
3935
3766
  objectId: objectId,
@@ -3937,63 +3768,63 @@ exports.CreateEncryptionConk = /*#__PURE__*/function () {
3937
3768
  metadataSubtree: capKey
3938
3769
  });
3939
3770
  case 13:
3940
- existingUserCap = _context47.sent;
3771
+ existingUserCap = _context46.sent;
3941
3772
  if (!existingUserCap) {
3942
- _context47.next = 20;
3773
+ _context46.next = 20;
3943
3774
  break;
3944
3775
  }
3945
- _context47.next = 17;
3776
+ _context46.next = 17;
3946
3777
  return this.Crypto.DecryptCap(existingUserCap, this.signer._signingKey().privateKey);
3947
3778
  case 17:
3948
- this.encryptionConks[objectId] = _context47.sent;
3949
- _context47.next = 34;
3779
+ this.encryptionConks[objectId] = _context46.sent;
3780
+ _context46.next = 34;
3950
3781
  break;
3951
3782
  case 20:
3952
- _context47.next = 22;
3783
+ _context46.next = 22;
3953
3784
  return this.Crypto.GeneratePrimaryConk({
3954
3785
  spaceId: this.contentSpaceId,
3955
3786
  objectId: objectId
3956
3787
  });
3957
3788
  case 22:
3958
- this.encryptionConks[objectId] = _context47.sent;
3959
- _context47.t0 = this;
3960
- _context47.t1 = libraryId;
3961
- _context47.t2 = objectId;
3962
- _context47.t3 = writeToken;
3963
- _context47.t4 = capKey;
3964
- _context47.next = 30;
3789
+ this.encryptionConks[objectId] = _context46.sent;
3790
+ _context46.t0 = this;
3791
+ _context46.t1 = libraryId;
3792
+ _context46.t2 = objectId;
3793
+ _context46.t3 = writeToken;
3794
+ _context46.t4 = capKey;
3795
+ _context46.next = 30;
3965
3796
  return this.Crypto.EncryptConk(this.encryptionConks[objectId], this.signer._signingKey().publicKey);
3966
3797
  case 30:
3967
- _context47.t5 = _context47.sent;
3968
- _context47.t6 = {
3969
- libraryId: _context47.t1,
3970
- objectId: _context47.t2,
3971
- writeToken: _context47.t3,
3972
- metadataSubtree: _context47.t4,
3973
- metadata: _context47.t5
3798
+ _context46.t5 = _context46.sent;
3799
+ _context46.t6 = {
3800
+ libraryId: _context46.t1,
3801
+ objectId: _context46.t2,
3802
+ writeToken: _context46.t3,
3803
+ metadataSubtree: _context46.t4,
3804
+ metadata: _context46.t5
3974
3805
  };
3975
- _context47.next = 34;
3976
- return _context47.t0.ReplaceMetadata.call(_context47.t0, _context47.t6);
3806
+ _context46.next = 34;
3807
+ return _context46.t0.ReplaceMetadata.call(_context46.t0, _context46.t6);
3977
3808
  case 34:
3978
3809
  if (!createKMSConk) {
3979
- _context47.next = 64;
3810
+ _context46.next = 64;
3980
3811
  break;
3981
3812
  }
3982
- _context47.prev = 35;
3983
- _context47.next = 38;
3813
+ _context46.prev = 35;
3814
+ _context46.next = 38;
3984
3815
  return this.authClient.KMSAddress({
3985
3816
  objectId: objectId
3986
3817
  });
3987
3818
  case 38:
3988
- kmsAddress = _context47.sent;
3989
- _context47.next = 41;
3819
+ kmsAddress = _context46.sent;
3820
+ _context46.next = 41;
3990
3821
  return this.authClient.KMSInfo({
3991
3822
  objectId: objectId
3992
3823
  });
3993
3824
  case 41:
3994
- kmsPublicKey = _context47.sent.publicKey;
3825
+ kmsPublicKey = _context46.sent.publicKey;
3995
3826
  kmsCapKey = "eluv.caps.ikms".concat(this.utils.AddressToHash(kmsAddress));
3996
- _context47.next = 45;
3827
+ _context46.next = 45;
3997
3828
  return this.ContentObjectMetadata({
3998
3829
  libraryId: libraryId,
3999
3830
  // Cap may only exist in draft
@@ -4002,49 +3833,49 @@ exports.CreateEncryptionConk = /*#__PURE__*/function () {
4002
3833
  metadataSubtree: kmsCapKey
4003
3834
  });
4004
3835
  case 45:
4005
- existingKMSCap = _context47.sent;
3836
+ existingKMSCap = _context46.sent;
4006
3837
  if (existingKMSCap) {
4007
- _context47.next = 58;
3838
+ _context46.next = 58;
4008
3839
  break;
4009
3840
  }
4010
- _context47.t7 = this;
4011
- _context47.t8 = libraryId;
4012
- _context47.t9 = objectId;
4013
- _context47.t10 = writeToken;
4014
- _context47.t11 = kmsCapKey;
4015
- _context47.next = 54;
3841
+ _context46.t7 = this;
3842
+ _context46.t8 = libraryId;
3843
+ _context46.t9 = objectId;
3844
+ _context46.t10 = writeToken;
3845
+ _context46.t11 = kmsCapKey;
3846
+ _context46.next = 54;
4016
3847
  return this.Crypto.EncryptConk(this.encryptionConks[objectId], kmsPublicKey);
4017
3848
  case 54:
4018
- _context47.t12 = _context47.sent;
4019
- _context47.t13 = {
4020
- libraryId: _context47.t8,
4021
- objectId: _context47.t9,
4022
- writeToken: _context47.t10,
4023
- metadataSubtree: _context47.t11,
4024
- metadata: _context47.t12
3849
+ _context46.t12 = _context46.sent;
3850
+ _context46.t13 = {
3851
+ libraryId: _context46.t8,
3852
+ objectId: _context46.t9,
3853
+ writeToken: _context46.t10,
3854
+ metadataSubtree: _context46.t11,
3855
+ metadata: _context46.t12
4025
3856
  };
4026
- _context47.next = 58;
4027
- return _context47.t7.ReplaceMetadata.call(_context47.t7, _context47.t13);
3857
+ _context46.next = 58;
3858
+ return _context46.t7.ReplaceMetadata.call(_context46.t7, _context46.t13);
4028
3859
  case 58:
4029
- _context47.next = 64;
3860
+ _context46.next = 64;
4030
3861
  break;
4031
3862
  case 60:
4032
- _context47.prev = 60;
4033
- _context47.t14 = _context47["catch"](35);
3863
+ _context46.prev = 60;
3864
+ _context46.t14 = _context46["catch"](35);
4034
3865
  // eslint-disable-next-line no-console
4035
3866
  console.error("Failed to create encryption cap for KMS:");
4036
3867
  // eslint-disable-next-line no-console
4037
- console.error(_context47.t14);
3868
+ console.error(_context46.t14);
4038
3869
  case 64:
4039
- return _context47.abrupt("return", this.encryptionConks[objectId]);
3870
+ return _context46.abrupt("return", this.encryptionConks[objectId]);
4040
3871
  case 65:
4041
3872
  case "end":
4042
- return _context47.stop();
3873
+ return _context46.stop();
4043
3874
  }
4044
- }, _callee47, this, [[35, 60]]);
3875
+ }, _callee46, this, [[35, 60]]);
4045
3876
  }));
4046
- return function (_x46) {
4047
- return _ref84.apply(this, arguments);
3877
+ return function (_x45) {
3878
+ return _ref82.apply(this, arguments);
4048
3879
  };
4049
3880
  }();
4050
3881
 
@@ -4066,12 +3897,12 @@ exports.CreateEncryptionConk = /*#__PURE__*/function () {
4066
3897
  * @return Promise<Object> - The encryption conk for the object
4067
3898
  */
4068
3899
  exports.EncryptionConk = /*#__PURE__*/function () {
4069
- var _ref86 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(_ref85) {
4070
- var libraryId, objectId, versionHash, writeToken, _ref85$download, download, owner, ownerCapKey, ownerCap, capKey, existingUserCap;
4071
- return _regeneratorRuntime.wrap(function _callee48$(_context48) {
4072
- while (1) switch (_context48.prev = _context48.next) {
3900
+ var _ref84 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(_ref83) {
3901
+ var libraryId, objectId, versionHash, writeToken, _ref83$download, download, owner, ownerCapKey, ownerCap, capKey, existingUserCap;
3902
+ return _regeneratorRuntime.wrap(function _callee47$(_context47) {
3903
+ while (1) switch (_context47.prev = _context47.next) {
4073
3904
  case 0:
4074
- libraryId = _ref85.libraryId, objectId = _ref85.objectId, versionHash = _ref85.versionHash, writeToken = _ref85.writeToken, _ref85$download = _ref85.download, download = _ref85$download === void 0 ? false : _ref85$download;
3905
+ libraryId = _ref83.libraryId, objectId = _ref83.objectId, versionHash = _ref83.versionHash, writeToken = _ref83.writeToken, _ref83$download = _ref83.download, download = _ref83$download === void 0 ? false : _ref83$download;
4075
3906
  ValidateParameters({
4076
3907
  libraryId: libraryId,
4077
3908
  objectId: objectId,
@@ -4083,14 +3914,14 @@ exports.EncryptionConk = /*#__PURE__*/function () {
4083
3914
  if (!objectId) {
4084
3915
  objectId = client.DecodeVersionHash(versionHash).objectId;
4085
3916
  }
4086
- _context48.next = 6;
3917
+ _context47.next = 6;
4087
3918
  return this.authClient.Owner({
4088
3919
  id: objectId
4089
3920
  });
4090
3921
  case 6:
4091
- owner = _context48.sent;
3922
+ owner = _context47.sent;
4092
3923
  ownerCapKey = "eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address));
4093
- _context48.next = 10;
3924
+ _context47.next = 10;
4094
3925
  return this.ContentObjectMetadata({
4095
3926
  libraryId: libraryId,
4096
3927
  objectId: objectId,
@@ -4098,39 +3929,39 @@ exports.EncryptionConk = /*#__PURE__*/function () {
4098
3929
  metadataSubtree: ownerCapKey
4099
3930
  });
4100
3931
  case 10:
4101
- ownerCap = _context48.sent;
3932
+ ownerCap = _context47.sent;
4102
3933
  if (!(!this.utils.EqualAddress(owner, this.signer.address) && !ownerCap)) {
4103
- _context48.next = 21;
3934
+ _context47.next = 21;
4104
3935
  break;
4105
3936
  }
4106
3937
  if (!download) {
4107
- _context48.next = 18;
3938
+ _context47.next = 18;
4108
3939
  break;
4109
3940
  }
4110
- _context48.next = 15;
3941
+ _context47.next = 15;
4111
3942
  return this.authClient.ReEncryptionConk({
4112
3943
  libraryId: libraryId,
4113
3944
  objectId: objectId,
4114
3945
  versionHash: versionHash
4115
3946
  });
4116
3947
  case 15:
4117
- return _context48.abrupt("return", _context48.sent);
3948
+ return _context47.abrupt("return", _context47.sent);
4118
3949
  case 18:
4119
- _context48.next = 20;
3950
+ _context47.next = 20;
4120
3951
  return this.authClient.EncryptionConk({
4121
3952
  libraryId: libraryId,
4122
3953
  objectId: objectId,
4123
3954
  versionHash: versionHash
4124
3955
  });
4125
3956
  case 20:
4126
- return _context48.abrupt("return", _context48.sent);
3957
+ return _context47.abrupt("return", _context47.sent);
4127
3958
  case 21:
4128
3959
  if (this.encryptionConks[objectId]) {
4129
- _context48.next = 38;
3960
+ _context47.next = 38;
4130
3961
  break;
4131
3962
  }
4132
3963
  capKey = "eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address));
4133
- _context48.next = 25;
3964
+ _context47.next = 25;
4134
3965
  return this.ContentObjectMetadata({
4135
3966
  libraryId: libraryId,
4136
3967
  objectId: objectId,
@@ -4140,23 +3971,23 @@ exports.EncryptionConk = /*#__PURE__*/function () {
4140
3971
  metadataSubtree: capKey
4141
3972
  });
4142
3973
  case 25:
4143
- existingUserCap = _context48.sent;
3974
+ existingUserCap = _context47.sent;
4144
3975
  if (!existingUserCap) {
4145
- _context48.next = 32;
3976
+ _context47.next = 32;
4146
3977
  break;
4147
3978
  }
4148
- _context48.next = 29;
3979
+ _context47.next = 29;
4149
3980
  return this.Crypto.DecryptCap(existingUserCap, this.signer._signingKey().privateKey);
4150
3981
  case 29:
4151
- this.encryptionConks[objectId] = _context48.sent;
4152
- _context48.next = 38;
3982
+ this.encryptionConks[objectId] = _context47.sent;
3983
+ _context47.next = 38;
4153
3984
  break;
4154
3985
  case 32:
4155
3986
  if (!writeToken) {
4156
- _context48.next = 37;
3987
+ _context47.next = 37;
4157
3988
  break;
4158
3989
  }
4159
- _context48.next = 35;
3990
+ _context47.next = 35;
4160
3991
  return this.CreateEncryptionConk({
4161
3992
  libraryId: libraryId,
4162
3993
  objectId: objectId,
@@ -4165,20 +3996,20 @@ exports.EncryptionConk = /*#__PURE__*/function () {
4165
3996
  createKMSConk: false
4166
3997
  });
4167
3998
  case 35:
4168
- _context48.next = 38;
3999
+ _context47.next = 38;
4169
4000
  break;
4170
4001
  case 37:
4171
4002
  throw "No encryption conk present for " + objectId;
4172
4003
  case 38:
4173
- return _context48.abrupt("return", this.encryptionConks[objectId]);
4004
+ return _context47.abrupt("return", this.encryptionConks[objectId]);
4174
4005
  case 39:
4175
4006
  case "end":
4176
- return _context48.stop();
4007
+ return _context47.stop();
4177
4008
  }
4178
- }, _callee48, this);
4009
+ }, _callee47, this);
4179
4010
  }));
4180
- return function (_x47) {
4181
- return _ref86.apply(this, arguments);
4011
+ return function (_x46) {
4012
+ return _ref84.apply(this, arguments);
4182
4013
  };
4183
4014
  }();
4184
4015
 
@@ -4196,37 +4027,37 @@ exports.EncryptionConk = /*#__PURE__*/function () {
4196
4027
  * @return {Promise<ArrayBuffer>}
4197
4028
  */
4198
4029
  exports.Encrypt = /*#__PURE__*/function () {
4199
- var _ref88 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(_ref87) {
4030
+ var _ref86 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(_ref85) {
4200
4031
  var libraryId, objectId, writeToken, chunk, conk, data;
4201
- return _regeneratorRuntime.wrap(function _callee49$(_context49) {
4202
- while (1) switch (_context49.prev = _context49.next) {
4032
+ return _regeneratorRuntime.wrap(function _callee48$(_context48) {
4033
+ while (1) switch (_context48.prev = _context48.next) {
4203
4034
  case 0:
4204
- libraryId = _ref87.libraryId, objectId = _ref87.objectId, writeToken = _ref87.writeToken, chunk = _ref87.chunk;
4035
+ libraryId = _ref85.libraryId, objectId = _ref85.objectId, writeToken = _ref85.writeToken, chunk = _ref85.chunk;
4205
4036
  ValidateParameters({
4206
4037
  libraryId: libraryId,
4207
4038
  objectId: objectId
4208
4039
  });
4209
- _context49.next = 4;
4040
+ _context48.next = 4;
4210
4041
  return this.EncryptionConk({
4211
4042
  libraryId: libraryId,
4212
4043
  objectId: objectId,
4213
4044
  writeToken: writeToken
4214
4045
  });
4215
4046
  case 4:
4216
- conk = _context49.sent;
4217
- _context49.next = 7;
4047
+ conk = _context48.sent;
4048
+ _context48.next = 7;
4218
4049
  return this.Crypto.Encrypt(conk, chunk);
4219
4050
  case 7:
4220
- data = _context49.sent;
4221
- return _context49.abrupt("return", data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength));
4051
+ data = _context48.sent;
4052
+ return _context48.abrupt("return", data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength));
4222
4053
  case 9:
4223
4054
  case "end":
4224
- return _context49.stop();
4055
+ return _context48.stop();
4225
4056
  }
4226
- }, _callee49, this);
4057
+ }, _callee48, this);
4227
4058
  }));
4228
- return function (_x48) {
4229
- return _ref88.apply(this, arguments);
4059
+ return function (_x47) {
4060
+ return _ref86.apply(this, arguments);
4230
4061
  };
4231
4062
  }();
4232
4063
 
@@ -4244,17 +4075,17 @@ exports.Encrypt = /*#__PURE__*/function () {
4244
4075
  * @return {Promise<ArrayBuffer>}
4245
4076
  */
4246
4077
  exports.Decrypt = /*#__PURE__*/function () {
4247
- var _ref90 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(_ref89) {
4078
+ var _ref88 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(_ref87) {
4248
4079
  var libraryId, objectId, writeToken, chunk, conk, data;
4249
- return _regeneratorRuntime.wrap(function _callee50$(_context50) {
4250
- while (1) switch (_context50.prev = _context50.next) {
4080
+ return _regeneratorRuntime.wrap(function _callee49$(_context49) {
4081
+ while (1) switch (_context49.prev = _context49.next) {
4251
4082
  case 0:
4252
- libraryId = _ref89.libraryId, objectId = _ref89.objectId, writeToken = _ref89.writeToken, chunk = _ref89.chunk;
4083
+ libraryId = _ref87.libraryId, objectId = _ref87.objectId, writeToken = _ref87.writeToken, chunk = _ref87.chunk;
4253
4084
  ValidateParameters({
4254
4085
  libraryId: libraryId,
4255
4086
  objectId: objectId
4256
4087
  });
4257
- _context50.next = 4;
4088
+ _context49.next = 4;
4258
4089
  return this.EncryptionConk({
4259
4090
  libraryId: libraryId,
4260
4091
  objectId: objectId,
@@ -4262,20 +4093,20 @@ exports.Decrypt = /*#__PURE__*/function () {
4262
4093
  download: true
4263
4094
  });
4264
4095
  case 4:
4265
- conk = _context50.sent;
4266
- _context50.next = 7;
4096
+ conk = _context49.sent;
4097
+ _context49.next = 7;
4267
4098
  return this.Crypto.Decrypt(conk, chunk);
4268
4099
  case 7:
4269
- data = _context50.sent;
4270
- return _context50.abrupt("return", data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength));
4100
+ data = _context49.sent;
4101
+ return _context49.abrupt("return", data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength));
4271
4102
  case 9:
4272
4103
  case "end":
4273
- return _context50.stop();
4104
+ return _context49.stop();
4274
4105
  }
4275
- }, _callee50, this);
4106
+ }, _callee49, this);
4276
4107
  }));
4277
- return function (_x49) {
4278
- return _ref90.apply(this, arguments);
4108
+ return function (_x48) {
4109
+ return _ref88.apply(this, arguments);
4279
4110
  };
4280
4111
  }();
4281
4112
 
@@ -4291,24 +4122,24 @@ exports.Decrypt = /*#__PURE__*/function () {
4291
4122
  * @return {Promise<string>} - Contract type of the item - "space", "library", "type", "object", "wallet", "group", or "other"
4292
4123
  */
4293
4124
  exports.AccessType = /*#__PURE__*/function () {
4294
- var _ref92 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(_ref91) {
4125
+ var _ref90 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(_ref89) {
4295
4126
  var id;
4296
- return _regeneratorRuntime.wrap(function _callee51$(_context51) {
4297
- while (1) switch (_context51.prev = _context51.next) {
4127
+ return _regeneratorRuntime.wrap(function _callee50$(_context50) {
4128
+ while (1) switch (_context50.prev = _context50.next) {
4298
4129
  case 0:
4299
- id = _ref91.id;
4300
- _context51.next = 3;
4130
+ id = _ref89.id;
4131
+ _context50.next = 3;
4301
4132
  return this.authClient.AccessType(id);
4302
4133
  case 3:
4303
- return _context51.abrupt("return", _context51.sent);
4134
+ return _context50.abrupt("return", _context50.sent);
4304
4135
  case 4:
4305
4136
  case "end":
4306
- return _context51.stop();
4137
+ return _context50.stop();
4307
4138
  }
4308
- }, _callee51, this);
4139
+ }, _callee50, this);
4309
4140
  }));
4310
- return function (_x50) {
4311
- return _ref92.apply(this, arguments);
4141
+ return function (_x49) {
4142
+ return _ref90.apply(this, arguments);
4312
4143
  };
4313
4144
  }();
4314
4145
 
@@ -4324,12 +4155,12 @@ exports.AccessType = /*#__PURE__*/function () {
4324
4155
  *
4325
4156
  * @return {Promise<Object>} - Info about the access charge and whether or not the object is accessible to the current user */
4326
4157
  exports.AccessInfo = /*#__PURE__*/function () {
4327
- var _ref94 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(_ref93) {
4158
+ var _ref92 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(_ref91) {
4328
4159
  var objectId, args, info;
4329
- return _regeneratorRuntime.wrap(function _callee52$(_context52) {
4330
- while (1) switch (_context52.prev = _context52.next) {
4160
+ return _regeneratorRuntime.wrap(function _callee51$(_context51) {
4161
+ while (1) switch (_context51.prev = _context51.next) {
4331
4162
  case 0:
4332
- objectId = _ref93.objectId, args = _ref93.args;
4163
+ objectId = _ref91.objectId, args = _ref91.args;
4333
4164
  ValidateObject(objectId);
4334
4165
  if (!args) {
4335
4166
  args = [0,
@@ -4341,16 +4172,16 @@ exports.AccessInfo = /*#__PURE__*/function () {
4341
4172
  }
4342
4173
 
4343
4174
  this.Log("Retrieving access info: ".concat(objectId));
4344
- _context52.next = 6;
4175
+ _context51.next = 6;
4345
4176
  return this.ethClient.CallContractMethod({
4346
4177
  contractAddress: this.utils.HashToAddress(objectId),
4347
4178
  methodName: "getAccessInfo",
4348
4179
  methodArgs: args
4349
4180
  });
4350
4181
  case 6:
4351
- info = _context52.sent;
4182
+ info = _context51.sent;
4352
4183
  this.Log(info);
4353
- return _context52.abrupt("return", {
4184
+ return _context51.abrupt("return", {
4354
4185
  visibilityCode: info[0],
4355
4186
  visible: info[0] >= 1,
4356
4187
  accessible: info[0] >= 10,
@@ -4361,12 +4192,12 @@ exports.AccessInfo = /*#__PURE__*/function () {
4361
4192
  });
4362
4193
  case 9:
4363
4194
  case "end":
4364
- return _context52.stop();
4195
+ return _context51.stop();
4365
4196
  }
4366
- }, _callee52, this);
4197
+ }, _callee51, this);
4367
4198
  }));
4368
- return function (_x51) {
4369
- return _ref94.apply(this, arguments);
4199
+ return function (_x50) {
4200
+ return _ref92.apply(this, arguments);
4370
4201
  };
4371
4202
  }();
4372
4203
 
@@ -4394,12 +4225,12 @@ exports.AccessInfo = /*#__PURE__*/function () {
4394
4225
  * @return {Promise<Object>} - Resultant AccessRequest or UpdateRequest event
4395
4226
  */
4396
4227
  exports.AccessRequest = /*#__PURE__*/function () {
4397
- var _ref96 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(_ref95) {
4398
- var libraryId, objectId, versionHash, _ref95$args, args, _ref95$update, update, _ref95$noCache, noCache;
4399
- return _regeneratorRuntime.wrap(function _callee53$(_context53) {
4400
- while (1) switch (_context53.prev = _context53.next) {
4228
+ var _ref94 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(_ref93) {
4229
+ var libraryId, objectId, versionHash, _ref93$args, args, _ref93$update, update, _ref93$noCache, noCache;
4230
+ return _regeneratorRuntime.wrap(function _callee52$(_context52) {
4231
+ while (1) switch (_context52.prev = _context52.next) {
4401
4232
  case 0:
4402
- libraryId = _ref95.libraryId, objectId = _ref95.objectId, versionHash = _ref95.versionHash, _ref95$args = _ref95.args, args = _ref95$args === void 0 ? [] : _ref95$args, _ref95$update = _ref95.update, update = _ref95$update === void 0 ? false : _ref95$update, _ref95$noCache = _ref95.noCache, noCache = _ref95$noCache === void 0 ? false : _ref95$noCache;
4233
+ libraryId = _ref93.libraryId, objectId = _ref93.objectId, versionHash = _ref93.versionHash, _ref93$args = _ref93.args, args = _ref93$args === void 0 ? [] : _ref93$args, _ref93$update = _ref93.update, update = _ref93$update === void 0 ? false : _ref93$update, _ref93$noCache = _ref93.noCache, noCache = _ref93$noCache === void 0 ? false : _ref93$noCache;
4403
4234
  ValidateParameters({
4404
4235
  libraryId: libraryId,
4405
4236
  objectId: objectId,
@@ -4408,7 +4239,7 @@ exports.AccessRequest = /*#__PURE__*/function () {
4408
4239
  if (versionHash) {
4409
4240
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
4410
4241
  }
4411
- _context53.next = 5;
4242
+ _context52.next = 5;
4412
4243
  return this.authClient.MakeAccessRequest({
4413
4244
  libraryId: libraryId,
4414
4245
  objectId: objectId,
@@ -4419,15 +4250,15 @@ exports.AccessRequest = /*#__PURE__*/function () {
4419
4250
  noCache: noCache
4420
4251
  });
4421
4252
  case 5:
4422
- return _context53.abrupt("return", _context53.sent);
4253
+ return _context52.abrupt("return", _context52.sent);
4423
4254
  case 6:
4424
4255
  case "end":
4425
- return _context53.stop();
4256
+ return _context52.stop();
4426
4257
  }
4427
- }, _callee53, this);
4258
+ }, _callee52, this);
4428
4259
  }));
4429
- return function (_x52) {
4430
- return _ref96.apply(this, arguments);
4260
+ return function (_x51) {
4261
+ return _ref94.apply(this, arguments);
4431
4262
  };
4432
4263
  }();
4433
4264
 
@@ -4439,8 +4270,8 @@ exports.AccessRequest = /*#__PURE__*/function () {
4439
4270
  * @param {Object=} context - Additional context to include in state channel requests
4440
4271
  * - Note: Context must be a map of string->string
4441
4272
  */
4442
- exports.SetAuthContext = function (_ref97) {
4443
- var context = _ref97.context;
4273
+ exports.SetAuthContext = function (_ref95) {
4274
+ var context = _ref95.context;
4444
4275
  if (context && Object.values(context).find(function (value) {
4445
4276
  return typeof value !== "string";
4446
4277
  })) {
@@ -4464,34 +4295,34 @@ exports.SetAuthContext = function (_ref97) {
4464
4295
  * @return {Promise<string>} - The state channel token
4465
4296
  */
4466
4297
  exports.GenerateStateChannelToken = /*#__PURE__*/function () {
4467
- var _ref99 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(_ref98) {
4468
- var objectId, versionHash, context, _ref98$noCache, noCache;
4469
- return _regeneratorRuntime.wrap(function _callee54$(_context54) {
4470
- while (1) switch (_context54.prev = _context54.next) {
4298
+ var _ref97 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(_ref96) {
4299
+ var objectId, versionHash, context, _ref96$noCache, noCache;
4300
+ return _regeneratorRuntime.wrap(function _callee53$(_context53) {
4301
+ while (1) switch (_context53.prev = _context53.next) {
4471
4302
  case 0:
4472
- objectId = _ref98.objectId, versionHash = _ref98.versionHash, context = _ref98.context, _ref98$noCache = _ref98.noCache, noCache = _ref98$noCache === void 0 ? false : _ref98$noCache;
4303
+ objectId = _ref96.objectId, versionHash = _ref96.versionHash, context = _ref96.context, _ref96$noCache = _ref96.noCache, noCache = _ref96$noCache === void 0 ? false : _ref96$noCache;
4473
4304
  versionHash ? ValidateVersion(versionHash) : ValidateObject(objectId);
4474
4305
  if (!versionHash) {
4475
- _context54.next = 6;
4306
+ _context53.next = 6;
4476
4307
  break;
4477
4308
  }
4478
4309
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
4479
- _context54.next = 10;
4310
+ _context53.next = 10;
4480
4311
  break;
4481
4312
  case 6:
4482
4313
  if (this.stateChannelAccess[objectId]) {
4483
- _context54.next = 10;
4314
+ _context53.next = 10;
4484
4315
  break;
4485
4316
  }
4486
- _context54.next = 9;
4317
+ _context53.next = 9;
4487
4318
  return this.LatestVersionHash({
4488
4319
  objectId: objectId
4489
4320
  });
4490
4321
  case 9:
4491
- versionHash = _context54.sent;
4322
+ versionHash = _context53.sent;
4492
4323
  case 10:
4493
4324
  this.stateChannelAccess[objectId] = versionHash;
4494
- _context54.next = 13;
4325
+ _context53.next = 13;
4495
4326
  return this.authClient.AuthorizationToken({
4496
4327
  objectId: objectId,
4497
4328
  channelAuth: true,
@@ -4500,15 +4331,15 @@ exports.GenerateStateChannelToken = /*#__PURE__*/function () {
4500
4331
  noCache: noCache
4501
4332
  });
4502
4333
  case 13:
4503
- return _context54.abrupt("return", _context54.sent);
4334
+ return _context53.abrupt("return", _context53.sent);
4504
4335
  case 14:
4505
4336
  case "end":
4506
- return _context54.stop();
4337
+ return _context53.stop();
4507
4338
  }
4508
- }, _callee54, this);
4339
+ }, _callee53, this);
4509
4340
  }));
4510
- return function (_x53) {
4511
- return _ref99.apply(this, arguments);
4341
+ return function (_x52) {
4342
+ return _ref97.apply(this, arguments);
4512
4343
  };
4513
4344
  }();
4514
4345
 
@@ -4522,38 +4353,38 @@ exports.GenerateStateChannelToken = /*#__PURE__*/function () {
4522
4353
  * @param {number} percentComplete - Completion percentage of the content
4523
4354
  */
4524
4355
  exports.FinalizeStateChannelAccess = /*#__PURE__*/function () {
4525
- var _ref101 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(_ref100) {
4356
+ var _ref99 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(_ref98) {
4526
4357
  var objectId, versionHash, percentComplete;
4527
- return _regeneratorRuntime.wrap(function _callee55$(_context55) {
4528
- while (1) switch (_context55.prev = _context55.next) {
4358
+ return _regeneratorRuntime.wrap(function _callee54$(_context54) {
4359
+ while (1) switch (_context54.prev = _context54.next) {
4529
4360
  case 0:
4530
- objectId = _ref100.objectId, versionHash = _ref100.versionHash, percentComplete = _ref100.percentComplete;
4361
+ objectId = _ref98.objectId, versionHash = _ref98.versionHash, percentComplete = _ref98.percentComplete;
4531
4362
  versionHash ? ValidateVersion(versionHash) : ValidateObject(objectId);
4532
4363
  if (!versionHash) {
4533
- _context55.next = 6;
4364
+ _context54.next = 6;
4534
4365
  break;
4535
4366
  }
4536
4367
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
4537
- _context55.next = 13;
4368
+ _context54.next = 13;
4538
4369
  break;
4539
4370
  case 6:
4540
4371
  if (!this.stateChannelAccess[objectId]) {
4541
- _context55.next = 10;
4372
+ _context54.next = 10;
4542
4373
  break;
4543
4374
  }
4544
4375
  versionHash = this.stateChannelAccess[objectId];
4545
- _context55.next = 13;
4376
+ _context54.next = 13;
4546
4377
  break;
4547
4378
  case 10:
4548
- _context55.next = 12;
4379
+ _context54.next = 12;
4549
4380
  return this.LatestVersionHash({
4550
4381
  objectId: objectId
4551
4382
  });
4552
4383
  case 12:
4553
- versionHash = _context55.sent;
4384
+ versionHash = _context54.sent;
4554
4385
  case 13:
4555
4386
  this.stateChannelAccess[objectId] = undefined;
4556
- _context55.next = 16;
4387
+ _context54.next = 16;
4557
4388
  return this.authClient.ChannelContentFinalize({
4558
4389
  objectId: objectId,
4559
4390
  versionHash: versionHash,
@@ -4561,12 +4392,12 @@ exports.FinalizeStateChannelAccess = /*#__PURE__*/function () {
4561
4392
  });
4562
4393
  case 16:
4563
4394
  case "end":
4564
- return _context55.stop();
4395
+ return _context54.stop();
4565
4396
  }
4566
- }, _callee55, this);
4397
+ }, _callee54, this);
4567
4398
  }));
4568
- return function (_x54) {
4569
- return _ref101.apply(this, arguments);
4399
+ return function (_x53) {
4400
+ return _ref99.apply(this, arguments);
4570
4401
  };
4571
4402
  }();
4572
4403
 
@@ -4583,34 +4414,34 @@ exports.FinalizeStateChannelAccess = /*#__PURE__*/function () {
4583
4414
  * @returns {Promise<Object>} - Transaction log of the AccessComplete event
4584
4415
  */
4585
4416
  exports.ContentObjectAccessComplete = /*#__PURE__*/function () {
4586
- var _ref103 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(_ref102) {
4587
- var objectId, _ref102$score, score;
4588
- return _regeneratorRuntime.wrap(function _callee56$(_context56) {
4589
- while (1) switch (_context56.prev = _context56.next) {
4417
+ var _ref101 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(_ref100) {
4418
+ var objectId, _ref100$score, score;
4419
+ return _regeneratorRuntime.wrap(function _callee55$(_context55) {
4420
+ while (1) switch (_context55.prev = _context55.next) {
4590
4421
  case 0:
4591
- objectId = _ref102.objectId, _ref102$score = _ref102.score, score = _ref102$score === void 0 ? 100 : _ref102$score;
4422
+ objectId = _ref100.objectId, _ref100$score = _ref100.score, score = _ref100$score === void 0 ? 100 : _ref100$score;
4592
4423
  ValidateObject(objectId);
4593
4424
  if (!(score < 0 || score > 100)) {
4594
- _context56.next = 4;
4425
+ _context55.next = 4;
4595
4426
  break;
4596
4427
  }
4597
4428
  throw Error("Invalid AccessComplete score: " + score);
4598
4429
  case 4:
4599
- _context56.next = 6;
4430
+ _context55.next = 6;
4600
4431
  return this.authClient.AccessComplete({
4601
4432
  id: objectId,
4602
4433
  score: score
4603
4434
  });
4604
4435
  case 6:
4605
- return _context56.abrupt("return", _context56.sent);
4436
+ return _context55.abrupt("return", _context55.sent);
4606
4437
  case 7:
4607
4438
  case "end":
4608
- return _context56.stop();
4439
+ return _context55.stop();
4609
4440
  }
4610
- }, _callee56, this);
4441
+ }, _callee55, this);
4611
4442
  }));
4612
- return function (_x55) {
4613
- return _ref103.apply(this, arguments);
4443
+ return function (_x54) {
4444
+ return _ref101.apply(this, arguments);
4614
4445
  };
4615
4446
  }();
4616
4447
 
@@ -4632,62 +4463,62 @@ exports.ContentObjectAccessComplete = /*#__PURE__*/function () {
4632
4463
  * @return {Promise<Array<string>>} - List of addresses of available items
4633
4464
  */
4634
4465
  exports.Collection = /*#__PURE__*/function () {
4635
- var _ref105 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(_ref104) {
4466
+ var _ref103 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(_ref102) {
4636
4467
  var collectionType, validCollectionTypes, walletAddress;
4637
- return _regeneratorRuntime.wrap(function _callee57$(_context57) {
4638
- while (1) switch (_context57.prev = _context57.next) {
4468
+ return _regeneratorRuntime.wrap(function _callee56$(_context56) {
4469
+ while (1) switch (_context56.prev = _context56.next) {
4639
4470
  case 0:
4640
- collectionType = _ref104.collectionType;
4471
+ collectionType = _ref102.collectionType;
4641
4472
  validCollectionTypes = ["accessGroups", "contentObjects", "contentTypes", "contracts", "libraries"];
4642
4473
  if (validCollectionTypes.includes(collectionType)) {
4643
- _context57.next = 4;
4474
+ _context56.next = 4;
4644
4475
  break;
4645
4476
  }
4646
4477
  throw new Error("Invalid collection type: " + collectionType);
4647
4478
  case 4:
4648
4479
  if (!this.signer) {
4649
- _context57.next = 10;
4480
+ _context56.next = 10;
4650
4481
  break;
4651
4482
  }
4652
- _context57.next = 7;
4483
+ _context56.next = 7;
4653
4484
  return this.userProfileClient.WalletAddress();
4654
4485
  case 7:
4655
- _context57.t0 = _context57.sent;
4656
- _context57.next = 11;
4486
+ _context56.t0 = _context56.sent;
4487
+ _context56.next = 11;
4657
4488
  break;
4658
4489
  case 10:
4659
- _context57.t0 = undefined;
4490
+ _context56.t0 = undefined;
4660
4491
  case 11:
4661
- walletAddress = _context57.t0;
4492
+ walletAddress = _context56.t0;
4662
4493
  if (walletAddress) {
4663
- _context57.next = 14;
4494
+ _context56.next = 14;
4664
4495
  break;
4665
4496
  }
4666
4497
  throw new Error("Unable to get collection: User wallet doesn't exist");
4667
4498
  case 14:
4668
4499
  this.Log("Retrieving ".concat(collectionType, " contract collection for user ").concat(this.signer.address));
4669
- _context57.next = 17;
4500
+ _context56.next = 17;
4670
4501
  return this.ethClient.MakeProviderCall({
4671
4502
  methodName: "send",
4672
4503
  args: ["elv_getWalletCollection", [this.contentSpaceId, "iusr".concat(this.utils.AddressToHash(this.signer.address)), collectionType]]
4673
4504
  });
4674
4505
  case 17:
4675
- _context57.t1 = _context57.sent;
4676
- if (_context57.t1) {
4677
- _context57.next = 20;
4506
+ _context56.t1 = _context56.sent;
4507
+ if (_context56.t1) {
4508
+ _context56.next = 20;
4678
4509
  break;
4679
4510
  }
4680
- _context57.t1 = [];
4511
+ _context56.t1 = [];
4681
4512
  case 20:
4682
- return _context57.abrupt("return", _context57.t1);
4513
+ return _context56.abrupt("return", _context56.t1);
4683
4514
  case 21:
4684
4515
  case "end":
4685
- return _context57.stop();
4516
+ return _context56.stop();
4686
4517
  }
4687
- }, _callee57, this);
4518
+ }, _callee56, this);
4688
4519
  }));
4689
- return function (_x56) {
4690
- return _ref105.apply(this, arguments);
4520
+ return function (_x55) {
4521
+ return _ref103.apply(this, arguments);
4691
4522
  };
4692
4523
  }();
4693
4524
 
@@ -4705,18 +4536,18 @@ exports.Collection = /*#__PURE__*/function () {
4705
4536
  * @returns {Promise<Object>} - Response describing verification results
4706
4537
  */
4707
4538
  exports.VerifyContentObject = /*#__PURE__*/function () {
4708
- var _ref107 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(_ref106) {
4539
+ var _ref105 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(_ref104) {
4709
4540
  var libraryId, objectId, versionHash;
4710
- return _regeneratorRuntime.wrap(function _callee58$(_context58) {
4711
- while (1) switch (_context58.prev = _context58.next) {
4541
+ return _regeneratorRuntime.wrap(function _callee57$(_context57) {
4542
+ while (1) switch (_context57.prev = _context57.next) {
4712
4543
  case 0:
4713
- libraryId = _ref106.libraryId, objectId = _ref106.objectId, versionHash = _ref106.versionHash;
4544
+ libraryId = _ref104.libraryId, objectId = _ref104.objectId, versionHash = _ref104.versionHash;
4714
4545
  ValidateParameters({
4715
4546
  libraryId: libraryId,
4716
4547
  objectId: objectId,
4717
4548
  versionHash: versionHash
4718
4549
  });
4719
- _context58.next = 4;
4550
+ _context57.next = 4;
4720
4551
  return ContentObjectVerification.VerifyContentObject({
4721
4552
  client: this,
4722
4553
  libraryId: libraryId,
@@ -4724,15 +4555,15 @@ exports.VerifyContentObject = /*#__PURE__*/function () {
4724
4555
  versionHash: versionHash
4725
4556
  });
4726
4557
  case 4:
4727
- return _context58.abrupt("return", _context58.sent);
4558
+ return _context57.abrupt("return", _context57.sent);
4728
4559
  case 5:
4729
4560
  case "end":
4730
- return _context58.stop();
4561
+ return _context57.stop();
4731
4562
  }
4732
- }, _callee58, this);
4563
+ }, _callee57, this);
4733
4564
  }));
4734
- return function (_x57) {
4735
- return _ref107.apply(this, arguments);
4565
+ return function (_x56) {
4566
+ return _ref105.apply(this, arguments);
4736
4567
  };
4737
4568
  }();
4738
4569
 
@@ -4749,12 +4580,12 @@ exports.VerifyContentObject = /*#__PURE__*/function () {
4749
4580
  * @returns {Promise<Object>} - Response containing proof information
4750
4581
  */
4751
4582
  exports.Proofs = /*#__PURE__*/function () {
4752
- var _ref109 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(_ref108) {
4583
+ var _ref107 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(_ref106) {
4753
4584
  var libraryId, objectId, versionHash, partHash, path;
4754
- return _regeneratorRuntime.wrap(function _callee59$(_context59) {
4755
- while (1) switch (_context59.prev = _context59.next) {
4585
+ return _regeneratorRuntime.wrap(function _callee58$(_context58) {
4586
+ while (1) switch (_context58.prev = _context58.next) {
4756
4587
  case 0:
4757
- libraryId = _ref108.libraryId, objectId = _ref108.objectId, versionHash = _ref108.versionHash, partHash = _ref108.partHash;
4588
+ libraryId = _ref106.libraryId, objectId = _ref106.objectId, versionHash = _ref106.versionHash, partHash = _ref106.partHash;
4758
4589
  ValidateParameters({
4759
4590
  libraryId: libraryId,
4760
4591
  objectId: objectId,
@@ -4765,32 +4596,32 @@ exports.Proofs = /*#__PURE__*/function () {
4765
4596
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
4766
4597
  }
4767
4598
  path = UrlJoin("q", versionHash || objectId, "data", partHash, "proofs");
4768
- _context59.t0 = this.utils;
4769
- _context59.t1 = this.HttpClient;
4770
- _context59.next = 9;
4599
+ _context58.t0 = this.utils;
4600
+ _context58.t1 = this.HttpClient;
4601
+ _context58.next = 9;
4771
4602
  return this.authClient.AuthorizationHeader({
4772
4603
  libraryId: libraryId,
4773
4604
  objectId: objectId,
4774
4605
  versionHash: versionHash
4775
4606
  });
4776
4607
  case 9:
4777
- _context59.t2 = _context59.sent;
4778
- _context59.t3 = path;
4779
- _context59.t4 = {
4780
- headers: _context59.t2,
4608
+ _context58.t2 = _context58.sent;
4609
+ _context58.t3 = path;
4610
+ _context58.t4 = {
4611
+ headers: _context58.t2,
4781
4612
  method: "GET",
4782
- path: _context59.t3
4613
+ path: _context58.t3
4783
4614
  };
4784
- _context59.t5 = _context59.t1.Request.call(_context59.t1, _context59.t4);
4785
- return _context59.abrupt("return", _context59.t0.ResponseToJson.call(_context59.t0, _context59.t5));
4615
+ _context58.t5 = _context58.t1.Request.call(_context58.t1, _context58.t4);
4616
+ return _context58.abrupt("return", _context58.t0.ResponseToJson.call(_context58.t0, _context58.t5));
4786
4617
  case 14:
4787
4618
  case "end":
4788
- return _context59.stop();
4619
+ return _context58.stop();
4789
4620
  }
4790
- }, _callee59, this);
4621
+ }, _callee58, this);
4791
4622
  }));
4792
- return function (_x58) {
4793
- return _ref109.apply(this, arguments);
4623
+ return function (_x57) {
4624
+ return _ref107.apply(this, arguments);
4794
4625
  };
4795
4626
  }();
4796
4627
 
@@ -4807,12 +4638,12 @@ exports.Proofs = /*#__PURE__*/function () {
4807
4638
  * @returns {Promise<Format>} - Response containing the CBOR response in the specified format
4808
4639
  */
4809
4640
  exports.QParts = /*#__PURE__*/function () {
4810
- var _ref111 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(_ref110) {
4811
- var libraryId, objectId, partHash, _ref110$format, format, path;
4812
- return _regeneratorRuntime.wrap(function _callee60$(_context60) {
4813
- while (1) switch (_context60.prev = _context60.next) {
4641
+ var _ref109 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(_ref108) {
4642
+ var libraryId, objectId, partHash, _ref108$format, format, path;
4643
+ return _regeneratorRuntime.wrap(function _callee59$(_context59) {
4644
+ while (1) switch (_context59.prev = _context59.next) {
4814
4645
  case 0:
4815
- libraryId = _ref110.libraryId, objectId = _ref110.objectId, partHash = _ref110.partHash, _ref110$format = _ref110.format, format = _ref110$format === void 0 ? "blob" : _ref110$format;
4646
+ libraryId = _ref108.libraryId, objectId = _ref108.objectId, partHash = _ref108.partHash, _ref108$format = _ref108.format, format = _ref108$format === void 0 ? "blob" : _ref108$format;
4816
4647
  ValidateParameters({
4817
4648
  libraryId: libraryId,
4818
4649
  objectId: objectId,
@@ -4820,32 +4651,32 @@ exports.QParts = /*#__PURE__*/function () {
4820
4651
  });
4821
4652
  ValidatePartHash(partHash);
4822
4653
  path = UrlJoin("qparts", partHash);
4823
- _context60.t0 = this.utils;
4824
- _context60.t1 = format;
4825
- _context60.t2 = this.HttpClient;
4826
- _context60.next = 9;
4654
+ _context59.t0 = this.utils;
4655
+ _context59.t1 = format;
4656
+ _context59.t2 = this.HttpClient;
4657
+ _context59.next = 9;
4827
4658
  return this.authClient.AuthorizationHeader({
4828
4659
  libraryId: libraryId,
4829
4660
  objectId: objectId,
4830
4661
  partHash: partHash
4831
4662
  });
4832
4663
  case 9:
4833
- _context60.t3 = _context60.sent;
4834
- _context60.t4 = path;
4835
- _context60.t5 = {
4836
- headers: _context60.t3,
4664
+ _context59.t3 = _context59.sent;
4665
+ _context59.t4 = path;
4666
+ _context59.t5 = {
4667
+ headers: _context59.t3,
4837
4668
  method: "GET",
4838
- path: _context60.t4
4669
+ path: _context59.t4
4839
4670
  };
4840
- _context60.t6 = _context60.t2.Request.call(_context60.t2, _context60.t5);
4841
- return _context60.abrupt("return", _context60.t0.ResponseToFormat.call(_context60.t0, _context60.t1, _context60.t6));
4671
+ _context59.t6 = _context59.t2.Request.call(_context59.t2, _context59.t5);
4672
+ return _context59.abrupt("return", _context59.t0.ResponseToFormat.call(_context59.t0, _context59.t1, _context59.t6));
4842
4673
  case 14:
4843
4674
  case "end":
4844
- return _context60.stop();
4675
+ return _context59.stop();
4845
4676
  }
4846
- }, _callee60, this);
4677
+ }, _callee59, this);
4847
4678
  }));
4848
- return function (_x59) {
4849
- return _ref111.apply(this, arguments);
4679
+ return function (_x58) {
4680
+ return _ref109.apply(this, arguments);
4850
4681
  };
4851
4682
  }();