@eluvio/elv-client-js 4.0.147 → 4.1.0

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