@eluvio/elv-client-js 4.2.4 → 4.2.6

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.
Files changed (41) hide show
  1. package/dist/ElvClient-min.js +1 -1
  2. package/dist/ElvClient-node-min.js +1 -1
  3. package/dist/ElvFrameClient-min.js +1 -1
  4. package/dist/ElvPermissionsClient-min.js +1 -1
  5. package/dist/ElvWalletClient-min.js +1 -1
  6. package/dist/ElvWalletClient-node-min.js +1 -1
  7. package/dist/src/AuthorizationClient.js +710 -709
  8. package/dist/src/ContentObjectAudit.js +56 -56
  9. package/dist/src/ContentObjectVerification.js +281 -0
  10. package/dist/src/Crypto.js +85 -85
  11. package/dist/src/ElvClient.js +499 -529
  12. package/dist/src/ElvWallet.js +28 -30
  13. package/dist/src/EthClient.js +311 -311
  14. package/dist/src/FrameClient.js +64 -63
  15. package/dist/src/HttpClient.js +60 -60
  16. package/dist/src/Id.js +2 -1
  17. package/dist/src/PermissionsClient.js +487 -499
  18. package/dist/src/RemoteSigner.js +83 -82
  19. package/dist/src/UserProfileClient.js +374 -392
  20. package/dist/src/Utils.js +66 -69
  21. package/dist/src/Validation.js +10 -10
  22. package/dist/src/client/ABRPublishing.js +238 -238
  23. package/dist/src/client/AccessGroups.js +474 -477
  24. package/dist/src/client/ContentAccess.js +1709 -1705
  25. package/dist/src/client/ContentManagement.js +871 -871
  26. package/dist/src/client/Contracts.js +578 -575
  27. package/dist/src/client/Files.js +684 -700
  28. package/dist/src/client/LiveConf.js +3 -1
  29. package/dist/src/client/LiveStream.js +693 -694
  30. package/dist/src/client/NFT.js +14 -14
  31. package/dist/src/client/NTP.js +84 -84
  32. package/dist/src/client/Shares.js +60 -53
  33. package/dist/src/walletClient/ClientMethods.js +951 -977
  34. package/dist/src/walletClient/Notifications.js +14 -14
  35. package/dist/src/walletClient/Profile.js +66 -66
  36. package/dist/src/walletClient/Utils.js +15 -15
  37. package/dist/src/walletClient/index.js +562 -572
  38. package/package.json +1 -1
  39. package/src/Utils.js +1 -4
  40. package/src/client/ABRPublishing.js +1 -1
  41. package/src/client/LiveStream.js +77 -50
@@ -2,10 +2,10 @@ var _regeneratorRuntime = require("@babel/runtime/regenerator");
2
2
  var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
3
3
  var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
4
4
  var _createClass = require("@babel/runtime/helpers/createClass");
5
+ var _inherits = require("@babel/runtime/helpers/inherits");
5
6
  var _possibleConstructorReturn = require("@babel/runtime/helpers/possibleConstructorReturn");
6
7
  var _getPrototypeOf = require("@babel/runtime/helpers/getPrototypeOf");
7
- var _inherits = require("@babel/runtime/helpers/inherits");
8
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
+ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
9
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
10
  var Ethers = require("ethers");
11
11
  var Utils = require("./Utils");
@@ -15,6 +15,8 @@ var UUID = require("uuid");
15
15
  var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
16
16
  "use strict";
17
17
 
