@eluvio/elv-client-js 4.0.99 → 4.0.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/ElvClient-min.js +15 -14
  2. package/dist/ElvClient-node-min.js +14 -13
  3. package/dist/ElvFrameClient-min.js +10 -10
  4. package/dist/ElvPermissionsClient-min.js +9 -9
  5. package/dist/ElvWalletClient-min.js +15 -14
  6. package/dist/ElvWalletClient-node-min.js +14 -13
  7. package/dist/src/AuthorizationClient.js +9 -12
  8. package/dist/src/ContentObjectAudit.js +3 -3
  9. package/dist/src/ContentObjectVerification.js +3 -3
  10. package/dist/src/Crypto.js +2 -2
  11. package/dist/src/ElvClient.js +47 -28
  12. package/dist/src/ElvWallet.js +7 -5
  13. package/dist/src/EthClient.js +8 -9
  14. package/dist/src/FrameClient.js +8 -9
  15. package/dist/src/HttpClient.js +1 -2
  16. package/dist/src/Id.js +1 -2
  17. package/dist/src/PermissionsClient.js +31 -19
  18. package/dist/src/RemoteSigner.js +6 -8
  19. package/dist/src/UserProfileClient.js +35 -19
  20. package/dist/src/Utils.js +2 -3
  21. package/dist/src/abr_profiles/abr_profile_live_drm.js +18 -0
  22. package/dist/src/client/ABRPublishing.js +2 -2
  23. package/dist/src/client/AccessGroups.js +2 -2
  24. package/dist/src/client/ContentAccess.js +700 -563
  25. package/dist/src/client/ContentManagement.js +3 -3
  26. package/dist/src/client/Contracts.js +2 -2
  27. package/dist/src/client/Files.js +2 -2
  28. package/dist/src/client/LiveConf.js +13 -6
  29. package/dist/src/client/LiveStream.js +31 -41
  30. package/dist/src/client/NFT.js +2 -2
  31. package/dist/src/walletClient/ClientMethods.js +2 -2
  32. package/dist/src/walletClient/Profile.js +2 -2
  33. package/dist/src/walletClient/Utils.js +4 -4
  34. package/dist/src/walletClient/index.js +18 -15
  35. package/package.json +1 -1
  36. package/src/abr_profiles/abr_profile_live_drm.js +18 -0
  37. package/src/client/LiveConf.js +9 -0
  38. package/src/client/LiveStream.js +2 -10
@@ -3,8 +3,8 @@ var _typeof = require("@babel/runtime/helpers/typeof");
3
3
  var _defineProperty = require("@babel/runtime/helpers/defineProperty");
4
4
  var _regeneratorRuntime = require("@babel/runtime/regenerator");
5
5
  var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
6
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
8
  /**
9
9
  * Methods for accessing content types, libraries and objects
10
10
  *
@@ -2485,7 +2485,7 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2485
2485
  i = 0;
2486
2486
  case 70:
2487
2487
  if (!(i < playoutOptions.length)) {
2488
- _context34.next = 116;
2488
+ _context34.next = 126;
2489
2489
  break;
2490
2490
  }
2491
2491
  option = playoutOptions[i];
@@ -2547,20 +2547,48 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2547
2547
  _context34.t24 = _context34.sent;
2548
2548
  case 100:
2549
2549
  _context34.t25 = _context34.t24;
2550
- _context34.t26 = drm ? _defineProperty({}, drm, {
2550
+ if (!signedLink) {
2551
+ _context34.next = 107;
2552
+ break;
2553
+ }
2554
+ _context34.next = 104;
2555
+ return this.GlobalUrl({
2556
+ versionHash: versionHash,
2557
+ path: UrlJoin(linkPath, offering, playoutPath),
2558
+ queryParams: queryParams
2559
+ });
2560
+ case 104:
2561
+ _context34.t26 = _context34.sent;
2562
+ _context34.next = 110;
2563
+ break;
2564
+ case 107:
2565
+ _context34.next = 109;
2566
+ return this.GlobalUrl({
2567
+ libraryId: linkTarget.libraryId || libraryId,
2568
+ objectId: linkTarget.objectId || objectId,
2569
+ versionHash: linkTarget.versionHash || versionHash,
2570
+ path: UrlJoin("rep", handler, offering, playoutPath),
2571
+ queryParams: queryParams
2572
+ });
2573
+ case 109:
2574
+ _context34.t26 = _context34.sent;
2575
+ case 110:
2576
+ _context34.t27 = _context34.t26;
2577
+ _context34.t28 = drm ? _defineProperty({}, drm, {
2551
2578
  licenseServers: licenseServers,
2552
2579
  cert: cert
2553
2580
  }) : undefined;
2554
- _context34.t27 = {
2581
+ _context34.t29 = {
2555
2582
  playoutUrl: _context34.t25,
2556
- drms: _context34.t26
2583
+ globalPlayoutUrl: _context34.t27,
2584
+ drms: _context34.t28
2557
2585
  };
2558
- _context34.t28 = (0, _context34.t21)(_context34.t22, _context34.t23, _context34.t27);
2559
- _context34.t29 = (0, _context34.t18)(_context34.t19, _context34.t20, _context34.t28);
2560
- _context34.t30 = {
2561
- playoutMethods: _context34.t29
2586
+ _context34.t30 = (0, _context34.t21)(_context34.t22, _context34.t23, _context34.t29);
2587
+ _context34.t31 = (0, _context34.t18)(_context34.t19, _context34.t20, _context34.t30);
2588
+ _context34.t32 = {
2589
+ playoutMethods: _context34.t31
2562
2590
  };
2563
- playoutMap[protocol] = (0, _context34.t15)(_context34.t16, _context34.t17, _context34.t30);
2591
+ playoutMap[protocol] = (0, _context34.t15)(_context34.t16, _context34.t17, _context34.t32);
2564
2592
  // Add .cert_url if playoutMap[protocol].playoutMethods[].drms[].cert is present
2565
2593
  // (for clients that need cert supplied as a URL reference rather than as a string literal)
2566
2594
  for (method in playoutMap[protocol].playoutMethods) {
@@ -2576,21 +2604,21 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2576
2604
  protocolMatch = protocols.includes(protocol);
2577
2605
  drmMatch = drms.includes(drm || "clear") || drms.length === 0 && !drm;
2578
2606
  if (!(!protocolMatch || !drmMatch)) {
2579
- _context34.next = 112;
2607
+ _context34.next = 122;
2580
2608
  break;
2581
2609
  }
2582
- return _context34.abrupt("continue", 113);
2583
- case 112:
2610
+ return _context34.abrupt("continue", 123);
2611
+ case 122:
2584
2612
  // This protocol / DRM satisfies the specifications (prefer DRM over clear, if available)
2585
2613
  if (!playoutMap[protocol].playoutUrl || drm && drm !== "clear") {
2586
2614
  playoutMap[protocol].playoutUrl = playoutMap[protocol].playoutMethods[drm || "clear"].playoutUrl;
2587
2615
  playoutMap[protocol].drms = playoutMap[protocol].playoutMethods[drm || "clear"].drms;
2588
2616
  }
2589
- case 113:
2617
+ case 123:
2590
2618
  i++;
2591
2619
  _context34.next = 70;
2592
2620
  break;
2593
- case 116:
2621
+ case 126:
2594
2622
  // Callbacks for retrieving and setting multiview views
2595
2623
  if (multiview && sessionId) {
2596
2624
  playoutMap.sessionId = sessionId;
@@ -2646,7 +2674,7 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2646
2674
  }
2647
2675
  this.Log(playoutMap);
2648
2676
  return _context34.abrupt("return", playoutMap);
2649
- case 119:
2677
+ case 129:
2650
2678
  case "end":
2651
2679
  return _context34.stop();
2652
2680
  }
@@ -2810,6 +2838,116 @@ exports.BitmovinPlayoutOptions = /*#__PURE__*/function () {
2810
2838
  };
2811
2839
  }();
2812
2840
 
