@eluvio/elv-client-js 4.2.10 → 4.2.11

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 (40) 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 +723 -710
  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 +500 -530
  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 +163 -114
  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 +6 -1
  29. package/dist/src/client/LiveStream.js +686 -723
  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 +581 -579
  38. package/package.json +1 -1
  39. package/src/client/LiveConf.js +5 -1
  40. package/src/client/LiveStream.js +9 -39
@@ -1,5 +1,6 @@
1
1
  var _defineProperty = require("@babel/runtime/helpers/defineProperty");
2
2
  var _regeneratorRuntime = require("@babel/runtime/regenerator");
3
+ var _toConsumableArray = require("@babel/runtime/helpers/toConsumableArray");
3
4
  var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
4
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -15,32 +16,38 @@ var UrlJoin = require("url-join");
15
16
  * Create a share
16
17
  *
17
18
  * @namedParams
18
- * @param {string} objectId - The object to create a share for
19
+ * @param {string} objectId - The ID of the object to share
20
+ * @param {Array<string>} objectIds - Additional object IDs to authorize
19
21
  * @param {Date} expiresAt - The expiration time of the share
20
22
  * @param {Object=} params - Additional parameters
21
23
  *
22
24
  * @returns {Promise<Object>} - Info about the created share
23
25
  */
