@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.
Files changed (111) hide show
  1. package/dist/.keep +0 -0
  2. package/dist/ElvClient-min.js +11 -10
  3. package/dist/ElvClient-node-min.js +11 -10
  4. package/dist/ElvFrameClient-min.js +11 -10
  5. package/dist/ElvPermissionsClient-min.js +10 -9
  6. package/dist/ElvWalletClient-min.js +10 -9
  7. package/dist/ElvWalletClient-node-min.js +10 -9
  8. package/dist/src/AuthorizationClient.js +1555 -2076
  9. package/dist/src/ContentObjectVerification.js +134 -185
  10. package/dist/src/Crypto.js +224 -319
  11. package/dist/src/ElvClient.js +822 -1114
  12. package/dist/src/ElvWallet.js +64 -106
  13. package/dist/src/EthClient.js +719 -974
  14. package/dist/src/FrameClient.js +223 -319
  15. package/dist/src/HttpClient.js +117 -156
  16. package/dist/src/Id.js +1 -6
  17. package/dist/src/LogMessage.js +4 -8
  18. package/dist/src/PermissionsClient.js +973 -1271
  19. package/dist/src/RemoteSigner.js +161 -232
  20. package/dist/src/UserProfileClient.js +781 -1038
  21. package/dist/src/Utils.js +159 -299
  22. package/dist/src/Validation.js +2 -17
  23. package/dist/src/client/ABRPublishing.js +828 -958
  24. package/dist/src/client/AccessGroups.js +849 -1095
  25. package/dist/src/client/ContentAccess.js +3323 -4195
  26. package/dist/src/client/ContentManagement.js +1818 -2290
  27. package/dist/src/client/Contracts.js +468 -614
  28. package/dist/src/client/Files.js +1506 -1846
  29. package/dist/src/client/NFT.js +94 -116
  30. package/dist/src/client/NTP.js +326 -425
  31. package/dist/src/index.js +2 -5
  32. package/dist/src/walletClient/ClientMethods.js +1368 -1763
  33. package/dist/src/walletClient/Configuration.js +5 -3
  34. package/dist/src/walletClient/Notifications.js +98 -127
  35. package/dist/src/walletClient/Profile.js +184 -246
  36. package/dist/src/walletClient/Utils.js +76 -122
  37. package/dist/src/walletClient/index.js +1171 -1496
  38. package/package.json +4 -21
  39. package/src/FrameClient.js +1 -0
  40. package/src/HttpClient.js +4 -2
  41. package/src/client/ABRPublishing.js +126 -105
  42. package/src/client/ContentAccess.js +1 -0
  43. package/src/client/ContentManagement.js +4 -2
  44. package/src/walletClient/Configuration.js +3 -2
  45. package/dist/AccessClient-min.js +0 -54
  46. package/dist/AccessClient-node-min.js +0 -74
  47. package/dist/src/AccessClient.js +0 -798
  48. package/dist/src/LimitedMap.js +0 -120
  49. package/dist/src/client/Access.js +0 -1
  50. package/dist/src/client/Management.js +0 -1606
  51. package/dist/src/contracts/AccessIndexor.js +0 -831
  52. package/dist/src/contracts/Accessible.js +0 -31
  53. package/dist/src/contracts/AdmgrAdvertisement.js +0 -695
  54. package/dist/src/contracts/AdmgrCampaign.js +0 -648
  55. package/dist/src/contracts/AdmgrCampaignManager.js +0 -493
  56. package/dist/src/contracts/AdmgrCommercialOffering.js +0 -622
  57. package/dist/src/contracts/AdmgrCommercialOfferingManager.js +0 -413
  58. package/dist/src/contracts/AdmgrMarketPlace.js +0 -413
  59. package/dist/src/contracts/AvailsDelivery.js +0 -535
  60. package/dist/src/contracts/BaseAccessControlGroup.js +0 -1221
  61. package/dist/src/contracts/BaseAccessWallet.js +0 -1575
  62. package/dist/src/contracts/BaseAccessWalletFactory.js +0 -93
  63. package/dist/src/contracts/BaseContent.js +0 -1104
  64. package/dist/src/contracts/BaseContentFactory.js +0 -99
  65. package/dist/src/contracts/BaseContentFactoryExt.js +0 -219
  66. package/dist/src/contracts/BaseContentSpace.js +0 -1346
  67. package/dist/src/contracts/BaseContentType.js +0 -353
  68. package/dist/src/contracts/BaseFactory.js +0 -107
  69. package/dist/src/contracts/BaseGroupFactory.js +0 -93
  70. package/dist/src/contracts/BaseLibrary.js +0 -1035
  71. package/dist/src/contracts/BaseLibraryFactory.js +0 -96
  72. package/dist/src/contracts/Certifyer.js +0 -87
  73. package/dist/src/contracts/Container.js +0 -543
  74. package/dist/src/contracts/Content.js +0 -432
  75. package/dist/src/contracts/Editable.js +0 -295
  76. package/dist/src/contracts/FactorySpace.js +0 -57
  77. package/dist/src/contracts/KmsSpace.js +0 -52
  78. package/dist/src/contracts/LvProvider.js +0 -512
  79. package/dist/src/contracts/LvRecordableStream.js +0 -1026
  80. package/dist/src/contracts/LvRecording.js +0 -627
  81. package/dist/src/contracts/LvStreamRightsHolder.js +0 -551
  82. package/dist/src/contracts/MetaObject.js +0 -110
  83. package/dist/src/contracts/Node.js +0 -167
  84. package/dist/src/contracts/NodeSpace.js +0 -18
  85. package/dist/src/contracts/NodeSpaceImpl.js +0 -273
  86. package/dist/src/contracts/Ownable.js +0 -87
  87. package/dist/src/contracts/PaymentService.js +0 -616
  88. package/dist/src/contracts/Precompile.js +0 -15
  89. package/dist/src/contracts/SampleContentAdMarketplace.js +0 -564
  90. package/dist/src/contracts/SampleContentAdvertising.js +0 -444
  91. package/dist/src/contracts/SampleContentHelloWorld.js +0 -459
  92. package/dist/src/contracts/SampleContentLicensing.js +0 -618
  93. package/dist/src/contracts/SampleContentSigned.js +0 -447
  94. package/dist/src/contracts/SampleInstance.js +0 -438
  95. package/dist/src/contracts/SampleInstanceFactory.js +0 -451
  96. package/dist/src/contracts/Transactable.js +0 -82
  97. package/dist/src/contracts/UserSpace.js +0 -18
  98. package/dist/src/contracts/UserSpaceImpl.js +0 -43
  99. package/dist/src/contracts/Utils.js +0 -18
  100. package/dist/src/contracts/Verifier.js +0 -53
  101. package/dist/src/contracts/strings.js +0 -4
  102. package/dist/src/contracts/v2/BaseContentFactoryExt.js +0 -219
  103. package/dist/src/contracts/v2/FactorySpace.js +0 -57
  104. package/dist/src/contracts/v2/KmsSpace.js +0 -52
  105. package/dist/src/contracts/v2/NodeSpaceImpl.js +0 -273
  106. package/dist/src/contracts/v2/UserSpaceImpl.js +0 -43
  107. package/dist/src/marketplaceClient/ClientMethods.js +0 -1918
  108. package/dist/src/marketplaceClient/Configuration.js +0 -29
  109. package/dist/src/marketplaceClient/Utils.js +0 -304
  110. package/dist/src/marketplaceClient/index.js +0 -1553
  111. 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", "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
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
- 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
  }));