@eluvio/elv-client-js 3.2.31 → 3.2.33

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.33",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -97,9 +97,8 @@ exports.SetProfileMetadata = async function({type="app", mode="public", appId, k
97
97
  * @param {string=} mode="public" - Specify `public` or `private` metadata.
98
98
  * @param {string=} appId - Namespace to use for the metadata, if retrieving app metadata.. Uses the app ID specified on client initialization by default.
99
99
  * @param {string} key - The metadata key to set
100
- * @param {string} value - The metadata value to set
101
100
  */
102
- exports.RemoveProfileMetadata = async function({type="app", mode="public", appId, key, value}) {
101
+ exports.RemoveProfileMetadata = async function({type="app", mode="public", appId, key}) {
103
102
  await this.stateStoreClient.Request({
104
103
  method: "DELETE",
105
104
  path: UserProfilePath({
@@ -110,7 +109,6 @@ exports.RemoveProfileMetadata = async function({type="app", mode="public", appId
110
109
  mode,
111
110
  key
112
111
  }),
113
- body: value,
114
112
  headers: {
115
113
  Authorization: `Bearer ${this.AuthToken()}`
116
114
  }
@@ -606,7 +606,9 @@ class ElvWalletClient {
606
606
  "*/marketplaces/*/.",
607
607
  "*/marketplaces/*/info/tenant_id",
608
608
  "*/marketplaces/*/info/tenant_name",
609
- "*/marketplaces/*/info/branding"
609
+ "*/marketplaces/*/info/branding",
610
+ "*/marketplaces/*/info/storefront/background",
611
+ "*/marketplaces/*/info/storefront/background_mobile"
610
612
  ],
611
613
  remove: [
612
614
  "*/marketplaces/*/info/branding/custom_css"
@@ -764,19 +766,23 @@ class ElvWalletClient {
764
766
  marketplace.items = await Promise.all(
765
767
  marketplace.items.map(async (item, index) => {
766
768
  if(item.requires_permissions) {
769
+ let authorizationToken;
767
770
  if(!this.loggedIn) {
771
+ // If not logged in, generated a dummy signed token
772
+ // Authorization may be based on geo-restriction, which doesn't require login
773
+ authorizationToken = await this.client.CreateFabricToken({});
774
+ }
775
+
776
+ try {
777
+ await this.client.ContentObjectMetadata({
778
+ versionHash: LinkTargetHash(item.nft_template),
779
+ metadataSubtree: "permissioned",
780
+ authorizationToken
781
+ });
782
+
783
+ item.authorized = true;
784
+ } catch(error) {
768
785
  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
786
  }
781
787
  }
782
788