@eluvio/elv-client-js 4.0.11 → 4.0.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/.keep +0 -0
- package/dist/ElvClient-min.js +11 -10
- package/dist/ElvClient-node-min.js +11 -10
- package/dist/ElvFrameClient-min.js +11 -10
- package/dist/ElvPermissionsClient-min.js +10 -9
- package/dist/ElvWalletClient-min.js +10 -9
- package/dist/ElvWalletClient-node-min.js +10 -9
- package/dist/src/AuthorizationClient.js +1555 -2076
- package/dist/src/ContentObjectVerification.js +134 -185
- package/dist/src/Crypto.js +224 -319
- package/dist/src/ElvClient.js +822 -1114
- package/dist/src/ElvWallet.js +64 -106
- package/dist/src/EthClient.js +719 -974
- package/dist/src/FrameClient.js +223 -319
- package/dist/src/HttpClient.js +117 -156
- package/dist/src/Id.js +1 -6
- package/dist/src/LogMessage.js +4 -8
- package/dist/src/PermissionsClient.js +973 -1271
- package/dist/src/RemoteSigner.js +161 -232
- package/dist/src/UserProfileClient.js +781 -1038
- package/dist/src/Utils.js +159 -299
- package/dist/src/Validation.js +2 -17
- package/dist/src/client/ABRPublishing.js +828 -958
- package/dist/src/client/AccessGroups.js +849 -1095
- package/dist/src/client/ContentAccess.js +3323 -4195
- package/dist/src/client/ContentManagement.js +1818 -2290
- package/dist/src/client/Contracts.js +468 -614
- package/dist/src/client/Files.js +1506 -1846
- package/dist/src/client/NFT.js +94 -116
- package/dist/src/client/NTP.js +326 -425
- package/dist/src/index.js +2 -5
- package/dist/src/walletClient/ClientMethods.js +1368 -1763
- package/dist/src/walletClient/Configuration.js +5 -3
- package/dist/src/walletClient/Notifications.js +98 -127
- package/dist/src/walletClient/Profile.js +184 -246
- package/dist/src/walletClient/Utils.js +76 -122
- package/dist/src/walletClient/index.js +1171 -1496
- package/package.json +4 -21
- package/src/FrameClient.js +1 -0
- package/src/HttpClient.js +4 -2
- package/src/client/ABRPublishing.js +126 -105
- package/src/client/ContentAccess.js +1 -0
- package/src/client/ContentManagement.js +4 -2
- package/src/walletClient/Configuration.js +3 -2
- package/dist/AccessClient-min.js +0 -54
- package/dist/AccessClient-node-min.js +0 -74
- package/dist/src/AccessClient.js +0 -798
- package/dist/src/LimitedMap.js +0 -120
- package/dist/src/client/Access.js +0 -1
- package/dist/src/client/Management.js +0 -1606
- package/dist/src/contracts/AccessIndexor.js +0 -831
- package/dist/src/contracts/Accessible.js +0 -31
- package/dist/src/contracts/AdmgrAdvertisement.js +0 -695
- package/dist/src/contracts/AdmgrCampaign.js +0 -648
- package/dist/src/contracts/AdmgrCampaignManager.js +0 -493
- package/dist/src/contracts/AdmgrCommercialOffering.js +0 -622
- package/dist/src/contracts/AdmgrCommercialOfferingManager.js +0 -413
- package/dist/src/contracts/AdmgrMarketPlace.js +0 -413
- package/dist/src/contracts/AvailsDelivery.js +0 -535
- package/dist/src/contracts/BaseAccessControlGroup.js +0 -1221
- package/dist/src/contracts/BaseAccessWallet.js +0 -1575
- package/dist/src/contracts/BaseAccessWalletFactory.js +0 -93
- package/dist/src/contracts/BaseContent.js +0 -1104
- package/dist/src/contracts/BaseContentFactory.js +0 -99
- package/dist/src/contracts/BaseContentFactoryExt.js +0 -219
- package/dist/src/contracts/BaseContentSpace.js +0 -1346
- package/dist/src/contracts/BaseContentType.js +0 -353
- package/dist/src/contracts/BaseFactory.js +0 -107
- package/dist/src/contracts/BaseGroupFactory.js +0 -93
- package/dist/src/contracts/BaseLibrary.js +0 -1035
- package/dist/src/contracts/BaseLibraryFactory.js +0 -96
- package/dist/src/contracts/Certifyer.js +0 -87
- package/dist/src/contracts/Container.js +0 -543
- package/dist/src/contracts/Content.js +0 -432
- package/dist/src/contracts/Editable.js +0 -295
- package/dist/src/contracts/FactorySpace.js +0 -57
- package/dist/src/contracts/KmsSpace.js +0 -52
- package/dist/src/contracts/LvProvider.js +0 -512
- package/dist/src/contracts/LvRecordableStream.js +0 -1026
- package/dist/src/contracts/LvRecording.js +0 -627
- package/dist/src/contracts/LvStreamRightsHolder.js +0 -551
- package/dist/src/contracts/MetaObject.js +0 -110
- package/dist/src/contracts/Node.js +0 -167
- package/dist/src/contracts/NodeSpace.js +0 -18
- package/dist/src/contracts/NodeSpaceImpl.js +0 -273
- package/dist/src/contracts/Ownable.js +0 -87
- package/dist/src/contracts/PaymentService.js +0 -616
- package/dist/src/contracts/Precompile.js +0 -15
- package/dist/src/contracts/SampleContentAdMarketplace.js +0 -564
- package/dist/src/contracts/SampleContentAdvertising.js +0 -444
- package/dist/src/contracts/SampleContentHelloWorld.js +0 -459
- package/dist/src/contracts/SampleContentLicensing.js +0 -618
- package/dist/src/contracts/SampleContentSigned.js +0 -447
- package/dist/src/contracts/SampleInstance.js +0 -438
- package/dist/src/contracts/SampleInstanceFactory.js +0 -451
- package/dist/src/contracts/Transactable.js +0 -82
- package/dist/src/contracts/UserSpace.js +0 -18
- package/dist/src/contracts/UserSpaceImpl.js +0 -43
- package/dist/src/contracts/Utils.js +0 -18
- package/dist/src/contracts/Verifier.js +0 -53
- package/dist/src/contracts/strings.js +0 -4
- package/dist/src/contracts/v2/BaseContentFactoryExt.js +0 -219
- package/dist/src/contracts/v2/FactorySpace.js +0 -57
- package/dist/src/contracts/v2/KmsSpace.js +0 -52
- package/dist/src/contracts/v2/NodeSpaceImpl.js +0 -273
- package/dist/src/contracts/v2/UserSpaceImpl.js +0 -43
- package/dist/src/marketplaceClient/ClientMethods.js +0 -1918
- package/dist/src/marketplaceClient/Configuration.js +0 -29
- package/dist/src/marketplaceClient/Utils.js +0 -304
- package/dist/src/marketplaceClient/index.js +0 -1553
- package/utilities/ListAccessGroups.js +0 -34
|
@@ -22,10 +22,12 @@ var WalletConfiguration = {
|
|
|
22
22
|
appUrl: "https://wallet.contentfabric.io"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
__MARKETPLACE_ORDER: ["PREVIEW", "de228e92-ed45-4fe0-8e52-658cf366e962", "wwe-marketplace-main", "
|
|
26
|
-
};
|
|
25
|
+
__MARKETPLACE_ORDER: ["PREVIEW", "masked-singer-brazil-marketplace", "de228e92-ed45-4fe0-8e52-658cf366e962", "wwe-marketplace-main", "maskverse-marketplace", "dolly-marketplace", "eluvio-live-marketplace-sonark", "cirkay-marketplace", "eluvio-live-marketplace-fuudge", "oc-marketplace", "emp-marketplace", "microsoft", "indieflix-marketplace", "angels-airwaves-marketplace", "realcannonballrun-marketplace"]
|
|
26
|
+
};
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
// No production environment on demo
|
|
29
|
+
WalletConfiguration.demo.production = WalletConfiguration.demo.staging;
|
|
29
30
|
|
|
31
|
+
// Allow demo to be referred to as demov3
|
|
30
32
|
WalletConfiguration.demov3 = WalletConfiguration.demo;
|
|
31
33
|
module.exports = WalletConfiguration;
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
2
|
-
|
|
3
2
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* Methods related to notifications for the current user.
|
|
7
5
|
*
|
|
8
6
|
* @module Notifications
|
|
9
7
|
*/
|
|
10
|
-
var Utils = require("../Utils");
|
|
11
8
|
|
|
9
|
+
var Utils = require("../Utils");
|
|
12
10
|
var UrlJoin = require("url-join");
|
|
13
|
-
|
|
14
11
|
var NotificationPath = function NotificationPath(_ref) {
|
|
15
12
|
var network = _ref.network,
|
|
16
|
-
|
|
13
|
+
path = _ref.path;
|
|
17
14
|
return UrlJoin("/push", network === "main" ? "/main" : "/dv3", path);
|
|
18
15
|
};
|
|
16
|
+
|
|
19
17
|
/**
|
|
20
18
|
* Push a notification to the current user
|
|
21
19
|
*
|
|
@@ -24,41 +22,36 @@ var NotificationPath = function NotificationPath(_ref) {
|
|
|
24
22
|
* @param {string} eventType - The type of the notification
|
|
25
23
|
* @param {(Object | string)=} data - Data associated with this notification
|
|
26
24
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
25
|
exports.PushNotification = /*#__PURE__*/function () {
|
|
30
26
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
|
|
31
27
|
var tenantId, eventType, data;
|
|
32
28
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
33
|
-
while (1) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
case "end":
|
|
52
|
-
return _context.stop();
|
|
53
|
-
}
|
|
29
|
+
while (1) switch (_context.prev = _context.next) {
|
|
30
|
+
case 0:
|
|
31
|
+
tenantId = _ref2.tenantId, eventType = _ref2.eventType, data = _ref2.data;
|
|
32
|
+
_context.next = 3;
|
|
33
|
+
return this.stateStoreClient.Request({
|
|
34
|
+
method: "POST",
|
|
35
|
+
path: NotificationPath({
|
|
36
|
+
network: this.network,
|
|
37
|
+
path: UrlJoin("notify_user", this.UserAddress(), tenantId, eventType)
|
|
38
|
+
}),
|
|
39
|
+
body: data,
|
|
40
|
+
headers: {
|
|
41
|
+
Authorization: "Bearer ".concat(this.AuthToken())
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
case 3:
|
|
45
|
+
case "end":
|
|
46
|
+
return _context.stop();
|
|
54
47
|
}
|
|
55
48
|
}, _callee, this);
|
|
56
49
|
}));
|
|
57
|
-
|
|
58
50
|
return function (_x) {
|
|
59
51
|
return _ref3.apply(this, arguments);
|
|
60
52
|
};
|
|
61
53
|
}();
|
|
54
|
+
|
|
62
55
|
/**
|
|
63
56
|
* Add a listener to receive new notifications.
|
|
64
57
|
*
|
|
@@ -67,56 +60,45 @@ exports.PushNotification = /*#__PURE__*/function () {
|
|
|
67
60
|
*
|
|
68
61
|
* @returns {Promise<EventSource>} - An EventSource instance listening for notifications. Use source.close() to close the listener.
|
|
69
62
|
*/
|
|
70
|
-
|
|
71
|
-
|
|
72
63
|
exports.AddNotificationListener = /*#__PURE__*/function () {
|
|
73
64
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref4) {
|
|
74
65
|
var onMessage, url, source;
|
|
75
66
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
76
|
-
while (1) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
onMessage(parsedMessage);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
return _context2.abrupt("return", source);
|
|
107
|
-
|
|
108
|
-
case 8:
|
|
109
|
-
case "end":
|
|
110
|
-
return _context2.stop();
|
|
111
|
-
}
|
|
67
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
68
|
+
case 0:
|
|
69
|
+
onMessage = _ref4.onMessage;
|
|
70
|
+
if (onMessage) {
|
|
71
|
+
_context2.next = 3;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
throw Error("Eluvio Wallet Client: No onMessage callback provided to AddNotificationListener");
|
|
75
|
+
case 3:
|
|
76
|
+
url = new URL(this.stateStoreClient.BaseURI().toString());
|
|
77
|
+
url.pathname = NotificationPath({
|
|
78
|
+
network: this.network,
|
|
79
|
+
path: UrlJoin("register", this.UserAddress(), this.AuthToken())
|
|
80
|
+
});
|
|
81
|
+
source = new EventSource(url);
|
|
82
|
+
source.onmessage = function (event) {
|
|
83
|
+
var parsedMessage = JSON.parse(event.data);
|
|
84
|
+
try {
|
|
85
|
+
parsedMessage.data = JSON.parse(parsedMessage.data);
|
|
86
|
+
// eslint-disable-next-line no-empty
|
|
87
|
+
} catch (error) {}
|
|
88
|
+
onMessage(parsedMessage);
|
|
89
|
+
};
|
|
90
|
+
return _context2.abrupt("return", source);
|
|
91
|
+
case 8:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context2.stop();
|
|
112
94
|
}
|
|
113
95
|
}, _callee2, this);
|
|
114
96
|
}));
|
|
115
|
-
|
|
116
97
|
return function (_x2) {
|
|
117
98
|
return _ref5.apply(this, arguments);
|
|
118
99
|
};
|
|
119
100
|
}();
|
|
101
|
+
|
|
120
102
|
/**
|
|
121
103
|
* Retrieve notifications for the current user.
|
|
122
104
|
*
|
|
@@ -128,69 +110,58 @@ exports.AddNotificationListener = /*#__PURE__*/function () {
|
|
|
128
110
|
*
|
|
129
111
|
* @returns {Promise<Array<Object>>} - A list of notifications for the specified parameters
|
|
130
112
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
113
|
exports.Notifications = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
134
114
|
var _ref7,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
115
|
+
tenantId,
|
|
116
|
+
types,
|
|
117
|
+
offsetId,
|
|
118
|
+
_ref7$limit,
|
|
119
|
+
limit,
|
|
120
|
+
queryParams,
|
|
121
|
+
_yield$Utils$Response,
|
|
122
|
+
records,
|
|
123
|
+
_args3 = arguments;
|
|
145
124
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
146
|
-
while (1) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
125
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
126
|
+
case 0:
|
|
127
|
+
_ref7 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, tenantId = _ref7.tenantId, types = _ref7.types, offsetId = _ref7.offsetId, _ref7$limit = _ref7.limit, limit = _ref7$limit === void 0 ? 10 : _ref7$limit;
|
|
128
|
+
queryParams = {
|
|
129
|
+
limit: limit
|
|
130
|
+
};
|
|
131
|
+
if (tenantId) {
|
|
132
|
+
queryParams.tenant_id = tenantId;
|
|
133
|
+
}
|
|
134
|
+
if (types) {
|
|
135
|
+
queryParams.types = Array.isArray(types) ? types.join(",") : types;
|
|
136
|
+
}
|
|
137
|
+
if (offsetId) {
|
|
138
|
+
queryParams.offset_by = offsetId;
|
|
139
|
+
}
|
|
140
|
+
_context3.next = 7;
|
|
141
|
+
return Utils.ResponseToJson(this.stateStoreClient.Request({
|
|
142
|
+
method: "GET",
|
|
143
|
+
path: NotificationPath({
|
|
144
|
+
network: this.network,
|
|
145
|
+
path: UrlJoin("history", this.UserAddress())
|
|
146
|
+
}),
|
|
147
|
+
queryParams: queryParams,
|
|
148
|
+
headers: {
|
|
149
|
+
Authorization: "Bearer ".concat(this.AuthToken())
|
|
164
150
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
case 7:
|
|
180
|
-
_yield$Utils$Response = _context3.sent;
|
|
181
|
-
records = _yield$Utils$Response.records;
|
|
182
|
-
return _context3.abrupt("return", records.map(function (record) {
|
|
183
|
-
try {
|
|
184
|
-
record.data = JSON.parse(record.data); // eslint-disable-next-line no-empty
|
|
185
|
-
} catch (error) {}
|
|
186
|
-
|
|
187
|
-
return record;
|
|
188
|
-
}));
|
|
189
|
-
|
|
190
|
-
case 10:
|
|
191
|
-
case "end":
|
|
192
|
-
return _context3.stop();
|
|
193
|
-
}
|
|
151
|
+
}));
|
|
152
|
+
case 7:
|
|
153
|
+
_yield$Utils$Response = _context3.sent;
|
|
154
|
+
records = _yield$Utils$Response.records;
|
|
155
|
+
return _context3.abrupt("return", records.map(function (record) {
|
|
156
|
+
try {
|
|
157
|
+
record.data = JSON.parse(record.data);
|
|
158
|
+
// eslint-disable-next-line no-empty
|
|
159
|
+
} catch (error) {}
|
|
160
|
+
return record;
|
|
161
|
+
}));
|
|
162
|
+
case 10:
|
|
163
|
+
case "end":
|
|
164
|
+
return _context3.stop();
|
|
194
165
|
}
|
|
195
166
|
}, _callee3, this);
|
|
196
167
|
}));
|