18
+ _inherits(RemoteSigner, _Ethers$Signer);
19
+ var _super = _createSuper(RemoteSigner);
18
20
  function RemoteSigner(_ref) {
19
21
  var _this;
20
22
  var signerURIs = _ref.signerURIs,
@@ -27,7 +29,7 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
27
29
  _ref$unsignedPublicAu = _ref.unsignedPublicAuth,
28
30
  unsignedPublicAuth = _ref$unsignedPublicAu === void 0 ? false : _ref$unsignedPublicAu;
29
31
  _classCallCheck(this, RemoteSigner);
30
- _this = _callSuper(this, RemoteSigner);
32
+ _this = _super.call(this);
31
33
  _this.remoteSigner = true;
32
34
  _this.unsignedPublicAuth = unsignedPublicAuth;
33
35
  _this.HttpClient = new HttpClient({
@@ -41,20 +43,19 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
41
43
  _this.signatureCache = {};
42
44
  return _this;
43
45
  }
44
- _inherits(RemoteSigner, _Ethers$Signer);
45
- return _createClass(RemoteSigner, [{
46
+ _createClass(RemoteSigner, [{
46
47
  key: "Initialize",
47
48
  value: function () {
48
- var _Initialize = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
49
+ var _Initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
49
50
  var _yield$Utils$Response, addr, eth, token, keys, address;
50
- return _regeneratorRuntime.wrap(function (_context) {
51
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
51
52
  while (1) switch (_context.prev = _context.next) {
52
53
  case 0:
53
54
  if (this.authToken) {
54
- _context.next = 2;
55
+ _context.next = 10;
55
56
  break;
56
57
  }
57
- _context.next = 1;
58
+ _context.next = 3;
58
59
  return Utils.ResponseToJson(this.HttpClient.Request({
59
60
  path: UrlJoin("as", "wlt", "login", "jwt"),
60
61
  method: "POST",
@@ -68,7 +69,7 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
68
69
  Authorization: "Bearer ".concat(this.idToken)
69
70
  }
70
71
  }));
71
- case 1:
72
+ case 3:
72
73
  _yield$Utils$Response = _context.sent;
73
74
  addr = _yield$Utils$Response.addr;
74
75
  eth = _yield$Utils$Response.eth;
@@ -76,12 +77,12 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
76
77
  this.authToken = token;
77
78
  this.address = Utils.FormatAddress(addr);
78
79
  this.id = eth;
79
- case 2:
80
+ case 10:
80
81
  if (this.address) {
81
- _context.next = 4;
82
+ _context.next = 16;
82
83
  break;
83
84
  }
84
- _context.next = 3;
85
+ _context.next = 13;
85
86
  return Utils.ResponseToJson(this.HttpClient.Request({
86
87
  method: "GET",
87
88
  path: UrlJoin("as", "wlt", "keys"),
@@ -89,7 +90,7 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
89
90
  Authorization: "Bearer ".concat(this.authToken)
90
91
  }
91
92
  }));
92
- case 3:
93
+ case 13:
93
94
  keys = _context.sent;
94
95
  address = keys.eth[0];
95
96
  if (address && address.startsWith("0x")) {
@@ -97,10 +98,10 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
97
98
  } else {
98
99
  this.address = Utils.HashToAddress(keys.eth[0]);
99
100
  }
100
- case 4:
101
+ case 16:
101
102
  this.id = this.address ? "ikms".concat(Utils.AddressToHash(this.address)) : undefined;
102
103
  this.signer = this.provider.getSigner(this.address);
103
- case 5:
104
+ case 18:
104
105
  case "end":
105
106
  return _context.stop();
106
107
  }
@@ -114,14 +115,14 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
114
115
  }, {
115
116
  key: "RetrieveCSAT",
116
117
  value: function () {
117
- var _RetrieveCSAT = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
118
+ var _RetrieveCSAT = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
118
119
  var email, nonce, tenantId, _ref2$force, force, _ref2$duration, duration, response;
119
- return _regeneratorRuntime.wrap(function (_context2) {
120
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
120
121
  while (1) switch (_context2.prev = _context2.next) {
121
122
  case 0:
122
123
  email = _ref2.email, nonce = _ref2.nonce, tenantId = _ref2.tenantId, _ref2$force = _ref2.force, force = _ref2$force === void 0 ? false : _ref2$force, _ref2$duration = _ref2.duration, duration = _ref2$duration === void 0 ? 24 : _ref2$duration;
123
124
  nonce = nonce || Utils.B58(UUID.parse(UUID.v4()));
124
- _context2.next = 1;
125
+ _context2.next = 4;
125
126
  return Utils.ResponseToJson(this.HttpClient.Request({
126
127
  method: "POST",
127
128
  body: {
@@ -136,11 +137,11 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
136
137
  Authorization: "Bearer ".concat(this.authToken)
137
138
  }
138
139
  }));
139
- case 1:
140
+ case 4:
140
141
  response = _context2.sent;
141
142
  response.nonce = nonce;
142
143
  return _context2.abrupt("return", response);
143
- case 2:
144
+ case 7:
144
145
  case "end":
145
146
  return _context2.stop();
146
147
  }
@@ -154,14 +155,14 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
154
155
  }, {
155
156
  key: "CSATStatus",
156
157
  value: function () {
157
- var _CSATStatus = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
158
- var accessToken, response, _t;
159
- return _regeneratorRuntime.wrap(function (_context3) {
158
+ var _CSATStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
159
+ var accessToken, response;
160
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
160
161
  while (1) switch (_context3.prev = _context3.next) {
161
162
  case 0:
162
163
  accessToken = _ref3.accessToken;
163
164
  _context3.prev = 1;
164
- _context3.next = 2;
165
+ _context3.next = 4;
165
166
  return Utils.ResponseToJson(this.HttpClient.Request({
166
167
  method: "POST",
167
168
  path: UrlJoin("as", "wlt", "login", "status"),
@@ -169,18 +170,18 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
169
170
  Authorization: "Bearer ".concat(accessToken)
170
171
  }
171
172
  }));
172
- case 2:
173
+ case 4:
173
174
  response = _context3.sent;
174
175
  return _context3.abrupt("return", response && response.is_active);
175
- case 3:
176
- _context3.prev = 3;
177
- _t = _context3["catch"](1);
178
- return _context3.abrupt("return", !_t || _t.status !== 403);
179
- case 4:
176
+ case 8:
177
+ _context3.prev = 8;
178
+ _context3.t0 = _context3["catch"](1);
179
+ return _context3.abrupt("return", !_context3.t0 || _context3.t0.status !== 403);
180
+ case 11:
180
181
  case "end":
181
182
  return _context3.stop();
182
183
  }
183
- }, _callee3, this, [[1, 3]]);
184
+ }, _callee3, this, [[1, 8]]);
184
185
  }));
185
186
  function CSATStatus(_x2) {
186
187
  return _CSATStatus.apply(this, arguments);
@@ -190,13 +191,13 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
190
191
  }, {
191
192
  key: "ReleaseCSAT",
192
193
  value: function () {
193
- var _ReleaseCSAT = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
194
+ var _ReleaseCSAT = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
194
195
  var accessToken;
195
- return _regeneratorRuntime.wrap(function (_context4) {
196
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
196
197
  while (1) switch (_context4.prev = _context4.next) {
197
198
  case 0:
198
199
  accessToken = _ref4.accessToken;
199
- _context4.next = 1;
200
+ _context4.next = 3;
200
201
  return Utils.ResponseToJson(this.HttpClient.Request({
201
202
  method: "POST",
202
203
  path: UrlJoin("as", "wlt", "login", "release"),
@@ -204,9 +205,9 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
204
205
  Authorization: "Bearer ".concat(accessToken)
205
206
  }
206
207
  }));
207
- case 1:
208
+ case 3:
208
209
  return _context4.abrupt("return", _context4.sent);
209
- case 2:
210
+ case 4:
210
211
  case "end":
211
212
  return _context4.stop();
212
213
  }
@@ -225,20 +226,20 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
225
226
  }, {
226
227
  key: "signDigest",
227
228
  value: function () {
228
- var _signDigest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(digest) {
229
+ var _signDigest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(digest) {
229
230
  var _this2 = this;
230
- return _regeneratorRuntime.wrap(function (_context6) {
231
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
231
232
  while (1) switch (_context6.prev = _context6.next) {
232
233
  case 0:
233
234
  if (!this.signatureCache[digest]) {
234
- this.signatureCache[digest] = new Promise(/*#__PURE__*/function () {
235
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(resolve, reject) {
236
- var signature, _t2;
237
- return _regeneratorRuntime.wrap(function (_context5) {
235
+ this.signatureCache[digest] = new Promise( /*#__PURE__*/function () {
236
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(resolve, reject) {
237
+ var signature;
238
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
238
239
  while (1) switch (_context5.prev = _context5.next) {
239
240
  case 0:
240
241
  _context5.prev = 0;
241
- _context5.next = 1;
242
+ _context5.next = 3;
242
243
  return Utils.ResponseToJson(_this2.HttpClient.Request({
243
244
  method: "POST",
244
245
  path: UrlJoin("as", "wlt", "sign", "eth", _this2.id),
@@ -249,33 +250,33 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
249
250
  hash: digest
250
251
  }
251
252
  }));
252
- case 1:
253
+ case 3:
253
254
  signature = _context5.sent;
254
255
  signature.v = parseInt(signature.v, 16);
255
256
  signature.recoveryParam = signature.v - 27;
256
257
  resolve(signature);
257
- _context5.next = 3;
258
+ _context5.next = 12;
258
259
  break;
259
- case 2:
260
- _context5.prev = 2;
261
- _t2 = _context5["catch"](0);
262
- reject(_t2);
263
- case 3:
260
+ case 9:
261
+ _context5.prev = 9;
262
+ _context5.t0 = _context5["catch"](0);
263
+ reject(_context5.t0);
264
+ case 12:
264
265
  case "end":
265
266
  return _context5.stop();
266
267
  }
267
- }, _callee5, null, [[0, 2]]);
268
+ }, _callee5, null, [[0, 9]]);
268
269
  }));
269
270
  return function (_x5, _x6) {
270
271
  return _ref5.apply(this, arguments);
271
272
  };
272
273
  }());
273
274
  }
274
- _context6.next = 1;
275
+ _context6.next = 3;
275
276
  return this.signatureCache[digest];
276
- case 1:
277
+ case 3:
277
278
  return _context6.abrupt("return", _context6.sent);
278
- case 2:
279
+ case 4:
279
280
  case "end":
280
281
  return _context6.stop();
281
282
  }
@@ -289,22 +290,21 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
289
290
  }, {
290
291
  key: "signMessage",
291
292
  value: function () {
292
- var _signMessage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(message) {
293
- var _t3, _t4, _t5, _t6, _t7, _t8;
294
- return _regeneratorRuntime.wrap(function (_context7) {
293
+ var _signMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(message) {
294
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
295
295
  while (1) switch (_context7.prev = _context7.next) {
296
296
  case 0:
297
- _t3 = Promise;
298
- _t4 = Ethers.utils;
299
- _t5 = "0x";
300
- _context7.next = 1;
297
+ _context7.t0 = Promise;
298
+ _context7.t1 = Ethers.utils;
299
+ _context7.t2 = "0x";
300
+ _context7.next = 5;
301
301
  return this.signDigest(Ethers.utils.hashMessage(message));
302
- case 1:
303
- _t6 = _context7.sent;
304
- _t7 = _t5.concat.call(_t5, _t6);
305
- _t8 = _t4.joinSignature.call(_t4, _t7);
306
- return _context7.abrupt("return", _t3.resolve.call(_t3, _t8));
307
- case 2:
302
+ case 5:
303
+ _context7.t3 = _context7.sent;
304
+ _context7.t4 = _context7.t2.concat.call(_context7.t2, _context7.t3);
305
+ _context7.t5 = _context7.t1.joinSignature.call(_context7.t1, _context7.t4);
306
+ return _context7.abrupt("return", _context7.t0.resolve.call(_context7.t0, _context7.t5));
307
+ case 9:
308
308
  case "end":
309
309
  return _context7.stop();
310
310
  }
@@ -318,21 +318,21 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
318
318
  }, {
319
319
  key: "sign",
320
320
  value: function () {
321
- var _sign = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(transaction) {
321
+ var _sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(transaction) {
322
322
  var signature;
323
- return _regeneratorRuntime.wrap(function (_context8) {
323
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
324
324
  while (1) switch (_context8.prev = _context8.next) {
325
325
  case 0:
326
- _context8.next = 1;
326
+ _context8.next = 2;
327
327
  return Ethers.utils.resolveProperties(transaction);
328
- case 1:
328
+ case 2:
329
329
  transaction = _context8.sent;
330
- _context8.next = 2;
330
+ _context8.next = 5;
331
331
  return this.signDigest(Ethers.utils.keccak256(Ethers.utils.serializeTransaction(transaction)));
332
- case 2:
332
+ case 5:
333
333
  signature = _context8.sent;
334
334
  return _context8.abrupt("return", Ethers.utils.serializeTransaction(transaction, signature));
335
- case 3:
335
+ case 7:
336
336
  case "end":
337
337
  return _context8.stop();
338
338
  }
@@ -346,27 +346,27 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
346
346
  }, {
347
347
  key: "sendTransaction",
348
348
  value: function () {
349
- var _sendTransaction = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(transaction) {
349
+ var _sendTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(transaction) {
350
350
  var _this3 = this;
351
- return _regeneratorRuntime.wrap(function (_context9) {
351
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
352
352
  while (1) switch (_context9.prev = _context9.next) {
353
353
  case 0:
354
354
  if (!(transaction.nonce == null)) {
355
- _context9.next = 2;
355
+ _context9.next = 5;
356
356
  break;
357
357
  }
358
358
  transaction = Ethers.utils.shallowCopy(transaction);
359
- _context9.next = 1;
359
+ _context9.next = 4;
360
360
  return this.provider.getTransactionCount(this.address, "pending");
361
- case 1:
361
+ case 4:
362
362
  transaction.nonce = _context9.sent;
363
- case 2:
363
+ case 5:
364
364
  return _context9.abrupt("return", this.populateTransaction(transaction, this.provider, this.address).then(function (tx) {
365
365
  return _this3.sign(tx).then(function (signedTransaction) {
366
366
  return _this3.provider.sendTransaction(signedTransaction);
367
367
  });
368
368
  }));
369
- case 3:
369
+ case 6:
370
370
  case "end":
371
371
  return _context9.stop();
372
372
  }
@@ -381,5 +381,6 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
381
381
  key: "connect",
382
382
  value: function connect() {}
383
383
  }]);
384
+ return RemoteSigner;
384
385
  }(Ethers.Signer);
385
386
  module.exports = RemoteSigner;