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