@eluvio/elv-client-js 4.0.39 → 4.0.41

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.0.39",
3
+ "version": "4.0.41",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -672,7 +672,7 @@ class ElvWalletClient {
672
672
  return response;
673
673
  }
674
674
 
675
- async SetCodeAuth({code, address, authToken}) {
675
+ async SetCodeAuth({code, address, type, authToken}) {
676
676
  await Utils.ResponseToJson(
677
677
  this.client.authClient.MakeAuthServiceRequest({
678
678
  path: UrlJoin("as", "wlt", "login", "session", code),
@@ -687,6 +687,7 @@ class ElvWalletClient {
687
687
  payload: JSON.stringify({
688
688
  addr: Utils.FormatAddress(address),
689
689
  eth: address ? `ikms${Utils.AddressToHash(address)}` : "",
690
+ type,
690
691
  token: authToken
691
692
  })
692
693
  }
@@ -719,7 +720,7 @@ class ElvWalletClient {
719
720
  let metadata = await this.client.ContentObjectMetadata({
720
721
  libraryId: this.mainSiteLibraryId,
721
722
  objectId: this.mainSiteId,
722
- metadataSubtree: "public/asset_metadata/tenants",
723
+ metadataSubtree: "public/asset_metadata",
723
724
  resolveLinks: true,
724
725
  linkDepthLimit: 2,
725
726
  resolveIncludeSource: true,
@@ -728,21 +729,25 @@ class ElvWalletClient {
728
729
  authorizationToken: this.publicStaticToken,
729
730
  noAuth: true,
730
731
  select: [
731
- "*/.",
732
- "*/info/branding",
733
- "*/marketplaces/*/.",
734
- "*/marketplaces/*/info/tenant_id",
735
- "*/marketplaces/*/info/tenant_name",
736
- "*/marketplaces/*/info/branding",
737
- "*/marketplaces/*/info/storefront/background",
738
- "*/marketplaces/*/info/storefront/background_mobile"
732
+ "info/marketplace_order",
733
+ "tenants/*/.",
734
+ "tenants/*/info/branding",
735
+ "tenants/*/marketplaces/*/.",
736
+ "tenants/*/marketplaces/*/info/tenant_id",
737
+ "tenants/*/marketplaces/*/info/tenant_name",
738
+ "tenants/*/marketplaces/*/info/branding",
739
+ "tenants/*/marketplaces/*/info/storefront/background",
740
+ "tenants/*/marketplaces/*/info/storefront/background_mobile"
739
741
  ],
740
742
  remove: [
741
- "*/info/branding/wallet_css",
742
- "*/marketplaces/*/info/branding/custom_css"
743
+ "tenants/*/info/branding/wallet_css",
744
+ "tenants/*/marketplaces/*/info/branding/custom_css"
743
745
  ]
744
746
  });
745
747
 
748
+ const marketplaceOrder = ((metadata || {}).info || {}).marketplace_order || [];
749
+ metadata = (metadata || {}).tenants || {};
750
+
746
751
  // If preview marketplace is specified, load it appropriately
747
752
  if(this.previewMarketplaceId) {
748
753
  let previewTenantSlug = "PREVIEW";
@@ -826,7 +831,7 @@ class ElvWalletClient {
826
831
  marketplaceId: objectId,
827
832
  marketplaceHash: versionHash,
828
833
  tenantBranding: (metadata[tenantSlug].info || {}).branding || {},
829
- order: Configuration.__MARKETPLACE_ORDER.findIndex(slug => slug === marketplaceSlug)
834
+ order: marketplaceOrder.findIndex(slug => slug === marketplaceSlug)
830
835
  };
831
836
 
832
837
  availableMarketplacesById[objectId] = availableMarketplaces[tenantSlug][marketplaceSlug];