@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/web-libs.js
CHANGED
|
@@ -30145,9 +30145,9 @@ var EthWeb3Manager = /*#__PURE__*/function () {
|
|
|
30145
30145
|
}();
|
|
30146
30146
|
|
|
30147
30147
|
var name = "@audius/sdk";
|
|
30148
|
-
var version = "3.0.3-beta.
|
|
30148
|
+
var version = "3.0.3-beta.55";
|
|
30149
30149
|
var audius = {
|
|
30150
|
-
releaseSHA: "
|
|
30150
|
+
releaseSHA: "0adb382c5750ea1da6b25a35bb857503ee32420a"
|
|
30151
30151
|
};
|
|
30152
30152
|
var description = "Audius SDK";
|
|
30153
30153
|
var main = "dist/index.cjs.js";
|
|
@@ -64309,9 +64309,7 @@ var Account = /*#__PURE__*/function (_Base) {
|
|
|
64309
64309
|
phase = phases.ADD_USER;
|
|
64310
64310
|
_context4.next = 34;
|
|
64311
64311
|
return this.User.createEntityManagerUserV2({
|
|
64312
|
-
metadata: metadata
|
|
64313
|
-
profilePictureFile: profilePictureFile,
|
|
64314
|
-
coverPhotoFile: coverPhotoFile
|
|
64312
|
+
metadata: metadata
|
|
64315
64313
|
});
|
|
64316
64314
|
|
|
64317
64315
|
case 34:
|
|
@@ -64319,14 +64317,20 @@ var Account = /*#__PURE__*/function (_Base) {
|
|
|
64319
64317
|
newMetadata = _yield$this$User$crea2.newMetadata;
|
|
64320
64318
|
blockHash = _yield$this$User$crea2.blockHash;
|
|
64321
64319
|
blockNumber = _yield$this$User$crea2.blockNumber;
|
|
64320
|
+
// Upload user's profile images, if any
|
|
64321
|
+
phase = phases.UPLOAD_PROFILE_IMAGES;
|
|
64322
|
+
_context4.next = 41;
|
|
64323
|
+
return this.User.uploadProfileImagesV2(profilePictureFile, coverPhotoFile, newMetadata);
|
|
64324
|
+
|
|
64325
|
+
case 41:
|
|
64322
64326
|
return _context4.abrupt("return", {
|
|
64323
64327
|
blockHash: blockHash,
|
|
64324
64328
|
blockNumber: blockNumber,
|
|
64325
64329
|
userId: newMetadata.user_id
|
|
64326
64330
|
});
|
|
64327
64331
|
|
|
64328
|
-
case
|
|
64329
|
-
_context4.prev =
|
|
64332
|
+
case 44:
|
|
64333
|
+
_context4.prev = 44;
|
|
64330
64334
|
_context4.t0 = _context4["catch"](7);
|
|
64331
64335
|
return _context4.abrupt("return", {
|
|
64332
64336
|
error: _context4.t0.message,
|
|
@@ -64334,12 +64338,12 @@ var Account = /*#__PURE__*/function (_Base) {
|
|
|
64334
64338
|
errorStatus: _context4.t0.response ? _context4.t0.response.status : null
|
|
64335
64339
|
});
|
|
64336
64340
|
|
|
64337
|
-
case
|
|
64341
|
+
case 47:
|
|
64338
64342
|
case "end":
|
|
64339
64343
|
return _context4.stop();
|
|
64340
64344
|
}
|
|
64341
64345
|
}
|
|
64342
|
-
}, _callee4, this, [[7,
|
|
64346
|
+
}, _callee4, this, [[7, 44]]);
|
|
64343
64347
|
}));
|
|
64344
64348
|
|
|
64345
64349
|
function signUpV2(_x6, _x7, _x8) {
|
|
@@ -66611,13 +66615,13 @@ var Users = /*#__PURE__*/function (_Base) {
|
|
|
66611
66615
|
key: "createEntityManagerUserV2",
|
|
66612
66616
|
value: function () {
|
|
66613
66617
|
var _createEntityManagerUserV = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17(_ref4) {
|
|
66614
|
-
var metadata,
|
|
66618
|
+
var metadata, userId, manageEntityResponse, newMetadata, _yield$this$updateMet, blockHash, blockNumber, errorMsg;
|
|
66615
66619
|
|
|
66616
66620
|
return regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
66617
66621
|
while (1) {
|
|
66618
66622
|
switch (_context17.prev = _context17.next) {
|
|
66619
66623
|
case 0:
|
|
66620
|
-
metadata = _ref4.metadata
|
|
66624
|
+
metadata = _ref4.metadata;
|
|
66621
66625
|
this.REQUIRES(Services.DISCOVERY_PROVIDER);
|
|
66622
66626
|
_context17.prev = 2;
|
|
66623
66627
|
_context17.next = 5;
|
|
@@ -66625,6 +66629,15 @@ var Users = /*#__PURE__*/function (_Base) {
|
|
|
66625
66629
|
|
|
66626
66630
|
case 5:
|
|
66627
66631
|
userId = _context17.sent;
|
|
66632
|
+
_context17.next = 8;
|
|
66633
|
+
return this.contracts.EntityManagerClient.manageEntity(userId, EntityManagerClient.EntityType.USER, userId, EntityManagerClient.Action.CREATE, 'v2');
|
|
66634
|
+
|
|
66635
|
+
case 8:
|
|
66636
|
+
manageEntityResponse = _context17.sent;
|
|
66637
|
+
_context17.next = 11;
|
|
66638
|
+
return this._waitForDiscoveryToIndexUser(userId, manageEntityResponse.txReceipt.blockNumber);
|
|
66639
|
+
|
|
66640
|
+
case 11:
|
|
66628
66641
|
// Ensure metadata has expected properties
|
|
66629
66642
|
newMetadata = this.cleanUserMetadata(_objectSpread2({}, metadata));
|
|
66630
66643
|
|
|
@@ -66640,81 +66653,46 @@ var Users = /*#__PURE__*/function (_Base) {
|
|
|
66640
66653
|
followee_count: 0,
|
|
66641
66654
|
follower_count: 0,
|
|
66642
66655
|
repost_count: 0
|
|
66643
|
-
})); //
|
|
66644
|
-
|
|
66645
|
-
if (!profilePictureFile) {
|
|
66646
|
-
_context17.next = 17;
|
|
66647
|
-
break;
|
|
66648
|
-
}
|
|
66649
|
-
|
|
66650
|
-
_context17.next = 15;
|
|
66651
|
-
return this.creatorNode.uploadProfilePictureV2(profilePictureFile);
|
|
66652
|
-
|
|
66653
|
-
case 15:
|
|
66654
|
-
resp = _context17.sent;
|
|
66655
|
-
newMetadata.profile_picture_sizes = resp.id;
|
|
66656
|
-
|
|
66657
|
-
case 17:
|
|
66658
|
-
if (!coverPhotoFile) {
|
|
66659
|
-
_context17.next = 22;
|
|
66660
|
-
break;
|
|
66661
|
-
}
|
|
66662
|
-
|
|
66663
|
-
_context17.next = 20;
|
|
66664
|
-
return this.creatorNode.uploadCoverPhotoV2(coverPhotoFile);
|
|
66656
|
+
})); // Update metadata on chain to include wallet
|
|
66665
66657
|
|
|
66666
|
-
|
|
66667
|
-
|
|
66668
|
-
|
|
66669
|
-
|
|
66670
|
-
|
|
66671
|
-
_context17.next = 24;
|
|
66672
|
-
return Utils.fileHasher.generateMetadataCidV1(newMetadata);
|
|
66673
|
-
|
|
66674
|
-
case 24:
|
|
66675
|
-
cid = _context17.sent;
|
|
66676
|
-
_context17.next = 27;
|
|
66677
|
-
return this.contracts.EntityManagerClient.manageEntity(userId, EntityManagerClient.EntityType.USER, userId, EntityManagerClient.Action.CREATE, JSON.stringify({
|
|
66678
|
-
cid: cid.toString(),
|
|
66679
|
-
data: newMetadata
|
|
66680
|
-
}));
|
|
66681
|
-
|
|
66682
|
-
case 27:
|
|
66683
|
-
manageEntityResponse = _context17.sent;
|
|
66684
|
-
_context17.next = 30;
|
|
66685
|
-
return this._waitForDiscoveryToIndexUser(userId, manageEntityResponse.txReceipt.blockNumber);
|
|
66658
|
+
_context17.next = 19;
|
|
66659
|
+
return this.updateMetadataV2({
|
|
66660
|
+
newMetadata: newMetadata,
|
|
66661
|
+
userId: userId
|
|
66662
|
+
});
|
|
66686
66663
|
|
|
66687
|
-
case
|
|
66688
|
-
|
|
66689
|
-
this.
|
|
66664
|
+
case 19:
|
|
66665
|
+
_yield$this$updateMet = _context17.sent;
|
|
66666
|
+
blockHash = _yield$this$updateMet.blockHash;
|
|
66667
|
+
blockNumber = _yield$this$updateMet.blockNumber;
|
|
66690
66668
|
return _context17.abrupt("return", {
|
|
66691
66669
|
newMetadata: newMetadata,
|
|
66692
|
-
blockHash:
|
|
66693
|
-
blockNumber:
|
|
66670
|
+
blockHash: blockHash,
|
|
66671
|
+
blockNumber: blockNumber
|
|
66694
66672
|
});
|
|
66695
66673
|
|
|
66696
|
-
case
|
|
66697
|
-
_context17.prev =
|
|
66674
|
+
case 25:
|
|
66675
|
+
_context17.prev = 25;
|
|
66698
66676
|
_context17.t0 = _context17["catch"](2);
|
|
66699
66677
|
errorMsg = "createEntityManagerUserV2() error: ".concat(_context17.t0);
|
|
66700
66678
|
|
|
66701
66679
|
if (!(_context17.t0 instanceof Error)) {
|
|
66702
|
-
_context17.next =
|
|
66680
|
+
_context17.next = 31;
|
|
66703
66681
|
break;
|
|
66704
66682
|
}
|
|
66705
66683
|
|
|
66706
66684
|
_context17.t0.message = errorMsg;
|
|
66707
66685
|
throw _context17.t0;
|
|
66708
66686
|
|
|
66709
|
-
case
|
|
66687
|
+
case 31:
|
|
66710
66688
|
throw new Error(errorMsg);
|
|
66711
66689
|
|
|
66712
|
-
case
|
|
66690
|
+
case 32:
|
|
66713
66691
|
case "end":
|
|
66714
66692
|
return _context17.stop();
|
|
66715
66693
|
}
|
|
66716
66694
|
}
|
|
66717
|
-
}, _callee17, this, [[2,
|
|
66695
|
+
}, _callee17, this, [[2, 25]]);
|
|
66718
66696
|
}));
|
|
66719
66697
|
|
|
66720
66698
|
function createEntityManagerUserV2(_x18) {
|