@eluvio/elv-client-js 4.0.121 → 4.0.123
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 +41 -32
- 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 +52 -61
- 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 +10 -5
- 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 +285 -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/AuthorizationClient.js +2 -0
- package/src/ElvClient.js +13 -3
- package/src/FrameClient.js +5 -0
- package/src/client/ABRPublishing.js +1 -1
- package/src/client/ContentAccess.js +6 -3
- package/src/client/Shares.js +162 -0
- package/utilities/GenerateFabricToken.js +3 -2
- package/build/BuildDocs.js +0 -12
|
@@ -3,8 +3,9 @@ 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
5
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
6
|
-
|
|
7
|
-
function
|
|
6
|
+
var _v, _v2;
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
8
9
|
var HttpClient = require("./HttpClient");
|
|
9
10
|
var Ethers = require("ethers");
|
|
10
11
|
var Utils = require("./Utils");
|
|
@@ -37,8 +38,8 @@ var ACCESS_TYPES = {
|
|
|
37
38
|
OTHER: "other"
|
|
38
39
|
};
|
|
39
40
|
var CONTRACTS = {
|
|
40
|
-
v2:
|
|
41
|
-
v3:
|
|
41
|
+
v2: (_v = {}, _defineProperty(_v, ACCESS_TYPES.SPACE, require("./contracts/v2/BaseContentSpace")), _defineProperty(_v, ACCESS_TYPES.LIBRARY, require("./contracts/v2/BaseLibrary")), _defineProperty(_v, ACCESS_TYPES.TYPE, require("./contracts/v2/BaseContentType")), _defineProperty(_v, ACCESS_TYPES.OBJECT, require("./contracts/v2/BaseContent")), _defineProperty(_v, ACCESS_TYPES.WALLET, require("./contracts/v2/BaseAccessWallet")), _defineProperty(_v, ACCESS_TYPES.GROUP, require("./contracts/v2/BaseAccessControlGroup")), _defineProperty(_v, ACCESS_TYPES.ACCESSIBLE, require("./contracts/v2/Accessible")), _defineProperty(_v, ACCESS_TYPES.EDITABLE, require("./contracts/v2/Editable")), _v),
|
|
42
|
+
v3: (_v2 = {}, _defineProperty(_v2, ACCESS_TYPES.SPACE, require("./contracts/v3/BaseContentSpace")), _defineProperty(_v2, ACCESS_TYPES.LIBRARY, require("./contracts/v3/BaseLibrary")), _defineProperty(_v2, ACCESS_TYPES.TYPE, require("./contracts/v3/BaseContentType")), _defineProperty(_v2, ACCESS_TYPES.OBJECT, require("./contracts/v3/BaseContent")), _defineProperty(_v2, ACCESS_TYPES.WALLET, require("./contracts/v3/BaseAccessWallet")), _defineProperty(_v2, ACCESS_TYPES.GROUP, require("./contracts/v3/BaseAccessControlGroup")), _defineProperty(_v2, ACCESS_TYPES.ACCESSIBLE, require("./contracts/v3/Accessible")), _defineProperty(_v2, ACCESS_TYPES.EDITABLE, require("./contracts/v3/Editable")), _defineProperty(_v2, ACCESS_TYPES.TENANT, require("./contracts/v3/BaseTenantSpace")), _v2),
|
|
42
43
|
v3b: _defineProperty({}, ACCESS_TYPES.GROUP, require("./contracts/v3b/BaseAccessControlGroup"))
|
|
43
44
|
};
|
|
44
45
|
var AuthorizationClient = /*#__PURE__*/function () {
|
|
@@ -76,7 +77,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
// Return authorization token in appropriate headers
|
|
79
|
-
|
|
80
|
+
_createClass(AuthorizationClient, [{
|
|
80
81
|
key: "Log",
|
|
81
82
|
value: function Log(message) {
|
|
82
83
|
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -139,30 +140,36 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
139
140
|
case 10:
|
|
140
141
|
isWalletRequest = _context2.t0;
|
|
141
142
|
if (!(this.client.staticToken && !isWalletRequest && !update)) {
|
|
142
|
-
_context2.next =
|
|
143
|
+
_context2.next = 15;
|
|
143
144
|
break;
|
|
144
145
|
}
|
|
145
146
|
return _context2.abrupt("return", this.client.staticToken);
|
|
146
|
-
case
|
|
147
|
+
case 15:
|
|
148
|
+
if (!(this.client.staticUpdateToken && !isWalletRequest)) {
|
|
149
|
+
_context2.next = 17;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
return _context2.abrupt("return", this.client.staticUpdateToken);
|
|
153
|
+
case 17:
|
|
147
154
|
initialNoCache = this.noCache;
|
|
148
|
-
_context2.prev =
|
|
155
|
+
_context2.prev = 18;
|
|
149
156
|
// noCache enabled for this call
|
|
150
157
|
if (noCache && !this.noCache) {
|
|
151
158
|
this.noCache = true;
|
|
152
159
|
}
|
|
153
160
|
if (!(channelAuth && this.client.signer && this.client.signer.remoteSigner)) {
|
|
154
|
-
_context2.next =
|
|
161
|
+
_context2.next = 22;
|
|
155
162
|
break;
|
|
156
163
|
}
|
|
157
164
|
return _context2.abrupt("return", this.client.CreateFabricToken({
|
|
158
165
|
context: context
|
|
159
166
|
}));
|
|
160
|
-
case
|
|
167
|
+
case 22:
|
|
161
168
|
if (!channelAuth) {
|
|
162
|
-
_context2.next =
|
|
169
|
+
_context2.next = 28;
|
|
163
170
|
break;
|
|
164
171
|
}
|
|
165
|
-
_context2.next =
|
|
172
|
+
_context2.next = 25;
|
|
166
173
|
return this.GenerateChannelContentToken({
|
|
167
174
|
objectId: objectId,
|
|
168
175
|
versionHash: versionHash,
|
|
@@ -170,20 +177,20 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
170
177
|
context: context,
|
|
171
178
|
oauthToken: oauthToken
|
|
172
179
|
});
|
|
173
|
-
case
|
|
180
|
+
case 25:
|
|
174
181
|
authorizationToken = _context2.sent;
|
|
175
|
-
_context2.next =
|
|
182
|
+
_context2.next = 33;
|
|
176
183
|
break;
|
|
177
|
-
case
|
|
184
|
+
case 28:
|
|
178
185
|
if (!(noAuth && this.client.signer && this.client.signer.remoteSigner && this.client.signer.unsignedPublicAuth)) {
|
|
179
|
-
_context2.next =
|
|
186
|
+
_context2.next = 30;
|
|
180
187
|
break;
|
|
181
188
|
}
|
|
182
189
|
return _context2.abrupt("return", this.client.CreateStaticToken({
|
|
183
190
|
libraryId: libraryId
|
|
184
191
|
}));
|
|
185
|
-
case
|
|
186
|
-
_context2.next =
|
|
192
|
+
case 30:
|
|
193
|
+
_context2.next = 32;
|
|
187
194
|
return this.GenerateAuthorizationToken({
|
|
188
195
|
libraryId: libraryId,
|
|
189
196
|
objectId: objectId,
|
|
@@ -193,23 +200,23 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
193
200
|
update: update,
|
|
194
201
|
makeAccessRequest: makeAccessRequest
|
|
195
202
|
});
|
|
196
|
-
case
|
|
203
|
+
case 32:
|
|
197
204
|
authorizationToken = _context2.sent;
|
|
198
|
-
case
|
|
205
|
+
case 33:
|
|
199
206
|
return _context2.abrupt("return", authorizationToken);
|
|
200
|
-
case
|
|
201
|
-
_context2.prev =
|
|
202
|
-
_context2.t4 = _context2["catch"](
|
|
207
|
+
case 36:
|
|
208
|
+
_context2.prev = 36;
|
|
209
|
+
_context2.t4 = _context2["catch"](18);
|
|
203
210
|
throw _context2.t4;
|
|
204
|
-
case
|
|
205
|
-
_context2.prev =
|
|
211
|
+
case 39:
|
|
212
|
+
_context2.prev = 39;
|
|
206
213
|
this.noCache = initialNoCache;
|
|
207
|
-
return _context2.finish(
|
|
208
|
-
case
|
|
214
|
+
return _context2.finish(39);
|
|
215
|
+
case 42:
|
|
209
216
|
case "end":
|
|
210
217
|
return _context2.stop();
|
|
211
218
|
}
|
|
212
|
-
}, _callee2, this, [[
|
|
219
|
+
}, _callee2, this, [[18, 36, 39, 42]]);
|
|
213
220
|
}));
|
|
214
221
|
function AuthorizationToken(_x2) {
|
|
215
222
|
return _AuthorizationToken.apply(this, arguments);
|
|
@@ -1025,6 +1032,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
1025
1032
|
}
|
|
1026
1033
|
}
|
|
1027
1034
|
}
|
|
1035
|
+
|
|
1028
1036
|
if (isV3 && (!args || args.length === 0)) {
|
|
1029
1037
|
args = [[],
|
|
1030
1038
|
// customValues
|
|
@@ -1171,7 +1179,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
1171
1179
|
}() /* Utility methods */
|
|
1172
1180
|
}, {
|
|
1173
1181
|
key: "ContractInfo",
|
|
1174
|
-
value:
|
|
1182
|
+
value: function () {
|
|
1175
1183
|
var _ContractInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref14) {
|
|
1176
1184
|
var id, address, isV3, contractName, accessType, v3Version, version;
|
|
1177
1185
|
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
@@ -1222,7 +1230,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
1222
1230
|
return _ContractInfo.apply(this, arguments);
|
|
1223
1231
|
}
|
|
1224
1232
|
return ContractInfo;
|
|
1225
|
-
}()
|
|
1233
|
+
}()
|
|
1226
1234
|
}, {
|
|
1227
1235
|
key: "GetAccessCharge",
|
|
1228
1236
|
value: function () {
|
|
@@ -2024,7 +2032,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
2024
2032
|
}() /* Creation methods */
|
|
2025
2033
|
}, {
|
|
2026
2034
|
key: "CreateAccessGroup",
|
|
2027
|
-
value:
|
|
2035
|
+
value: function () {
|
|
2028
2036
|
var _CreateAccessGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
|
|
2029
2037
|
var _yield$this$client$et, contractAddress, transactionHash;
|
|
2030
2038
|
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
@@ -2053,7 +2061,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
2053
2061
|
return _CreateAccessGroup.apply(this, arguments);
|
|
2054
2062
|
}
|
|
2055
2063
|
return CreateAccessGroup;
|
|
2056
|
-
}()
|
|
2064
|
+
}()
|
|
2057
2065
|
}, {
|
|
2058
2066
|
key: "CreateContentType",
|
|
2059
2067
|
value: function () {
|
|
@@ -2162,5 +2170,6 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
2162
2170
|
this.channelContentTokens = {};
|
|
2163
2171
|
}
|
|
2164
2172
|
}]);
|
|
2173
|
+
return AuthorizationClient;
|
|
2165
2174
|
}();
|
|
2166
2175
|
module.exports = AuthorizationClient;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
2
2
|
var _toConsumableArray = require("@babel/runtime/helpers/toConsumableArray");
|
|
3
3
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
-
function _createForOfIteratorHelper(
|
|
5
|
-
function _unsupportedIterableToArray(
|
|
6
|
-
function _arrayLikeToArray(
|
|
4
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
7
|
var UrlJoin = require("url-join");
|
|
8
8
|
var HttpClient = require("./HttpClient");
|
|
9
9
|
var UUID = require("uuid").v4;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
2
2
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
3
|
-
function _createForOfIteratorHelper(
|
|
4
|
-
function _unsupportedIterableToArray(
|
|
5
|
-
function _arrayLikeToArray(
|
|
3
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
6
|
var CBOR = require("cbor");
|
|
7
7
|
var SJCL = require("sjcl");
|
|
8
8
|
var MultiHash = require("multihashes");
|
package/dist/src/Crypto.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
2
2
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
3
3
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
-
function _getRequireWildcardCache(
|
|
5
|
-
function _interopRequireWildcard(
|
|
4
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
5
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
6
6
|
if (typeof globalThis.Buffer === "undefined") {
|
|
7
7
|
globalThis.Buffer = require("buffer/").Buffer;
|
|
8
8
|
}
|