@audius/sdk 3.0.3-beta.54 → 3.0.3-beta.55
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/dist/api/Users.d.ts +1 -3
- package/dist/index.cjs.js +42 -64
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +42 -64
- package/dist/index.esm.js.map +1 -1
- package/dist/legacy.js +42 -64
- package/dist/legacy.js.map +1 -1
- package/dist/native-libs.js +42 -64
- package/dist/native-libs.js.map +1 -1
- package/dist/web-libs.js +42 -64
- package/dist/web-libs.js.map +1 -1
- package/package.json +2 -2
- package/src/api/Account.ts +8 -3
- package/src/api/Users.ts +20 -44
- package/src/sdk/services/DiscoveryNodeSelector/healthChecks.ts +7 -6
package/dist/native-libs.js
CHANGED
|
@@ -600,9 +600,9 @@ if (typeof window !== 'undefined' && window && window.Web3) {
|
|
|
600
600
|
var LibsWeb3 = Web3;
|
|
601
601
|
|
|
602
602
|
var name = "@audius/sdk";
|
|
603
|
-
var version$1 = "3.0.3-beta.
|
|
603
|
+
var version$1 = "3.0.3-beta.55";
|
|
604
604
|
var audius = {
|
|
605
|
-
releaseSHA: "
|
|
605
|
+
releaseSHA: "0adb382c5750ea1da6b25a35bb857503ee32420a"
|
|
606
606
|
};
|
|
607
607
|
var description = "Audius SDK";
|
|
608
608
|
var main = "dist/index.cjs.js";
|
|
@@ -43452,9 +43452,7 @@ var Account = /*#__PURE__*/function (_Base) {
|
|
|
43452
43452
|
phase = phases.ADD_USER;
|
|
43453
43453
|
_context4.next = 34;
|
|
43454
43454
|
return this.User.createEntityManagerUserV2({
|
|
43455
|
-
metadata: metadata
|
|
43456
|
-
profilePictureFile: profilePictureFile,
|
|
43457
|
-
coverPhotoFile: coverPhotoFile
|
|
43455
|
+
metadata: metadata
|
|
43458
43456
|
});
|
|
43459
43457
|
|
|
43460
43458
|
case 34:
|
|
@@ -43462,14 +43460,20 @@ var Account = /*#__PURE__*/function (_Base) {
|
|
|
43462
43460
|
newMetadata = _yield$this$User$crea2.newMetadata;
|
|
43463
43461
|
blockHash = _yield$this$User$crea2.blockHash;
|
|
43464
43462
|
blockNumber = _yield$this$User$crea2.blockNumber;
|
|
43463
|
+
// Upload user's profile images, if any
|
|
43464
|
+
phase = phases.UPLOAD_PROFILE_IMAGES;
|
|
43465
|
+
_context4.next = 41;
|
|
43466
|
+
return this.User.uploadProfileImagesV2(profilePictureFile, coverPhotoFile, newMetadata);
|
|
43467
|
+
|
|
43468
|
+
case 41:
|
|
43465
43469
|
return _context4.abrupt("return", {
|
|
43466
43470
|
blockHash: blockHash,
|
|
43467
43471
|
blockNumber: blockNumber,
|
|
43468
43472
|
userId: newMetadata.user_id
|
|
43469
43473
|
});
|
|
43470
43474
|
|
|
43471
|
-
case
|
|
43472
|
-
_context4.prev =
|
|
43475
|
+
case 44:
|
|
43476
|
+
_context4.prev = 44;
|
|
43473
43477
|
_context4.t0 = _context4["catch"](7);
|
|
43474
43478
|
return _context4.abrupt("return", {
|
|
43475
43479
|
error: _context4.t0.message,
|
|
@@ -43477,12 +43481,12 @@ var Account = /*#__PURE__*/function (_Base) {
|
|
|
43477
43481
|
errorStatus: _context4.t0.response ? _context4.t0.response.status : null
|
|
43478
43482
|
});
|
|
43479
43483
|
|
|
43480
|
-
case
|
|
43484
|
+
case 47:
|
|
43481
43485
|
case "end":
|
|
43482
43486
|
return _context4.stop();
|
|
43483
43487
|
}
|
|
43484
43488
|
}
|
|
43485
|
-
}, _callee4, this, [[7,
|
|
43489
|
+
}, _callee4, this, [[7, 44]]);
|
|
43486
43490
|
}));
|
|
43487
43491
|
|
|
43488
43492
|
function signUpV2(_x6, _x7, _x8) {
|
|
@@ -45754,13 +45758,13 @@ var Users = /*#__PURE__*/function (_Base) {
|
|
|
45754
45758
|
key: "createEntityManagerUserV2",
|
|
45755
45759
|
value: function () {
|
|
45756
45760
|
var _createEntityManagerUserV = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17(_ref4) {
|
|
45757
|
-
var metadata,
|
|
45761
|
+
var metadata, userId, manageEntityResponse, newMetadata, _yield$this$updateMet, blockHash, blockNumber, errorMsg;
|
|
45758
45762
|
|
|
45759
45763
|
return regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
45760
45764
|
while (1) {
|
|
45761
45765
|
switch (_context17.prev = _context17.next) {
|
|
45762
45766
|
case 0:
|
|
45763
|
-
metadata = _ref4.metadata
|
|
45767
|
+
metadata = _ref4.metadata;
|
|
45764
45768
|
this.REQUIRES(Services.DISCOVERY_PROVIDER);
|
|
45765
45769
|
_context17.prev = 2;
|
|
45766
45770
|
_context17.next = 5;
|
|
@@ -45768,6 +45772,15 @@ var Users = /*#__PURE__*/function (_Base) {
|
|
|
45768
45772
|
|
|
45769
45773
|
case 5:
|
|
45770
45774
|
userId = _context17.sent;
|
|
45775
|
+
_context17.next = 8;
|
|
45776
|
+
return this.contracts.EntityManagerClient.manageEntity(userId, EntityManagerClient.EntityType.USER, userId, EntityManagerClient.Action.CREATE, 'v2');
|
|
45777
|
+
|
|
45778
|
+
case 8:
|
|
45779
|
+
manageEntityResponse = _context17.sent;
|
|
45780
|
+
_context17.next = 11;
|
|
45781
|
+
return this._waitForDiscoveryToIndexUser(userId, manageEntityResponse.txReceipt.blockNumber);
|
|
45782
|
+
|
|
45783
|
+
case 11:
|
|
45771
45784
|
// Ensure metadata has expected properties
|
|
45772
45785
|
newMetadata = this.cleanUserMetadata(_objectSpread2({}, metadata));
|
|
45773
45786
|
|
|
@@ -45783,81 +45796,46 @@ var Users = /*#__PURE__*/function (_Base) {
|
|
|
45783
45796
|
followee_count: 0,
|
|
45784
45797
|
follower_count: 0,
|
|
45785
45798
|
repost_count: 0
|
|
45786
|
-
})); //
|
|
45787
|
-
|
|
45788
|
-
if (!profilePictureFile) {
|
|
45789
|
-
_context17.next = 17;
|
|
45790
|
-
break;
|
|
45791
|
-
}
|
|
45792
|
-
|
|
45793
|
-
_context17.next = 15;
|
|
45794
|
-
return this.creatorNode.uploadProfilePictureV2(profilePictureFile);
|
|
45795
|
-
|
|
45796
|
-
case 15:
|
|
45797
|
-
resp = _context17.sent;
|
|
45798
|
-
newMetadata.profile_picture_sizes = resp.id;
|
|
45799
|
-
|
|
45800
|
-
case 17:
|
|
45801
|
-
if (!coverPhotoFile) {
|
|
45802
|
-
_context17.next = 22;
|
|
45803
|
-
break;
|
|
45804
|
-
}
|
|
45805
|
-
|
|
45806
|
-
_context17.next = 20;
|
|
45807
|
-
return this.creatorNode.uploadCoverPhotoV2(coverPhotoFile);
|
|
45799
|
+
})); // Update metadata on chain to include wallet
|
|
45808
45800
|
|
|
45809
|
-
|
|
45810
|
-
|
|
45811
|
-
|
|
45812
|
-
|
|
45813
|
-
|
|
45814
|
-
_context17.next = 24;
|
|
45815
|
-
return Utils.fileHasher.generateMetadataCidV1(newMetadata);
|
|
45816
|
-
|
|
45817
|
-
case 24:
|
|
45818
|
-
cid = _context17.sent;
|
|
45819
|
-
_context17.next = 27;
|
|
45820
|
-
return this.contracts.EntityManagerClient.manageEntity(userId, EntityManagerClient.EntityType.USER, userId, EntityManagerClient.Action.CREATE, JSON.stringify({
|
|
45821
|
-
cid: cid.toString(),
|
|
45822
|
-
data: newMetadata
|
|
45823
|
-
}));
|
|
45824
|
-
|
|
45825
|
-
case 27:
|
|
45826
|
-
manageEntityResponse = _context17.sent;
|
|
45827
|
-
_context17.next = 30;
|
|
45828
|
-
return this._waitForDiscoveryToIndexUser(userId, manageEntityResponse.txReceipt.blockNumber);
|
|
45801
|
+
_context17.next = 19;
|
|
45802
|
+
return this.updateMetadataV2({
|
|
45803
|
+
newMetadata: newMetadata,
|
|
45804
|
+
userId: userId
|
|
45805
|
+
});
|
|
45829
45806
|
|
|
45830
|
-
case
|
|
45831
|
-
|
|
45832
|
-
this.
|
|
45807
|
+
case 19:
|
|
45808
|
+
_yield$this$updateMet = _context17.sent;
|
|
45809
|
+
blockHash = _yield$this$updateMet.blockHash;
|
|
45810
|
+
blockNumber = _yield$this$updateMet.blockNumber;
|
|
45833
45811
|
return _context17.abrupt("return", {
|
|
45834
45812
|
newMetadata: newMetadata,
|
|
45835
|
-
blockHash:
|
|
45836
|
-
blockNumber:
|
|
45813
|
+
blockHash: blockHash,
|
|
45814
|
+
blockNumber: blockNumber
|
|
45837
45815
|
});
|
|
45838
45816
|
|
|
45839
|
-
case
|
|
45840
|
-
_context17.prev =
|
|
45817
|
+
case 25:
|
|
45818
|
+
_context17.prev = 25;
|
|
45841
45819
|
_context17.t0 = _context17["catch"](2);
|
|
45842
45820
|
errorMsg = "createEntityManagerUserV2() error: ".concat(_context17.t0);
|
|
45843
45821
|
|
|
45844
45822
|
if (!(_context17.t0 instanceof Error)) {
|
|
45845
|
-
_context17.next =
|
|
45823
|
+
_context17.next = 31;
|
|
45846
45824
|
break;
|
|
45847
45825
|
}
|
|
45848
45826
|
|
|
45849
45827
|
_context17.t0.message = errorMsg;
|
|
45850
45828
|
throw _context17.t0;
|
|
45851
45829
|
|
|
45852
|
-
case
|
|
45830
|
+
case 31:
|
|
45853
45831
|
throw new Error(errorMsg);
|
|
45854
45832
|
|
|
45855
|
-
case
|
|
45833
|
+
case 32:
|
|
45856
45834
|
case "end":
|
|
45857
45835
|
return _context17.stop();
|
|
45858
45836
|
}
|
|
45859
45837
|
}
|
|
45860
|
-
}, _callee17, this, [[2,
|
|
45838
|
+
}, _callee17, this, [[2, 25]]);
|
|
45861
45839
|
}));
|
|
45862
45840
|
|
|
45863
45841
|
function createEntityManagerUserV2(_x18) {
|