@eluvio/elv-client-js 4.0.147 → 4.2.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.
- package/dist/ElvClient-min.js +2 -67
- package/dist/ElvClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvClient-node-min.js +2 -66
- package/dist/ElvClient-node-min.js.LICENSE.txt +72 -0
- package/dist/ElvFrameClient-min.js +2 -60
- package/dist/ElvFrameClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvPermissionsClient-min.js +2 -60
- package/dist/ElvPermissionsClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvWalletClient-min.js +2 -67
- package/dist/ElvWalletClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvWalletClient-node-min.js +2 -66
- package/dist/ElvWalletClient-node-min.js.LICENSE.txt +72 -0
- package/dist/src/AuthorizationClient.js +713 -715
- package/dist/src/ContentObjectAudit.js +59 -59
- package/dist/src/Crypto.js +85 -86
- package/dist/src/ElvClient.js +532 -501
- package/dist/src/ElvWallet.js +30 -28
- package/dist/src/EthClient.js +316 -316
- package/dist/src/FrameClient.js +70 -71
- package/dist/src/HttpClient.js +60 -60
- package/dist/src/Id.js +1 -2
- package/dist/src/PermissionsClient.js +501 -489
- package/dist/src/RemoteSigner.js +83 -84
- package/dist/src/UserProfileClient.js +392 -374
- package/dist/src/Utils.js +67 -67
- package/dist/src/Validation.js +20 -12
- package/dist/src/client/ABRPublishing.js +412 -356
- package/dist/src/client/AccessGroups.js +479 -476
- package/dist/src/client/ContentAccess.js +1750 -1804
- package/dist/src/client/ContentManagement.js +874 -874
- package/dist/src/client/Contracts.js +586 -590
- package/dist/src/client/Files.js +702 -686
- package/dist/src/client/LiveConf.js +3 -5
- package/dist/src/client/LiveStream.js +659 -652
- package/dist/src/client/NFT.js +16 -16
- package/dist/src/client/NTP.js +84 -84
- package/dist/src/client/Shares.js +51 -51
- package/dist/src/walletClient/ClientMethods.js +979 -953
- package/dist/src/walletClient/Notifications.js +14 -14
- package/dist/src/walletClient/Profile.js +68 -68
- package/dist/src/walletClient/Utils.js +17 -17
- package/dist/src/walletClient/index.js +574 -564
- package/package.json +17 -16
- package/src/client/AccessGroups.js +1 -1
- package/testScripts/Test.js +5 -1
- package/webpack.config.js +10 -13
- package/dist/src/ContentObjectVerification.js +0 -281
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
2
2
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
3
3
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
-
function ownKeys(
|
|
5
|
-
function _objectSpread(
|
|
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; }
|
|
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; }
|
|
6
6
|
/**
|
|
7
7
|
* Methods for creating and managing shared authorization tokens
|
|
8
8
|
*
|
|
@@ -22,25 +22,25 @@ var UrlJoin = require("url-join");
|
|
|
22
22
|
* @returns {Promise<Object>} - Info about the created share
|
|
23
23
|
*/
|
|
24
24
|
exports.CreateShare = /*#__PURE__*/function () {
|
|
25
|
-
var _ref2 = _asyncToGenerator(
|
|
25
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
26
26
|
var objectId, expiresAt, _ref$params, params, tenantId, token, share;
|
|
27
|
-
return _regeneratorRuntime.wrap(function
|
|
27
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
28
28
|
while (1) switch (_context.prev = _context.next) {
|
|
29
29
|
case 0:
|
|
30
30
|
objectId = _ref.objectId, expiresAt = _ref.expiresAt, _ref$params = _ref.params, params = _ref$params === void 0 ? {} : _ref$params;
|
|
31
|
-
_context.next =
|
|
31
|
+
_context.next = 1;
|
|
32
32
|
return this.userProfileClient.TenantContractId();
|
|
33
|
-
case
|
|
33
|
+
case 1:
|
|
34
34
|
tenantId = _context.sent;
|
|
35
|
-
_context.next =
|
|
35
|
+
_context.next = 2;
|
|
36
36
|
return this.CreateFabricToken({});
|
|
37
|
-
case
|
|
37
|
+
case 2:
|
|
38
38
|
token = _context.sent;
|
|
39
39
|
params.object_id = objectId;
|
|
40
40
|
if (expiresAt) {
|
|
41
41
|
params.end_time = Math.floor(new Date(expiresAt).getTime() / 1000);
|
|
42
42
|
}
|
|
43
|
-
_context.next =
|
|
43
|
+
_context.next = 3;
|
|
44
44
|
return this.MakeAuthServiceRequest({
|
|
45
45
|
path: UrlJoin("as", "sharing", tenantId, "share"),
|
|
46
46
|
method: "POST",
|
|
@@ -50,12 +50,12 @@ exports.CreateShare = /*#__PURE__*/function () {
|
|
|
50
50
|
Authorization: "Bearer ".concat(token)
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
|
-
case
|
|
53
|
+
case 3:
|
|
54
54
|
share = _context.sent;
|
|
55
55
|
share.start_time = share.start_time ? new Date(share.start_time * 1000).toISOString() : undefined;
|
|
56
56
|
share.end_time = share.end_time ? new Date(share.end_time * 1000).toISOString() : undefined;
|
|
57
57
|
return _context.abrupt("return", share);
|
|
58
|
-
case
|
|
58
|
+
case 4:
|
|
59
59
|
case "end":
|
|
60
60
|
return _context.stop();
|
|
61
61
|
}
|
|
@@ -77,7 +77,7 @@ exports.CreateShare = /*#__PURE__*/function () {
|
|
|
77
77
|
*
|
|
78
78
|
* @returns {Promise<Array<Object>>} - Info about the shares
|
|
79
79
|
*/
|
|
80
|
-
exports.Shares = /*#__PURE__*/_asyncToGenerator(
|
|
80
|
+
exports.Shares = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
81
81
|
var _ref4,
|
|
82
82
|
objectId,
|
|
83
83
|
_ref4$limit,
|
|
@@ -90,19 +90,19 @@ exports.Shares = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntim
|
|
|
90
90
|
token,
|
|
91
91
|
response,
|
|
92
92
|
_args2 = arguments;
|
|
93
|
-
return _regeneratorRuntime.wrap(function
|
|
93
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
94
94
|
while (1) switch (_context2.prev = _context2.next) {
|
|
95
95
|
case 0:
|
|
96
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;
|
|
97
|
-
_context2.next =
|
|
97
|
+
_context2.next = 1;
|
|
98
98
|
return this.userProfileClient.TenantContractId();
|
|
99
|
-
case
|
|
99
|
+
case 1:
|
|
100
100
|
tenantId = _context2.sent;
|
|
101
|
-
_context2.next =
|
|
101
|
+
_context2.next = 2;
|
|
102
102
|
return this.CreateFabricToken({});
|
|
103
|
-
case
|
|
103
|
+
case 2:
|
|
104
104
|
token = _context2.sent;
|
|
105
|
-
_context2.next =
|
|
105
|
+
_context2.next = 3;
|
|
106
106
|
return this.MakeAuthServiceRequest({
|
|
107
107
|
path: UrlJoin("as", "sharing", tenantId, "shares"),
|
|
108
108
|
method: objectId || Object.keys(params).length > 0 ? "POST" : "GET",
|
|
@@ -118,7 +118,7 @@ exports.Shares = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntim
|
|
|
118
118
|
Authorization: "Bearer ".concat(token)
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
|
-
case
|
|
121
|
+
case 3:
|
|
122
122
|
response = _context2.sent;
|
|
123
123
|
// Convert dates from seconds to date strings
|
|
124
124
|
if (response && response.shares) {
|
|
@@ -130,7 +130,7 @@ exports.Shares = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntim
|
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
return _context2.abrupt("return", response);
|
|
133
|
-
case
|
|
133
|
+
case 4:
|
|
134
134
|
case "end":
|
|
135
135
|
return _context2.stop();
|
|
136
136
|
}
|
|
@@ -148,24 +148,24 @@ exports.Shares = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntim
|
|
|
148
148
|
* @returns {Promise<Object>} - Info about the updated share
|
|
149
149
|
*/
|
|
150
150
|
exports.UpdateShare = /*#__PURE__*/function () {
|
|
151
|
-
var _ref6 = _asyncToGenerator(
|
|
151
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
|
|
152
152
|
var shareId, expiresAt, _ref5$params, params, tenantId, token;
|
|
153
|
-
return _regeneratorRuntime.wrap(function
|
|
153
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
154
154
|
while (1) switch (_context3.prev = _context3.next) {
|
|
155
155
|
case 0:
|
|
156
156
|
shareId = _ref5.shareId, expiresAt = _ref5.expiresAt, _ref5$params = _ref5.params, params = _ref5$params === void 0 ? {} : _ref5$params;
|
|
157
|
-
_context3.next =
|
|
157
|
+
_context3.next = 1;
|
|
158
158
|
return this.userProfileClient.TenantContractId();
|
|
159
|
-
case
|
|
159
|
+
case 1:
|
|
160
160
|
tenantId = _context3.sent;
|
|
161
|
-
_context3.next =
|
|
161
|
+
_context3.next = 2;
|
|
162
162
|
return this.CreateFabricToken({});
|
|
163
|
-
case
|
|
163
|
+
case 2:
|
|
164
164
|
token = _context3.sent;
|
|
165
165
|
if (expiresAt) {
|
|
166
166
|
params.end_time = Math.floor(new Date(expiresAt).getTime() / 1000);
|
|
167
167
|
}
|
|
168
|
-
_context3.next =
|
|
168
|
+
_context3.next = 3;
|
|
169
169
|
return this.MakeAuthServiceRequest({
|
|
170
170
|
path: UrlJoin("as", "sharing", tenantId, "share", shareId),
|
|
171
171
|
method: "PUT",
|
|
@@ -175,9 +175,9 @@ exports.UpdateShare = /*#__PURE__*/function () {
|
|
|
175
175
|
Authorization: "Bearer ".concat(token)
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
|
-
case
|
|
178
|
+
case 3:
|
|
179
179
|
return _context3.abrupt("return", _context3.sent);
|
|
180
|
-
case
|
|
180
|
+
case 4:
|
|
181
181
|
case "end":
|
|
182
182
|
return _context3.stop();
|
|
183
183
|
}
|
|
@@ -195,21 +195,21 @@ exports.UpdateShare = /*#__PURE__*/function () {
|
|
|
195
195
|
* @param {string} shareId - The ID of the share to modify
|
|
196
196
|
*/
|
|
197
197
|
exports.RevokeShare = /*#__PURE__*/function () {
|
|
198
|
-
var _ref8 = _asyncToGenerator(
|
|
198
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref7) {
|
|
199
199
|
var shareId, tenantId, token;
|
|
200
|
-
return _regeneratorRuntime.wrap(function
|
|
200
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
201
201
|
while (1) switch (_context4.prev = _context4.next) {
|
|
202
202
|
case 0:
|
|
203
203
|
shareId = _ref7.shareId;
|
|
204
|
-
_context4.next =
|
|
204
|
+
_context4.next = 1;
|
|
205
205
|
return this.userProfileClient.TenantContractId();
|
|
206
|
-
case
|
|
206
|
+
case 1:
|
|
207
207
|
tenantId = _context4.sent;
|
|
208
|
-
_context4.next =
|
|
208
|
+
_context4.next = 2;
|
|
209
209
|
return this.CreateFabricToken({});
|
|
210
|
-
case
|
|
210
|
+
case 2:
|
|
211
211
|
token = _context4.sent;
|
|
212
|
-
_context4.next =
|
|
212
|
+
_context4.next = 3;
|
|
213
213
|
return this.MakeAuthServiceRequest({
|
|
214
214
|
path: UrlJoin("as", "sharing", tenantId, "share", shareId, "revoke"),
|
|
215
215
|
method: "PUT",
|
|
@@ -218,9 +218,9 @@ exports.RevokeShare = /*#__PURE__*/function () {
|
|
|
218
218
|
Authorization: "Bearer ".concat(token)
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
|
-
case
|
|
221
|
+
case 3:
|
|
222
222
|
return _context4.abrupt("return", _context4.sent);
|
|
223
|
-
case
|
|
223
|
+
case 4:
|
|
224
224
|
case "end":
|
|
225
225
|
return _context4.stop();
|
|
226
226
|
}
|
|
@@ -240,19 +240,19 @@ exports.RevokeShare = /*#__PURE__*/function () {
|
|
|
240
240
|
* @returns {Promise<Object>} - Info about the share
|
|
241
241
|
*/
|
|
242
242
|
exports.ShareInfo = /*#__PURE__*/function () {
|
|
243
|
-
var
|
|
243
|
+
var _ref0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref9) {
|
|
244
244
|
var shareId, _yield$this$MakeAuthS, share;
|
|
245
|
-
return _regeneratorRuntime.wrap(function
|
|
245
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
246
246
|
while (1) switch (_context5.prev = _context5.next) {
|
|
247
247
|
case 0:
|
|
248
248
|
shareId = _ref9.shareId;
|
|
249
|
-
_context5.next =
|
|
249
|
+
_context5.next = 1;
|
|
250
250
|
return this.MakeAuthServiceRequest({
|
|
251
251
|
path: UrlJoin("as", "sharing", "share", shareId, "info"),
|
|
252
252
|
method: "GET",
|
|
253
253
|
format: "JSON"
|
|
254
254
|
});
|
|
255
|
-
case
|
|
255
|
+
case 1:
|
|
256
256
|
_yield$this$MakeAuthS = _context5.sent;
|
|
257
257
|
share = _yield$this$MakeAuthS.share;
|
|
258
258
|
if (share.start_time) {
|
|
@@ -262,14 +262,14 @@ exports.ShareInfo = /*#__PURE__*/function () {
|
|
|
262
262
|
share.end_time = new Date(share.end_time * 1000).toISOString();
|
|
263
263
|
}
|
|
264
264
|
return _context5.abrupt("return", share);
|
|
265
|
-
case
|
|
265
|
+
case 2:
|
|
266
266
|
case "end":
|
|
267
267
|
return _context5.stop();
|
|
268
268
|
}
|
|
269
269
|
}, _callee5, this);
|
|
270
270
|
}));
|
|
271
271
|
return function (_x4) {
|
|
272
|
-
return
|
|
272
|
+
return _ref0.apply(this, arguments);
|
|
273
273
|
};
|
|
274
274
|
}();
|
|
275
275
|
|
|
@@ -282,27 +282,27 @@ exports.ShareInfo = /*#__PURE__*/function () {
|
|
|
282
282
|
* @returns {Promise<Object>} - The authorization token for the share
|
|
283
283
|
*/
|
|
284
284
|
exports.RedeemShareToken = /*#__PURE__*/function () {
|
|
285
|
-
var
|
|
285
|
+
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref1) {
|
|
286
286
|
var shareId;
|
|
287
|
-
return _regeneratorRuntime.wrap(function
|
|
287
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
288
288
|
while (1) switch (_context6.prev = _context6.next) {
|
|
289
289
|
case 0:
|
|
290
|
-
shareId =
|
|
291
|
-
_context6.next =
|
|
290
|
+
shareId = _ref1.shareId;
|
|
291
|
+
_context6.next = 1;
|
|
292
292
|
return this.MakeAuthServiceRequest({
|
|
293
293
|
path: UrlJoin("as", "sharing", "share", shareId, "token"),
|
|
294
294
|
method: "GET",
|
|
295
295
|
format: "JSON"
|
|
296
296
|
});
|
|
297
|
-
case
|
|
297
|
+
case 1:
|
|
298
298
|
return _context6.abrupt("return", _context6.sent.token);
|
|
299
|
-
case
|
|
299
|
+
case 2:
|
|
300
300
|
case "end":
|
|
301
301
|
return _context6.stop();
|
|
302
302
|
}
|
|
303
303
|
}, _callee6, this);
|
|
304
304
|
}));
|
|
305
305
|
return function (_x5) {
|
|
306
|
-
return
|
|
306
|
+
return _ref10.apply(this, arguments);
|
|
307
307
|
};
|
|
308
308
|
}();
|