@eluvio/elv-client-js 4.0.5 → 4.0.7

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.
Files changed (43) hide show
  1. package/dist/ElvClient-min.js +12 -11
  2. package/dist/ElvClient-node-min.js +12 -11
  3. package/dist/ElvFrameClient-min.js +12 -11
  4. package/dist/ElvPermissionsClient-min.js +10 -9
  5. package/dist/ElvWalletClient-min.js +12 -11
  6. package/dist/ElvWalletClient-node-min.js +11 -10
  7. package/dist/src/AuthorizationClient.js +1556 -2077
  8. package/dist/src/ContentObjectVerification.js +134 -185
  9. package/dist/src/Crypto.js +225 -322
  10. package/dist/src/ElvClient.js +823 -1117
  11. package/dist/src/ElvWallet.js +64 -106
  12. package/dist/src/EthClient.js +719 -974
  13. package/dist/src/FrameClient.js +222 -318
  14. package/dist/src/HttpClient.js +112 -154
  15. package/dist/src/Id.js +1 -6
  16. package/dist/src/LogMessage.js +4 -8
  17. package/dist/src/PermissionsClient.js +973 -1271
  18. package/dist/src/RemoteSigner.js +161 -232
  19. package/dist/src/UserProfileClient.js +781 -1038
  20. package/dist/src/Utils.js +160 -302
  21. package/dist/src/Validation.js +2 -17
  22. package/dist/src/client/ABRPublishing.js +772 -942
  23. package/dist/src/client/AccessGroups.js +849 -1095
  24. package/dist/src/client/ContentAccess.js +3263 -4132
  25. package/dist/src/client/ContentManagement.js +1811 -2283
  26. package/dist/src/client/Contracts.js +468 -614
  27. package/dist/src/client/Files.js +1505 -1845
  28. package/dist/src/client/NFT.js +94 -116
  29. package/dist/src/client/NTP.js +326 -425
  30. package/dist/src/index.js +2 -5
  31. package/dist/src/walletClient/ClientMethods.js +1348 -1735
  32. package/dist/src/walletClient/Configuration.js +4 -2
  33. package/dist/src/walletClient/Notifications.js +98 -127
  34. package/dist/src/walletClient/Profile.js +184 -246
  35. package/dist/src/walletClient/Utils.js +76 -122
  36. package/dist/src/walletClient/index.js +1168 -1493
  37. package/package.json +2 -2
  38. package/src/Crypto.js +1 -1
  39. package/src/ElvClient.js +1 -3
  40. package/src/Utils.js +1 -1
  41. package/testScripts/Test.js +0 -1
  42. package/utilities/NFTIngest.js +527 -0
  43. package/utilities/lib/concerns/LocalFile.js +2 -1
@@ -23,9 +23,11 @@ var WalletConfiguration = {
23
23
  }
24
24
  },
25
25
  __MARKETPLACE_ORDER: ["PREVIEW", "de228e92-ed45-4fe0-8e52-658cf366e962", "wwe-marketplace-main", "realcannonballrun-marketplace", "maskverse-marketplace", "dolly-marketplace", "eluvio-live-marketplace-sonark", "cirkay-marketplace", "eluvio-live-marketplace-fuudge", "oc-marketplace", "emp-marketplace", "microsoft", "indieflix-marketplace", "angels-airwaves-marketplace"]
26
- }; // No production environment on demo
26
+ };
27
27
 
28
- WalletConfiguration.demo.production = WalletConfiguration.demo.staging; // Allow demo to be referred to as demov3
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
- path = _ref.path;
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
- switch (_context.prev = _context.next) {
35
- case 0:
36
- tenantId = _ref2.tenantId, eventType = _ref2.eventType, data = _ref2.data;
37
- _context.next = 3;
38
- return this.stateStoreClient.Request({
39
- method: "POST",
40
- path: NotificationPath({
41
- network: this.network,
42
- path: UrlJoin("notify_user", this.UserAddress(), tenantId, eventType)
43
- }),
44
- body: data,
45
- headers: {
46
- Authorization: "Bearer ".concat(this.AuthToken())
47
- }
48
- });
49
-
50
- case 3:
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
- switch (_context2.prev = _context2.next) {
78
- case 0:
79
- onMessage = _ref4.onMessage;
80
-
81
- if (onMessage) {
82
- _context2.next = 3;
83
- break;
84
- }
85
-
86
- throw Error("Eluvio Wallet Client: No onMessage callback provided to AddNotificationListener");
87
-
88
- case 3:
89
- url = new URL(this.stateStoreClient.BaseURI().toString());
90
- url.pathname = NotificationPath({
91
- network: this.network,
92
- path: UrlJoin("register", this.UserAddress(), this.AuthToken())
93
- });
94
- source = new EventSource(url);
95
-
96
- source.onmessage = function (event) {
97
- var parsedMessage = JSON.parse(event.data);
98
-
99
- try {
100
- parsedMessage.data = JSON.parse(parsedMessage.data); // eslint-disable-next-line no-empty
101
- } catch (error) {}
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
- tenantId,
136
- types,
137
- offsetId,
138
- _ref7$limit,
139
- limit,
140
- queryParams,
141
- _yield$Utils$Response,
142
- records,
143
- _args3 = arguments;
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
- switch (_context3.prev = _context3.next) {
148
- case 0:
149
- _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;
150
- queryParams = {
151
- limit: limit
152
- };
153
-
154
- if (tenantId) {
155
- queryParams.tenant_id = tenantId;
156
- }
157
-
158
- if (types) {
159
- queryParams.types = Array.isArray(types) ? types.join(",") : types;
160
- }
161
-
162
- if (offsetId) {
163
- queryParams.offset_by = offsetId;
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
- _context3.next = 7;
167
- return Utils.ResponseToJson(this.stateStoreClient.Request({
168
- method: "GET",
169
- path: NotificationPath({
170
- network: this.network,
171
- path: UrlJoin("history", this.UserAddress())
172
- }),
173
- queryParams: queryParams,
174
- headers: {
175
- Authorization: "Bearer ".concat(this.AuthToken())
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
  }));