@eluvio/elv-client-js 4.0.121 → 4.0.122
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/README.md +1 -1
- package/dist/ElvClient-min.js +14 -15
- package/dist/ElvClient-node-min.js +13 -14
- package/dist/ElvFrameClient-min.js +10 -10
- package/dist/ElvPermissionsClient-min.js +9 -9
- package/dist/ElvWalletClient-min.js +14 -15
- package/dist/ElvWalletClient-node-min.js +13 -14
- package/dist/src/AuthorizationClient.js +12 -9
- package/dist/src/ContentObjectAudit.js +3 -3
- package/dist/src/ContentObjectVerification.js +3 -3
- package/dist/src/Crypto.js +2 -2
- package/dist/src/ElvClient.js +47 -60
- package/dist/src/ElvWallet.js +5 -7
- package/dist/src/EthClient.js +9 -8
- package/dist/src/FrameClient.js +10 -9
- package/dist/src/HttpClient.js +2 -1
- package/dist/src/Id.js +2 -1
- package/dist/src/PermissionsClient.js +19 -31
- package/dist/src/RemoteSigner.js +8 -6
- package/dist/src/UserProfileClient.js +20 -35
- package/dist/src/Utils.js +3 -2
- package/dist/src/client/ABRPublishing.js +3 -3
- package/dist/src/client/AccessGroups.js +2 -2
- package/dist/src/client/ContentAccess.js +3 -2
- package/dist/src/client/ContentManagement.js +3 -3
- package/dist/src/client/Contracts.js +2 -2
- package/dist/src/client/Files.js +2 -2
- package/dist/src/client/LiveConf.js +5 -3
- package/dist/src/client/LiveStream.js +2 -0
- package/dist/src/client/NFT.js +2 -2
- package/dist/src/client/Shares.js +284 -0
- package/dist/src/walletClient/ClientMethods.js +2 -2
- package/dist/src/walletClient/Profile.js +2 -2
- package/dist/src/walletClient/Utils.js +2 -2
- package/dist/src/walletClient/index.js +14 -17
- package/package.json +2 -2
- package/src/ElvClient.js +9 -2
- package/src/FrameClient.js +5 -0
- package/src/client/ABRPublishing.js +1 -1
- package/src/client/Shares.js +161 -0
- package/build/BuildDocs.js +0 -12
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
2
|
+
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
3
|
+
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
/**
|
|
7
|
+
* Methods for creating and managing shared authorization tokens
|
|
8
|
+
*
|
|
9
|
+
* @module ElvClient/Shares
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
var UrlJoin = require("url-join");
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Create a share
|
|
16
|
+
*
|
|
17
|
+
* @namedParams
|
|
18
|
+
* @param {string} objectId - The object to create a share for
|
|
19
|
+
* @param {Date} expiresAt - The expiration time of the share
|
|
20
|
+
* @param {Object=} params - Additional parameters
|
|
21
|
+
*
|
|
22
|
+
* @returns {Promise<Object>} - Info about the created share
|
|
23
|
+
*/
|
|
24
|
+
exports.CreateShare = /*#__PURE__*/function () {
|
|
25
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
26
|
+
var objectId, expiresAt, _ref$params, params, tenantId;
|
|
27
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
28
|
+
while (1) switch (_context.prev = _context.next) {
|
|
29
|
+
case 0:
|
|
30
|
+
objectId = _ref.objectId, expiresAt = _ref.expiresAt, _ref$params = _ref.params, params = _ref$params === void 0 ? {} : _ref$params;
|
|
31
|
+
_context.next = 3;
|
|
32
|
+
return this.userProfileClient.TenantContractId();
|
|
33
|
+
case 3:
|
|
34
|
+
tenantId = _context.sent;
|
|
35
|
+
params.object_id = objectId;
|
|
36
|
+
if (expiresAt) {
|
|
37
|
+
params.end_time = Math.floor(new Date(expiresAt).getTime() / 1000);
|
|
38
|
+
}
|
|
39
|
+
_context.next = 8;
|
|
40
|
+
return this.MakeAuthServiceRequest({
|
|
41
|
+
path: UrlJoin("as", "sharing", tenantId, "share"),
|
|
42
|
+
method: "POST",
|
|
43
|
+
body: params,
|
|
44
|
+
headers: {
|
|
45
|
+
Authorization: "Bearer ".concat(this.signedToken)
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
case 8:
|
|
49
|
+
return _context.abrupt("return", _context.sent);
|
|
50
|
+
case 9:
|
|
51
|
+
case "end":
|
|
52
|
+
return _context.stop();
|
|
53
|
+
}
|
|
54
|
+
}, _callee, this);
|
|
55
|
+
}));
|
|
56
|
+
return function (_x) {
|
|
57
|
+
return _ref2.apply(this, arguments);
|
|
58
|
+
};
|
|
59
|
+
}();
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* List shares associated with your tenancy
|
|
63
|
+
*
|
|
64
|
+
* @namedParams
|
|
65
|
+
* @param {string=} objectId - If specified, the results will be limited shares for the specified object
|
|
66
|
+
* @param {number=} limit=100 - Maximum number of results to return
|
|
67
|
+
* @param {number=} offset=0 - Offset from which to return results
|
|
68
|
+
*
|
|
69
|
+
* @returns {Promise<Array<Object>>} - Info about the shares
|
|
70
|
+
*/
|
|
71
|
+
exports.Shares = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
72
|
+
var _ref4,
|
|
73
|
+
objectId,
|
|
74
|
+
_ref4$limit,
|
|
75
|
+
limit,
|
|
76
|
+
_ref4$offset,
|
|
77
|
+
offset,
|
|
78
|
+
tenantId,
|
|
79
|
+
response,
|
|
80
|
+
_args2 = arguments;
|
|
81
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
82
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
83
|
+
case 0:
|
|
84
|
+
_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;
|
|
85
|
+
_context2.next = 3;
|
|
86
|
+
return this.userProfileClient.TenantContractId();
|
|
87
|
+
case 3:
|
|
88
|
+
tenantId = _context2.sent;
|
|
89
|
+
_context2.next = 6;
|
|
90
|
+
return this.MakeAuthServiceRequest({
|
|
91
|
+
path: UrlJoin("as", "sharing", tenantId, "shares"),
|
|
92
|
+
method: objectId ? "POST" : "GET",
|
|
93
|
+
queryParams: {
|
|
94
|
+
limit: limit,
|
|
95
|
+
offset: offset
|
|
96
|
+
},
|
|
97
|
+
body: objectId ? {
|
|
98
|
+
object_id: objectId
|
|
99
|
+
} : undefined,
|
|
100
|
+
format: "JSON",
|
|
101
|
+
headers: {
|
|
102
|
+
Authorization: "Bearer ".concat(this.signedToken)
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
case 6:
|
|
106
|
+
response = _context2.sent;
|
|
107
|
+
// Convert dates from seconds to date strings
|
|
108
|
+
if (response && response.shares) {
|
|
109
|
+
response.shares = response.shares.map(function (share) {
|
|
110
|
+
return _objectSpread(_objectSpread({}, share), {}, {
|
|
111
|
+
start_time: share.start_time ? new Date(share.start_time * 1000).toISOString() : null,
|
|
112
|
+
end_time: share.end_time ? new Date(share.end_time * 1000).toISOString() : null
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return _context2.abrupt("return", response);
|
|
117
|
+
case 9:
|
|
118
|
+
case "end":
|
|
119
|
+
return _context2.stop();
|
|
120
|
+
}
|
|
121
|
+
}, _callee2, this);
|
|
122
|
+
}));
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Update the specified share
|
|
126
|
+
*
|
|
127
|
+
* @namedParams
|
|
128
|
+
* @param {string} shareId - The ID of the share to modify
|
|
129
|
+
* @param {Date=} expiresAt - The new expiration time of the share
|
|
130
|
+
* @param {Object=} params - Additional parameters
|
|
131
|
+
*
|
|
132
|
+
* @returns {Promise<Object>} - Info about the updated share
|
|
133
|
+
*/
|
|
134
|
+
exports.UpdateShare = /*#__PURE__*/function () {
|
|
135
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
|
|
136
|
+
var shareId, expiresAt, _ref5$params, params, tenantId;
|
|
137
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
138
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
139
|
+
case 0:
|
|
140
|
+
shareId = _ref5.shareId, expiresAt = _ref5.expiresAt, _ref5$params = _ref5.params, params = _ref5$params === void 0 ? {} : _ref5$params;
|
|
141
|
+
_context3.next = 3;
|
|
142
|
+
return this.userProfileClient.TenantContractId();
|
|
143
|
+
case 3:
|
|
144
|
+
tenantId = _context3.sent;
|
|
145
|
+
if (expiresAt) {
|
|
146
|
+
params.end_time = Math.floor(new Date(expiresAt).getTime() / 1000);
|
|
147
|
+
}
|
|
148
|
+
_context3.next = 7;
|
|
149
|
+
return this.MakeAuthServiceRequest({
|
|
150
|
+
path: UrlJoin("as", "sharing", tenantId, "share", shareId),
|
|
151
|
+
method: "PUT",
|
|
152
|
+
format: "JSON",
|
|
153
|
+
body: params,
|
|
154
|
+
headers: {
|
|
155
|
+
Authorization: "Bearer ".concat(this.signedToken)
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
case 7:
|
|
159
|
+
return _context3.abrupt("return", _context3.sent);
|
|
160
|
+
case 8:
|
|
161
|
+
case "end":
|
|
162
|
+
return _context3.stop();
|
|
163
|
+
}
|
|
164
|
+
}, _callee3, this);
|
|
165
|
+
}));
|
|
166
|
+
return function (_x2) {
|
|
167
|
+
return _ref6.apply(this, arguments);
|
|
168
|
+
};
|
|
169
|
+
}();
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Revoke the specified share
|
|
173
|
+
*
|
|
174
|
+
* @namedParams
|
|
175
|
+
* @param {string} shareId - The ID of the share to modify
|
|
176
|
+
*/
|
|
177
|
+
exports.RevokeShare = /*#__PURE__*/function () {
|
|
178
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref7) {
|
|
179
|
+
var shareId, tenantId;
|
|
180
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
181
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
182
|
+
case 0:
|
|
183
|
+
shareId = _ref7.shareId;
|
|
184
|
+
_context4.next = 3;
|
|
185
|
+
return this.userProfileClient.TenantContractId();
|
|
186
|
+
case 3:
|
|
187
|
+
tenantId = _context4.sent;
|
|
188
|
+
_context4.next = 6;
|
|
189
|
+
return this.MakeAuthServiceRequest({
|
|
190
|
+
path: UrlJoin("as", "sharing", tenantId, "share", shareId, "revoke"),
|
|
191
|
+
method: "PUT",
|
|
192
|
+
format: "JSON",
|
|
193
|
+
headers: {
|
|
194
|
+
Authorization: "Bearer ".concat(this.signedToken)
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
case 6:
|
|
198
|
+
return _context4.abrupt("return", _context4.sent);
|
|
199
|
+
case 7:
|
|
200
|
+
case "end":
|
|
201
|
+
return _context4.stop();
|
|
202
|
+
}
|
|
203
|
+
}, _callee4, this);
|
|
204
|
+
}));
|
|
205
|
+
return function (_x3) {
|
|
206
|
+
return _ref8.apply(this, arguments);
|
|
207
|
+
};
|
|
208
|
+
}();
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Retrieve info about the specified share
|
|
212
|
+
*
|
|
213
|
+
* @namedParams
|
|
214
|
+
* @param {string} shareId - The ID of the share
|
|
215
|
+
*
|
|
216
|
+
* @returns {Promise<Object>} - Info about the share
|
|
217
|
+
*/
|
|
218
|
+
exports.ShareInfo = /*#__PURE__*/function () {
|
|
219
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref9) {
|
|
220
|
+
var shareId, _yield$this$MakeAuthS, share;
|
|
221
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
222
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
223
|
+
case 0:
|
|
224
|
+
shareId = _ref9.shareId;
|
|
225
|
+
_context5.next = 3;
|
|
226
|
+
return this.MakeAuthServiceRequest({
|
|
227
|
+
path: UrlJoin("as", "sharing", "share", shareId, "info"),
|
|
228
|
+
method: "GET",
|
|
229
|
+
format: "JSON"
|
|
230
|
+
});
|
|
231
|
+
case 3:
|
|
232
|
+
_yield$this$MakeAuthS = _context5.sent;
|
|
233
|
+
share = _yield$this$MakeAuthS.share;
|
|
234
|
+
if (share.start_time) {
|
|
235
|
+
share.start_time = new Date(share.start_time * 1000).toISOString();
|
|
236
|
+
}
|
|
237
|
+
if (share.end_time) {
|
|
238
|
+
share.end_time = new Date(share.end_time * 1000).toISOString();
|
|
239
|
+
}
|
|
240
|
+
return _context5.abrupt("return", share);
|
|
241
|
+
case 8:
|
|
242
|
+
case "end":
|
|
243
|
+
return _context5.stop();
|
|
244
|
+
}
|
|
245
|
+
}, _callee5, this);
|
|
246
|
+
}));
|
|
247
|
+
return function (_x4) {
|
|
248
|
+
return _ref10.apply(this, arguments);
|
|
249
|
+
};
|
|
250
|
+
}();
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Retrieve the authorization token for the specified share
|
|
254
|
+
*
|
|
255
|
+
* @namedParams
|
|
256
|
+
* @param {string} shareId - The ID of the share
|
|
257
|
+
*
|
|
258
|
+
* @returns {Promise<Object>} - The authorization token for the share
|
|
259
|
+
*/
|
|
260
|
+
exports.RedeemShareToken = /*#__PURE__*/function () {
|
|
261
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref11) {
|
|
262
|
+
var shareId;
|
|
263
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
264
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
265
|
+
case 0:
|
|
266
|
+
shareId = _ref11.shareId;
|
|
267
|
+
_context6.next = 3;
|
|
268
|
+
return this.MakeAuthServiceRequest({
|
|
269
|
+
path: UrlJoin("as", "sharing", "share", shareId, "token"),
|
|
270
|
+
method: "GET",
|
|
271
|
+
format: "JSON"
|
|
272
|
+
});
|
|
273
|
+
case 3:
|
|
274
|
+
return _context6.abrupt("return", _context6.sent.token);
|
|
275
|
+
case 4:
|
|
276
|
+
case "end":
|
|
277
|
+
return _context6.stop();
|
|
278
|
+
}
|
|
279
|
+
}, _callee6, this);
|
|
280
|
+
}));
|
|
281
|
+
return function (_x5) {
|
|
282
|
+
return _ref12.apply(this, arguments);
|
|
283
|
+
};
|
|
284
|
+
}();
|
|
@@ -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(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
var Utils = require("../Utils");
|
|
7
7
|
var UrlJoin = require("url-join");
|
|
8
8
|
var _require = require("./Utils"),
|
|
@@ -2,8 +2,8 @@ var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
|
2
2
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
3
3
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
4
4
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
5
|
-
function ownKeys(
|
|
6
|
-
function _objectSpread(
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
var Utils = require("../Utils");
|
|
8
8
|
var UrlJoin = require("url-join");
|
|
9
9
|
var StateStorePath = function StateStorePath(_ref) {
|
|
@@ -2,8 +2,8 @@ var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
|
2
2
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
3
3
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
4
4
|
var _slicedToArray = require("@babel/runtime/helpers/slicedToArray");
|
|
5
|
-
function ownKeys(
|
|
6
|
-
function _objectSpread(
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
var Utils = require("../Utils");
|
|
8
8
|
var RarityToPercentage = function RarityToPercentage(rarity) {
|
|
9
9
|
if (!rarity) {
|
|
@@ -7,8 +7,8 @@ var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
|
7
7
|
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
|
8
8
|
var _createClass = require("@babel/runtime/helpers/createClass");
|
|
9
9
|
var _excluded = ["code", "address", "type", "authToken", "expiresAt"];
|
|
10
|
-
function ownKeys(
|
|
11
|
-
function _objectSpread(
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
12
|
var _require = require("../ElvClient"),
|
|
13
13
|
ElvClient = _require.ElvClient;
|
|
14
14
|
var Configuration = require("./Configuration");
|
|
@@ -79,7 +79,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
79
79
|
this.utils = client.utils;
|
|
80
80
|
this.ForbiddenMethods = ElvWalletClient.ForbiddenMethods;
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
_createClass(ElvWalletClient, [{
|
|
83
83
|
key: "Log",
|
|
84
84
|
value: function Log(message) {
|
|
85
85
|
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -136,7 +136,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
136
136
|
*/
|
|
137
137
|
}, {
|
|
138
138
|
key: "PersonalSign",
|
|
139
|
-
value:
|
|
139
|
+
value: function () {
|
|
140
140
|
var _PersonalSign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
|
|
141
141
|
var message, parameters, url;
|
|
142
142
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
@@ -265,7 +265,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
265
265
|
return _PersonalSign.apply(this, arguments);
|
|
266
266
|
}
|
|
267
267
|
return PersonalSign;
|
|
268
|
-
}()
|
|
268
|
+
}()
|
|
269
269
|
}, {
|
|
270
270
|
key: "LogInURL",
|
|
271
271
|
value: function () {
|
|
@@ -344,7 +344,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
344
344
|
*/
|
|
345
345
|
}, {
|
|
346
346
|
key: "LogIn",
|
|
347
|
-
value:
|
|
347
|
+
value: function () {
|
|
348
348
|
var _LogIn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref5) {
|
|
349
349
|
var _this = this;
|
|
350
350
|
var _ref5$method, method, provider, _ref5$mode, mode, callbackUrl, marketplaceParams, _ref5$clearLogin, clearLogin, callback, loginUrl;
|
|
@@ -463,10 +463,9 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
463
463
|
*
|
|
464
464
|
* @methodGroup Login
|
|
465
465
|
*/
|
|
466
|
-
)
|
|
467
466
|
}, {
|
|
468
467
|
key: "LogOut",
|
|
469
|
-
value:
|
|
468
|
+
value: function () {
|
|
470
469
|
var _LogOut = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
471
470
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
472
471
|
while (1) switch (_context8.prev = _context8.next) {
|
|
@@ -509,7 +508,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
509
508
|
return _LogOut.apply(this, arguments);
|
|
510
509
|
}
|
|
511
510
|
return LogOut;
|
|
512
|
-
}()
|
|
511
|
+
}()
|
|
513
512
|
}, {
|
|
514
513
|
key: "TokenStatus",
|
|
515
514
|
value: function () {
|
|
@@ -549,7 +548,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
549
548
|
*/
|
|
550
549
|
}, {
|
|
551
550
|
key: "Authenticate",
|
|
552
|
-
value:
|
|
551
|
+
value: function () {
|
|
553
552
|
var _Authenticate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref7) {
|
|
554
553
|
var token, decodedToken;
|
|
555
554
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
@@ -615,10 +614,9 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
615
614
|
* - signingToken - Identical to `authToken`, but also includes the ability to perform arbitrary signatures with the custodial wallet. This token should be protected and should not be
|
|
616
615
|
* shared with third parties.
|
|
617
616
|
*/
|
|
618
|
-
)
|
|
619
617
|
}, {
|
|
620
618
|
key: "AuthenticateOAuth",
|
|
621
|
-
value:
|
|
619
|
+
value: function () {
|
|
622
620
|
var _AuthenticateOAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref8) {
|
|
623
621
|
var idToken, tenantId, email, signerURIs, _ref8$shareEmail, shareEmail, _ref8$extraData, extraData, nonce, _ref8$createRemoteTok, createRemoteToken, _ref8$force, force, tokenDuration, fabricToken, expiresAt, tokenResponse, address, decodedToken;
|
|
624
622
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
@@ -746,10 +744,9 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
746
744
|
* @returns {Promise<string>} - Returns an authorization token that can be used to initialize the client using <a href="#Authenticate">Authenticate</a>.
|
|
747
745
|
* Save this token to avoid having to reauthenticate. This token expires after 24 hours.
|
|
748
746
|
*/
|
|
749
|
-
)
|
|
750
747
|
}, {
|
|
751
748
|
key: "AuthenticateExternalWallet",
|
|
752
|
-
value:
|
|
749
|
+
value: function () {
|
|
753
750
|
var _AuthenticateExternalWallet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref9) {
|
|
754
751
|
var _this2 = this;
|
|
755
752
|
var address, _ref9$tokenDuration, tokenDuration, _ref9$walletName, walletName, Sign, expiresAt, fabricToken;
|
|
@@ -818,7 +815,6 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
818
815
|
*
|
|
819
816
|
* @returns {string} - The client auth token
|
|
820
817
|
*/
|
|
821
|
-
)
|
|
822
818
|
}, {
|
|
823
819
|
key: "ClientAuthToken",
|
|
824
820
|
value: function ClientAuthToken() {
|
|
@@ -1882,7 +1878,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1882
1878
|
*/
|
|
1883
1879
|
}, {
|
|
1884
1880
|
key: "Initialize",
|
|
1885
|
-
value:
|
|
1881
|
+
value: function () {
|
|
1886
1882
|
var _Initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref24) {
|
|
1887
1883
|
var client, _ref24$appId, appId, _ref24$network, network, _ref24$mode, mode, localization, marketplaceParams, previewMarketplaceId, _ref24$storeAuthToken, storeAuthToken, _ref24$skipMarketplac, skipMarketplaceLoad, _ref25, tenantSlug, marketplaceSlug, marketplaceId, marketplaceHash, previewMarketplaceHash, walletClient, url, savedToken;
|
|
1888
1884
|
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
@@ -2009,8 +2005,9 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
2009
2005
|
return _Initialize.apply(this, arguments);
|
|
2010
2006
|
}
|
|
2011
2007
|
return Initialize;
|
|
2012
|
-
}()
|
|
2008
|
+
}()
|
|
2013
2009
|
}]);
|
|
2010
|
+
return ElvWalletClient;
|
|
2014
2011
|
}();
|
|
2015
2012
|
Object.assign(ElvWalletClient.prototype, require("./ClientMethods"));
|
|
2016
2013
|
Object.assign(ElvWalletClient.prototype, require("./Profile"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eluvio/elv-client-js",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.122",
|
|
4
4
|
"description": "Javascript client for the Eluvio Content Fabric",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "Kevin Talmadge",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"bump-version": "npm --git-tag-version --no-commit-hooks version patch",
|
|
11
11
|
"build": "npm run build-docs && npm run build-dist && npm run build-frame-client && npm run build-permissions-client && npm run build-wallet-client-web && npm run build-wallet-client-node && npm run build-prod",
|
|
12
|
-
"build-docs": "
|
|
12
|
+
"build-docs": "npm run build-client-docs && npm run build-wallet-client-docs",
|
|
13
13
|
"build-client-docs": "./node_modules/.bin/jsdoc --configure ./.jsdoc.json --readme README.md",
|
|
14
14
|
"build-wallet-client-docs": "./node_modules/.bin/jsdoc --configure ./.jsdoc-mc.json --readme ./src/walletClient/README.md",
|
|
15
15
|
"build-dist": "node ./node_modules/@babel/cli/bin/babel.js --source-type=unambiguous --presets=@babel/preset-env --plugins @babel/plugin-transform-runtime src --out-dir dist/src",
|
package/src/ElvClient.js
CHANGED
|
@@ -750,6 +750,9 @@ class ElvClient {
|
|
|
750
750
|
signer.provider.pollingInterval = 500;
|
|
751
751
|
this.signer = signer;
|
|
752
752
|
|
|
753
|
+
this.CreateFabricToken({})
|
|
754
|
+
.then(token => this.signedToken = token);
|
|
755
|
+
|
|
753
756
|
if(reset) {
|
|
754
757
|
this.InitializeClients();
|
|
755
758
|
}
|
|
@@ -1299,8 +1302,11 @@ class ElvClient {
|
|
|
1299
1302
|
);
|
|
1300
1303
|
}
|
|
1301
1304
|
|
|
1302
|
-
async MakeAuthServiceRequest({kmsId, objectId, versionHash, method="GET", path, bodyType, body={}, queryParams={}, headers}) {
|
|
1303
|
-
|
|
1305
|
+
async MakeAuthServiceRequest({kmsId, objectId, versionHash, method="GET", path, bodyType, body={}, queryParams={}, headers, format}) {
|
|
1306
|
+
const response = this.authClient.MakeAuthServiceRequest({kmsId, objectId, versionHash, method, path, bodyType, body, queryParams, headers});
|
|
1307
|
+
|
|
1308
|
+
return !format ? response :
|
|
1309
|
+
this.utils.ResponseToFormat(format, response);
|
|
1304
1310
|
}
|
|
1305
1311
|
|
|
1306
1312
|
/* FrameClient related */
|
|
@@ -1416,5 +1422,6 @@ Object.assign(ElvClient.prototype, require("./client/LiveStream"));
|
|
|
1416
1422
|
Object.assign(ElvClient.prototype, require("./client/ContentManagement"));
|
|
1417
1423
|
Object.assign(ElvClient.prototype, require("./client/NTP"));
|
|
1418
1424
|
Object.assign(ElvClient.prototype, require("./client/NFT"));
|
|
1425
|
+
Object.assign(ElvClient.prototype, require("./client/Shares"));
|
|
1419
1426
|
|
|
1420
1427
|
exports.ElvClient = ElvClient;
|
package/src/FrameClient.js
CHANGED
|
@@ -375,6 +375,7 @@ class FrameClient {
|
|
|
375
375
|
"CreateNonOwnerCap",
|
|
376
376
|
"CreatePart",
|
|
377
377
|
"CreateProductionMaster",
|
|
378
|
+
"CreateShare",
|
|
378
379
|
"CreateSignedToken",
|
|
379
380
|
"CreateStaticToken",
|
|
380
381
|
"CurrentAccountAddress",
|
|
@@ -452,6 +453,7 @@ class FrameClient {
|
|
|
452
453
|
"QParts",
|
|
453
454
|
"RecordWriteToken",
|
|
454
455
|
"RedeemCode",
|
|
456
|
+
"RedeemShareToken",
|
|
455
457
|
"RemoveAccessGroupManager",
|
|
456
458
|
"RemoveAccessGroupMember",
|
|
457
459
|
"RemoveContentObjectGroupPermission",
|
|
@@ -462,6 +464,7 @@ class FrameClient {
|
|
|
462
464
|
"ReplaceMetadata",
|
|
463
465
|
"Request",
|
|
464
466
|
"ResetRegion",
|
|
467
|
+
"RevokeShare",
|
|
465
468
|
"SendFunds",
|
|
466
469
|
"SetAccessCharge",
|
|
467
470
|
"SetAuth",
|
|
@@ -478,6 +481,7 @@ class FrameClient {
|
|
|
478
481
|
"SetStaticToken",
|
|
479
482
|
"SetVisibility",
|
|
480
483
|
"SetPermission",
|
|
484
|
+
"Shares",
|
|
481
485
|
"SpaceNodes",
|
|
482
486
|
"StartABRMezzanineJobs",
|
|
483
487
|
"StreamAddWatermark",
|
|
@@ -495,6 +499,7 @@ class FrameClient {
|
|
|
495
499
|
"UnlinkAccessGroupFromOauth",
|
|
496
500
|
"UpdateContentObjectGraph",
|
|
497
501
|
"UpdateNTPInstance",
|
|
502
|
+
"UpdateShare",
|
|
498
503
|
"UploadFileData",
|
|
499
504
|
"UploadFilesFromS3",
|
|
500
505
|
"UploadJobStatus",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Methods for ABR video creation and management
|
|
3
3
|
*
|
|
4
|
-
* For more information on how to publish ABR content see <a href="
|
|
4
|
+
* For more information on how to publish ABR content see <a href="https://docs.eluv.io/docs/guides/media-ingest/">this detailed guide</a>
|
|
5
5
|
*
|
|
6
6
|
* @module ElvClient/ABRPublishing
|
|
7
7
|
*/
|