@audius/sdk 1.0.42 → 1.0.43

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.
@@ -49,19 +49,19 @@ export declare class Account extends Base {
49
49
  * @param generateRecoveryLink an optional flag to skip generating recovery link for testing purposes
50
50
  */
51
51
  signUp(email: string, password: string, metadata: UserMetadata, profilePictureFile?: Nullable<File>, coverPhotoFile?: Nullable<File>, hasWallet?: boolean, host?: string | null, handleUserBankOutcomes?: (_outcome?: string | undefined, _errorCodes?: {} | undefined) => void, userBankOutcomes?: Partial<UserBankOutcomes>, feePayerOverride?: Nullable<string>, generateRecoveryLink?: boolean): Promise<{
52
+ blockHash: string;
53
+ blockNumber: number;
54
+ userId: number;
55
+ error?: undefined;
56
+ phase?: undefined;
57
+ errorStatus?: undefined;
58
+ } | {
52
59
  error: any;
53
60
  phase: string;
54
61
  errorStatus: any;
55
62
  blockHash?: undefined;
56
63
  blockNumber?: undefined;
57
64
  userId?: undefined;
58
- } | {
59
- blockHash: undefined;
60
- blockNumber: undefined;
61
- userId: undefined;
62
- error?: undefined;
63
- phase?: undefined;
64
- errorStatus?: undefined;
65
65
  }>;
66
66
  /**
67
67
  * Generates and sends a recovery email for a user
@@ -168,7 +168,11 @@ export declare class Users extends Base {
168
168
  uploadProfileImages(profilePictureFile: File, coverPhotoFile: File, metadata: UserMetadata): Promise<UserMetadata>;
169
169
  createEntityManagerUser({ metadata }: {
170
170
  metadata: UserMetadata;
171
- }): Promise<Pick<UserMetadata, keyof UserMetadata>>;
171
+ }): Promise<{
172
+ newMetadata: Pick<UserMetadata, keyof UserMetadata>;
173
+ blockHash: string;
174
+ blockNumber: number;
175
+ }>;
172
176
  /**
173
177
  * Create an on-chain non-creator user. Some fields are restricted (ex.
174
178
  * creator_node_endpoint); this should error if the metadata given attempts to set them.
@@ -247,7 +251,10 @@ export declare class Users extends Base {
247
251
  updateAndUploadMetadata({ newMetadata, userId }: {
248
252
  newMetadata: UserMetadata;
249
253
  userId: number;
250
- }): Promise<void>;
254
+ }): Promise<{
255
+ blockHash: string;
256
+ blockNumber: number;
257
+ }>;
251
258
  /**
252
259
  * If a user's creator_node_endpoint is null, assign a replica set.
253
260
  * Used during the sanity check and in uploadImage() in files.js
package/dist/index.cjs.js CHANGED
@@ -37387,9 +37387,9 @@ exports.ChatPermission = void 0;
37387
37387
  })(exports.ChatPermission || (exports.ChatPermission = {}));
37388
37388
 
37389
37389
  var name = "@audius/sdk";
37390
- var version = "1.0.42";
37390
+ var version = "1.0.43";
37391
37391
  var audius = {
37392
- releaseSHA: "245719683140d9237d692bc50dabbbea94dc5175"
37392
+ releaseSHA: "ec73ca0407b42e6ad140f9f6a6a5c48da8539be0"
37393
37393
  };
37394
37394
  var description = "";
37395
37395
  var main = "dist/index.cjs.js";
@@ -55424,12 +55424,13 @@ var Account = /*#__PURE__*/function (_Base) {
55424
55424
  generateRecoveryLink,
55425
55425
  phases,
55426
55426
  phase,
55427
- userId,
55428
- blockHash,
55429
- blockNumber,
55430
55427
  ownerWallet,
55428
+ _yield$this$User$crea,
55431
55429
  newMetadata,
55430
+ blockHash,
55431
+ blockNumber,
55432
55432
  _args4 = arguments;
55433
+
55433
55434
  return regeneratorRuntime.wrap(function _callee4$(_context4) {
55434
55435
  while (1) {
55435
55436
  switch (_context4.prev = _context4.next) {
@@ -55556,16 +55557,22 @@ var Account = /*#__PURE__*/function (_Base) {
55556
55557
  });
55557
55558
 
55558
55559
  case 31:
55559
- newMetadata = _context4.sent;
55560
- _context4.next = 34;
55560
+ _yield$this$User$crea = _context4.sent;
55561
+ newMetadata = _yield$this$User$crea.newMetadata;
55562
+ blockHash = _yield$this$User$crea.blockHash;
55563
+ blockNumber = _yield$this$User$crea.blockNumber;
55564
+ _context4.next = 37;
55561
55565
  return this.User.uploadProfileImages(profilePictureFile, coverPhotoFile, newMetadata);
55562
55566
 
55563
- case 34:
55564
- _context4.next = 39;
55565
- break;
55567
+ case 37:
55568
+ return _context4.abrupt("return", {
55569
+ blockHash: blockHash,
55570
+ blockNumber: blockNumber,
55571
+ userId: newMetadata.user_id
55572
+ });
55566
55573
 
55567
- case 36:
55568
- _context4.prev = 36;
55574
+ case 40:
55575
+ _context4.prev = 40;
55569
55576
  _context4.t0 = _context4["catch"](10);
55570
55577
  return _context4.abrupt("return", {
55571
55578
  error: _context4.t0.message,
@@ -55573,19 +55580,12 @@ var Account = /*#__PURE__*/function (_Base) {
55573
55580
  errorStatus: _context4.t0.response ? _context4.t0.response.status : null
55574
55581
  });
55575
55582
 
55576
- case 39:
55577
- return _context4.abrupt("return", {
55578
- blockHash: blockHash,
55579
- blockNumber: blockNumber,
55580
- userId: userId
55581
- });
55582
-
55583
- case 40:
55583
+ case 43:
55584
55584
  case "end":
55585
55585
  return _context4.stop();
55586
55586
  }
55587
55587
  }
55588
- }, _callee4, this, [[10, 36]]);
55588
+ }, _callee4, this, [[10, 40]]);
55589
55589
  }));