24
26
  exports.CreateShare = /*#__PURE__*/function () {
25
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
26
- var objectId, expiresAt, _ref$params, params, tenantId, token, share;
27
- return _regeneratorRuntime.wrap(function (_context) {
27
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
28
+ var objectId, _ref$objectIds, objectIds, expiresAt, _ref$params, params, tenantId, token, share;
29
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
28
30
  while (1) switch (_context.prev = _context.next) {
29
31
  case 0:
30
- objectId = _ref.objectId, expiresAt = _ref.expiresAt, _ref$params = _ref.params, params = _ref$params === void 0 ? {} : _ref$params;
31
- _context.next = 1;
32
+ objectId = _ref.objectId, _ref$objectIds = _ref.objectIds, objectIds = _ref$objectIds === void 0 ? [] : _ref$objectIds, expiresAt = _ref.expiresAt, _ref$params = _ref.params, params = _ref$params === void 0 ? {} : _ref$params;
33
+ _context.next = 3;
32
34
  return this.userProfileClient.TenantContractId();
33
- case 1:
35
+ case 3:
34
36
  tenantId = _context.sent;
35
- _context.next = 2;
37
+ _context.next = 6;
36
38
  return this.CreateFabricToken({});
37
- case 2:
39
+ case 6:
38
40
  token = _context.sent;
39
- params.object_id = objectId;
41
+ if (objectId) {
42
+ objectIds = [objectId].concat(_toConsumableArray(objectIds)).filter(function (x, i, a) {
43
+ return x && a.indexOf(x) == i;
44
+ });
45
+ }
46
+ params.object_ids = objectIds;
40
47
  if (expiresAt) {
41
48
  params.end_time = Math.floor(new Date(expiresAt).getTime() / 1000);
42
49
  }
43
- _context.next = 3;
50
+ _context.next = 12;
44
51
  return this.MakeAuthServiceRequest({
45
52
  path: UrlJoin("as", "sharing", tenantId, "share"),
46
53
  method: "POST",
@@ -50,12 +57,12 @@ exports.CreateShare = /*#__PURE__*/function () {
50
57
  Authorization: "Bearer ".concat(token)
51
58
  }
52
59
  });
53
- case 3:
60
+ case 12:
54
61
  share = _context.sent;
55
62
  share.start_time = share.start_time ? new Date(share.start_time * 1000).toISOString() : undefined;
56
63
  share.end_time = share.end_time ? new Date(share.end_time * 1000).toISOString() : undefined;
57
64
  return _context.abrupt("return", share);
58
- case 4:
65
+ case 16:
59
66
  case "end":
60
67
  return _context.stop();
61
68
  }
@@ -77,7 +84,7 @@ exports.CreateShare = /*#__PURE__*/function () {
77
84
  *
78
85
  * @returns {Promise<Array<Object>>} - Info about the shares
79
86
  */
80
- exports.Shares = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
87
+ exports.Shares = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
81
88
  var _ref4,
82
89
  objectId,
83
90
  _ref4$limit,
@@ -90,19 +97,19 @@ exports.Shares = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime
90
97
  token,
91
98
  response,
92
99
  _args2 = arguments;
93
- return _regeneratorRuntime.wrap(function (_context2) {
100
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
94
101
  while (1) switch (_context2.prev = _context2.next) {
95
102
  case 0:
96
103
  _ref4 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, objectId = _ref4.objectId, _ref4$limit = _ref4.limit, limit = _ref4$limit === void 0 ? 100 : _ref4$limit, _ref4$offset = _ref4.offset, offset = _ref4$offset === void 0 ? 0 : _ref4$offset, _ref4$params = _ref4.params, params = _ref4$params === void 0 ? {} : _ref4$params;
97
- _context2.next = 1;
104
+ _context2.next = 3;
98
105
  return this.userProfileClient.TenantContractId();
99
- case 1:
106
+ case 3:
100
107
  tenantId = _context2.sent;
101
- _context2.next = 2;
108
+ _context2.next = 6;
102
109
  return this.CreateFabricToken({});
103
- case 2:
110
+ case 6:
104
111
  token = _context2.sent;
105
- _context2.next = 3;
112
+ _context2.next = 9;
106
113
  return this.MakeAuthServiceRequest({
107
114
  path: UrlJoin("as", "sharing", tenantId, "shares"),
108
115
  method: objectId || Object.keys(params).length > 0 ? "POST" : "GET",
@@ -118,7 +125,7 @@ exports.Shares = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime
118
125
  Authorization: "Bearer ".concat(token)
119
126
  }
120
127
  });
121
- case 3:
128
+ case 9:
122
129
  response = _context2.sent;
123
130
  // Convert dates from seconds to date strings
124
131
  if (response && response.shares) {
@@ -130,7 +137,7 @@ exports.Shares = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime
130
137
  });
131
138
  }
132
139
  return _context2.abrupt("return", response);
133
- case 4:
140
+ case 12:
134
141
  case "end":
135
142
  return _context2.stop();
136
143
  }
@@ -148,24 +155,24 @@ exports.Shares = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime
148
155
  * @returns {Promise<Object>} - Info about the updated share
149
156
  */
150
157
  exports.UpdateShare = /*#__PURE__*/function () {
151
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
158
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
152
159
  var shareId, expiresAt, _ref5$params, params, tenantId, token;
153
- return _regeneratorRuntime.wrap(function (_context3) {
160
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
154
161
  while (1) switch (_context3.prev = _context3.next) {
155
162
  case 0:
156
163
  shareId = _ref5.shareId, expiresAt = _ref5.expiresAt, _ref5$params = _ref5.params, params = _ref5$params === void 0 ? {} : _ref5$params;
157
- _context3.next = 1;
164
+ _context3.next = 3;
158
165
  return this.userProfileClient.TenantContractId();
159
- case 1:
166
+ case 3:
160
167
  tenantId = _context3.sent;
161
- _context3.next = 2;
168
+ _context3.next = 6;
162
169
  return this.CreateFabricToken({});
163
- case 2:
170
+ case 6:
164
171
  token = _context3.sent;
165
172
  if (expiresAt) {
166
173
  params.end_time = Math.floor(new Date(expiresAt).getTime() / 1000);
167
174
  }
168
- _context3.next = 3;
175
+ _context3.next = 10;
169
176
  return this.MakeAuthServiceRequest({
170
177
  path: UrlJoin("as", "sharing", tenantId, "share", shareId),
171
178
  method: "PUT",
@@ -175,9 +182,9 @@ exports.UpdateShare = /*#__PURE__*/function () {
175
182
  Authorization: "Bearer ".concat(token)
176
183
  }
177
184
  });
178
- case 3:
185
+ case 10:
179
186
  return _context3.abrupt("return", _context3.sent);
180
- case 4:
187
+ case 11:
181
188
  case "end":
182
189
  return _context3.stop();
183
190
  }
@@ -195,21 +202,21 @@ exports.UpdateShare = /*#__PURE__*/function () {
195
202
  * @param {string} shareId - The ID of the share to modify
196
203
  */
197
204
  exports.RevokeShare = /*#__PURE__*/function () {
198
- var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref7) {
205
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref7) {
199
206
  var shareId, tenantId, token;
200
- return _regeneratorRuntime.wrap(function (_context4) {
207
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
201
208
  while (1) switch (_context4.prev = _context4.next) {
202
209
  case 0:
203
210
  shareId = _ref7.shareId;
204
- _context4.next = 1;
211
+ _context4.next = 3;
205
212
  return this.userProfileClient.TenantContractId();
206
- case 1:
213
+ case 3:
207
214
  tenantId = _context4.sent;
208
- _context4.next = 2;
215
+ _context4.next = 6;
209
216
  return this.CreateFabricToken({});
210
- case 2:
217
+ case 6:
211
218
  token = _context4.sent;
212
- _context4.next = 3;
219
+ _context4.next = 9;
213
220
  return this.MakeAuthServiceRequest({
214
221
  path: UrlJoin("as", "sharing", tenantId, "share", shareId, "revoke"),
215
222
  method: "PUT",
@@ -218,9 +225,9 @@ exports.RevokeShare = /*#__PURE__*/function () {
218
225
  Authorization: "Bearer ".concat(token)
219
226
  }
220
227
  });
221
- case 3:
228
+ case 9:
222
229
  return _context4.abrupt("return", _context4.sent);
223
- case 4:
230
+ case 10:
224
231
  case "end":
225
232
  return _context4.stop();
226
233
  }
@@ -240,19 +247,19 @@ exports.RevokeShare = /*#__PURE__*/function () {
240
247
  * @returns {Promise<Object>} - Info about the share
241
248
  */
242
249
  exports.ShareInfo = /*#__PURE__*/function () {
243
- var _ref0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref9) {
250
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref9) {
244
251
  var shareId, _yield$this$MakeAuthS, share;
245
- return _regeneratorRuntime.wrap(function (_context5) {
252
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
246
253
  while (1) switch (_context5.prev = _context5.next) {
247
254
  case 0:
248
255
  shareId = _ref9.shareId;
249
- _context5.next = 1;
256
+ _context5.next = 3;
250
257
  return this.MakeAuthServiceRequest({
251
258
  path: UrlJoin("as", "sharing", "share", shareId, "info"),
252
259
  method: "GET",
253
260
  format: "JSON"
254
261
  });
255
- case 1:
262
+ case 3:
256
263
  _yield$this$MakeAuthS = _context5.sent;
257
264
  share = _yield$this$MakeAuthS.share;
258
265
  if (share.start_time) {
@@ -262,14 +269,14 @@ exports.ShareInfo = /*#__PURE__*/function () {
262
269
  share.end_time = new Date(share.end_time * 1000).toISOString();
263
270
  }
264
271
  return _context5.abrupt("return", share);
265
- case 2:
272
+ case 8:
266
273
  case "end":
267
274
  return _context5.stop();
268
275
  }
269
276
  }, _callee5, this);
270
277
  }));
271
278
  return function (_x4) {
272
- return _ref0.apply(this, arguments);
279
+ return _ref10.apply(this, arguments);
273
280
  };
274
281
  }();
275
282
 
@@ -282,27 +289,27 @@ exports.ShareInfo = /*#__PURE__*/function () {
282
289
  * @returns {Promise<Object>} - The authorization token for the share
283
290
  */
284
291
  exports.RedeemShareToken = /*#__PURE__*/function () {
285
- var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref1) {
292
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref11) {
286
293
  var shareId;
287
- return _regeneratorRuntime.wrap(function (_context6) {
294
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
288
295
  while (1) switch (_context6.prev = _context6.next) {
289
296
  case 0:
290
- shareId = _ref1.shareId;
291
- _context6.next = 1;
297
+ shareId = _ref11.shareId;
298
+ _context6.next = 3;
292
299
  return this.MakeAuthServiceRequest({
293
300
  path: UrlJoin("as", "sharing", "share", shareId, "token"),
294
301
  method: "GET",
295
302
  format: "JSON"
296
303
  });
297
- case 1:
304
+ case 3:
298
305
  return _context6.abrupt("return", _context6.sent.token);
299
- case 2:
306
+ case 4:
300
307
  case "end":
301
308
  return _context6.stop();
302
309
  }
303
310
  }, _callee6, this);
304
311
  }));
305
312
  return function (_x5) {
306
- return _ref10.apply(this, arguments);
313
+ return _ref12.apply(this, arguments);
307
314
  };
308
315
  }();