@eluvio/elv-client-js 3.2.31 → 3.2.32

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.
@@ -22,7 +22,7 @@ var WalletConfiguration = {
22
22
  appUrl: "https://wallet.contentfabric.io"
23
23
  }
24
24
  },
25
- __MARKETPLACE_ORDER: ["PREVIEW", "wwe-marketplace-main", "realcannonballrun-marketplace", "maskverse-marketplace", "dolly-marketplace", "oc-marketplace", "cirkay-marketplace", "emp-marketplace", "microsoft", "indieflix-marketplace", "angels-airwaves-marketplace"]
25
+ __MARKETPLACE_ORDER: ["PREVIEW", "wwe-marketplace-main", "realcannonballrun-marketplace", "maskverse-marketplace", "dolly-marketplace", "eluvio-live-marketplace-sonark", "cirkay-marketplace", "oc-marketplace", "emp-marketplace", "microsoft", "indieflix-marketplace", "angels-airwaves-marketplace"]
26
26
  }; // No production environment on demo
27
27
 
28
28
  WalletConfiguration.demo.production = WalletConfiguration.demo.staging; // Allow demo to be referred to as demov3
@@ -1259,6 +1259,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
1259
1259
  _context15.next = 12;
1260
1260
  return Promise.all(marketplace.items.map( /*#__PURE__*/function () {
1261
1261
  var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(item, index) {
1262
+ var authorizationToken;
1262
1263
  return _regeneratorRuntime.wrap(function _callee14$(_context14) {
1263
1264
  while (1) {
1264
1265
  switch (_context14.prev = _context14.next) {
@@ -1273,16 +1274,19 @@ var ElvWalletClient = /*#__PURE__*/function () {
1273
1274
  break;
1274
1275
  }
1275
1276
 
1276
- item.authorized = false;
1277
- _context14.next = 14;
1278
- break;
1277
+ _context14.next = 4;
1278
+ return _this5.client.CreateFabricToken({});
1279
+
1280
+ case 4:
1281
+ authorizationToken = _context14.sent;
1279
1282
 
1280
1283
  case 5:
1281
1284
  _context14.prev = 5;
1282
1285
  _context14.next = 8;
1283
1286
  return _this5.client.ContentObjectMetadata({
1284
1287
  versionHash: LinkTargetHash(item.nft_template),
1285
- metadataSubtree: "permissioned"
1288
+ metadataSubtree: "permissioned",
1289
+ authorizationToken: authorizationToken
1286
1290
  });
1287
1291
 
1288
1292
  case 8:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "3.2.31",
3
+ "version": "3.2.32",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -764,19 +764,23 @@ class ElvWalletClient {
764
764
  marketplace.items = await Promise.all(
765
765
  marketplace.items.map(async (item, index) => {
766
766
  if(item.requires_permissions) {
767
+ let authorizationToken;
767
768
  if(!this.loggedIn) {
769
+ // If not logged in, generated a dummy signed token
770
+ // Authorization may be based on geo-restriction, which doesn't require login
771
+ authorizationToken = await this.client.CreateFabricToken({});
772
+ }
773
+
774
+ try {
775
+ await this.client.ContentObjectMetadata({
776
+ versionHash: LinkTargetHash(item.nft_template),
777
+ metadataSubtree: "permissioned",
778
+ authorizationToken
779
+ });
780
+
781
+ item.authorized = true;
782
+ } catch(error) {
768
783
  item.authorized = false;
769
- } else {
770
- try {
771
- await this.client.ContentObjectMetadata({
772
- versionHash: LinkTargetHash(item.nft_template),
773
- metadataSubtree: "permissioned"
774
- });
775
-
776
- item.authorized = true;
777
- } catch(error) {
778
- item.authorized = false;
779
- }
780
784
  }
781
785
  }
782
786