@eluvio/elv-client-js 3.1.76 → 3.1.80

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.
@@ -205,7 +205,9 @@ function () {
205
205
  _ref$noCache = _ref.noCache,
206
206
  noCache = _ref$noCache === void 0 ? false : _ref$noCache,
207
207
  _ref$noAuth = _ref.noAuth,
208
- noAuth = _ref$noAuth === void 0 ? false : _ref$noAuth;
208
+ noAuth = _ref$noAuth === void 0 ? false : _ref$noAuth,
209
+ _ref$assumeV = _ref.assumeV3,
210
+ assumeV3 = _ref$assumeV === void 0 ? false : _ref$assumeV;
209
211
 
210
212
  _classCallCheck(this, ElvClient);
211
213
 
@@ -224,6 +226,7 @@ function () {
224
226
  this.trustAuthorityId = trustAuthorityId;
225
227
  this.noCache = noCache;
226
228
  this.noAuth = noAuth;
229
+ this.assumeV3 = assumeV3;
227
230
  this.debug = false;
228
231
  this.InitializeClients({
229
232
  staticToken: staticToken
@@ -1500,13 +1503,13 @@ function () {
1500
1503
  }, {
1501
1504
  key: "FromNetworkName",
1502
1505
  value: function FromNetworkName(_ref22) {
1503
- var networkName, region, trustAuthorityId, staticToken, _ref22$ethereumContra, ethereumContractTimeout, _ref22$noCache, noCache, _ref22$noAuth, noAuth, configUrl;
1506
+ var networkName, region, trustAuthorityId, staticToken, _ref22$ethereumContra, ethereumContractTimeout, _ref22$noCache, noCache, _ref22$noAuth, noAuth, assumeV3, configUrl;
1504
1507
 
1505
1508
  return _regeneratorRuntime.async(function FromNetworkName$(_context19) {
1506
1509
  while (1) {
1507
1510
  switch (_context19.prev = _context19.next) {
1508
1511
  case 0:
1509
- networkName = _ref22.networkName, region = _ref22.region, trustAuthorityId = _ref22.trustAuthorityId, staticToken = _ref22.staticToken, _ref22$ethereumContra = _ref22.ethereumContractTimeout, ethereumContractTimeout = _ref22$ethereumContra === void 0 ? 10 : _ref22$ethereumContra, _ref22$noCache = _ref22.noCache, noCache = _ref22$noCache === void 0 ? false : _ref22$noCache, _ref22$noAuth = _ref22.noAuth, noAuth = _ref22$noAuth === void 0 ? false : _ref22$noAuth;
1512
+ networkName = _ref22.networkName, region = _ref22.region, trustAuthorityId = _ref22.trustAuthorityId, staticToken = _ref22.staticToken, _ref22$ethereumContra = _ref22.ethereumContractTimeout, ethereumContractTimeout = _ref22$ethereumContra === void 0 ? 10 : _ref22$ethereumContra, _ref22$noCache = _ref22.noCache, noCache = _ref22$noCache === void 0 ? false : _ref22$noCache, _ref22$noAuth = _ref22.noAuth, noAuth = _ref22$noAuth === void 0 ? false : _ref22$noAuth, assumeV3 = _ref22.assumeV3;
1510
1513
  configUrl = networks[networkName];
1511
1514
 
1512
1515
  if (configUrl) {
@@ -1525,7 +1528,8 @@ function () {
1525
1528
  staticToken: staticToken,
1526
1529
  ethereumContractTimeout: ethereumContractTimeout,
1527
1530
  noCache: noCache,
1528
- noAuth: noAuth
1531
+ noAuth: noAuth,
1532
+ assumeV3: assumeV3
1529
1533
  }));
1530
1534
 
1531
1535
  case 6:
@@ -1557,13 +1561,13 @@ function () {
1557
1561
  }, {
1558
1562
  key: "FromConfigurationUrl",
1559
1563
  value: function FromConfigurationUrl(_ref23) {
1560
- var configUrl, region, trustAuthorityId, staticToken, _ref23$ethereumContra, ethereumContractTimeout, _ref23$noCache, noCache, _ref23$noAuth, noAuth, _ref24, contentSpaceId, networkId, networkName, fabricURIs, ethereumURIs, authServiceURIs, fabricVersion, client;
1564
+ var configUrl, region, trustAuthorityId, staticToken, _ref23$ethereumContra, ethereumContractTimeout, _ref23$noCache, noCache, _ref23$noAuth, noAuth, _ref23$assumeV, assumeV3, _ref24, contentSpaceId, networkId, networkName, fabricURIs, ethereumURIs, authServiceURIs, fabricVersion, client;
1561
1565
 
1562
1566
  return _regeneratorRuntime.async(function FromConfigurationUrl$(_context20) {
1563
1567
  while (1) {
1564
1568
  switch (_context20.prev = _context20.next) {
1565
1569
  case 0:
1566
- configUrl = _ref23.configUrl, region = _ref23.region, trustAuthorityId = _ref23.trustAuthorityId, staticToken = _ref23.staticToken, _ref23$ethereumContra = _ref23.ethereumContractTimeout, ethereumContractTimeout = _ref23$ethereumContra === void 0 ? 10 : _ref23$ethereumContra, _ref23$noCache = _ref23.noCache, noCache = _ref23$noCache === void 0 ? false : _ref23$noCache, _ref23$noAuth = _ref23.noAuth, noAuth = _ref23$noAuth === void 0 ? false : _ref23$noAuth;
1570
+ configUrl = _ref23.configUrl, region = _ref23.region, trustAuthorityId = _ref23.trustAuthorityId, staticToken = _ref23.staticToken, _ref23$ethereumContra = _ref23.ethereumContractTimeout, ethereumContractTimeout = _ref23$ethereumContra === void 0 ? 10 : _ref23$ethereumContra, _ref23$noCache = _ref23.noCache, noCache = _ref23$noCache === void 0 ? false : _ref23$noCache, _ref23$noAuth = _ref23.noAuth, noAuth = _ref23$noAuth === void 0 ? false : _ref23$noAuth, _ref23$assumeV = _ref23.assumeV3, assumeV3 = _ref23$assumeV === void 0 ? false : _ref23$assumeV;
1567
1571
  _context20.next = 3;
1568
1572
  return _regeneratorRuntime.awrap(ElvClient.Configuration({
1569
1573
  configUrl: configUrl,
@@ -1591,7 +1595,8 @@ function () {
1591
1595
  trustAuthorityId: trustAuthorityId,
1592
1596
  staticToken: staticToken,
1593
1597
  noCache: noCache,
1594
- noAuth: noAuth
1598
+ noAuth: noAuth,
1599
+ assumeV3: assumeV3
1595
1600
  });
1596
1601
  client.configUrl = configUrl;
1597
1602
  return _context20.abrupt("return", client);
@@ -480,7 +480,7 @@ function () {
480
480
 
481
481
  case 22:
482
482
  if (success) {
483
- _context6.next = 45;
483
+ _context6.next = 49;
484
484
  break;
485
485
  }
486
486
 
@@ -491,7 +491,7 @@ function () {
491
491
  case 26:
492
492
  result = _context6.sent;
493
493
  success = true;
494
- _context6.next = 43;
494
+ _context6.next = 47;
495
495
  break;
496
496
 
497
497
  case 30:
@@ -513,41 +513,51 @@ function () {
513
513
  latestBlock = _context6.sent;
514
514
  overrides.gasLimit = latestBlock.gasLimit;
515
515
  overrides.gasPrice = overrides.gasPrice ? overrides.gasPrice * 1.50 : 8000000000;
516
- _context6.next = 43;
516
+ _context6.next = 47;
517
517
  break;
518
518
 
519
519
  case 40:
520
+ if (!(_context6.t0.code === "NONCE_EXPIRED" && _context6.t0.reason === "nonce has already been used")) {
521
+ _context6.next = 44;
522
+ break;
523
+ }
524
+
525
+ this.Log("Retrying method call ".concat(methodName));
526
+ _context6.next = 47;
527
+ break;
528
+
529
+ case 44:
520
530
  if ((_context6.t0.message || _context6.t0).includes("invalid response")) {
521
- _context6.next = 43;
531
+ _context6.next = 47;
522
532
  break;
523
533
  }
524
534
 
525
535
  this.Log(_typeof(_context6.t0) === "object" ? JSON.stringify(_context6.t0, null, 2) : _context6.t0, true);
526
536
  throw _context6.t0;
527
537
 
528
- case 43:
538
+ case 47:
529
539
  _context6.next = 22;
530
540
  break;
531
541
 
532
- case 45:
542
+ case 49:
533
543
  return _context6.abrupt("return", result);
534
544
 
535
- case 46:
536
- _context6.prev = 46;
545
+ case 50:
546
+ _context6.prev = 50;
537
547
 
538
548
  // Unlock if performing a transaction
539
549
  if (!methodAbi || !methodAbi.constant) {
540
550
  this.locked = false;
541
551
  }
542
552
 
543
- return _context6.finish(46);
553
+ return _context6.finish(50);
544
554
 
545
- case 49:
555
+ case 53:
546
556
  case "end":
547
557
  return _context6.stop();
548
558
  }
549
559
  }
550
- }, null, this, [[20,, 46, 49], [23, 30]]);
560
+ }, null, this, [[20,, 50, 53], [23, 30]]);
551
561
  }
552
562
  }, {
553
563
  key: "CallContractMethodAndWait",
@@ -78,6 +78,8 @@ function () {
78
78
  this.client = client;
79
79
  this.debug = debug;
80
80
  this.userWalletAddresses = {};
81
+ this.walletAddress = undefined;
82
+ this.walletAddressRetrieved = false;
81
83
  }
82
84
 
83
85
  _createClass(UserProfileClient, [{
@@ -242,7 +244,7 @@ function () {
242
244
  case 0:
243
245
  autoCreate = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : true;
244
246
 
245
- if (!this.walletAddress) {
247
+ if (!(this.walletAddress || this.walletAddressRetrieved)) {
246
248
  _context2.next = 3;
247
249
  break;
248
250
  }
@@ -250,14 +252,18 @@ function () {
250
252
  return _context2.abrupt("return", this.walletAddress);
251
253
 
252
254
  case 3:
253
- _context2.next = 5;
254
- return _regeneratorRuntime.awrap(this.client.CallContractMethod({
255
- contractAddress: Utils.HashToAddress(this.client.contentSpaceId),
256
- methodName: "userWallets",
257
- methodArgs: [this.client.signer.address]
258
- }));
255
+ if (!this.walletAddressPromise) {
256
+ this.walletAddressPromise = this.client.CallContractMethod({
257
+ contractAddress: Utils.HashToAddress(this.client.contentSpaceId),
258
+ methodName: "userWallets",
259
+ methodArgs: [this.client.signer.address]
260
+ });
261
+ }
259
262
 
260
- case 5:
263
+ _context2.next = 6;
264
+ return _regeneratorRuntime.awrap(this.walletAddressPromise);
265
+
266
+ case 6:
261
267
  walletAddress = _context2.sent;
262
268
 
263
269
  if (!Utils.EqualAddress(walletAddress, Utils.nullAddress)) {
@@ -265,17 +271,18 @@ function () {
265
271
  }
266
272
 
267
273
  if (!(!this.walletAddress && autoCreate)) {
268
- _context2.next = 10;
274
+ _context2.next = 11;
269
275
  break;
270
276
  }
271
277
 
272
- _context2.next = 10;
278
+ _context2.next = 11;
273
279
  return _regeneratorRuntime.awrap(this.CreateWallet());
274
280
 
275
- case 10:
281
+ case 11:
282
+ this.walletAddressRetrieved = true;
276
283
  return _context2.abrupt("return", this.walletAddress);
277
284
 
278
- case 11:
285
+ case 13:
279
286
  case "end":
280
287
  return _context2.stop();
281
288
  }
@@ -15,6 +15,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
15
15
  *
16
16
  * @module ElvClient/ABRPublishing
17
17
  */
18
+ var R = require("ramda");
19
+
18
20
  var UrlJoin = require("url-join");
19
21
 
20
22
  var HttpClient = require("../HttpClient");
@@ -344,7 +346,7 @@ exports.CreateProductionMaster = function _callee(_ref) {
344
346
 
345
347
 
346
348
  exports.CreateABRMezzanine = function _callee2(_ref4) {
347
- var libraryId, objectId, type, name, description, metadata, masterVersionHash, abrProfile, _ref4$variant, variant, _ref4$offeringKey, offeringKey, existingMez, options, id, write_token, editResponse, createResponse, masterName, authorizationTokens, headers, body, storeClear, _ref5, logs, errors, warnings, finalizeResponse;
349
+ var libraryId, objectId, type, name, description, metadata, masterVersionHash, abrProfile, _ref4$variant, variant, _ref4$offeringKey, offeringKey, existingMez, options, id, write_token, editResponse, createResponse, masterName, authorizationTokens, headers, body, storeClear, _ref5, logs, errors, warnings, existingMetadata, finalizeResponse;
348
350
 
349
351
  return _regeneratorRuntime.async(function _callee2$(_context2) {
350
352
  while (1) {
@@ -541,7 +543,6 @@ exports.CreateABRMezzanine = function _callee2(_ref4) {
541
543
  "/": "./rep/playout/".concat(offeringKey, "/options.json")
542
544
  })
543
545
  }, metadata["public"].asset_metadata);
544
- metadata.elv_created_at = new Date().getTime();
545
546
 
546
547
  if (name || !existingMez) {
547
548
  metadata.name = name || "".concat(masterName, " Mezzanine");
@@ -551,18 +552,38 @@ exports.CreateABRMezzanine = function _callee2(_ref4) {
551
552
  if (description || !existingMez) {
552
553
  metadata.description = description || "";
553
554
  metadata["public"].description = description || "";
554
- }
555
+ } // retrieve existing metadata to merge with updated metadata
555
556
 
556
- _context2.next = 72;
557
- return _regeneratorRuntime.awrap(this.MergeMetadata({
557
+
558
+ _context2.next = 71;
559
+ return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
560
+ libraryId: libraryId,
561
+ objectId: id,
562
+ writeToken: write_token
563
+ }));
564
+
565
+ case 71:
566
+ existingMetadata = _context2.sent;
567
+ // newer metadata values replace existing metadata, unless both new and old values are objects,
568
+ // in which case their keys are merged recursively
569
+ metadata = R.mergeDeepRight(existingMetadata, metadata);
570
+
571
+ if (!existingMez) {
572
+ // set creation date
573
+ metadata.elv_created_at = new Date().getTime();
574
+ } // write metadata to mezzanine object
575
+
576
+
577
+ _context2.next = 76;
578
+ return _regeneratorRuntime.awrap(this.ReplaceMetadata({
558
579
  libraryId: libraryId,
559
580
  objectId: id,
560
581
  writeToken: write_token,
561
582
  metadata: metadata
562
583
  }));
563
584
 
564
- case 72:
565
- _context2.next = 74;
585
+ case 76:
586
+ _context2.next = 78;
566
587
  return _regeneratorRuntime.awrap(this.FinalizeContentObject({
567
588
  libraryId: libraryId,
568
589
  objectId: id,
@@ -570,7 +591,7 @@ exports.CreateABRMezzanine = function _callee2(_ref4) {
570
591
  commitMessage: "Create ABR mezzanine"
571
592
  }));
572
593
 
573
- case 74:
594
+ case 78:
574
595
  finalizeResponse = _context2.sent;
575
596
  return _context2.abrupt("return", _objectSpread({
576
597
  logs: logs || [],
@@ -578,7 +599,7 @@ exports.CreateABRMezzanine = function _callee2(_ref4) {
578
599
  errors: errors || []
579
600
  }, finalizeResponse));
580
601
 
581
- case 76:
602
+ case 80:
582
603
  case "end":
583
604
  return _context2.stop();
584
605
  }
@@ -1443,13 +1443,13 @@ exports.ProduceMetadataLinks = function _callee22(_ref15) {
1443
1443
  };
1444
1444
 
1445
1445
  exports.MetadataAuth = function _callee23(_ref16) {
1446
- var libraryId, objectId, versionHash, _ref16$path, path, _ref16$channelAuth, channelAuth, visibility, accessType, isPublic, noAuth, kmsAddress;
1446
+ var libraryId, objectId, versionHash, _ref16$path, path, _ref16$channelAuth, channelAuth, _ref16$noAuth, noAuth, isPublic, accessType, visibility, kmsAddress;
1447
1447
 
1448
1448
  return _regeneratorRuntime.async(function _callee23$(_context23) {
1449
1449
  while (1) {
1450
1450
  switch (_context23.prev = _context23.next) {
1451
1451
  case 0:
1452
- 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;
1452
+ 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, _ref16$noAuth = _ref16.noAuth, noAuth = _ref16$noAuth === void 0 ? false : _ref16$noAuth;
1453
1453
  ValidateParameters({
1454
1454
  libraryId: libraryId,
1455
1455
  objectId: objectId,
@@ -1460,43 +1460,52 @@ exports.MetadataAuth = function _callee23(_ref16) {
1460
1460
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
1461
1461
  }
1462
1462
 
1463
- _context23.next = 5;
1463
+ noAuth = this.noAuth || noAuth;
1464
+ isPublic = noAuth;
1465
+
1466
+ if (noAuth) {
1467
+ _context23.next = 14;
1468
+ break;
1469
+ }
1470
+
1471
+ _context23.next = 8;
1464
1472
  return _regeneratorRuntime.awrap(this.Visibility({
1465
1473
  id: objectId
1466
1474
  }));
1467
1475
 
1468
- case 5:
1476
+ case 8:
1469
1477
  visibility = _context23.sent;
1470
- _context23.next = 8;
1478
+ _context23.next = 11;
1471
1479
  return _regeneratorRuntime.awrap(this.AccessType({
1472
1480
  id: objectId
1473
1481
  }));
1474
1482
 
1475
- case 8:
1483
+ case 11:
1476
1484
  accessType = _context23.sent;
1477
1485
  isPublic = (path || "").replace(/^\/+/, "").startsWith("public");
1478
1486
  noAuth = visibility >= 10 || isPublic && visibility >= 1;
1479
1487
 
1488
+ case 14:
1480
1489
  if (!this.oauthToken) {
1481
- _context23.next = 19;
1490
+ _context23.next = 22;
1482
1491
  break;
1483
1492
  }
1484
1493
 
1485
- _context23.next = 14;
1494
+ _context23.next = 17;
1486
1495
  return _regeneratorRuntime.awrap(this.authClient.KMSAddress({
1487
1496
  objectId: objectId,
1488
1497
  versionHash: versionHash
1489
1498
  }));
1490
1499
 
1491
- case 14:
1500
+ case 17:
1492
1501
  kmsAddress = _context23.sent;
1493
1502
 
1494
1503
  if (!(kmsAddress && !this.utils.EqualAddress(kmsAddress, this.utils.nullAddress))) {
1495
- _context23.next = 19;
1504
+ _context23.next = 22;
1496
1505
  break;
1497
1506
  }
1498
1507
 
1499
- _context23.next = 18;
1508
+ _context23.next = 21;
1500
1509
  return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
1501
1510
  libraryId: libraryId,
1502
1511
  objectId: objectId,
@@ -1505,35 +1514,35 @@ exports.MetadataAuth = function _callee23(_ref16) {
1505
1514
  oauthToken: this.oauthToken
1506
1515
  }));
1507
1516
 
1508
- case 18:
1517
+ case 21:
1509
1518
  return _context23.abrupt("return", _context23.sent);
1510
1519
 
1511
- case 19:
1520
+ case 22:
1512
1521
  if (!(!this.inaccessibleLibraries[libraryId] && isPublic && accessType === this.authClient.ACCESS_TYPES.OBJECT && !channelAuth)) {
1513
- _context23.next = 47;
1522
+ _context23.next = 50;
1514
1523
  break;
1515
1524
  }
1516
1525
 
1517
- _context23.prev = 20;
1526
+ _context23.prev = 23;
1518
1527
  _context23.t0 = _regeneratorRuntime;
1519
1528
  _context23.t1 = this.authClient;
1520
1529
  _context23.t2 = libraryId;
1521
1530
 
1522
1531
  if (_context23.t2) {
1523
- _context23.next = 28;
1532
+ _context23.next = 31;
1524
1533
  break;
1525
1534
  }
1526
1535
 
1527
- _context23.next = 27;
1536
+ _context23.next = 30;
1528
1537
  return _regeneratorRuntime.awrap(this.ContentObjectLibraryId({
1529
1538
  objectId: objectId,
1530
1539
  versionHash: versionHash
1531
1540
  }));
1532
1541
 
1533
- case 27:
1542
+ case 30:
1534
1543
  _context23.t2 = _context23.sent;
1535
1544
 
1536
- case 28:
1545
+ case 31:
1537
1546
  _context23.t3 = _context23.t2;
1538
1547
  _context23.t4 = noAuth;
1539
1548
  _context23.t5 = {
@@ -1541,23 +1550,23 @@ exports.MetadataAuth = function _callee23(_ref16) {
1541
1550
  noAuth: _context23.t4
1542
1551
  };
1543
1552
  _context23.t6 = _context23.t1.AuthorizationToken.call(_context23.t1, _context23.t5);
1544
- _context23.next = 34;
1553
+ _context23.next = 37;
1545
1554
  return _context23.t0.awrap.call(_context23.t0, _context23.t6);
1546
1555
 
1547
- case 34:
1556
+ case 37:
1548
1557
  return _context23.abrupt("return", _context23.sent);
1549
1558
 
1550
- case 37:
1551
- _context23.prev = 37;
1552
- _context23.t7 = _context23["catch"](20);
1559
+ case 40:
1560
+ _context23.prev = 40;
1561
+ _context23.t7 = _context23["catch"](23);
1553
1562
 
1554
1563
  if (!(_context23.t7.message && _context23.t7.message.toLowerCase().startsWith("access denied"))) {
1555
- _context23.next = 44;
1564
+ _context23.next = 47;
1556
1565
  break;
1557
1566
  }
1558
1567
 
1559
1568
  this.inaccessibleLibraries[libraryId] = true;
1560
- _context23.next = 43;
1569
+ _context23.next = 46;
1561
1570
  return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
1562
1571
  libraryId: libraryId,
1563
1572
  objectId: objectId,
@@ -1566,18 +1575,18 @@ exports.MetadataAuth = function _callee23(_ref16) {
1566
1575
  channelAuth: channelAuth
1567
1576
  }));
1568
1577
 
1569
- case 43:
1578
+ case 46:
1570
1579
  return _context23.abrupt("return", _context23.sent);
1571
1580
 
1572
- case 44:
1581
+ case 47:
1573
1582
  throw _context23.t7;
1574
1583
 
1575
- case 45:
1576
- _context23.next = 50;
1584
+ case 48:
1585
+ _context23.next = 53;
1577
1586
  break;
1578
1587
 
1579
- case 47:
1580
- _context23.next = 49;
1588
+ case 50:
1589
+ _context23.next = 52;
1581
1590
  return _regeneratorRuntime.awrap(this.authClient.AuthorizationToken({
1582
1591
  libraryId: libraryId,
1583
1592
  objectId: objectId,
@@ -1586,15 +1595,15 @@ exports.MetadataAuth = function _callee23(_ref16) {
1586
1595
  channelAuth: channelAuth
1587
1596
  }));
1588
1597
 
1589
- case 49:
1598
+ case 52:
1590
1599
  return _context23.abrupt("return", _context23.sent);
1591
1600
 
1592
- case 50:
1601
+ case 53:
1593
1602
  case "end":
1594
1603
  return _context23.stop();
1595
1604
  }
1596
1605
  }
1597
- }, null, this, [[20, 37]]);
1606
+ }, null, this, [[23, 40]]);
1598
1607
  };
1599
1608
  /**
1600
1609
  * Get the metadata of a content object
@@ -1611,6 +1620,7 @@ exports.MetadataAuth = function _callee23(_ref16) {
1611
1620
  * - Note: Selection is relative to "metadataSubtree". For example, metadataSubtree="public" and select=["name", "description"] would select "public/name" and "public/description"
1612
1621
  * @param {Array<string>=} remove - Exclude the specified items from the retrieved metadata
1613
1622
  * @param {string=} authorizationToken - Additional authorization token for this request
1623
+ * @param {string=} noAuth=false - If specified, the normal authorization flow will be skipped. Useful if you know the metadata you're retrieving is publicly accessible
1614
1624
  * @param {boolean=} resolveLinks=false - If specified, links in the metadata will be resolved
1615
1625
  * @param {boolean=} resolveIncludeSource=false - If specified, resolved links will include the hash of the link at the root of the metadata
1616
1626
 
@@ -1638,13 +1648,13 @@ exports.MetadataAuth = function _callee23(_ref16) {
1638
1648
 
1639
1649
 
1640
1650
  exports.ContentObjectMetadata = function _callee24(_ref17) {
1641
- 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;
1651
+ var libraryId, objectId, versionHash, writeToken, _ref17$metadataSubtre, metadataSubtree, _ref17$queryParams, queryParams, _ref17$select, select, _ref17$remove, remove, authorizationToken, _ref17$noAuth, noAuth, _ref17$resolveLinks, resolveLinks, _ref17$resolveInclude, resolveIncludeSource, _ref17$resolveIgnoreE, resolveIgnoreErrors, _ref17$linkDepthLimit, linkDepthLimit, _ref17$produceLinkUrl, produceLinkUrls, path, defaultAuthToken, authTokens, metadata;
1642
1652
 
1643
1653
  return _regeneratorRuntime.async(function _callee24$(_context24) {
1644
1654
  while (1) {
1645
1655
  switch (_context24.prev = _context24.next) {
1646
1656
  case 0:
1647
- 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;
1657
+ 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$noAuth = _ref17.noAuth, noAuth = _ref17$noAuth === void 0 ? false : _ref17$noAuth, _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;
1648
1658
  ValidateParameters({
1649
1659
  libraryId: libraryId,
1650
1660
  objectId: objectId,
@@ -1664,7 +1674,8 @@ exports.ContentObjectMetadata = function _callee24(_ref17) {
1664
1674
  libraryId: libraryId,
1665
1675
  objectId: objectId,
1666
1676
  versionHash: versionHash,
1667
- path: metadataSubtree
1677
+ path: metadataSubtree,
1678
+ noAuth: noAuth
1668
1679
  }));
1669
1680
 
1670
1681
  case 8:
@@ -3961,28 +3972,22 @@ exports.LinkUrl = function _callee44(_ref37) {
3961
3972
  }
3962
3973
 
3963
3974
  authorization = [authorizationToken];
3964
-
3965
- if (noAuth) {
3966
- _context44.next = 14;
3967
- break;
3968
- }
3969
-
3970
3975
  _context44.t0 = authorization;
3971
- _context44.next = 12;
3976
+ _context44.next = 11;
3972
3977
  return _regeneratorRuntime.awrap(this.MetadataAuth({
3973
3978
  libraryId: libraryId,
3974
3979
  objectId: objectId,
3975
3980
  versionHash: versionHash,
3976
3981
  path: linkPath,
3977
- channelAuth: channelAuth
3982
+ channelAuth: channelAuth,
3983
+ noAuth: noAuth
3978
3984
  }));
3979
3985
 
3980
- case 12:
3986
+ case 11:
3981
3987
  _context44.t1 = _context44.sent;
3982
3988
 
3983
3989
  _context44.t0.push.call(_context44.t0, _context44.t1);
3984
3990
 
3985
- case 14:
3986
3991
  if (queryParams.authorization) {
3987
3992
  authorization.push(queryParams.authorization);
3988
3993
  }
@@ -4003,7 +4008,7 @@ exports.LinkUrl = function _callee44(_ref37) {
4003
4008
  queryParams: queryParams
4004
4009
  }));
4005
4010
 
4006
- case 18:
4011
+ case 17:
4007
4012
  case "end":
4008
4013
  return _context44.stop();
4009
4014
  }