2841
+ /**
2842
+ * Create a 'global' URL with the specified parameters
2843
+ *
2844
+ * A global URL is a URL that will resolve to a Fabric node close to the resolver. This is useful in cases where URLS are being passed to clients that may be in a different geographical location from where the URL was created.
2845
+ *
2846
+ * @methodGroup URL Generation
2847
+ * @namedParams
2848
+ * @param {string=} libraryId - ID of the library
2849
+ * @param {string=} objectId - ID of the object
2850
+ * @param {string=} versionHash - Version hash of the object
2851
+ * @param {string=} writeToken - Write token of an object draft
2852
+ * @param {string=} path - Path of the URL
2853
+ * @param {string=} authorizationToken - Authorization token for the URL. If not specified and `noAuth` is false, the client will generate the token automatically
2854
+ * @param {boolean=} noAuth=false - Set to true if the URL is for publicly accessible content
2855
+ * @param {boolean=} resolve=false - Whether links should resolve (if this URL is for metadata)
2856
+ * @param {Object=} queryParams={} - Additional URL query params
2857
+ *
2858
+ * @returns {Promise<string>} - The generated global URL
2859
+ */
2860
+ exports.GlobalUrl = /*#__PURE__*/function () {
2861
+ var _ref63 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(_ref62) {
2862
+ var libraryId, objectId, writeToken, versionHash, _ref62$path, path, authorizationToken, _ref62$noAuth, noAuth, _ref62$resolve, resolve, _ref62$queryParams, queryParams, network, url, fabricNodeUrl, urlPath;
2863
+ return _regeneratorRuntime.wrap(function _callee36$(_context36) {
2864
+ while (1) switch (_context36.prev = _context36.next) {
2865
+ case 0:
2866
+ libraryId = _ref62.libraryId, objectId = _ref62.objectId, writeToken = _ref62.writeToken, versionHash = _ref62.versionHash, _ref62$path = _ref62.path, path = _ref62$path === void 0 ? "/" : _ref62$path, authorizationToken = _ref62.authorizationToken, _ref62$noAuth = _ref62.noAuth, noAuth = _ref62$noAuth === void 0 ? false : _ref62$noAuth, _ref62$resolve = _ref62.resolve, resolve = _ref62$resolve === void 0 ? true : _ref62$resolve, _ref62$queryParams = _ref62.queryParams, queryParams = _ref62$queryParams === void 0 ? {} : _ref62$queryParams;
2867
+ network = this.NetworkInfo().name;
2868
+ url = new URL(network === "main" ? "https://main.net955305.contentfabric.io" : "https://demov3.net955210.contentfabric.io"); // Pull auth out of query params
2869
+ if (queryParams.authorization && (typeof queryParams.authorization === "string" || Array.isArray(queryParams.authorization) && queryParams.authorization.length === 1)) {
2870
+ queryParams = _objectSpread({}, queryParams);
2871
+ authorizationToken = typeof queryParams.authorization === "string" ? queryParams.authorization : queryParams.authorization[0];
2872
+ }
2873
+ if (writeToken) {
2874
+ fabricNodeUrl = this.HttpClient.draftURIs[writeToken];
2875
+ if (fabricNodeUrl) {
2876
+ url = new URL(fabricNodeUrl);
2877
+ }
2878
+ }
2879
+ urlPath = UrlJoin("s", network);
2880
+ if (!(!noAuth || authorizationToken)) {
2881
+ _context36.next = 15;
2882
+ break;
2883
+ }
2884
+ _context36.t0 = UrlJoin;
2885
+ _context36.t1 = authorizationToken;
2886
+ if (_context36.t1) {
2887
+ _context36.next = 13;
2888
+ break;
2889
+ }
2890
+ _context36.next = 12;
2891
+ return this.authClient.AuthorizationToken({
2892
+ libraryId: libraryId,
2893
+ objectId: objectId,
2894
+ versionHash: versionHash,
2895
+ noAuth: noAuth
2896
+ });
2897
+ case 12:
2898
+ _context36.t1 = _context36.sent;
2899
+ case 13:
2900
+ _context36.t2 = _context36.t1;
2901
+ urlPath = (0, _context36.t0)("t", _context36.t2);
2902
+ case 15:
2903
+ if (!versionHash) {
2904
+ _context36.next = 19;
2905
+ break;
2906
+ }
2907
+ objectId = this.utils.DecodeVersionHash(versionHash).objectId;
2908
+ _context36.next = 25;
2909
+ break;
2910
+ case 19:
2911
+ _context36.t3 = libraryId;
2912
+ if (_context36.t3) {
2913
+ _context36.next = 24;
2914
+ break;
2915
+ }
2916
+ _context36.next = 23;
2917
+ return this.ContentObjectLibraryId({
2918
+ objectId: objectId
2919
+ });
2920
+ case 23:
2921
+ _context36.t3 = _context36.sent;
2922
+ case 24:
2923
+ libraryId = _context36.t3;
2924
+ case 25:
2925
+ if (path.startsWith("/qfab")) {
2926
+ urlPath = UrlJoin(urlPath, path.replace(/^\/qfab/, "q"));
2927
+ } else if (versionHash) {
2928
+ urlPath = UrlJoin(urlPath, "q", writeToken || versionHash, path);
2929
+ } else {
2930
+ urlPath = UrlJoin(urlPath, "qlibs", libraryId, "q", writeToken || objectId, path);
2931
+ }
2932
+ url.pathname = urlPath;
2933
+ if (resolve) {
2934
+ url.searchParams.set("resolve", "true");
2935
+ }
2936
+ Object.keys(queryParams).forEach(function (key) {
2937
+ return url.searchParams.set(key, queryParams[key]);
2938
+ });
2939
+ return _context36.abrupt("return", url.toString());
2940
+ case 30:
2941
+ case "end":
2942
+ return _context36.stop();
2943
+ }
2944
+ }, _callee36, this);
2945
+ }));
2946
+ return function (_x35) {
2947
+ return _ref63.apply(this, arguments);
2948
+ };
2949
+ }();
2950
+
2813
2951
  /**
2814
2952
  * Call the specified bitcode method on the specified object
2815
2953
  *
@@ -2830,19 +2968,19 @@ exports.BitmovinPlayoutOptions = /*#__PURE__*/function () {
2830
2968
  * @returns {Promise<format>} - The response from the call in the specified format
2831
2969
  */
2832
2970
  exports.CallBitcodeMethod = /*#__PURE__*/function () {
2833
- var _ref63 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(_ref62) {
2834
- var libraryId, objectId, versionHash, writeToken, method, _ref62$queryParams, queryParams, _ref62$body, body, _ref62$headers, headers, _ref62$constant, constant, _ref62$format, format, path, authHeader;
2835
- return _regeneratorRuntime.wrap(function _callee36$(_context36) {
2836
- while (1) switch (_context36.prev = _context36.next) {
2971
+ var _ref65 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(_ref64) {
2972
+ var libraryId, objectId, versionHash, writeToken, method, _ref64$queryParams, queryParams, _ref64$body, body, _ref64$headers, headers, _ref64$constant, constant, _ref64$format, format, path, authHeader;
2973
+ return _regeneratorRuntime.wrap(function _callee37$(_context37) {
2974
+ while (1) switch (_context37.prev = _context37.next) {
2837
2975
  case 0:
2838
- libraryId = _ref62.libraryId, objectId = _ref62.objectId, versionHash = _ref62.versionHash, writeToken = _ref62.writeToken, method = _ref62.method, _ref62$queryParams = _ref62.queryParams, queryParams = _ref62$queryParams === void 0 ? {} : _ref62$queryParams, _ref62$body = _ref62.body, body = _ref62$body === void 0 ? {} : _ref62$body, _ref62$headers = _ref62.headers, headers = _ref62$headers === void 0 ? {} : _ref62$headers, _ref62$constant = _ref62.constant, constant = _ref62$constant === void 0 ? true : _ref62$constant, _ref62$format = _ref62.format, format = _ref62$format === void 0 ? "json" : _ref62$format;
2976
+ libraryId = _ref64.libraryId, objectId = _ref64.objectId, versionHash = _ref64.versionHash, writeToken = _ref64.writeToken, method = _ref64.method, _ref64$queryParams = _ref64.queryParams, queryParams = _ref64$queryParams === void 0 ? {} : _ref64$queryParams, _ref64$body = _ref64.body, body = _ref64$body === void 0 ? {} : _ref64$body, _ref64$headers = _ref64.headers, headers = _ref64$headers === void 0 ? {} : _ref64$headers, _ref64$constant = _ref64.constant, constant = _ref64$constant === void 0 ? true : _ref64$constant, _ref64$format = _ref64.format, format = _ref64$format === void 0 ? "json" : _ref64$format;
2839
2977
  ValidateParameters({
2840
2978
  libraryId: libraryId,
2841
2979
  objectId: objectId,
2842
2980
  versionHash: versionHash
2843
2981
  });
2844
2982
  if (method) {
2845
- _context36.next = 4;
2983
+ _context37.next = 4;
2846
2984
  break;
2847
2985
  }
2848
2986
  throw "Bitcode method not specified";
@@ -2856,22 +2994,22 @@ exports.CallBitcodeMethod = /*#__PURE__*/function () {
2856
2994
  }
2857
2995
  authHeader = headers.authorization || headers.Authorization;
2858
2996
  if (authHeader) {
2859
- _context36.next = 12;
2997
+ _context37.next = 12;
2860
2998
  break;
2861
2999
  }
2862
- _context36.next = 11;
3000
+ _context37.next = 11;
2863
3001
  return this.authClient.AuthorizationHeader({
2864
3002
  libraryId: libraryId,
2865
3003
  objectId: objectId,
2866
3004
  update: !constant
2867
3005
  });
2868
3006
  case 11:
2869
- headers.Authorization = _context36.sent.Authorization;
3007
+ headers.Authorization = _context37.sent.Authorization;
2870
3008
  case 12:
2871
3009
  this.Log("Calling bitcode method: ".concat(libraryId || "", " ").concat(objectId || versionHash, " ").concat(writeToken || "", "\n ").concat(constant ? "GET" : "POST", " ").concat(path, "\n Query Params:\n ").concat(JSON.stringify(queryParams || ""), "\n Body:\n ").concat(JSON.stringify(body || ""), "\n Headers\n ").concat(JSON.stringify(headers || "")));
2872
- _context36.t0 = this.utils;
2873
- _context36.t1 = format;
2874
- _context36.next = 17;
3010
+ _context37.t0 = this.utils;
3011
+ _context37.t1 = format;
3012
+ _context37.next = 17;
2875
3013
  return this.HttpClient.Request({
2876
3014
  body: body,
2877
3015
  headers: headers,
@@ -2881,18 +3019,18 @@ exports.CallBitcodeMethod = /*#__PURE__*/function () {
2881
3019
  allowFailover: false
2882
3020
  });
2883
3021
  case 17:
2884
- _context36.t2 = _context36.sent;
2885
- _context36.t3 = this.HttpClient.debug;
2886
- _context36.t4 = this.HttpClient.Log.bind(this.HttpClient);
2887
- return _context36.abrupt("return", _context36.t0.ResponseToFormat.call(_context36.t0, _context36.t1, _context36.t2, _context36.t3, _context36.t4));
3022
+ _context37.t2 = _context37.sent;
3023
+ _context37.t3 = this.HttpClient.debug;
3024
+ _context37.t4 = this.HttpClient.Log.bind(this.HttpClient);
3025
+ return _context37.abrupt("return", _context37.t0.ResponseToFormat.call(_context37.t0, _context37.t1, _context37.t2, _context37.t3, _context37.t4));
2888
3026
  case 21:
2889
3027
  case "end":
2890
- return _context36.stop();
3028
+ return _context37.stop();
2891
3029
  }
2892
- }, _callee36, this);
3030
+ }, _callee37, this);
2893
3031
  }));
2894
- return function (_x35) {
2895
- return _ref63.apply(this, arguments);
3032
+ return function (_x36) {
3033
+ return _ref65.apply(this, arguments);
2896
3034
  };
2897
3035
  }();
2898
3036
 
@@ -2921,24 +3059,24 @@ exports.CallBitcodeMethod = /*#__PURE__*/function () {
2921
3059
  * @returns {Promise<string>} - URL to the specified rep endpoint with authorization token
2922
3060
  */
2923
3061
  exports.Rep = /*#__PURE__*/function () {
2924
- var _ref65 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(_ref64) {
2925
- var libraryId, objectId, versionHash, rep, _ref64$queryParams, queryParams, _ref64$service, service, _ref64$makeAccessRequ, makeAccessRequest, _ref64$channelAuth, channelAuth, _ref64$noAuth, noAuth, _ref64$noCache, noCache;
2926
- return _regeneratorRuntime.wrap(function _callee37$(_context37) {
2927
- while (1) switch (_context37.prev = _context37.next) {
3062
+ var _ref67 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(_ref66) {
3063
+ var libraryId, objectId, versionHash, rep, _ref66$queryParams, queryParams, _ref66$service, service, _ref66$makeAccessRequ, makeAccessRequest, _ref66$channelAuth, channelAuth, _ref66$noAuth, noAuth, _ref66$noCache, noCache;
3064
+ return _regeneratorRuntime.wrap(function _callee38$(_context38) {
3065
+ while (1) switch (_context38.prev = _context38.next) {
2928
3066
  case 0:
2929
- libraryId = _ref64.libraryId, objectId = _ref64.objectId, versionHash = _ref64.versionHash, rep = _ref64.rep, _ref64$queryParams = _ref64.queryParams, queryParams = _ref64$queryParams === void 0 ? {} : _ref64$queryParams, _ref64$service = _ref64.service, service = _ref64$service === void 0 ? "fabric" : _ref64$service, _ref64$makeAccessRequ = _ref64.makeAccessRequest, makeAccessRequest = _ref64$makeAccessRequ === void 0 ? false : _ref64$makeAccessRequ, _ref64$channelAuth = _ref64.channelAuth, channelAuth = _ref64$channelAuth === void 0 ? false : _ref64$channelAuth, _ref64$noAuth = _ref64.noAuth, noAuth = _ref64$noAuth === void 0 ? false : _ref64$noAuth, _ref64$noCache = _ref64.noCache, noCache = _ref64$noCache === void 0 ? false : _ref64$noCache;
3067
+ libraryId = _ref66.libraryId, objectId = _ref66.objectId, versionHash = _ref66.versionHash, rep = _ref66.rep, _ref66$queryParams = _ref66.queryParams, queryParams = _ref66$queryParams === void 0 ? {} : _ref66$queryParams, _ref66$service = _ref66.service, service = _ref66$service === void 0 ? "fabric" : _ref66$service, _ref66$makeAccessRequ = _ref66.makeAccessRequest, makeAccessRequest = _ref66$makeAccessRequ === void 0 ? false : _ref66$makeAccessRequ, _ref66$channelAuth = _ref66.channelAuth, channelAuth = _ref66$channelAuth === void 0 ? false : _ref66$channelAuth, _ref66$noAuth = _ref66.noAuth, noAuth = _ref66$noAuth === void 0 ? false : _ref66$noAuth, _ref66$noCache = _ref66.noCache, noCache = _ref66$noCache === void 0 ? false : _ref66$noCache;
2930
3068
  ValidateParameters({
2931
3069
  libraryId: libraryId,
2932
3070
  objectId: objectId,
2933
3071
  versionHash: versionHash
2934
3072
  });
2935
3073
  if (rep) {
2936
- _context37.next = 4;
3074
+ _context38.next = 4;
2937
3075
  break;
2938
3076
  }
2939
3077
  throw "Rep not specified";
2940
3078
  case 4:
2941
- return _context37.abrupt("return", this.FabricUrl({
3079
+ return _context38.abrupt("return", this.FabricUrl({
2942
3080
  libraryId: libraryId,
2943
3081
  objectId: objectId,
2944
3082
  versionHash: versionHash,
@@ -2952,12 +3090,12 @@ exports.Rep = /*#__PURE__*/function () {
2952
3090
  }));
2953
3091
  case 5:
2954
3092
  case "end":
2955
- return _context37.stop();
3093
+ return _context38.stop();
2956
3094
  }
2957
- }, _callee37, this);
3095
+ }, _callee38, this);
2958
3096
  }));
2959
- return function (_x36) {
2960
- return _ref65.apply(this, arguments);
3097
+ return function (_x37) {
3098
+ return _ref67.apply(this, arguments);
2961
3099
  };
2962
3100
  }();
2963
3101
 
@@ -2979,24 +3117,24 @@ exports.Rep = /*#__PURE__*/function () {
2979
3117
  * @returns {Promise<string>} - URL to the specified rep endpoint with authorization token
2980
3118
  */
2981
3119
  exports.PublicRep = /*#__PURE__*/function () {
2982
- var _ref67 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(_ref66) {
2983
- var libraryId, objectId, versionHash, rep, _ref66$queryParams, queryParams, _ref66$service, service;
2984
- return _regeneratorRuntime.wrap(function _callee38$(_context38) {
2985
- while (1) switch (_context38.prev = _context38.next) {
3120
+ var _ref69 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(_ref68) {
3121
+ var libraryId, objectId, versionHash, rep, _ref68$queryParams, queryParams, _ref68$service, service;
3122
+ return _regeneratorRuntime.wrap(function _callee39$(_context39) {
3123
+ while (1) switch (_context39.prev = _context39.next) {
2986
3124
  case 0:
2987
- libraryId = _ref66.libraryId, objectId = _ref66.objectId, versionHash = _ref66.versionHash, rep = _ref66.rep, _ref66$queryParams = _ref66.queryParams, queryParams = _ref66$queryParams === void 0 ? {} : _ref66$queryParams, _ref66$service = _ref66.service, service = _ref66$service === void 0 ? "fabric" : _ref66$service;
3125
+ libraryId = _ref68.libraryId, objectId = _ref68.objectId, versionHash = _ref68.versionHash, rep = _ref68.rep, _ref68$queryParams = _ref68.queryParams, queryParams = _ref68$queryParams === void 0 ? {} : _ref68$queryParams, _ref68$service = _ref68.service, service = _ref68$service === void 0 ? "fabric" : _ref68$service;
2988
3126
  ValidateParameters({
2989
3127
  libraryId: libraryId,
2990
3128
  objectId: objectId,
2991
3129
  versionHash: versionHash
2992
3130
  });
2993
3131
  if (rep) {
2994
- _context38.next = 4;
3132
+ _context39.next = 4;
2995
3133
  break;
2996
3134
  }
2997
3135
  throw "Rep not specified";
2998
3136
  case 4:
2999
- return _context38.abrupt("return", this.FabricUrl({
3137
+ return _context39.abrupt("return", this.FabricUrl({
3000
3138
  libraryId: libraryId,
3001
3139
  objectId: objectId,
3002
3140
  versionHash: versionHash,
@@ -3007,12 +3145,12 @@ exports.PublicRep = /*#__PURE__*/function () {
3007
3145
  }));
3008
3146
  case 5:
3009
3147
  case "end":
3010
- return _context38.stop();
3148
+ return _context39.stop();
3011
3149
  }
3012
- }, _callee38, this);
3150
+ }, _callee39, this);
3013
3151
  }));
3014
- return function (_x37) {
3015
- return _ref67.apply(this, arguments);
3152
+ return function (_x38) {
3153
+ return _ref69.apply(this, arguments);
3016
3154
  };
3017
3155
  }();
3018
3156
 
@@ -3041,12 +3179,12 @@ exports.PublicRep = /*#__PURE__*/function () {
3041
3179
  * @returns {Promise<string>} - URL to the specified endpoint with authorization token
3042
3180
  */
3043
3181
  exports.FabricUrl = /*#__PURE__*/function () {
3044
- var _ref69 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(_ref68) {
3045
- var libraryId, objectId, versionHash, writeToken, partHash, rep, publicRep, call, _ref68$queryParams, queryParams, _ref68$service, service, _ref68$channelAuth, channelAuth, _ref68$makeAccessRequ, makeAccessRequest, _ref68$noAuth, noAuth, _ref68$noCache, noCache, authorization, path, httpClient;
3046
- return _regeneratorRuntime.wrap(function _callee39$(_context39) {
3047
- while (1) switch (_context39.prev = _context39.next) {
3182
+ var _ref71 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(_ref70) {
3183
+ var libraryId, objectId, versionHash, writeToken, partHash, rep, publicRep, call, _ref70$queryParams, queryParams, _ref70$service, service, _ref70$channelAuth, channelAuth, _ref70$makeAccessRequ, makeAccessRequest, _ref70$noAuth, noAuth, _ref70$noCache, noCache, authorization, path, httpClient;
3184
+ return _regeneratorRuntime.wrap(function _callee40$(_context40) {
3185
+ while (1) switch (_context40.prev = _context40.next) {
3048
3186
  case 0:
3049
- libraryId = _ref68.libraryId, objectId = _ref68.objectId, versionHash = _ref68.versionHash, writeToken = _ref68.writeToken, partHash = _ref68.partHash, rep = _ref68.rep, publicRep = _ref68.publicRep, call = _ref68.call, _ref68$queryParams = _ref68.queryParams, queryParams = _ref68$queryParams === void 0 ? {} : _ref68$queryParams, _ref68$service = _ref68.service, service = _ref68$service === void 0 ? "fabric" : _ref68$service, _ref68$channelAuth = _ref68.channelAuth, channelAuth = _ref68$channelAuth === void 0 ? false : _ref68$channelAuth, _ref68$makeAccessRequ = _ref68.makeAccessRequest, makeAccessRequest = _ref68$makeAccessRequ === void 0 ? false : _ref68$makeAccessRequ, _ref68$noAuth = _ref68.noAuth, noAuth = _ref68$noAuth === void 0 ? false : _ref68$noAuth, _ref68$noCache = _ref68.noCache, noCache = _ref68$noCache === void 0 ? false : _ref68$noCache;
3187
+ libraryId = _ref70.libraryId, objectId = _ref70.objectId, versionHash = _ref70.versionHash, writeToken = _ref70.writeToken, partHash = _ref70.partHash, rep = _ref70.rep, publicRep = _ref70.publicRep, call = _ref70.call, _ref70$queryParams = _ref70.queryParams, queryParams = _ref70$queryParams === void 0 ? {} : _ref70$queryParams, _ref70$service = _ref70.service, service = _ref70$service === void 0 ? "fabric" : _ref70$service, _ref70$channelAuth = _ref70.channelAuth, channelAuth = _ref70$channelAuth === void 0 ? false : _ref70$channelAuth, _ref70$makeAccessRequ = _ref70.makeAccessRequest, makeAccessRequest = _ref70$makeAccessRequ === void 0 ? false : _ref70$makeAccessRequ, _ref70$noAuth = _ref70.noAuth, noAuth = _ref70$noAuth === void 0 ? false : _ref70$noAuth, _ref70$noCache = _ref70.noCache, noCache = _ref70$noCache === void 0 ? false : _ref70$noCache;
3050
3188
  if (objectId || versionHash) {
3051
3189
  ValidateParameters({
3052
3190
  libraryId: libraryId,
@@ -3063,11 +3201,11 @@ exports.FabricUrl = /*#__PURE__*/function () {
3063
3201
  authorization.push(queryParams.authorization);
3064
3202
  }
3065
3203
  if (noAuth && queryParams.authorization) {
3066
- _context39.next = 12;
3204
+ _context40.next = 12;
3067
3205
  break;
3068
3206
  }
3069
- _context39.t0 = authorization;
3070
- _context39.next = 10;
3207
+ _context40.t0 = authorization;
3208
+ _context40.next = 10;
3071
3209
  return this.authClient.AuthorizationToken({
3072
3210
  libraryId: libraryId,
3073
3211
  objectId: objectId,
@@ -3078,23 +3216,23 @@ exports.FabricUrl = /*#__PURE__*/function () {
3078
3216
  noCache: noCache
3079
3217
  });
3080
3218
  case 10:
3081
- _context39.t1 = _context39.sent;
3082
- _context39.t0.push.call(_context39.t0, _context39.t1);
3219
+ _context40.t1 = _context40.sent;
3220
+ _context40.t0.push.call(_context40.t0, _context40.t1);
3083
3221
  case 12:
3084
3222
  // Clone queryParams to avoid modification of the original
3085
3223
  queryParams = _objectSpread(_objectSpread({}, queryParams), {}, {
3086
3224
  authorization: authorization.flat()
3087
3225
  });
3088
3226
  if (!((rep || publicRep) && objectId && !versionHash)) {
3089
- _context39.next = 17;
3227
+ _context40.next = 17;
3090
3228
  break;
3091
3229
  }
3092
- _context39.next = 16;
3230
+ _context40.next = 16;
3093
3231
  return this.LatestVersionHash({
3094
3232
  objectId: objectId
3095
3233
  });
3096
3234
  case 16:
3097
- versionHash = _context39.sent;
3235
+ versionHash = _context40.sent;
3098
3236
  case 17:
3099
3237
  path = "";
3100
3238
  if (libraryId) {
@@ -3120,18 +3258,18 @@ exports.FabricUrl = /*#__PURE__*/function () {
3120
3258
  } else if (service === "auth") {
3121
3259
  httpClient = this.AuthHttpClient;
3122
3260
  }
3123
- return _context39.abrupt("return", httpClient.URL({
3261
+ return _context40.abrupt("return", httpClient.URL({
3124
3262
  path: path,
3125
3263
  queryParams: queryParams
3126
3264
  }));
3127
3265
  case 23:
3128
3266
  case "end":
3129
- return _context39.stop();
3267
+ return _context40.stop();
3130
3268
  }
3131
- }, _callee39, this);
3269
+ }, _callee40, this);
3132
3270
  }));
3133
- return function (_x38) {
3134
- return _ref69.apply(this, arguments);
3271
+ return function (_x39) {
3272
+ return _ref71.apply(this, arguments);
3135
3273
  };
3136
3274
  }();
3137
3275
 
@@ -3152,19 +3290,19 @@ exports.FabricUrl = /*#__PURE__*/function () {
3152
3290
  * @returns {Promise<string>} - URL to the specified file with authorization token
3153
3291
  */
3154
3292
  exports.FileUrl = /*#__PURE__*/function () {
3155
- var _ref71 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(_ref70) {
3156
- var libraryId, objectId, versionHash, writeToken, filePath, _ref70$queryParams, queryParams, _ref70$noCache, noCache, path, authorizationToken, fileInfo, encrypted;
3157
- return _regeneratorRuntime.wrap(function _callee40$(_context40) {
3158
- while (1) switch (_context40.prev = _context40.next) {
3293
+ var _ref73 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(_ref72) {
3294
+ var libraryId, objectId, versionHash, writeToken, filePath, _ref72$queryParams, queryParams, _ref72$noCache, noCache, path, authorizationToken, fileInfo, encrypted;
3295
+ return _regeneratorRuntime.wrap(function _callee41$(_context41) {
3296
+ while (1) switch (_context41.prev = _context41.next) {
3159
3297
  case 0:
3160
- libraryId = _ref70.libraryId, objectId = _ref70.objectId, versionHash = _ref70.versionHash, writeToken = _ref70.writeToken, filePath = _ref70.filePath, _ref70$queryParams = _ref70.queryParams, queryParams = _ref70$queryParams === void 0 ? {} : _ref70$queryParams, _ref70$noCache = _ref70.noCache, noCache = _ref70$noCache === void 0 ? false : _ref70$noCache;
3298
+ libraryId = _ref72.libraryId, objectId = _ref72.objectId, versionHash = _ref72.versionHash, writeToken = _ref72.writeToken, filePath = _ref72.filePath, _ref72$queryParams = _ref72.queryParams, queryParams = _ref72$queryParams === void 0 ? {} : _ref72$queryParams, _ref72$noCache = _ref72.noCache, noCache = _ref72$noCache === void 0 ? false : _ref72$noCache;
3161
3299
  ValidateParameters({
3162
3300
  libraryId: libraryId,
3163
3301
  objectId: objectId,
3164
3302
  versionHash: versionHash
3165
3303
  });
3166
3304
  if (filePath) {
3167
- _context40.next = 4;
3305
+ _context41.next = 4;
3168
3306
  break;
3169
3307
  }
3170
3308
  throw "File path not specified";
@@ -3177,18 +3315,18 @@ exports.FileUrl = /*#__PURE__*/function () {
3177
3315
  } else {
3178
3316
  path = UrlJoin("q", versionHash);
3179
3317
  }
3180
- _context40.next = 8;
3318
+ _context41.next = 8;
3181
3319
  return this.authClient.AuthorizationToken({
3182
3320
  libraryId: libraryId,
3183
3321
  objectId: objectId,
3184
3322
  noCache: noCache
3185
3323
  });
3186
3324
  case 8:
3187
- authorizationToken = _context40.sent;
3325
+ authorizationToken = _context41.sent;
3188
3326
  queryParams = _objectSpread(_objectSpread({}, queryParams), {}, {
3189
3327
  authorization: authorizationToken
3190
3328
  });
3191
- _context40.next = 12;
3329
+ _context41.next = 12;
3192
3330
  return this.ContentObjectMetadata({
3193
3331
  libraryId: libraryId,
3194
3332
  objectId: objectId,
@@ -3197,7 +3335,7 @@ exports.FileUrl = /*#__PURE__*/function () {
3197
3335
  metadataSubtree: UrlJoin("files", filePath)
3198
3336
  });
3199
3337
  case 12:
3200
- fileInfo = _context40.sent;
3338
+ fileInfo = _context41.sent;
3201
3339
  encrypted = fileInfo && fileInfo["."].encryption && fileInfo["."].encryption.scheme === "cgck";
3202
3340
  if (encrypted) {
3203
3341
  path = UrlJoin(path, "rep", "files_download", filePath);
@@ -3205,18 +3343,18 @@ exports.FileUrl = /*#__PURE__*/function () {
3205
3343
  } else {
3206
3344
  path = UrlJoin(path, "files", filePath);
3207
3345
  }
3208
- return _context40.abrupt("return", this.HttpClient.URL({
3346
+ return _context41.abrupt("return", this.HttpClient.URL({
3209
3347
  path: path,
3210
3348
  queryParams: queryParams
3211
3349
  }));
3212
3350
  case 16:
3213
3351
  case "end":
3214
- return _context40.stop();
3352
+ return _context41.stop();
3215
3353
  }
3216
- }, _callee40, this);
3354
+ }, _callee41, this);
3217
3355
  }));
3218
- return function (_x39) {
3219
- return _ref71.apply(this, arguments);
3356
+ return function (_x40) {
3357
+ return _ref73.apply(this, arguments);
3220
3358
  };
3221
3359
  }();
3222
3360
 
@@ -3236,78 +3374,78 @@ exports.FileUrl = /*#__PURE__*/function () {
3236
3374
  * @returns {Promise<string | undefined>} - If the object has an image, will return a URL for that image.
3237
3375
  */
3238
3376
  exports.ContentObjectImageUrl = /*#__PURE__*/function () {
3239
- var _ref73 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(_ref72) {
3240
- var libraryId, objectId, versionHash, height, _ref72$imagePath, imagePath, imageMetadata, _queryParams;
3241
- return _regeneratorRuntime.wrap(function _callee41$(_context41) {
3242
- while (1) switch (_context41.prev = _context41.next) {
3377
+ var _ref75 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(_ref74) {
3378
+ var libraryId, objectId, versionHash, height, _ref74$imagePath, imagePath, imageMetadata, _queryParams;
3379
+ return _regeneratorRuntime.wrap(function _callee42$(_context42) {
3380
+ while (1) switch (_context42.prev = _context42.next) {
3243
3381
  case 0:
3244
- libraryId = _ref72.libraryId, objectId = _ref72.objectId, versionHash = _ref72.versionHash, height = _ref72.height, _ref72$imagePath = _ref72.imagePath, imagePath = _ref72$imagePath === void 0 ? "public/display_image" : _ref72$imagePath;
3382
+ libraryId = _ref74.libraryId, objectId = _ref74.objectId, versionHash = _ref74.versionHash, height = _ref74.height, _ref74$imagePath = _ref74.imagePath, imagePath = _ref74$imagePath === void 0 ? "public/display_image" : _ref74$imagePath;
3245
3383
  ValidateParameters({
3246
3384
  libraryId: libraryId,
3247
3385
  objectId: objectId,
3248
3386
  versionHash: versionHash
3249
3387
  });
3250
3388
  if (versionHash) {
3251
- _context41.next = 6;
3389
+ _context42.next = 6;
3252
3390
  break;
3253
3391
  }
3254
- _context41.next = 5;
3392
+ _context42.next = 5;
3255
3393
  return this.LatestVersionHash({
3256
3394
  objectId: objectId
3257
3395
  });
3258
3396
  case 5:
3259
- versionHash = _context41.sent;
3397
+ versionHash = _context42.sent;
3260
3398
  case 6:
3261
3399
  this.Log("Retrieving content object image url: ".concat(libraryId, " ").concat(objectId, " ").concat(versionHash));
3262
3400
  if (this.objectImageUrls[versionHash]) {
3263
- _context41.next = 26;
3401
+ _context42.next = 26;
3264
3402
  break;
3265
3403
  }
3266
- _context41.prev = 8;
3267
- _context41.next = 11;
3404
+ _context42.prev = 8;
3405
+ _context42.next = 11;
3268
3406
  return this.ContentObjectMetadata({
3269
3407
  versionHash: versionHash,
3270
3408
  metadataSubtree: imagePath
3271
3409
  });
3272
3410
  case 11:
3273
- imageMetadata = _context41.sent;
3411
+ imageMetadata = _context42.sent;
3274
3412
  if (imageMetadata) {
3275
- _context41.next = 15;
3413
+ _context42.next = 15;
3276
3414
  break;
3277
3415
  }
3278
3416
  this.Log("No image url set: ".concat(libraryId, " ").concat(objectId, " ").concat(versionHash));
3279
- return _context41.abrupt("return");
3417
+ return _context42.abrupt("return");
3280
3418
  case 15:
3281
- _context41.next = 21;
3419
+ _context42.next = 21;
3282
3420
  break;
3283
3421
  case 17:
3284
- _context41.prev = 17;
3285
- _context41.t0 = _context41["catch"](8);
3422
+ _context42.prev = 17;
3423
+ _context42.t0 = _context42["catch"](8);
3286
3424
  this.Log("Unable to query for image metadata: ".concat(libraryId, " ").concat(objectId, " ").concat(versionHash), true);
3287
- this.Log(_context41.t0, true);
3425
+ this.Log(_context42.t0, true);
3288
3426
  case 21:
3289
3427
  _queryParams = {};
3290
3428
  if (height && !isNaN(parseInt(height))) {
3291
3429
  _queryParams["height"] = parseInt(height);
3292
3430
  }
3293
- _context41.next = 25;
3431
+ _context42.next = 25;
3294
3432
  return this.LinkUrl({
3295
3433
  versionHash: versionHash,
3296
3434
  linkPath: imagePath,
3297
3435
  queryParams: _queryParams
3298
3436
  });
3299
3437
  case 25:
3300
- this.objectImageUrls[versionHash] = _context41.sent;
3438
+ this.objectImageUrls[versionHash] = _context42.sent;
3301
3439
  case 26:
3302
- return _context41.abrupt("return", this.objectImageUrls[versionHash]);
3440
+ return _context42.abrupt("return", this.objectImageUrls[versionHash]);
3303
3441
  case 27:
3304
3442
  case "end":
3305
- return _context41.stop();
3443
+ return _context42.stop();
3306
3444
  }
3307
- }, _callee41, this, [[8, 17]]);
3445
+ }, _callee42, this, [[8, 17]]);
3308
3446
  }));
3309
- return function (_x40) {
3310
- return _ref73.apply(this, arguments);
3447
+ return function (_x41) {
3448
+ return _ref75.apply(this, arguments);
3311
3449
  };
3312
3450
  }();
3313
3451
  var EmbedMediaTypes = {
@@ -3364,12 +3502,12 @@ var EmbedMediaTypes = {
3364
3502
  * @returns {Promise<string>} - Will return an embed URL
3365
3503
  */
3366
3504
  exports.EmbedUrl = /*#__PURE__*/function () {
3367
- var _ref75 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(_ref74) {
3368
- var objectId, versionHash, _ref74$duration, duration, _ref74$mediaType, mediaType, _ref74$options, options, controlsMap, embedUrl, networkInfo, networkName, permission, data, _i, _Object$keys, option, token;
3369
- return _regeneratorRuntime.wrap(function _callee42$(_context42) {
3370
- while (1) switch (_context42.prev = _context42.next) {
3505
+ var _ref77 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(_ref76) {
3506
+ var objectId, versionHash, _ref76$duration, duration, _ref76$mediaType, mediaType, _ref76$options, options, controlsMap, embedUrl, networkInfo, networkName, permission, data, _i, _Object$keys, option, token;
3507
+ return _regeneratorRuntime.wrap(function _callee43$(_context43) {
3508
+ while (1) switch (_context43.prev = _context43.next) {
3371
3509
  case 0:
3372
- objectId = _ref74.objectId, versionHash = _ref74.versionHash, _ref74$duration = _ref74.duration, duration = _ref74$duration === void 0 ? 86400000 : _ref74$duration, _ref74$mediaType = _ref74.mediaType, mediaType = _ref74$mediaType === void 0 ? "video" : _ref74$mediaType, _ref74$options = _ref74.options, options = _ref74$options === void 0 ? {} : _ref74$options;
3510
+ objectId = _ref76.objectId, versionHash = _ref76.versionHash, _ref76$duration = _ref76.duration, duration = _ref76$duration === void 0 ? 86400000 : _ref76$duration, _ref76$mediaType = _ref76.mediaType, mediaType = _ref76$mediaType === void 0 ? "video" : _ref76$mediaType, _ref76$options = _ref76.options, options = _ref76$options === void 0 ? {} : _ref76$options;
3373
3511
  if (versionHash) {
3374
3512
  ValidateVersion(versionHash);
3375
3513
  } else if (objectId) {
@@ -3385,17 +3523,17 @@ exports.EmbedUrl = /*#__PURE__*/function () {
3385
3523
  hideWithVolume: "hv"
3386
3524
  };
3387
3525
  embedUrl = new URL("https://embed.v3.contentfabric.io");
3388
- _context42.next = 7;
3526
+ _context43.next = 7;
3389
3527
  return this.NetworkInfo();
3390
3528
  case 7:
3391
- networkInfo = _context42.sent;
3529
+ networkInfo = _context43.sent;
3392
3530
  networkName = networkInfo.name === "demov3" ? "demo" : networkInfo.name === "test" && networkInfo.id === 955205 ? "testv4" : networkInfo.name;
3393
- _context42.next = 11;
3531
+ _context43.next = 11;
3394
3532
  return this.Permission({
3395
3533
  objectId: objectId ? objectId : this.utils.DecodeVersionHash(versionHash).objectId
3396
3534
  });
3397
3535
  case 11:
3398
- permission = _context42.sent;
3536
+ permission = _context43.sent;
3399
3537
  embedUrl.searchParams.set("p", "");
3400
3538
  embedUrl.searchParams.set("net", networkName);
3401
3539
  if (versionHash) {
@@ -3408,69 +3546,69 @@ exports.EmbedUrl = /*#__PURE__*/function () {
3408
3546
  _i = 0, _Object$keys = Object.keys(options);
3409
3547
  case 18:
3410
3548
  if (!(_i < _Object$keys.length)) {
3411
- _context42.next = 68;
3549
+ _context43.next = 68;
3412
3550
  break;
3413
3551
  }
3414
3552
  option = _Object$keys[_i];
3415
- _context42.t0 = option;
3416
- _context42.next = _context42.t0 === "accountWatermark" ? 23 : _context42.t0 === "autoplay" ? 25 : _context42.t0 === "capLevelToPlayerSize" ? 27 : _context42.t0 === "clipEnd" ? 29 : _context42.t0 === "clipStart" ? 31 : _context42.t0 === "controls" ? 33 : _context42.t0 === "description" ? 35 : _context42.t0 === "directLink" ? 37 : _context42.t0 === "linkPath" ? 39 : _context42.t0 === "loop" ? 41 : _context42.t0 === "muted" ? 43 : _context42.t0 === "offerings" ? 45 : _context42.t0 === "posterUrl" ? 47 : _context42.t0 === "protocols" ? 49 : _context42.t0 === "showShare" ? 51 : _context42.t0 === "showTitle" ? 53 : _context42.t0 === "title" ? 55 : _context42.t0 === "viewRecordKey" ? 57 : _context42.t0 === "useTicketCodes" ? 59 : 65;
3553
+ _context43.t0 = option;
3554
+ _context43.next = _context43.t0 === "accountWatermark" ? 23 : _context43.t0 === "autoplay" ? 25 : _context43.t0 === "capLevelToPlayerSize" ? 27 : _context43.t0 === "clipEnd" ? 29 : _context43.t0 === "clipStart" ? 31 : _context43.t0 === "controls" ? 33 : _context43.t0 === "description" ? 35 : _context43.t0 === "directLink" ? 37 : _context43.t0 === "linkPath" ? 39 : _context43.t0 === "loop" ? 41 : _context43.t0 === "muted" ? 43 : _context43.t0 === "offerings" ? 45 : _context43.t0 === "posterUrl" ? 47 : _context43.t0 === "protocols" ? 49 : _context43.t0 === "showShare" ? 51 : _context43.t0 === "showTitle" ? 53 : _context43.t0 === "title" ? 55 : _context43.t0 === "viewRecordKey" ? 57 : _context43.t0 === "useTicketCodes" ? 59 : 65;
3417
3555
  break;
3418
3556
  case 23:
3419
3557
  embedUrl.searchParams.set("awm", "");
3420
- return _context42.abrupt("break", 65);
3558
+ return _context43.abrupt("break", 65);
3421
3559
  case 25:
3422
3560
  embedUrl.searchParams.set("ap", "");
3423
- return _context42.abrupt("break", 65);
3561
+ return _context43.abrupt("break", 65);
3424
3562
  case 27:
3425
3563
  embedUrl.searchParams.set("cap", "");
3426
- return _context42.abrupt("break", 65);
3564
+ return _context43.abrupt("break", 65);
3427
3565
  case 29:
3428
3566
  embedUrl.searchParams.set("end", options.clipEnd);
3429
- return _context42.abrupt("break", 65);
3567
+ return _context43.abrupt("break", 65);
3430
3568
  case 31:
3431
3569
  embedUrl.searchParams.set("start", options.clipStart);
3432
- return _context42.abrupt("break", 65);
3570
+ return _context43.abrupt("break", 65);
3433
3571
  case 33:
3434
3572
  if (options.controls !== "hide") {
3435
3573
  embedUrl.searchParams.set("ct", controlsMap[options.controls]);
3436
3574
  }
3437
- return _context42.abrupt("break", 65);
3575
+ return _context43.abrupt("break", 65);
3438
3576
  case 35:
3439
3577
  data["og:description"] = options.description;
3440
- return _context42.abrupt("break", 65);
3578
+ return _context43.abrupt("break", 65);
3441
3579
  case 37:
3442
3580
  embedUrl.searchParams.set("dr", "");
3443
- return _context42.abrupt("break", 65);
3581
+ return _context43.abrupt("break", 65);
3444
3582
  case 39:
3445
3583
  embedUrl.searchParams.set("ln", this.utils.B64(options.linkPath));
3446
- return _context42.abrupt("break", 65);
3584
+ return _context43.abrupt("break", 65);
3447
3585
  case 41:
3448
3586
  embedUrl.searchParams.set("lp", "");
3449
- return _context42.abrupt("break", 65);
3587
+ return _context43.abrupt("break", 65);
3450
3588
  case 43:
3451
3589
  embedUrl.searchParams.set("m", "");
3452
- return _context42.abrupt("break", 65);
3590
+ return _context43.abrupt("break", 65);
3453
3591
  case 45:
3454
3592
  embedUrl.searchParams.set("off", options.offerings.join(","));
3455
- return _context42.abrupt("break", 65);
3593
+ return _context43.abrupt("break", 65);
3456
3594
  case 47:
3457
3595
  embedUrl.searchParams.set("pst", options.posterUrl);
3458
- return _context42.abrupt("break", 65);
3596
+ return _context43.abrupt("break", 65);
3459
3597
  case 49:
3460
3598
  embedUrl.searchParams.set("ptc", options.protocols.join(","));
3461
- return _context42.abrupt("break", 65);
3599
+ return _context43.abrupt("break", 65);
3462
3600
  case 51:
3463
3601
  embedUrl.searchParams.set("sh", "");
3464
- return _context42.abrupt("break", 65);
3602
+ return _context43.abrupt("break", 65);
3465
3603
  case 53:
3466
3604
  embedUrl.searchParams.set("st", "");
3467
- return _context42.abrupt("break", 65);
3605
+ return _context43.abrupt("break", 65);
3468
3606
  case 55:
3469
3607
  data["og:title"] = options.title;
3470
- return _context42.abrupt("break", 65);
3608
+ return _context43.abrupt("break", 65);
3471
3609
  case 57:
3472
3610
  embedUrl.searchParams.set("vrk", options.viewRecordKey);
3473
- return _context42.abrupt("break", 65);
3611
+ return _context43.abrupt("break", 65);
3474
3612
  case 59:
3475
3613
  embedUrl.searchParams.set("ptk", "");
3476
3614
  if (options.tenantId) {
@@ -3485,10 +3623,10 @@ exports.EmbedUrl = /*#__PURE__*/function () {
3485
3623
  if (options.ticketSubject) {
3486
3624
  embedUrl.searchParams.set("sbj", Buffer.from(options.ticketSubject).toString("base64"));
3487
3625
  }
3488
- return _context42.abrupt("break", 65);
3626
+ return _context43.abrupt("break", 65);
3489
3627
  case 65:
3490
3628
  _i++;
3491
- _context42.next = 18;
3629
+ _context43.next = 18;
3492
3630
  break;
3493
3631
  case 68:
3494
3632
  if (Object.keys(data).length > 0) {
@@ -3497,28 +3635,28 @@ exports.EmbedUrl = /*#__PURE__*/function () {
3497
3635
  })));
3498
3636
  }
3499
3637
  if (!["owner", "editable", "viewable"].includes(permission)) {
3500
- _context42.next = 74;
3638
+ _context43.next = 74;
3501
3639
  break;
3502
3640
  }
3503
- _context42.next = 72;
3641
+ _context43.next = 72;
3504
3642
  return this.CreateSignedToken({
3505
3643
  objectId: objectId,
3506
3644
  versionHash: versionHash,
3507
3645
  duration: duration
3508
3646
  });
3509
3647
  case 72:
3510
- token = _context42.sent;
3648
+ token = _context43.sent;
3511
3649
  embedUrl.searchParams.set("ath", token);
3512
3650
  case 74:
3513
- return _context42.abrupt("return", embedUrl.toString());
3651
+ return _context43.abrupt("return", embedUrl.toString());
3514
3652
  case 75:
3515
3653
  case "end":
3516
- return _context42.stop();
3654
+ return _context43.stop();
3517
3655
  }
3518
- }, _callee42, this);
3656
+ }, _callee43, this);
3519
3657
  }));
3520
- return function (_x41) {
3521
- return _ref75.apply(this, arguments);
3658
+ return function (_x42) {
3659
+ return _ref77.apply(this, arguments);
3522
3660
  };
3523
3661
  }();
3524
3662
 
@@ -3538,13 +3676,13 @@ exports.EmbedUrl = /*#__PURE__*/function () {
3538
3676
  * @returns {Promise<Object>} - Description of created object
3539
3677
  */
3540
3678
  exports.ContentObjectGraph = /*#__PURE__*/function () {
3541
- var _ref77 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(_ref76) {
3679
+ var _ref79 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(_ref78) {
3542
3680
  var _this10 = this;
3543
- var libraryId, objectId, versionHash, _ref76$autoUpdate, autoUpdate, select, path, errorInfo, cycles, info;
3544
- return _regeneratorRuntime.wrap(function _callee44$(_context44) {
3545
- while (1) switch (_context44.prev = _context44.next) {
3681
+ var libraryId, objectId, versionHash, _ref78$autoUpdate, autoUpdate, select, path, errorInfo, cycles, info;
3682
+ return _regeneratorRuntime.wrap(function _callee45$(_context45) {
3683
+ while (1) switch (_context45.prev = _context45.next) {
3546
3684
  case 0:
3547
- libraryId = _ref76.libraryId, objectId = _ref76.objectId, versionHash = _ref76.versionHash, _ref76$autoUpdate = _ref76.autoUpdate, autoUpdate = _ref76$autoUpdate === void 0 ? false : _ref76$autoUpdate, select = _ref76.select;
3685
+ libraryId = _ref78.libraryId, objectId = _ref78.objectId, versionHash = _ref78.versionHash, _ref78$autoUpdate = _ref78.autoUpdate, autoUpdate = _ref78$autoUpdate === void 0 ? false : _ref78$autoUpdate, select = _ref78.select;
3548
3686
  ValidateParameters({
3549
3687
  libraryId: libraryId,
3550
3688
  objectId: objectId,
@@ -3555,133 +3693,133 @@ exports.ContentObjectGraph = /*#__PURE__*/function () {
3555
3693
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
3556
3694
  }
3557
3695
  path = UrlJoin("q", versionHash || objectId, "links");
3558
- _context44.prev = 5;
3559
- _context44.t0 = this.utils;
3560
- _context44.t1 = this.HttpClient;
3561
- _context44.next = 10;
3696
+ _context45.prev = 5;
3697
+ _context45.t0 = this.utils;
3698
+ _context45.t1 = this.HttpClient;
3699
+ _context45.next = 10;
3562
3700
  return this.authClient.AuthorizationHeader({
3563
3701
  libraryId: libraryId,
3564
3702
  objectId: objectId,
3565
3703
  versionHash: versionHash
3566
3704
  });
3567
3705
  case 10:
3568
- _context44.t2 = _context44.sent;
3569
- _context44.t3 = {
3706
+ _context45.t2 = _context45.sent;
3707
+ _context45.t3 = {
3570
3708
  auto_update: autoUpdate,
3571
3709
  select: select
3572
3710
  };
3573
- _context44.t4 = path;
3574
- _context44.t5 = {
3575
- headers: _context44.t2,
3576
- queryParams: _context44.t3,
3711
+ _context45.t4 = path;
3712
+ _context45.t5 = {
3713
+ headers: _context45.t2,
3714
+ queryParams: _context45.t3,
3577
3715
  method: "GET",
3578
- path: _context44.t4
3716
+ path: _context45.t4
3579
3717
  };
3580
- _context44.t6 = _context44.t1.Request.call(_context44.t1, _context44.t5);
3581
- _context44.next = 17;
3582
- return _context44.t0.ResponseToJson.call(_context44.t0, _context44.t6);
3718
+ _context45.t6 = _context45.t1.Request.call(_context45.t1, _context45.t5);
3719
+ _context45.next = 17;
3720
+ return _context45.t0.ResponseToJson.call(_context45.t0, _context45.t6);
3583
3721
  case 17:
3584
- return _context44.abrupt("return", _context44.sent);
3722
+ return _context45.abrupt("return", _context45.sent);
3585
3723
  case 20:
3586
- _context44.prev = 20;
3587
- _context44.t7 = _context44["catch"](5);
3588
- _context44.prev = 22;
3589
- cycles = _context44.t7.body.errors[0].cause.cause.cause.cycle;
3724
+ _context45.prev = 20;
3725
+ _context45.t7 = _context45["catch"](5);
3726
+ _context45.prev = 22;
3727
+ cycles = _context45.t7.body.errors[0].cause.cause.cause.cycle;
3590
3728
  if (!(!cycles || cycles.length === 0)) {
3591
- _context44.next = 26;
3729
+ _context45.next = 26;
3592
3730
  break;
3593
3731
  }
3594
- throw _context44.t7;
3732
+ throw _context45.t7;
3595
3733
  case 26:
3596
3734
  info = {};
3597
- _context44.next = 29;
3735
+ _context45.next = 29;
3598
3736
  return Promise.all(cycles.map( /*#__PURE__*/function () {
3599
- var _ref78 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(cycleHash) {
3737
+ var _ref80 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(cycleHash) {
3600
3738
  var cycleId, name;
3601
- return _regeneratorRuntime.wrap(function _callee43$(_context43) {
3602
- while (1) switch (_context43.prev = _context43.next) {
3739
+ return _regeneratorRuntime.wrap(function _callee44$(_context44) {
3740
+ while (1) switch (_context44.prev = _context44.next) {
3603
3741
  case 0:
3604
3742
  if (!info[cycleHash]) {
3605
- _context43.next = 2;
3743
+ _context44.next = 2;
3606
3744
  break;
3607
3745
  }
3608
- return _context43.abrupt("return");
3746
+ return _context44.abrupt("return");
3609
3747
  case 2:
3610
3748
  cycleId = _this10.utils.DecodeVersionHash(cycleHash).objectId;
3611
- _context43.next = 5;
3749
+ _context44.next = 5;
3612
3750
  return _this10.ContentObjectMetadata({
3613
3751
  versionHash: cycleHash,
3614
3752
  metadataSubtree: "public/asset_metadata/display_title"
3615
3753
  });
3616
3754
  case 5:
3617
- _context43.t2 = _context43.sent;
3618
- if (_context43.t2) {
3619
- _context43.next = 10;
3755
+ _context44.t2 = _context44.sent;
3756
+ if (_context44.t2) {
3757
+ _context44.next = 10;
3620
3758
  break;
3621
3759
  }
3622
- _context43.next = 9;
3760
+ _context44.next = 9;
3623
3761
  return _this10.ContentObjectMetadata({
3624
3762
  versionHash: cycleHash,
3625
3763
  metadataSubtree: "public/name"
3626
3764
  });
3627
3765
  case 9:
3628
- _context43.t2 = _context43.sent;
3766
+ _context44.t2 = _context44.sent;
3629
3767
  case 10:
3630
- _context43.t1 = _context43.t2;
3631
- if (_context43.t1) {
3632
- _context43.next = 15;
3768
+ _context44.t1 = _context44.t2;
3769
+ if (_context44.t1) {
3770
+ _context44.next = 15;
3633
3771
  break;
3634
3772
  }
3635
- _context43.next = 14;
3773
+ _context44.next = 14;
3636
3774
  return _this10.ContentObjectMetadata({
3637
3775
  versionHash: cycleHash,
3638
3776
  metadataSubtree: "name"
3639
3777
  });
3640
3778
  case 14:
3641
- _context43.t1 = _context43.sent;
3779
+ _context44.t1 = _context44.sent;
3642
3780
  case 15:
3643
- _context43.t0 = _context43.t1;
3644
- if (_context43.t0) {
3645
- _context43.next = 18;
3781
+ _context44.t0 = _context44.t1;
3782
+ if (_context44.t0) {
3783
+ _context44.next = 18;
3646
3784
  break;
3647
3785
  }
3648
- _context43.t0 = cycleId;
3786
+ _context44.t0 = cycleId;
3649
3787
  case 18:
3650
- name = _context43.t0;
3788
+ name = _context44.t0;
3651
3789
  info[cycleHash] = {
3652
3790
  name: name,
3653
3791
  objectId: cycleId
3654
3792
  };
3655
3793
  case 20:
3656
3794
  case "end":
3657
- return _context43.stop();
3795
+ return _context44.stop();
3658
3796
  }
3659
- }, _callee43);
3797
+ }, _callee44);
3660
3798
  }));
3661
- return function (_x43) {
3662
- return _ref78.apply(this, arguments);
3799
+ return function (_x44) {
3800
+ return _ref80.apply(this, arguments);
3663
3801
  };
3664
3802
  }()));
3665
3803
  case 29:
3666
3804
  errorInfo = cycles.map(function (cycleHash) {
3667
3805
  return "".concat(info[cycleHash].name, " (").concat(info[cycleHash].objectId, ")");
3668
3806
  });
3669
- _context44.next = 35;
3807
+ _context45.next = 35;
3670
3808
  break;
3671
3809
  case 32:
3672
- _context44.prev = 32;
3673
- _context44.t8 = _context44["catch"](22);
3674
- throw _context44.t7;
3810
+ _context45.prev = 32;
3811
+ _context45.t8 = _context45["catch"](22);
3812
+ throw _context45.t7;
3675
3813
  case 35:
3676
3814
  throw new Error("Cycle found in links: ".concat(errorInfo.join(" -> ")));
3677
3815
  case 36:
3678
3816
  case "end":
3679
- return _context44.stop();
3817
+ return _context45.stop();
3680
3818
  }
3681
- }, _callee44, this, [[5, 20], [22, 32]]);
3819
+ }, _callee45, this, [[5, 20], [22, 32]]);
3682
3820
  }));
3683
- return function (_x42) {
3684
- return _ref77.apply(this, arguments);
3821
+ return function (_x43) {
3822
+ return _ref79.apply(this, arguments);
3685
3823
  };
3686
3824
  }();
3687
3825
 
@@ -3701,12 +3839,12 @@ exports.ContentObjectGraph = /*#__PURE__*/function () {
3701
3839
  * @returns {Promise<string>} - Version hash of the link's target
3702
3840
  */
3703
3841
  exports.LinkTarget = /*#__PURE__*/function () {
3704
- var _ref80 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(_ref79) {
3842
+ var _ref82 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(_ref81) {
3705
3843
  var libraryId, objectId, versionHash, writeToken, linkPath, authorizationToken, linkInfo, targetHash, subPath;
3706
- return _regeneratorRuntime.wrap(function _callee45$(_context45) {
3707
- while (1) switch (_context45.prev = _context45.next) {
3844
+ return _regeneratorRuntime.wrap(function _callee46$(_context46) {
3845
+ while (1) switch (_context46.prev = _context46.next) {
3708
3846
  case 0:
3709
- libraryId = _ref79.libraryId, objectId = _ref79.objectId, versionHash = _ref79.versionHash, writeToken = _ref79.writeToken, linkPath = _ref79.linkPath, authorizationToken = _ref79.authorizationToken, linkInfo = _ref79.linkInfo;
3847
+ libraryId = _ref81.libraryId, objectId = _ref81.objectId, versionHash = _ref81.versionHash, writeToken = _ref81.writeToken, linkPath = _ref81.linkPath, authorizationToken = _ref81.authorizationToken, linkInfo = _ref81.linkInfo;
3710
3848
  ValidateParameters({
3711
3849
  libraryId: libraryId,
3712
3850
  objectId: objectId,
@@ -3719,21 +3857,21 @@ exports.LinkTarget = /*#__PURE__*/function () {
3719
3857
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
3720
3858
  }
3721
3859
  if (!(writeToken && !libraryId)) {
3722
- _context45.next = 8;
3860
+ _context46.next = 8;
3723
3861
  break;
3724
3862
  }
3725
- _context45.next = 7;
3863
+ _context46.next = 7;
3726
3864
  return this.ContentObjectLibraryId({
3727
3865
  objectId: objectId
3728
3866
  });
3729
3867
  case 7:
3730
- libraryId = _context45.sent;
3868
+ libraryId = _context46.sent;
3731
3869
  case 8:
3732
3870
  if (linkInfo) {
3733
- _context45.next = 12;
3871
+ _context46.next = 12;
3734
3872
  break;
3735
3873
  }
3736
- _context45.next = 11;
3874
+ _context46.next = 11;
3737
3875
  return this.ContentObjectMetadata({
3738
3876
  libraryId: libraryId,
3739
3877
  objectId: objectId,
@@ -3746,10 +3884,10 @@ exports.LinkTarget = /*#__PURE__*/function () {
3746
3884
  authorizationToken: authorizationToken
3747
3885
  });
3748
3886
  case 11:
3749
- linkInfo = _context45.sent;
3887
+ linkInfo = _context46.sent;
3750
3888
  case 12:
3751
3889
  if (!(linkInfo && linkInfo["/"])) {
3752
- _context45.next = 27;
3890
+ _context46.next = 27;
3753
3891
  break;
3754
3892
  }
3755
3893
  /* For absolute links - extract the hash from the link itself. Otherwise use "container" */
@@ -3758,32 +3896,32 @@ exports.LinkTarget = /*#__PURE__*/function () {
3758
3896
  targetHash = linkInfo["."].container;
3759
3897
  }
3760
3898
  if (!targetHash) {
3761
- _context45.next = 19;
3899
+ _context46.next = 19;
3762
3900
  break;
3763
3901
  }
3764
- return _context45.abrupt("return", targetHash);
3902
+ return _context46.abrupt("return", targetHash);
3765
3903
  case 19:
3766
3904
  if (!versionHash) {
3767
- _context45.next = 21;
3905
+ _context46.next = 21;
3768
3906
  break;
3769
3907
  }
3770
- return _context45.abrupt("return", versionHash);
3908
+ return _context46.abrupt("return", versionHash);
3771
3909
  case 21:
3772
- _context45.t0 = versionHash;
3773
- if (_context45.t0) {
3774
- _context45.next = 26;
3910
+ _context46.t0 = versionHash;
3911
+ if (_context46.t0) {
3912
+ _context46.next = 26;
3775
3913
  break;
3776
3914
  }
3777
- _context45.next = 25;
3915
+ _context46.next = 25;
3778
3916
  return this.LatestVersionHash({
3779
3917
  objectId: objectId
3780
3918
  });
3781
3919
  case 25:
3782
- _context45.t0 = _context45.sent;
3920
+ _context46.t0 = _context46.sent;
3783
3921
  case 26:
3784
- return _context45.abrupt("return", _context45.t0);
3922
+ return _context46.abrupt("return", _context46.t0);
3785
3923
  case 27:
3786
- _context45.next = 29;
3924
+ _context46.next = 29;
3787
3925
  return this.ContentObjectMetadata({
3788
3926
  libraryId: libraryId,
3789
3927
  objectId: objectId,
@@ -3794,50 +3932,50 @@ exports.LinkTarget = /*#__PURE__*/function () {
3794
3932
  authorizationToken: authorizationToken
3795
3933
  });
3796
3934
  case 29:
3797
- linkInfo = _context45.sent;
3935
+ linkInfo = _context46.sent;
3798
3936
  if (!(!linkInfo || !linkInfo["."])) {
3799
- _context45.next = 49;
3937
+ _context46.next = 49;
3800
3938
  break;
3801
3939
  }
3802
3940
  if (!(_typeof(linkInfo) === "object")) {
3803
- _context45.next = 38;
3941
+ _context46.next = 38;
3804
3942
  break;
3805
3943
  }
3806
- _context45.t1 = versionHash;
3807
- if (_context45.t1) {
3808
- _context45.next = 37;
3944
+ _context46.t1 = versionHash;
3945
+ if (_context46.t1) {
3946
+ _context46.next = 37;
3809
3947
  break;
3810
3948
  }
3811
- _context45.next = 36;
3949
+ _context46.next = 36;
3812
3950
  return this.LatestVersionHash({
3813
3951
  objectId: objectId
3814
3952
  });
3815
3953
  case 36:
3816
- _context45.t1 = _context45.sent;
3954
+ _context46.t1 = _context46.sent;
3817
3955
  case 37:
3818
- return _context45.abrupt("return", _context45.t1);
3956
+ return _context46.abrupt("return", _context46.t1);
3819
3957
  case 38:
3820
3958
  // linkPath is not a direct link, but points to a literal value - back up one path element to find the container
3821
3959
  subPath = linkPath.split("/").slice(0, -1).join("/");
3822
3960
  if (subPath) {
3823
- _context45.next = 46;
3961
+ _context46.next = 46;
3824
3962
  break;
3825
3963
  }
3826
- _context45.t2 = versionHash;
3827
- if (_context45.t2) {
3828
- _context45.next = 45;
3964
+ _context46.t2 = versionHash;
3965
+ if (_context46.t2) {
3966
+ _context46.next = 45;
3829
3967
  break;
3830
3968
  }
3831
- _context45.next = 44;
3969
+ _context46.next = 44;
3832
3970
  return this.LatestVersionHash({
3833
3971
  objectId: objectId
3834
3972
  });
3835
3973
  case 44:
3836
- _context45.t2 = _context45.sent;
3974
+ _context46.t2 = _context46.sent;
3837
3975
  case 45:
3838
- return _context45.abrupt("return", _context45.t2);
3976
+ return _context46.abrupt("return", _context46.t2);
3839
3977
  case 46:
3840
- _context45.next = 48;
3978
+ _context46.next = 48;
3841
3979
  return this.ContentObjectMetadata({
3842
3980
  libraryId: libraryId,
3843
3981
  objectId: objectId,
@@ -3848,17 +3986,17 @@ exports.LinkTarget = /*#__PURE__*/function () {
3848
3986
  authorizationToken: authorizationToken
3849
3987
  });
3850
3988
  case 48:
3851
- linkInfo = _context45.sent;
3989
+ linkInfo = _context46.sent;
3852
3990
  case 49:
3853
- return _context45.abrupt("return", linkInfo["."].source);
3991
+ return _context46.abrupt("return", linkInfo["."].source);
3854
3992
  case 50:
3855
3993
  case "end":
3856
- return _context45.stop();
3994
+ return _context46.stop();
3857
3995
  }
3858
- }, _callee45, this);
3996
+ }, _callee46, this);
3859
3997
  }));
3860
- return function (_x44) {
3861
- return _ref80.apply(this, arguments);
3998
+ return function (_x45) {
3999
+ return _ref82.apply(this, arguments);
3862
4000
  };
3863
4001
  }();
3864
4002
 
@@ -3881,12 +4019,12 @@ exports.LinkTarget = /*#__PURE__*/function () {
3881
4019
  * @returns {Promise<string>} - URL to the specified file with authorization token
3882
4020
  */
3883
4021
  exports.LinkUrl = /*#__PURE__*/function () {
3884
- var _ref82 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(_ref81) {
3885
- var libraryId, objectId, versionHash, writeToken, linkPath, mimeType, authorizationToken, _ref81$queryParams, queryParams, _ref81$channelAuth, channelAuth, _ref81$noAuth, noAuth, path, authorization;
3886
- return _regeneratorRuntime.wrap(function _callee46$(_context46) {
3887
- while (1) switch (_context46.prev = _context46.next) {
4022
+ var _ref84 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(_ref83) {
4023
+ var libraryId, objectId, versionHash, writeToken, linkPath, mimeType, authorizationToken, _ref83$queryParams, queryParams, _ref83$channelAuth, channelAuth, _ref83$noAuth, noAuth, path, authorization;
4024
+ return _regeneratorRuntime.wrap(function _callee47$(_context47) {
4025
+ while (1) switch (_context47.prev = _context47.next) {
3888
4026
  case 0:
3889
- libraryId = _ref81.libraryId, objectId = _ref81.objectId, versionHash = _ref81.versionHash, writeToken = _ref81.writeToken, linkPath = _ref81.linkPath, mimeType = _ref81.mimeType, authorizationToken = _ref81.authorizationToken, _ref81$queryParams = _ref81.queryParams, queryParams = _ref81$queryParams === void 0 ? {} : _ref81$queryParams, _ref81$channelAuth = _ref81.channelAuth, channelAuth = _ref81$channelAuth === void 0 ? false : _ref81$channelAuth, _ref81$noAuth = _ref81.noAuth, noAuth = _ref81$noAuth === void 0 ? false : _ref81$noAuth;
4027
+ libraryId = _ref83.libraryId, objectId = _ref83.objectId, versionHash = _ref83.versionHash, writeToken = _ref83.writeToken, linkPath = _ref83.linkPath, mimeType = _ref83.mimeType, authorizationToken = _ref83.authorizationToken, _ref83$queryParams = _ref83.queryParams, queryParams = _ref83$queryParams === void 0 ? {} : _ref83$queryParams, _ref83$channelAuth = _ref83.channelAuth, channelAuth = _ref83$channelAuth === void 0 ? false : _ref83$channelAuth, _ref83$noAuth = _ref83.noAuth, noAuth = _ref83$noAuth === void 0 ? false : _ref83$noAuth;
3890
4028
  ValidateParameters({
3891
4029
  libraryId: libraryId,
3892
4030
  objectId: objectId,
@@ -3896,7 +4034,7 @@ exports.LinkUrl = /*#__PURE__*/function () {
3896
4034
  ValidateWriteToken(writeToken);
3897
4035
  }
3898
4036
  if (linkPath) {
3899
- _context46.next = 5;
4037
+ _context47.next = 5;
3900
4038
  break;
3901
4039
  }
3902
4040
  throw Error("Link path not specified");
@@ -3910,8 +4048,8 @@ exports.LinkUrl = /*#__PURE__*/function () {
3910
4048
  path = UrlJoin("q", versionHash, "meta", linkPath);
3911
4049
  }
3912
4050
  authorization = [authorizationToken];
3913
- _context46.t0 = authorization;
3914
- _context46.next = 11;
4051
+ _context47.t0 = authorization;
4052
+ _context47.next = 11;
3915
4053
  return this.MetadataAuth({
3916
4054
  libraryId: libraryId,
3917
4055
  objectId: objectId,
@@ -3921,8 +4059,8 @@ exports.LinkUrl = /*#__PURE__*/function () {
3921
4059
  noAuth: noAuth
3922
4060
  });
3923
4061
  case 11:
3924
- _context46.t1 = _context46.sent;
3925
- _context46.t0.push.call(_context46.t0, _context46.t1);
4062
+ _context47.t1 = _context47.sent;
4063
+ _context47.t0.push.call(_context47.t0, _context47.t1);
3926
4064
  if (queryParams.authorization) {
3927
4065
  authorization.push(queryParams.authorization);
3928
4066
  }
@@ -3935,18 +4073,18 @@ exports.LinkUrl = /*#__PURE__*/function () {
3935
4073
  if (mimeType) {
3936
4074
  queryParams["header-accept"] = mimeType;
3937
4075
  }
3938
- return _context46.abrupt("return", this.HttpClient.URL({
4076
+ return _context47.abrupt("return", this.HttpClient.URL({
3939
4077
  path: path,
3940
4078
  queryParams: queryParams
3941
4079
  }));
3942
4080
  case 17:
3943
4081
  case "end":
3944
- return _context46.stop();
4082
+ return _context47.stop();
3945
4083
  }
3946
- }, _callee46, this);
4084
+ }, _callee47, this);
3947
4085
  }));
3948
- return function (_x45) {
3949
- return _ref82.apply(this, arguments);
4086
+ return function (_x46) {
4087
+ return _ref84.apply(this, arguments);
3950
4088
  };
3951
4089
  }();
3952
4090
 
@@ -3965,13 +4103,13 @@ exports.LinkUrl = /*#__PURE__*/function () {
3965
4103
  * @param {boolean=} channelAuth=false - If specified, state channel authorization will be performed instead of access request authorization
3966
4104
  */
3967
4105
  exports.LinkData = /*#__PURE__*/function () {
3968
- var _ref84 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(_ref83) {
3969
- var libraryId, objectId, versionHash, writeToken, linkPath, _ref83$queryParams, queryParams, _ref83$format, format, channelAuth, linkUrl;
3970
- return _regeneratorRuntime.wrap(function _callee47$(_context47) {
3971
- while (1) switch (_context47.prev = _context47.next) {
4106
+ var _ref86 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(_ref85) {
4107
+ var libraryId, objectId, versionHash, writeToken, linkPath, _ref85$queryParams, queryParams, _ref85$format, format, channelAuth, linkUrl;
4108
+ return _regeneratorRuntime.wrap(function _callee48$(_context48) {
4109
+ while (1) switch (_context48.prev = _context48.next) {
3972
4110
  case 0:
3973
- libraryId = _ref83.libraryId, objectId = _ref83.objectId, versionHash = _ref83.versionHash, writeToken = _ref83.writeToken, linkPath = _ref83.linkPath, _ref83$queryParams = _ref83.queryParams, queryParams = _ref83$queryParams === void 0 ? {} : _ref83$queryParams, _ref83$format = _ref83.format, format = _ref83$format === void 0 ? "json" : _ref83$format, channelAuth = _ref83.channelAuth;
3974
- _context47.next = 3;
4111
+ libraryId = _ref85.libraryId, objectId = _ref85.objectId, versionHash = _ref85.versionHash, writeToken = _ref85.writeToken, linkPath = _ref85.linkPath, _ref85$queryParams = _ref85.queryParams, queryParams = _ref85$queryParams === void 0 ? {} : _ref85$queryParams, _ref85$format = _ref85.format, format = _ref85$format === void 0 ? "json" : _ref85$format, channelAuth = _ref85.channelAuth;
4112
+ _context48.next = 3;
3975
4113
  return this.LinkUrl({
3976
4114
  libraryId: libraryId,
3977
4115
  objectId: objectId,
@@ -3982,39 +4120,39 @@ exports.LinkData = /*#__PURE__*/function () {
3982
4120
  channelAuth: channelAuth
3983
4121
  });
3984
4122
  case 3:
3985
- linkUrl = _context47.sent;
3986
- _context47.t0 = this.utils;
3987
- _context47.t1 = format;
3988
- _context47.next = 8;
4123
+ linkUrl = _context48.sent;
4124
+ _context48.t0 = this.utils;
4125
+ _context48.t1 = format;
4126
+ _context48.next = 8;
3989
4127
  return HttpClient.Fetch(linkUrl);
3990
4128
  case 8:
3991
- _context47.t2 = _context47.sent;
3992
- return _context47.abrupt("return", _context47.t0.ResponseToFormat.call(_context47.t0, _context47.t1, _context47.t2));
4129
+ _context48.t2 = _context48.sent;
4130
+ return _context48.abrupt("return", _context48.t0.ResponseToFormat.call(_context48.t0, _context48.t1, _context48.t2));
3993
4131
  case 10:
3994
4132
  case "end":
3995
- return _context47.stop();
4133
+ return _context48.stop();
3996
4134
  }
3997
- }, _callee47, this);
4135
+ }, _callee48, this);
3998
4136
  }));
3999
- return function (_x46) {
4000
- return _ref84.apply(this, arguments);
4137
+ return function (_x47) {
4138
+ return _ref86.apply(this, arguments);
4001
4139
  };
4002
4140
  }();
4003
4141
 
4004
4142
  /* Encryption */
4005
4143
 
4006
4144
  exports.CreateEncryptionConk = /*#__PURE__*/function () {
4007
- var _ref86 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(_ref85) {
4008
- var libraryId, objectId, versionHash, writeToken, _ref85$createKMSConk, createKMSConk, capKey, existingUserCap, kmsAddress, kmsPublicKey, kmsCapKey, existingKMSCap;
4009
- return _regeneratorRuntime.wrap(function _callee48$(_context48) {
4010
- while (1) switch (_context48.prev = _context48.next) {
4145
+ var _ref88 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(_ref87) {
4146
+ var libraryId, objectId, versionHash, writeToken, _ref87$createKMSConk, createKMSConk, capKey, existingUserCap, kmsAddress, kmsPublicKey, kmsCapKey, existingKMSCap;
4147
+ return _regeneratorRuntime.wrap(function _callee49$(_context49) {
4148
+ while (1) switch (_context49.prev = _context49.next) {
4011
4149
  case 0:
4012
- libraryId = _ref85.libraryId, objectId = _ref85.objectId, versionHash = _ref85.versionHash, writeToken = _ref85.writeToken, _ref85$createKMSConk = _ref85.createKMSConk, createKMSConk = _ref85$createKMSConk === void 0 ? true : _ref85$createKMSConk;
4150
+ libraryId = _ref87.libraryId, objectId = _ref87.objectId, versionHash = _ref87.versionHash, writeToken = _ref87.writeToken, _ref87$createKMSConk = _ref87.createKMSConk, createKMSConk = _ref87$createKMSConk === void 0 ? true : _ref87$createKMSConk;
4013
4151
  if (!this.signer.remoteSigner) {
4014
- _context48.next = 3;
4152
+ _context49.next = 3;
4015
4153
  break;
4016
4154
  }
4017
- return _context48.abrupt("return");
4155
+ return _context49.abrupt("return");
4018
4156
  case 3:
4019
4157
  ValidateParameters({
4020
4158
  libraryId: libraryId,
@@ -4026,18 +4164,18 @@ exports.CreateEncryptionConk = /*#__PURE__*/function () {
4026
4164
  objectId = client.DecodeVersionHash(versionHash).objectId;
4027
4165
  }
4028
4166
  if (libraryId) {
4029
- _context48.next = 10;
4167
+ _context49.next = 10;
4030
4168
  break;
4031
4169
  }
4032
- _context48.next = 9;
4170
+ _context49.next = 9;
4033
4171
  return this.ContentObjectLibraryId({
4034
4172
  objectId: objectId
4035
4173
  });
4036
4174
  case 9:
4037
- libraryId = _context48.sent;
4175
+ libraryId = _context49.sent;
4038
4176
  case 10:
4039
4177
  capKey = "eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address));
4040
- _context48.next = 13;
4178
+ _context49.next = 13;
4041
4179
  return this.ContentObjectMetadata({
4042
4180
  libraryId: libraryId,
4043
4181
  objectId: objectId,
@@ -4045,63 +4183,63 @@ exports.CreateEncryptionConk = /*#__PURE__*/function () {
4045
4183
  metadataSubtree: capKey
4046
4184
  });
4047
4185
  case 13:
4048
- existingUserCap = _context48.sent;
4186
+ existingUserCap = _context49.sent;
4049
4187
  if (!existingUserCap) {
4050
- _context48.next = 20;
4188
+ _context49.next = 20;
4051
4189
  break;
4052
4190
  }
4053
- _context48.next = 17;
4191
+ _context49.next = 17;
4054
4192
  return this.Crypto.DecryptCap(existingUserCap, this.signer._signingKey().privateKey);
4055
4193
  case 17:
4056
- this.encryptionConks[objectId] = _context48.sent;
4057
- _context48.next = 34;
4194
+ this.encryptionConks[objectId] = _context49.sent;
4195
+ _context49.next = 34;
4058
4196
  break;
4059
4197
  case 20:
4060
- _context48.next = 22;
4198
+ _context49.next = 22;
4061
4199
  return this.Crypto.GeneratePrimaryConk({
4062
4200
  spaceId: this.contentSpaceId,
4063
4201
  objectId: objectId
4064
4202
  });
4065
4203
  case 22:
4066
- this.encryptionConks[objectId] = _context48.sent;
4067
- _context48.t0 = this;
4068
- _context48.t1 = libraryId;
4069
- _context48.t2 = objectId;
4070
- _context48.t3 = writeToken;
4071
- _context48.t4 = capKey;
4072
- _context48.next = 30;
4204
+ this.encryptionConks[objectId] = _context49.sent;
4205
+ _context49.t0 = this;
4206
+ _context49.t1 = libraryId;
4207
+ _context49.t2 = objectId;
4208
+ _context49.t3 = writeToken;
4209
+ _context49.t4 = capKey;
4210
+ _context49.next = 30;
4073
4211
  return this.Crypto.EncryptConk(this.encryptionConks[objectId], this.signer._signingKey().publicKey);
4074
4212
  case 30:
4075
- _context48.t5 = _context48.sent;
4076
- _context48.t6 = {
4077
- libraryId: _context48.t1,
4078
- objectId: _context48.t2,
4079
- writeToken: _context48.t3,
4080
- metadataSubtree: _context48.t4,
4081
- metadata: _context48.t5
4213
+ _context49.t5 = _context49.sent;
4214
+ _context49.t6 = {
4215
+ libraryId: _context49.t1,
4216
+ objectId: _context49.t2,
4217
+ writeToken: _context49.t3,
4218
+ metadataSubtree: _context49.t4,
4219
+ metadata: _context49.t5
4082
4220
  };
4083
- _context48.next = 34;
4084
- return _context48.t0.ReplaceMetadata.call(_context48.t0, _context48.t6);
4221
+ _context49.next = 34;
4222
+ return _context49.t0.ReplaceMetadata.call(_context49.t0, _context49.t6);
4085
4223
  case 34:
4086
4224
  if (!createKMSConk) {
4087
- _context48.next = 64;
4225
+ _context49.next = 64;
4088
4226
  break;
4089
4227
  }
4090
- _context48.prev = 35;
4091
- _context48.next = 38;
4228
+ _context49.prev = 35;
4229
+ _context49.next = 38;
4092
4230
  return this.authClient.KMSAddress({
4093
4231
  objectId: objectId
4094
4232
  });
4095
4233
  case 38:
4096
- kmsAddress = _context48.sent;
4097
- _context48.next = 41;
4234
+ kmsAddress = _context49.sent;
4235
+ _context49.next = 41;
4098
4236
  return this.authClient.KMSInfo({
4099
4237
  objectId: objectId
4100
4238
  });
4101
4239
  case 41:
4102
- kmsPublicKey = _context48.sent.publicKey;
4240
+ kmsPublicKey = _context49.sent.publicKey;
4103
4241
  kmsCapKey = "eluv.caps.ikms".concat(this.utils.AddressToHash(kmsAddress));
4104
- _context48.next = 45;
4242
+ _context49.next = 45;
4105
4243
  return this.ContentObjectMetadata({
4106
4244
  libraryId: libraryId,
4107
4245
  // Cap may only exist in draft
@@ -4110,49 +4248,49 @@ exports.CreateEncryptionConk = /*#__PURE__*/function () {
4110
4248
  metadataSubtree: kmsCapKey
4111
4249
  });
4112
4250
  case 45:
4113
- existingKMSCap = _context48.sent;
4251
+ existingKMSCap = _context49.sent;
4114
4252
  if (existingKMSCap) {
4115
- _context48.next = 58;
4253
+ _context49.next = 58;
4116
4254
  break;
4117
4255
  }
4118
- _context48.t7 = this;
4119
- _context48.t8 = libraryId;
4120
- _context48.t9 = objectId;
4121
- _context48.t10 = writeToken;
4122
- _context48.t11 = kmsCapKey;
4123
- _context48.next = 54;
4256
+ _context49.t7 = this;
4257
+ _context49.t8 = libraryId;
4258
+ _context49.t9 = objectId;
4259
+ _context49.t10 = writeToken;
4260
+ _context49.t11 = kmsCapKey;
4261
+ _context49.next = 54;
4124
4262
  return this.Crypto.EncryptConk(this.encryptionConks[objectId], kmsPublicKey);
4125
4263
  case 54:
4126
- _context48.t12 = _context48.sent;
4127
- _context48.t13 = {
4128
- libraryId: _context48.t8,
4129
- objectId: _context48.t9,
4130
- writeToken: _context48.t10,
4131
- metadataSubtree: _context48.t11,
4132
- metadata: _context48.t12
4264
+ _context49.t12 = _context49.sent;
4265
+ _context49.t13 = {
4266
+ libraryId: _context49.t8,
4267
+ objectId: _context49.t9,
4268
+ writeToken: _context49.t10,
4269
+ metadataSubtree: _context49.t11,
4270
+ metadata: _context49.t12
4133
4271
  };
4134
- _context48.next = 58;
4135
- return _context48.t7.ReplaceMetadata.call(_context48.t7, _context48.t13);
4272
+ _context49.next = 58;
4273
+ return _context49.t7.ReplaceMetadata.call(_context49.t7, _context49.t13);
4136
4274
  case 58:
4137
- _context48.next = 64;
4275
+ _context49.next = 64;
4138
4276
  break;
4139
4277
  case 60:
4140
- _context48.prev = 60;
4141
- _context48.t14 = _context48["catch"](35);
4278
+ _context49.prev = 60;
4279
+ _context49.t14 = _context49["catch"](35);
4142
4280
  // eslint-disable-next-line no-console
4143
4281
  console.error("Failed to create encryption cap for KMS:");
4144
4282
  // eslint-disable-next-line no-console
4145
- console.error(_context48.t14);
4283
+ console.error(_context49.t14);
4146
4284
  case 64:
4147
- return _context48.abrupt("return", this.encryptionConks[objectId]);
4285
+ return _context49.abrupt("return", this.encryptionConks[objectId]);
4148
4286
  case 65:
4149
4287
  case "end":
4150
- return _context48.stop();
4288
+ return _context49.stop();
4151
4289
  }
4152
- }, _callee48, this, [[35, 60]]);
4290
+ }, _callee49, this, [[35, 60]]);
4153
4291
  }));
4154
- return function (_x47) {
4155
- return _ref86.apply(this, arguments);
4292
+ return function (_x48) {
4293
+ return _ref88.apply(this, arguments);
4156
4294
  };
4157
4295
  }();
4158
4296
 
@@ -4174,12 +4312,12 @@ exports.CreateEncryptionConk = /*#__PURE__*/function () {
4174
4312
  * @return Promise<Object> - The encryption conk for the object
4175
4313
  */
4176
4314
  exports.EncryptionConk = /*#__PURE__*/function () {
4177
- var _ref88 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(_ref87) {
4178
- var libraryId, objectId, versionHash, writeToken, _ref87$download, download, owner, ownerCapKey, ownerCap, capKey, existingUserCap;
4179
- return _regeneratorRuntime.wrap(function _callee49$(_context49) {
4180
- while (1) switch (_context49.prev = _context49.next) {
4315
+ var _ref90 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(_ref89) {
4316
+ var libraryId, objectId, versionHash, writeToken, _ref89$download, download, owner, ownerCapKey, ownerCap, capKey, existingUserCap;
4317
+ return _regeneratorRuntime.wrap(function _callee50$(_context50) {
4318
+ while (1) switch (_context50.prev = _context50.next) {
4181
4319
  case 0:
4182
- libraryId = _ref87.libraryId, objectId = _ref87.objectId, versionHash = _ref87.versionHash, writeToken = _ref87.writeToken, _ref87$download = _ref87.download, download = _ref87$download === void 0 ? false : _ref87$download;
4320
+ libraryId = _ref89.libraryId, objectId = _ref89.objectId, versionHash = _ref89.versionHash, writeToken = _ref89.writeToken, _ref89$download = _ref89.download, download = _ref89$download === void 0 ? false : _ref89$download;
4183
4321
  ValidateParameters({
4184
4322
  libraryId: libraryId,
4185
4323
  objectId: objectId,
@@ -4191,14 +4329,14 @@ exports.EncryptionConk = /*#__PURE__*/function () {
4191
4329
  if (!objectId) {
4192
4330
  objectId = client.DecodeVersionHash(versionHash).objectId;
4193
4331
  }
4194
- _context49.next = 6;
4332
+ _context50.next = 6;
4195
4333
  return this.authClient.Owner({
4196
4334
  id: objectId
4197
4335
  });
4198
4336
  case 6:
4199
- owner = _context49.sent;
4337
+ owner = _context50.sent;
4200
4338
  ownerCapKey = "eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address));
4201
- _context49.next = 10;
4339
+ _context50.next = 10;
4202
4340
  return this.ContentObjectMetadata({
4203
4341
  libraryId: libraryId,
4204
4342
  objectId: objectId,
@@ -4206,39 +4344,39 @@ exports.EncryptionConk = /*#__PURE__*/function () {
4206
4344
  metadataSubtree: ownerCapKey
4207
4345
  });
4208
4346
  case 10:
4209
- ownerCap = _context49.sent;
4347
+ ownerCap = _context50.sent;
4210
4348
  if (!(!this.utils.EqualAddress(owner, this.signer.address) && !ownerCap)) {
4211
- _context49.next = 21;
4349
+ _context50.next = 21;
4212
4350
  break;
4213
4351
  }
4214
4352
  if (!download) {
4215
- _context49.next = 18;
4353
+ _context50.next = 18;
4216
4354
  break;
4217
4355
  }
4218
- _context49.next = 15;
4356
+ _context50.next = 15;
4219
4357
  return this.authClient.ReEncryptionConk({
4220
4358
  libraryId: libraryId,
4221
4359
  objectId: objectId,
4222
4360
  versionHash: versionHash
4223
4361
  });
4224
4362
  case 15:
4225
- return _context49.abrupt("return", _context49.sent);
4363
+ return _context50.abrupt("return", _context50.sent);
4226
4364
  case 18:
4227
- _context49.next = 20;
4365
+ _context50.next = 20;
4228
4366
  return this.authClient.EncryptionConk({
4229
4367
  libraryId: libraryId,
4230
4368
  objectId: objectId,
4231
4369
  versionHash: versionHash
4232
4370
  });
4233
4371
  case 20:
4234
- return _context49.abrupt("return", _context49.sent);
4372
+ return _context50.abrupt("return", _context50.sent);
4235
4373
  case 21:
4236
4374
  if (this.encryptionConks[objectId]) {
4237
- _context49.next = 38;
4375
+ _context50.next = 38;
4238
4376
  break;
4239
4377
  }
4240
4378
  capKey = "eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address));
4241
- _context49.next = 25;
4379
+ _context50.next = 25;
4242
4380
  return this.ContentObjectMetadata({
4243
4381
  libraryId: libraryId,
4244
4382
  objectId: objectId,
@@ -4248,23 +4386,23 @@ exports.EncryptionConk = /*#__PURE__*/function () {
4248
4386
  metadataSubtree: capKey
4249
4387
  });
4250
4388
  case 25:
4251
- existingUserCap = _context49.sent;
4389
+ existingUserCap = _context50.sent;
4252
4390
  if (!existingUserCap) {
4253
- _context49.next = 32;
4391
+ _context50.next = 32;
4254
4392
  break;
4255
4393
  }
4256
- _context49.next = 29;
4394
+ _context50.next = 29;
4257
4395
  return this.Crypto.DecryptCap(existingUserCap, this.signer._signingKey().privateKey);
4258
4396
  case 29:
4259
- this.encryptionConks[objectId] = _context49.sent;
4260
- _context49.next = 38;
4397
+ this.encryptionConks[objectId] = _context50.sent;
4398
+ _context50.next = 38;
4261
4399
  break;
4262
4400
  case 32:
4263
4401
  if (!writeToken) {
4264
- _context49.next = 37;
4402
+ _context50.next = 37;
4265
4403
  break;
4266
4404
  }
4267
- _context49.next = 35;
4405
+ _context50.next = 35;
4268
4406
  return this.CreateEncryptionConk({
4269
4407
  libraryId: libraryId,
4270
4408
  objectId: objectId,
@@ -4273,20 +4411,20 @@ exports.EncryptionConk = /*#__PURE__*/function () {
4273
4411
  createKMSConk: false
4274
4412
  });
4275
4413
  case 35:
4276
- _context49.next = 38;
4414
+ _context50.next = 38;
4277
4415
  break;
4278
4416
  case 37:
4279
4417
  throw "No encryption conk present for " + objectId;
4280
4418
  case 38:
4281
- return _context49.abrupt("return", this.encryptionConks[objectId]);
4419
+ return _context50.abrupt("return", this.encryptionConks[objectId]);
4282
4420
  case 39:
4283
4421
  case "end":
4284
- return _context49.stop();
4422
+ return _context50.stop();
4285
4423
  }
4286
- }, _callee49, this);
4424
+ }, _callee50, this);
4287
4425
  }));
4288
- return function (_x48) {
4289
- return _ref88.apply(this, arguments);
4426
+ return function (_x49) {
4427
+ return _ref90.apply(this, arguments);
4290
4428
  };
4291
4429
  }();
4292
4430
 
@@ -4304,37 +4442,37 @@ exports.EncryptionConk = /*#__PURE__*/function () {
4304
4442
  * @return {Promise<ArrayBuffer>}
4305
4443
  */
4306
4444
  exports.Encrypt = /*#__PURE__*/function () {
4307
- var _ref90 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(_ref89) {
4445
+ var _ref92 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(_ref91) {
4308
4446
  var libraryId, objectId, writeToken, chunk, conk, data;
4309
- return _regeneratorRuntime.wrap(function _callee50$(_context50) {
4310
- while (1) switch (_context50.prev = _context50.next) {
4447
+ return _regeneratorRuntime.wrap(function _callee51$(_context51) {
4448
+ while (1) switch (_context51.prev = _context51.next) {
4311
4449
  case 0:
4312
- libraryId = _ref89.libraryId, objectId = _ref89.objectId, writeToken = _ref89.writeToken, chunk = _ref89.chunk;
4450
+ libraryId = _ref91.libraryId, objectId = _ref91.objectId, writeToken = _ref91.writeToken, chunk = _ref91.chunk;
4313
4451
  ValidateParameters({
4314
4452
  libraryId: libraryId,
4315
4453
  objectId: objectId
4316
4454
  });
4317
- _context50.next = 4;
4455
+ _context51.next = 4;
4318
4456
  return this.EncryptionConk({
4319
4457
  libraryId: libraryId,
4320
4458
  objectId: objectId,
4321
4459
  writeToken: writeToken
4322
4460
  });
4323
4461
  case 4:
4324
- conk = _context50.sent;
4325
- _context50.next = 7;
4462
+ conk = _context51.sent;
4463
+ _context51.next = 7;
4326
4464
  return this.Crypto.Encrypt(conk, chunk);
4327
4465
  case 7:
4328
- data = _context50.sent;
4329
- return _context50.abrupt("return", data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength));
4466
+ data = _context51.sent;
4467
+ return _context51.abrupt("return", data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength));
4330
4468
  case 9:
4331
4469
  case "end":
4332
- return _context50.stop();
4470
+ return _context51.stop();
4333
4471
  }
4334
- }, _callee50, this);
4472
+ }, _callee51, this);
4335
4473
  }));
4336
- return function (_x49) {
4337
- return _ref90.apply(this, arguments);
4474
+ return function (_x50) {
4475
+ return _ref92.apply(this, arguments);
4338
4476
  };
4339
4477
  }();
4340
4478
 
@@ -4352,17 +4490,17 @@ exports.Encrypt = /*#__PURE__*/function () {
4352
4490
  * @return {Promise<ArrayBuffer>}
4353
4491
  */
4354
4492
  exports.Decrypt = /*#__PURE__*/function () {
4355
- var _ref92 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(_ref91) {
4493
+ var _ref94 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(_ref93) {
4356
4494
  var libraryId, objectId, writeToken, chunk, conk, data;
4357
- return _regeneratorRuntime.wrap(function _callee51$(_context51) {
4358
- while (1) switch (_context51.prev = _context51.next) {
4495
+ return _regeneratorRuntime.wrap(function _callee52$(_context52) {
4496
+ while (1) switch (_context52.prev = _context52.next) {
4359
4497
  case 0:
4360
- libraryId = _ref91.libraryId, objectId = _ref91.objectId, writeToken = _ref91.writeToken, chunk = _ref91.chunk;
4498
+ libraryId = _ref93.libraryId, objectId = _ref93.objectId, writeToken = _ref93.writeToken, chunk = _ref93.chunk;
4361
4499
  ValidateParameters({
4362
4500
  libraryId: libraryId,
4363
4501
  objectId: objectId
4364
4502
  });
4365
- _context51.next = 4;
4503
+ _context52.next = 4;
4366
4504
  return this.EncryptionConk({
4367
4505
  libraryId: libraryId,
4368
4506
  objectId: objectId,
@@ -4370,20 +4508,20 @@ exports.Decrypt = /*#__PURE__*/function () {
4370
4508
  download: true
4371
4509
  });
4372
4510
  case 4:
4373
- conk = _context51.sent;
4374
- _context51.next = 7;
4511
+ conk = _context52.sent;
4512
+ _context52.next = 7;
4375
4513
  return this.Crypto.Decrypt(conk, chunk);
4376
4514
  case 7:
4377
- data = _context51.sent;
4378
- return _context51.abrupt("return", data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength));
4515
+ data = _context52.sent;
4516
+ return _context52.abrupt("return", data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength));
4379
4517
  case 9:
4380
4518
  case "end":
4381
- return _context51.stop();
4519
+ return _context52.stop();
4382
4520
  }
4383
- }, _callee51, this);
4521
+ }, _callee52, this);
4384
4522
  }));
4385
- return function (_x50) {
4386
- return _ref92.apply(this, arguments);
4523
+ return function (_x51) {
4524
+ return _ref94.apply(this, arguments);
4387
4525
  };
4388
4526
  }();
4389
4527
 
@@ -4399,24 +4537,24 @@ exports.Decrypt = /*#__PURE__*/function () {
4399
4537
  * @return {Promise<string>} - Contract type of the item - "space", "library", "type", "object", "wallet", "group", or "other"
4400
4538
  */
4401
4539
  exports.AccessType = /*#__PURE__*/function () {
4402
- var _ref94 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(_ref93) {
4540
+ var _ref96 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(_ref95) {
4403
4541
  var id;
4404
- return _regeneratorRuntime.wrap(function _callee52$(_context52) {
4405
- while (1) switch (_context52.prev = _context52.next) {
4542
+ return _regeneratorRuntime.wrap(function _callee53$(_context53) {
4543
+ while (1) switch (_context53.prev = _context53.next) {
4406
4544
  case 0:
4407
- id = _ref93.id;
4408
- _context52.next = 3;
4545
+ id = _ref95.id;
4546
+ _context53.next = 3;
4409
4547
  return this.authClient.AccessType(id);
4410
4548
  case 3:
4411
- return _context52.abrupt("return", _context52.sent);
4549
+ return _context53.abrupt("return", _context53.sent);
4412
4550
  case 4:
4413
4551
  case "end":
4414
- return _context52.stop();
4552
+ return _context53.stop();
4415
4553
  }
4416
- }, _callee52, this);
4554
+ }, _callee53, this);
4417
4555
  }));
4418
- return function (_x51) {
4419
- return _ref94.apply(this, arguments);
4556
+ return function (_x52) {
4557
+ return _ref96.apply(this, arguments);
4420
4558
  };
4421
4559
  }();
4422
4560
 
@@ -4432,12 +4570,12 @@ exports.AccessType = /*#__PURE__*/function () {
4432
4570
  *
4433
4571
  * @return {Promise<Object>} - Info about the access charge and whether or not the object is accessible to the current user */
4434
4572
  exports.AccessInfo = /*#__PURE__*/function () {
4435
- var _ref96 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(_ref95) {
4573
+ var _ref98 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(_ref97) {
4436
4574
  var objectId, args, info;
4437
- return _regeneratorRuntime.wrap(function _callee53$(_context53) {
4438
- while (1) switch (_context53.prev = _context53.next) {
4575
+ return _regeneratorRuntime.wrap(function _callee54$(_context54) {
4576
+ while (1) switch (_context54.prev = _context54.next) {
4439
4577
  case 0:
4440
- objectId = _ref95.objectId, args = _ref95.args;
4578
+ objectId = _ref97.objectId, args = _ref97.args;
4441
4579
  ValidateObject(objectId);
4442
4580
  if (!args) {
4443
4581
  args = [0,
@@ -4447,18 +4585,17 @@ exports.AccessInfo = /*#__PURE__*/function () {
4447
4585
  [] // Stakeholders
4448
4586
  ];
4449
4587
  }
4450
-
4451
4588
  this.Log("Retrieving access info: ".concat(objectId));
4452
- _context53.next = 6;
4589
+ _context54.next = 6;
4453
4590
  return this.ethClient.CallContractMethod({
4454
4591
  contractAddress: this.utils.HashToAddress(objectId),
4455
4592
  methodName: "getAccessInfo",
4456
4593
  methodArgs: args
4457
4594
  });
4458
4595
  case 6:
4459
- info = _context53.sent;
4596
+ info = _context54.sent;
4460
4597
  this.Log(info);
4461
- return _context53.abrupt("return", {
4598
+ return _context54.abrupt("return", {
4462
4599
  visibilityCode: info[0],
4463
4600
  visible: info[0] >= 1,
4464
4601
  accessible: info[0] >= 10,
@@ -4469,12 +4606,12 @@ exports.AccessInfo = /*#__PURE__*/function () {
4469
4606
  });
4470
4607
  case 9:
4471
4608
  case "end":
4472
- return _context53.stop();
4609
+ return _context54.stop();
4473
4610
  }
4474
- }, _callee53, this);
4611
+ }, _callee54, this);
4475
4612
  }));
4476
- return function (_x52) {
4477
- return _ref96.apply(this, arguments);
4613
+ return function (_x53) {
4614
+ return _ref98.apply(this, arguments);
4478
4615
  };
4479
4616
  }();
4480
4617
 
@@ -4502,12 +4639,12 @@ exports.AccessInfo = /*#__PURE__*/function () {
4502
4639
  * @return {Promise<Object>} - Resultant AccessRequest or UpdateRequest event
4503
4640
  */
4504
4641
  exports.AccessRequest = /*#__PURE__*/function () {
4505
- var _ref98 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(_ref97) {
4506
- var libraryId, objectId, versionHash, _ref97$args, args, _ref97$update, update, _ref97$noCache, noCache;
4507
- return _regeneratorRuntime.wrap(function _callee54$(_context54) {
4508
- while (1) switch (_context54.prev = _context54.next) {
4642
+ var _ref100 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(_ref99) {
4643
+ var libraryId, objectId, versionHash, _ref99$args, args, _ref99$update, update, _ref99$noCache, noCache;
4644
+ return _regeneratorRuntime.wrap(function _callee55$(_context55) {
4645
+ while (1) switch (_context55.prev = _context55.next) {
4509
4646
  case 0:
4510
- libraryId = _ref97.libraryId, objectId = _ref97.objectId, versionHash = _ref97.versionHash, _ref97$args = _ref97.args, args = _ref97$args === void 0 ? [] : _ref97$args, _ref97$update = _ref97.update, update = _ref97$update === void 0 ? false : _ref97$update, _ref97$noCache = _ref97.noCache, noCache = _ref97$noCache === void 0 ? false : _ref97$noCache;
4647
+ libraryId = _ref99.libraryId, objectId = _ref99.objectId, versionHash = _ref99.versionHash, _ref99$args = _ref99.args, args = _ref99$args === void 0 ? [] : _ref99$args, _ref99$update = _ref99.update, update = _ref99$update === void 0 ? false : _ref99$update, _ref99$noCache = _ref99.noCache, noCache = _ref99$noCache === void 0 ? false : _ref99$noCache;
4511
4648
  ValidateParameters({
4512
4649
  libraryId: libraryId,
4513
4650
  objectId: objectId,
@@ -4516,7 +4653,7 @@ exports.AccessRequest = /*#__PURE__*/function () {
4516
4653
  if (versionHash) {
4517
4654
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
4518
4655
  }
4519
- _context54.next = 5;
4656
+ _context55.next = 5;
4520
4657
  return this.authClient.MakeAccessRequest({
4521
4658
  libraryId: libraryId,
4522
4659
  objectId: objectId,
@@ -4527,15 +4664,15 @@ exports.AccessRequest = /*#__PURE__*/function () {
4527
4664
  noCache: noCache
4528
4665
  });
4529
4666
  case 5:
4530
- return _context54.abrupt("return", _context54.sent);
4667
+ return _context55.abrupt("return", _context55.sent);
4531
4668
  case 6:
4532
4669
  case "end":
4533
- return _context54.stop();
4670
+ return _context55.stop();
4534
4671
  }
4535
- }, _callee54, this);
4672
+ }, _callee55, this);
4536
4673
  }));
4537
- return function (_x53) {
4538
- return _ref98.apply(this, arguments);
4674
+ return function (_x54) {
4675
+ return _ref100.apply(this, arguments);
4539
4676
  };
4540
4677
  }();
4541
4678
 
@@ -4547,8 +4684,8 @@ exports.AccessRequest = /*#__PURE__*/function () {
4547
4684
  * @param {Object=} context - Additional context to include in state channel requests
4548
4685
  * - Note: Context must be a map of string->string
4549
4686
  */
4550
- exports.SetAuthContext = function (_ref99) {
4551
- var context = _ref99.context;
4687
+ exports.SetAuthContext = function (_ref101) {
4688
+ var context = _ref101.context;
4552
4689
  if (context && Object.values(context).find(function (value) {
4553
4690
  return typeof value !== "string";
4554
4691
  })) {
@@ -4572,34 +4709,34 @@ exports.SetAuthContext = function (_ref99) {
4572
4709
  * @return {Promise<string>} - The state channel token
4573
4710
  */
4574
4711
  exports.GenerateStateChannelToken = /*#__PURE__*/function () {
4575
- var _ref101 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(_ref100) {
4576
- var objectId, versionHash, context, _ref100$noCache, noCache;
4577
- return _regeneratorRuntime.wrap(function _callee55$(_context55) {
4578
- while (1) switch (_context55.prev = _context55.next) {
4712
+ var _ref103 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(_ref102) {
4713
+ var objectId, versionHash, context, _ref102$noCache, noCache;
4714
+ return _regeneratorRuntime.wrap(function _callee56$(_context56) {
4715
+ while (1) switch (_context56.prev = _context56.next) {
4579
4716
  case 0:
4580
- objectId = _ref100.objectId, versionHash = _ref100.versionHash, context = _ref100.context, _ref100$noCache = _ref100.noCache, noCache = _ref100$noCache === void 0 ? false : _ref100$noCache;
4717
+ objectId = _ref102.objectId, versionHash = _ref102.versionHash, context = _ref102.context, _ref102$noCache = _ref102.noCache, noCache = _ref102$noCache === void 0 ? false : _ref102$noCache;
4581
4718
  versionHash ? ValidateVersion(versionHash) : ValidateObject(objectId);
4582
4719
  if (!versionHash) {
4583
- _context55.next = 6;
4720
+ _context56.next = 6;
4584
4721
  break;
4585
4722
  }
4586
4723
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
4587
- _context55.next = 10;
4724
+ _context56.next = 10;
4588
4725
  break;
4589
4726
  case 6:
4590
4727
  if (this.stateChannelAccess[objectId]) {
4591
- _context55.next = 10;
4728
+ _context56.next = 10;
4592
4729
  break;
4593
4730
  }
4594
- _context55.next = 9;
4731
+ _context56.next = 9;
4595
4732
  return this.LatestVersionHash({
4596
4733
  objectId: objectId
4597
4734
  });
4598
4735
  case 9:
4599
- versionHash = _context55.sent;
4736
+ versionHash = _context56.sent;
4600
4737
  case 10:
4601
4738
  this.stateChannelAccess[objectId] = versionHash;
4602
- _context55.next = 13;
4739
+ _context56.next = 13;
4603
4740
  return this.authClient.AuthorizationToken({
4604
4741
  objectId: objectId,
4605
4742
  channelAuth: true,
@@ -4608,15 +4745,15 @@ exports.GenerateStateChannelToken = /*#__PURE__*/function () {
4608
4745
  noCache: noCache
4609
4746
  });
4610
4747
  case 13:
4611
- return _context55.abrupt("return", _context55.sent);
4748
+ return _context56.abrupt("return", _context56.sent);
4612
4749
  case 14:
4613
4750
  case "end":
4614
- return _context55.stop();
4751
+ return _context56.stop();
4615
4752
  }
4616
- }, _callee55, this);
4753
+ }, _callee56, this);
4617
4754
  }));
4618
- return function (_x54) {
4619
- return _ref101.apply(this, arguments);
4755
+ return function (_x55) {
4756
+ return _ref103.apply(this, arguments);
4620
4757
  };
4621
4758
  }();
4622
4759
 
@@ -4630,38 +4767,38 @@ exports.GenerateStateChannelToken = /*#__PURE__*/function () {
4630
4767
  * @param {number} percentComplete - Completion percentage of the content
4631
4768
  */
4632
4769
  exports.FinalizeStateChannelAccess = /*#__PURE__*/function () {
4633
- var _ref103 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(_ref102) {
4770
+ var _ref105 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(_ref104) {
4634
4771
  var objectId, versionHash, percentComplete;
4635
- return _regeneratorRuntime.wrap(function _callee56$(_context56) {
4636
- while (1) switch (_context56.prev = _context56.next) {
4772
+ return _regeneratorRuntime.wrap(function _callee57$(_context57) {
4773
+ while (1) switch (_context57.prev = _context57.next) {
4637
4774
  case 0:
4638
- objectId = _ref102.objectId, versionHash = _ref102.versionHash, percentComplete = _ref102.percentComplete;
4775
+ objectId = _ref104.objectId, versionHash = _ref104.versionHash, percentComplete = _ref104.percentComplete;
4639
4776
  versionHash ? ValidateVersion(versionHash) : ValidateObject(objectId);
4640
4777
  if (!versionHash) {
4641
- _context56.next = 6;
4778
+ _context57.next = 6;
4642
4779
  break;
4643
4780
  }
4644
4781
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
4645
- _context56.next = 13;
4782
+ _context57.next = 13;
4646
4783
  break;
4647
4784
  case 6:
4648
4785
  if (!this.stateChannelAccess[objectId]) {
4649
- _context56.next = 10;
4786
+ _context57.next = 10;
4650
4787
  break;
4651
4788
  }
4652
4789
  versionHash = this.stateChannelAccess[objectId];
4653
- _context56.next = 13;
4790
+ _context57.next = 13;
4654
4791
  break;
4655
4792
  case 10:
4656
- _context56.next = 12;
4793
+ _context57.next = 12;
4657
4794
  return this.LatestVersionHash({
4658
4795
  objectId: objectId
4659
4796
  });
4660
4797
  case 12:
4661
- versionHash = _context56.sent;
4798
+ versionHash = _context57.sent;
4662
4799
  case 13:
4663
4800
  this.stateChannelAccess[objectId] = undefined;
4664
- _context56.next = 16;
4801
+ _context57.next = 16;
4665
4802
  return this.authClient.ChannelContentFinalize({
4666
4803
  objectId: objectId,
4667
4804
  versionHash: versionHash,
@@ -4669,12 +4806,12 @@ exports.FinalizeStateChannelAccess = /*#__PURE__*/function () {
4669
4806
  });
4670
4807
  case 16:
4671
4808
  case "end":
4672
- return _context56.stop();
4809
+ return _context57.stop();
4673
4810
  }
4674
- }, _callee56, this);
4811
+ }, _callee57, this);
4675
4812
  }));
4676
- return function (_x55) {
4677
- return _ref103.apply(this, arguments);
4813
+ return function (_x56) {
4814
+ return _ref105.apply(this, arguments);
4678
4815
  };
4679
4816
  }();
4680
4817
 
@@ -4691,34 +4828,34 @@ exports.FinalizeStateChannelAccess = /*#__PURE__*/function () {
4691
4828
  * @returns {Promise<Object>} - Transaction log of the AccessComplete event
4692
4829
  */
4693
4830
  exports.ContentObjectAccessComplete = /*#__PURE__*/function () {
4694
- var _ref105 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(_ref104) {
4695
- var objectId, _ref104$score, score;
4696
- return _regeneratorRuntime.wrap(function _callee57$(_context57) {
4697
- while (1) switch (_context57.prev = _context57.next) {
4831
+ var _ref107 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(_ref106) {
4832
+ var objectId, _ref106$score, score;
4833
+ return _regeneratorRuntime.wrap(function _callee58$(_context58) {
4834
+ while (1) switch (_context58.prev = _context58.next) {
4698
4835
  case 0:
4699
- objectId = _ref104.objectId, _ref104$score = _ref104.score, score = _ref104$score === void 0 ? 100 : _ref104$score;
4836
+ objectId = _ref106.objectId, _ref106$score = _ref106.score, score = _ref106$score === void 0 ? 100 : _ref106$score;
4700
4837
  ValidateObject(objectId);
4701
4838
  if (!(score < 0 || score > 100)) {
4702
- _context57.next = 4;
4839
+ _context58.next = 4;
4703
4840
  break;
4704
4841
  }
4705
4842
  throw Error("Invalid AccessComplete score: " + score);
4706
4843
  case 4:
4707
- _context57.next = 6;
4844
+ _context58.next = 6;
4708
4845
  return this.authClient.AccessComplete({
4709
4846
  id: objectId,
4710
4847
  score: score
4711
4848
  });
4712
4849
  case 6:
4713
- return _context57.abrupt("return", _context57.sent);
4850
+ return _context58.abrupt("return", _context58.sent);
4714
4851
  case 7:
4715
4852
  case "end":
4716
- return _context57.stop();
4853
+ return _context58.stop();
4717
4854
  }
4718
- }, _callee57, this);
4855
+ }, _callee58, this);
4719
4856
  }));
4720
- return function (_x56) {
4721
- return _ref105.apply(this, arguments);
4857
+ return function (_x57) {
4858
+ return _ref107.apply(this, arguments);
4722
4859
  };
4723
4860
  }();
4724
4861
 
@@ -4740,62 +4877,62 @@ exports.ContentObjectAccessComplete = /*#__PURE__*/function () {
4740
4877
  * @return {Promise<Array<string>>} - List of addresses of available items
4741
4878
  */
4742
4879
  exports.Collection = /*#__PURE__*/function () {
4743
- var _ref107 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(_ref106) {
4880
+ var _ref109 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(_ref108) {
4744
4881
  var collectionType, validCollectionTypes, walletAddress;
4745
- return _regeneratorRuntime.wrap(function _callee58$(_context58) {
4746
- while (1) switch (_context58.prev = _context58.next) {
4882
+ return _regeneratorRuntime.wrap(function _callee59$(_context59) {
4883
+ while (1) switch (_context59.prev = _context59.next) {
4747
4884
  case 0:
4748
- collectionType = _ref106.collectionType;
4885
+ collectionType = _ref108.collectionType;
4749
4886
  validCollectionTypes = ["accessGroups", "contentObjects", "contentTypes", "contracts", "libraries"];
4750
4887
  if (validCollectionTypes.includes(collectionType)) {
4751
- _context58.next = 4;
4888
+ _context59.next = 4;
4752
4889
  break;
4753
4890
  }
4754
4891
  throw new Error("Invalid collection type: " + collectionType);
4755
4892
  case 4:
4756
4893
  if (!this.signer) {
4757
- _context58.next = 10;
4894
+ _context59.next = 10;
4758
4895
  break;
4759
4896
  }
4760
- _context58.next = 7;
4897
+ _context59.next = 7;
4761
4898
  return this.userProfileClient.WalletAddress();
4762
4899
  case 7:
4763
- _context58.t0 = _context58.sent;
4764
- _context58.next = 11;
4900
+ _context59.t0 = _context59.sent;
4901
+ _context59.next = 11;
4765
4902
  break;
4766
4903
  case 10:
4767
- _context58.t0 = undefined;
4904
+ _context59.t0 = undefined;
4768
4905
  case 11:
4769
- walletAddress = _context58.t0;
4906
+ walletAddress = _context59.t0;
4770
4907
  if (walletAddress) {
4771
- _context58.next = 14;
4908
+ _context59.next = 14;
4772
4909
  break;
4773
4910
  }
4774
4911
  throw new Error("Unable to get collection: User wallet doesn't exist");
4775
4912
  case 14:
4776
4913
  this.Log("Retrieving ".concat(collectionType, " contract collection for user ").concat(this.signer.address));
4777
- _context58.next = 17;
4914
+ _context59.next = 17;
4778
4915
  return this.ethClient.MakeProviderCall({
4779
4916
  methodName: "send",
4780
4917
  args: ["elv_getWalletCollection", [this.contentSpaceId, "iusr".concat(this.utils.AddressToHash(this.signer.address)), collectionType]]
4781
4918
  });
4782
4919
  case 17:
4783
- _context58.t1 = _context58.sent;
4784
- if (_context58.t1) {
4785
- _context58.next = 20;
4920
+ _context59.t1 = _context59.sent;
4921
+ if (_context59.t1) {
4922
+ _context59.next = 20;
4786
4923
  break;
4787
4924
  }
4788
- _context58.t1 = [];
4925
+ _context59.t1 = [];
4789
4926
  case 20:
4790
- return _context58.abrupt("return", _context58.t1);
4927
+ return _context59.abrupt("return", _context59.t1);
4791
4928
  case 21:
4792
4929
  case "end":
4793
- return _context58.stop();
4930
+ return _context59.stop();
4794
4931
  }
4795
- }, _callee58, this);
4932
+ }, _callee59, this);
4796
4933
  }));
4797
- return function (_x57) {
4798
- return _ref107.apply(this, arguments);
4934
+ return function (_x58) {
4935
+ return _ref109.apply(this, arguments);
4799
4936
  };
4800
4937
  }();
4801
4938
 
@@ -4816,13 +4953,13 @@ exports.Collection = /*#__PURE__*/function () {
4816
4953
  * @returns {Promise<Object>} - Response describing audit results
4817
4954
  */
4818
4955
  exports.AuditContentObject = /*#__PURE__*/function () {
4819
- var _ref109 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(_ref108) {
4956
+ var _ref111 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(_ref110) {
4820
4957
  var libraryId, objectId, versionHash, salt, samples, authorizationToken;
4821
- return _regeneratorRuntime.wrap(function _callee59$(_context59) {
4822
- while (1) switch (_context59.prev = _context59.next) {
4958
+ return _regeneratorRuntime.wrap(function _callee60$(_context60) {
4959
+ while (1) switch (_context60.prev = _context60.next) {
4823
4960
  case 0:
4824
- libraryId = _ref108.libraryId, objectId = _ref108.objectId, versionHash = _ref108.versionHash, salt = _ref108.salt, samples = _ref108.samples, authorizationToken = _ref108.authorizationToken;
4825
- _context59.next = 3;
4961
+ libraryId = _ref110.libraryId, objectId = _ref110.objectId, versionHash = _ref110.versionHash, salt = _ref110.salt, samples = _ref110.samples, authorizationToken = _ref110.authorizationToken;
4962
+ _context60.next = 3;
4826
4963
  return ContentObjectAudit.AuditContentObject({
4827
4964
  client: this,
4828
4965
  libraryId: libraryId,
@@ -4833,15 +4970,15 @@ exports.AuditContentObject = /*#__PURE__*/function () {
4833
4970
  authorizationToken: authorizationToken
4834
4971
  });
4835
4972
  case 3:
4836
- return _context59.abrupt("return", _context59.sent);
4973
+ return _context60.abrupt("return", _context60.sent);
4837
4974
  case 4:
4838
4975
  case "end":
4839
- return _context59.stop();
4976
+ return _context60.stop();
4840
4977
  }
4841
- }, _callee59, this);
4978
+ }, _callee60, this);
4842
4979
  }));
4843
- return function (_x58) {
4844
- return _ref109.apply(this, arguments);
4980
+ return function (_x59) {
4981
+ return _ref111.apply(this, arguments);
4845
4982
  };
4846
4983
  }();
4847
4984
 
@@ -4858,12 +4995,12 @@ exports.AuditContentObject = /*#__PURE__*/function () {
4858
4995
  * @returns {Promise<Object>} - Response containing proof information
4859
4996
  */
4860
4997
  exports.Proofs = /*#__PURE__*/function () {
4861
- var _ref111 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(_ref110) {
4998
+ var _ref113 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(_ref112) {
4862
4999
  var libraryId, objectId, versionHash, partHash, path;
4863
- return _regeneratorRuntime.wrap(function _callee60$(_context60) {
4864
- while (1) switch (_context60.prev = _context60.next) {
5000
+ return _regeneratorRuntime.wrap(function _callee61$(_context61) {
5001
+ while (1) switch (_context61.prev = _context61.next) {
4865
5002
  case 0:
4866
- libraryId = _ref110.libraryId, objectId = _ref110.objectId, versionHash = _ref110.versionHash, partHash = _ref110.partHash;
5003
+ libraryId = _ref112.libraryId, objectId = _ref112.objectId, versionHash = _ref112.versionHash, partHash = _ref112.partHash;
4867
5004
  ValidateParameters({
4868
5005
  libraryId: libraryId,
4869
5006
  objectId: objectId,
@@ -4874,32 +5011,32 @@ exports.Proofs = /*#__PURE__*/function () {
4874
5011
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
4875
5012
  }
4876
5013
  path = UrlJoin("q", versionHash || objectId, "data", partHash, "proofs");
4877
- _context60.t0 = this.utils;
4878
- _context60.t1 = this.HttpClient;
4879
- _context60.next = 9;
5014
+ _context61.t0 = this.utils;
5015
+ _context61.t1 = this.HttpClient;
5016
+ _context61.next = 9;
4880
5017
  return this.authClient.AuthorizationHeader({
4881
5018
  libraryId: libraryId,
4882
5019
  objectId: objectId,
4883
5020
  versionHash: versionHash
4884
5021
  });
4885
5022
  case 9:
4886
- _context60.t2 = _context60.sent;
4887
- _context60.t3 = path;
4888
- _context60.t4 = {
4889
- headers: _context60.t2,
5023
+ _context61.t2 = _context61.sent;
5024
+ _context61.t3 = path;
5025
+ _context61.t4 = {
5026
+ headers: _context61.t2,
4890
5027
  method: "GET",
4891
- path: _context60.t3
5028
+ path: _context61.t3
4892
5029
  };
4893
- _context60.t5 = _context60.t1.Request.call(_context60.t1, _context60.t4);
4894
- return _context60.abrupt("return", _context60.t0.ResponseToJson.call(_context60.t0, _context60.t5));
5030
+ _context61.t5 = _context61.t1.Request.call(_context61.t1, _context61.t4);
5031
+ return _context61.abrupt("return", _context61.t0.ResponseToJson.call(_context61.t0, _context61.t5));
4895
5032
  case 14:
4896
5033
  case "end":
4897
- return _context60.stop();
5034
+ return _context61.stop();
4898
5035
  }
4899
- }, _callee60, this);
5036
+ }, _callee61, this);
4900
5037
  }));
4901
- return function (_x59) {
4902
- return _ref111.apply(this, arguments);
5038
+ return function (_x60) {
5039
+ return _ref113.apply(this, arguments);
4903
5040
  };
4904
5041
  }();
4905
5042
 
@@ -4916,12 +5053,12 @@ exports.Proofs = /*#__PURE__*/function () {
4916
5053
  * @returns {Promise<Format>} - Response containing the CBOR response in the specified format
4917
5054
  */
4918
5055
  exports.QParts = /*#__PURE__*/function () {
4919
- var _ref113 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(_ref112) {
4920
- var libraryId, objectId, partHash, _ref112$format, format, path;
4921
- return _regeneratorRuntime.wrap(function _callee61$(_context61) {
4922
- while (1) switch (_context61.prev = _context61.next) {
5056
+ var _ref115 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(_ref114) {
5057
+ var libraryId, objectId, partHash, _ref114$format, format, path;
5058
+ return _regeneratorRuntime.wrap(function _callee62$(_context62) {
5059
+ while (1) switch (_context62.prev = _context62.next) {
4923
5060
  case 0:
4924
- libraryId = _ref112.libraryId, objectId = _ref112.objectId, partHash = _ref112.partHash, _ref112$format = _ref112.format, format = _ref112$format === void 0 ? "blob" : _ref112$format;
5061
+ libraryId = _ref114.libraryId, objectId = _ref114.objectId, partHash = _ref114.partHash, _ref114$format = _ref114.format, format = _ref114$format === void 0 ? "blob" : _ref114$format;
4925
5062
  ValidateParameters({
4926
5063
  libraryId: libraryId,
4927
5064
  objectId: objectId,
@@ -4929,32 +5066,32 @@ exports.QParts = /*#__PURE__*/function () {
4929
5066
  });
4930
5067
  ValidatePartHash(partHash);
4931
5068
  path = UrlJoin("qparts", partHash);
4932
- _context61.t0 = this.utils;
4933
- _context61.t1 = format;
4934
- _context61.t2 = this.HttpClient;
4935
- _context61.next = 9;
5069
+ _context62.t0 = this.utils;
5070
+ _context62.t1 = format;
5071
+ _context62.t2 = this.HttpClient;
5072
+ _context62.next = 9;
4936
5073
  return this.authClient.AuthorizationHeader({
4937
5074
  libraryId: libraryId,
4938
5075
  objectId: objectId,
4939
5076
  partHash: partHash
4940
5077
  });
4941
5078
  case 9:
4942
- _context61.t3 = _context61.sent;
4943
- _context61.t4 = path;
4944
- _context61.t5 = {
4945
- headers: _context61.t3,
5079
+ _context62.t3 = _context62.sent;
5080
+ _context62.t4 = path;
5081
+ _context62.t5 = {
5082
+ headers: _context62.t3,
4946
5083
  method: "GET",
4947
- path: _context61.t4
5084
+ path: _context62.t4
4948
5085
  };
4949
- _context61.t6 = _context61.t2.Request.call(_context61.t2, _context61.t5);
4950
- return _context61.abrupt("return", _context61.t0.ResponseToFormat.call(_context61.t0, _context61.t1, _context61.t6));
5086
+ _context62.t6 = _context62.t2.Request.call(_context62.t2, _context62.t5);
5087
+ return _context62.abrupt("return", _context62.t0.ResponseToFormat.call(_context62.t0, _context62.t1, _context62.t6));
4951
5088
  case 14:
4952
5089
  case "end":
4953
- return _context61.stop();
5090
+ return _context62.stop();
4954
5091
  }
4955
- }, _callee61, this);
5092
+ }, _callee62, this);
4956
5093
  }));
4957
- return function (_x60) {
4958
- return _ref113.apply(this, arguments);
5094
+ return function (_x61) {
5095
+ return _ref115.apply(this, arguments);
4959
5096
  };
4960
5097
  }();