55590
55590
 
55591
55591
  function signUp(_x3, _x4, _x5) {
@@ -57742,7 +57742,8 @@ var Users = /*#__PURE__*/function (_Base) {
57742
57742
  var _createEntityManagerUser = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15(_ref2) {
57743
57743
  var _this2 = this;
57744
57744
 
57745
- var metadata, phases, phase, logPrefix, fnStartMs, startMs, response, primary, secondaries, spIds, userId, manageEntityResponse, newMetadata, newContentNodeEndpoints, errorMsg;
57745
+ var metadata, phases, phase, logPrefix, fnStartMs, startMs, response, primary, secondaries, spIds, userId, manageEntityResponse, newMetadata, newContentNodeEndpoints, _yield$this$updateAnd, blockHash, blockNumber, errorMsg;
57746
+
57746
57747
  return regeneratorRuntime.wrap(function _callee15$(_context15) {
57747
57748
  while (1) {
57748
57749
  switch (_context15.prev = _context15.next) {
@@ -57864,32 +57865,39 @@ var Users = /*#__PURE__*/function (_Base) {
57864
57865
  });
57865
57866
 
57866
57867
  case 42:
57868
+ _yield$this$updateAnd = _context15.sent;
57869
+ blockHash = _yield$this$updateAnd.blockHash;
57870
+ blockNumber = _yield$this$updateAnd.blockNumber;
57867
57871
  console.log("".concat(logPrefix, " [phase: ").concat(phase, "] updateAndUploadMetadata() completed in ").concat(Date.now() - startMs, "ms"));
57868
57872
  console.log("".concat(logPrefix, " completed in ").concat(Date.now() - fnStartMs, "ms"));
57869
- return _context15.abrupt("return", newMetadata);
57873
+ return _context15.abrupt("return", {
57874
+ newMetadata: newMetadata,
57875
+ blockHash: blockHash,
57876
+ blockNumber: blockNumber
57877
+ });
57870
57878
 
57871
- case 47:
57872
- _context15.prev = 47;
57879
+ case 50:
57880
+ _context15.prev = 50;
57873
57881
  _context15.t0 = _context15["catch"](7);
57874
57882
  errorMsg = "assignReplicaSet() Error -- Phase ".concat(phase, " in ").concat(Date.now() - fnStartMs, "ms: ").concat(_context15.t0);
57875
57883
 
57876
57884
  if (!(_context15.t0 instanceof Error)) {
57877
- _context15.next = 53;
57885
+ _context15.next = 56;
57878
57886
  break;
57879
57887
  }
57880
57888
 
57881
57889
  _context15.t0.message = errorMsg;
57882
57890
  throw _context15.t0;
57883
57891
 
57884
- case 53:
57892
+ case 56:
57885
57893
  throw new Error(errorMsg);
57886
57894
 
57887
- case 54:
57895
+ case 57:
57888
57896
  case "end":
57889
57897
  return _context15.stop();
57890
57898
  }
57891
57899
  }
57892
- }, _callee15, this, [[7, 47]]);
57900
+ }, _callee15, this, [[7, 50]]);
57893
57901
  }));
57894
57902
 
57895
57903
  function createEntityManagerUser(_x13) {
@@ -58472,32 +58480,34 @@ var Users = /*#__PURE__*/function (_Base) {
58472
58480
 
58473
58481
  this.userStateManager.setCurrentUser(_objectSpread2(_objectSpread2({}, oldMetadata), newMetadata));
58474
58482
  console.log("".concat(logPrefix, " completed in ").concat(Date.now() - fnStartMs, "ms"));
58475
- _context25.next = 59;
58476
- break;
58483
+ return _context25.abrupt("return", {
58484
+ blockHash: txReceipt.blockHash,
58485
+ blockNumber: blockNumber
58486
+ });
58477
58487
 
58478
- case 52:
58479
- _context25.prev = 52;
58488
+ case 53:
58489
+ _context25.prev = 53;
58480
58490
  _context25.t0 = _context25["catch"](13);
58481
58491
  // TODO: think about handling the update metadata on chain and associating..
58482
58492
  errorMsg = "updateAndUploadMetadata() Error -- Phase ".concat(phase, " in ").concat(Date.now() - fnStartMs, "ms: ").concat(_context25.t0);
58483
58493
 
58484
58494
  if (!(_context25.t0 instanceof Error)) {
58485
- _context25.next = 58;
58495
+ _context25.next = 59;
58486
58496
  break;
58487
58497
  }
58488
58498
 
58489
58499
  _context25.t0.message = errorMsg;
58490
58500
  throw _context25.t0;
58491
58501
 
58492
- case 58:
58502
+ case 59:
58493
58503
  throw new Error(errorMsg);
58494
58504
 
58495
- case 59:
58505
+ case 60:
58496
58506
  case "end":
58497
58507
  return _context25.stop();
58498
58508
  }
58499
58509
  }
58500
- }, _callee25, this, [[13, 52]]);
58510
+ }, _callee25, this, [[13, 53]]);
58501
58511
  }));
58502
58512
 
58503
58513
  function updateAndUploadMetadata(_x27) {