@eluvio/elv-client-js 4.0.10 → 4.0.12

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 (78) hide show
  1. package/dist/.keep +0 -0
  2. package/dist/ElvClient-min.js +10 -10
  3. package/dist/ElvClient-node-min.js +3 -3
  4. package/dist/ElvFrameClient-min.js +10 -10
  5. package/dist/ElvWalletClient-min.js +9 -9
  6. package/dist/ElvWalletClient-node-min.js +3 -3
  7. package/dist/src/AuthorizationClient.js +7 -8
  8. package/dist/src/client/Files.js +2 -1
  9. package/package.json +4 -21
  10. package/src/AuthorizationClient.js +5 -5
  11. package/src/client/Files.js +1 -1
  12. package/dist/AccessClient-min.js +0 -54
  13. package/dist/AccessClient-node-min.js +0 -74
  14. package/dist/src/AccessClient.js +0 -798
  15. package/dist/src/LimitedMap.js +0 -120
  16. package/dist/src/client/Access.js +0 -1
  17. package/dist/src/client/Management.js +0 -1606
  18. package/dist/src/contracts/AccessIndexor.js +0 -831
  19. package/dist/src/contracts/Accessible.js +0 -31
  20. package/dist/src/contracts/AdmgrAdvertisement.js +0 -695
  21. package/dist/src/contracts/AdmgrCampaign.js +0 -648
  22. package/dist/src/contracts/AdmgrCampaignManager.js +0 -493
  23. package/dist/src/contracts/AdmgrCommercialOffering.js +0 -622
  24. package/dist/src/contracts/AdmgrCommercialOfferingManager.js +0 -413
  25. package/dist/src/contracts/AdmgrMarketPlace.js +0 -413
  26. package/dist/src/contracts/AvailsDelivery.js +0 -535
  27. package/dist/src/contracts/BaseAccessControlGroup.js +0 -1221
  28. package/dist/src/contracts/BaseAccessWallet.js +0 -1575
  29. package/dist/src/contracts/BaseAccessWalletFactory.js +0 -93
  30. package/dist/src/contracts/BaseContent.js +0 -1104
  31. package/dist/src/contracts/BaseContentFactory.js +0 -99
  32. package/dist/src/contracts/BaseContentFactoryExt.js +0 -219
  33. package/dist/src/contracts/BaseContentSpace.js +0 -1346
  34. package/dist/src/contracts/BaseContentType.js +0 -353
  35. package/dist/src/contracts/BaseFactory.js +0 -107
  36. package/dist/src/contracts/BaseGroupFactory.js +0 -93
  37. package/dist/src/contracts/BaseLibrary.js +0 -1035
  38. package/dist/src/contracts/BaseLibraryFactory.js +0 -96
  39. package/dist/src/contracts/Certifyer.js +0 -87
  40. package/dist/src/contracts/Container.js +0 -543
  41. package/dist/src/contracts/Content.js +0 -432
  42. package/dist/src/contracts/Editable.js +0 -295
  43. package/dist/src/contracts/FactorySpace.js +0 -57
  44. package/dist/src/contracts/KmsSpace.js +0 -52
  45. package/dist/src/contracts/LvProvider.js +0 -512
  46. package/dist/src/contracts/LvRecordableStream.js +0 -1026
  47. package/dist/src/contracts/LvRecording.js +0 -627
  48. package/dist/src/contracts/LvStreamRightsHolder.js +0 -551
  49. package/dist/src/contracts/MetaObject.js +0 -110
  50. package/dist/src/contracts/Node.js +0 -167
  51. package/dist/src/contracts/NodeSpace.js +0 -18
  52. package/dist/src/contracts/NodeSpaceImpl.js +0 -273
  53. package/dist/src/contracts/Ownable.js +0 -87
  54. package/dist/src/contracts/PaymentService.js +0 -616
  55. package/dist/src/contracts/Precompile.js +0 -15
  56. package/dist/src/contracts/SampleContentAdMarketplace.js +0 -564
  57. package/dist/src/contracts/SampleContentAdvertising.js +0 -444
  58. package/dist/src/contracts/SampleContentHelloWorld.js +0 -459
  59. package/dist/src/contracts/SampleContentLicensing.js +0 -618
  60. package/dist/src/contracts/SampleContentSigned.js +0 -447
  61. package/dist/src/contracts/SampleInstance.js +0 -438
  62. package/dist/src/contracts/SampleInstanceFactory.js +0 -451
  63. package/dist/src/contracts/Transactable.js +0 -82
  64. package/dist/src/contracts/UserSpace.js +0 -18
  65. package/dist/src/contracts/UserSpaceImpl.js +0 -43
  66. package/dist/src/contracts/Utils.js +0 -18
  67. package/dist/src/contracts/Verifier.js +0 -53
  68. package/dist/src/contracts/strings.js +0 -4
  69. package/dist/src/contracts/v2/BaseContentFactoryExt.js +0 -219
  70. package/dist/src/contracts/v2/FactorySpace.js +0 -57
  71. package/dist/src/contracts/v2/KmsSpace.js +0 -52
  72. package/dist/src/contracts/v2/NodeSpaceImpl.js +0 -273
  73. package/dist/src/contracts/v2/UserSpaceImpl.js +0 -43
  74. package/dist/src/marketplaceClient/ClientMethods.js +0 -1918
  75. package/dist/src/marketplaceClient/Configuration.js +0 -29
  76. package/dist/src/marketplaceClient/Utils.js +0 -304
  77. package/dist/src/marketplaceClient/index.js +0 -1553
  78. package/testScripts/CreateMezMonolithic.js +0 -779
@@ -127,11 +127,11 @@ var AuthorizationClient = /*#__PURE__*/function () {
127
127
  key: "AuthorizationToken",
128
128
  value: function () {
129
129
  var _AuthorizationToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
130
- var libraryId, objectId, versionHash, partHash, encryption, audienceData, context, _ref3$update, update, _ref3$channelAuth, channelAuth, oauthToken, _ref3$noCache, noCache, _ref3$noAuth, noAuth, isWalletRequest, initialNoCache, authorizationToken;
130
+ var libraryId, objectId, versionHash, partHash, encryption, audienceData, context, _ref3$update, update, _ref3$makeAccessReque, makeAccessRequest, _ref3$channelAuth, channelAuth, oauthToken, _ref3$noCache, noCache, _ref3$noAuth, noAuth, isWalletRequest, initialNoCache, authorizationToken;
131
131
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
132
132
  while (1) switch (_context2.prev = _context2.next) {
133
133
  case 0:
134
- libraryId = _ref3.libraryId, objectId = _ref3.objectId, versionHash = _ref3.versionHash, partHash = _ref3.partHash, encryption = _ref3.encryption, audienceData = _ref3.audienceData, context = _ref3.context, _ref3$update = _ref3.update, update = _ref3$update === void 0 ? false : _ref3$update, _ref3$channelAuth = _ref3.channelAuth, channelAuth = _ref3$channelAuth === void 0 ? false : _ref3$channelAuth, oauthToken = _ref3.oauthToken, _ref3$noCache = _ref3.noCache, noCache = _ref3$noCache === void 0 ? false : _ref3$noCache, _ref3$noAuth = _ref3.noAuth, noAuth = _ref3$noAuth === void 0 ? false : _ref3$noAuth;
134
+ libraryId = _ref3.libraryId, objectId = _ref3.objectId, versionHash = _ref3.versionHash, partHash = _ref3.partHash, encryption = _ref3.encryption, audienceData = _ref3.audienceData, context = _ref3.context, _ref3$update = _ref3.update, update = _ref3$update === void 0 ? false : _ref3$update, _ref3$makeAccessReque = _ref3.makeAccessRequest, makeAccessRequest = _ref3$makeAccessReque === void 0 ? false : _ref3$makeAccessReque, _ref3$channelAuth = _ref3.channelAuth, channelAuth = _ref3$channelAuth === void 0 ? false : _ref3$channelAuth, oauthToken = _ref3.oauthToken, _ref3$noCache = _ref3.noCache, noCache = _ref3$noCache === void 0 ? false : _ref3$noCache, _ref3$noAuth = _ref3.noAuth, noAuth = _ref3$noAuth === void 0 ? false : _ref3$noAuth;
135
135
  if (versionHash) {
136
136
  objectId = this.client.utils.DecodeVersionHash(versionHash).objectId;
137
137
  }
@@ -199,7 +199,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
199
199
  partHash: partHash,
200
200
  encryption: encryption,
201
201
  update: update,
202
- noAuth: noAuth
202
+ makeAccessRequest: makeAccessRequest
203
203
  });
204
204
  case 27:
205
205
  authorizationToken = _context2.sent;
@@ -228,11 +228,11 @@ var AuthorizationClient = /*#__PURE__*/function () {
228
228
  key: "GenerateAuthorizationToken",
229
229
  value: function () {
230
230
  var _GenerateAuthorizationToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
231
- var libraryId, objectId, versionHash, partHash, encryption, _ref4$update, update, _ref4$noAuth, noAuth, publicKey, owner, ownerCapKey, ownerCap, cap, token, _yield$this$MakeAcces, transactionHash, signature, multiSig;
231
+ var libraryId, objectId, versionHash, partHash, encryption, _ref4$update, update, _ref4$makeAccessReque, makeAccessRequest, publicKey, owner, ownerCapKey, ownerCap, cap, token, _yield$this$MakeAcces, transactionHash, signature, multiSig;
232
232
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
233
233
  while (1) switch (_context3.prev = _context3.next) {
234
234
  case 0:
235
- libraryId = _ref4.libraryId, objectId = _ref4.objectId, versionHash = _ref4.versionHash, partHash = _ref4.partHash, encryption = _ref4.encryption, _ref4$update = _ref4.update, update = _ref4$update === void 0 ? false : _ref4$update, _ref4$noAuth = _ref4.noAuth, noAuth = _ref4$noAuth === void 0 ? false : _ref4$noAuth;
235
+ libraryId = _ref4.libraryId, objectId = _ref4.objectId, versionHash = _ref4.versionHash, partHash = _ref4.partHash, encryption = _ref4.encryption, _ref4$update = _ref4.update, update = _ref4$update === void 0 ? false : _ref4$update, _ref4$makeAccessReque = _ref4.makeAccessRequest, makeAccessRequest = _ref4$makeAccessReque === void 0 ? false : _ref4$makeAccessReque;
236
236
  if (versionHash) {
237
237
  objectId = Utils.DecodeVersionHash(versionHash).objectId;
238
238
  }
@@ -286,7 +286,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
286
286
  qspace_id: this.contentSpaceId,
287
287
  addr: Utils.FormatAddress(this.client.signer && this.client.signer.address || "")
288
288
  };
289
- if (!update) {
289
+ if (!(update || makeAccessRequest)) {
290
290
  _context3.next = 29;
291
291
  break;
292
292
  }
@@ -297,8 +297,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
297
297
  versionHash: versionHash,
298
298
  update: update,
299
299
  publicKey: publicKey,
300
- noCache: this.noCache,
301
- noAuth: this.noAuth || noAuth
300
+ noCache: this.noCache
302
301
  });
303
302
  case 26:
304
303
  _yield$this$MakeAcces = _context3.sent;
@@ -1340,7 +1340,8 @@ exports.DownloadPart = /*#__PURE__*/function () {
1340
1340
  libraryId: libraryId,
1341
1341
  objectId: objectId,
1342
1342
  versionHash: versionHash,
1343
- encryption: encryption
1343
+ encryption: encryption,
1344
+ makeAccessRequest: true
1344
1345
  });
1345
1346
  case 9:
1346
1347
  headers = _context17.sent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.0.10",
3
+ "version": "4.0.12",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -30,15 +30,7 @@
30
30
  "publish": "npm publish --access public",
31
31
  "test": "node test/RunTests.js",
32
32
  "test-docs": "GENERATE_METHOD_LOGS=true node test/RunTests.js",
33
- "test-utilities": "mocha --recursive utilities/tests/unit",
34
- "jest": "jest",
35
- "test-cov": "jest --coverage --coverageDirectory 'test/coverage'",
36
- "test-build": "USE_BUILD=true jest"
37
- },
38
- "pre-commit": {
39
- "run": [
40
- "lint"
41
- ]
33
+ "test-utilities": "mocha --recursive utilities/tests/unit"
42
34
  },
43
35
  "browser": {
44
36
  "fs": false
@@ -85,7 +77,6 @@
85
77
  "lodash": "^4.17.19",
86
78
  "lodash.isequal": "^4.5.0",
87
79
  "mime-types": "^2.1.24",
88
- "multicodec": "^0.5.3",
89
80
  "multihashes": "^0.4.14",
90
81
  "node-fetch": "^2.6.7",
91
82
  "object-path": "^0.11.8",
@@ -96,7 +87,6 @@
96
87
  "ramda": "^0.27.1",
97
88
  "shell-escape": "^0.2.0",
98
89
  "sjcl": "^1.0.8",
99
- "stream-browserify": "^3.0.0",
100
90
  "typedarray": "0.0.6",
101
91
  "unorm": "^1.5.0",
102
92
  "urijs": "^1.19.10",
@@ -116,21 +106,14 @@
116
106
  "copy-webpack-plugin": "^6.0.2",
117
107
  "eslint": "^5.15.0",
118
108
  "eslint-plugin-html": "^5.0.0",
119
- "jest": "^24.9.0",
120
- "jest-cli": "^24.9.0",
121
- "jsdoc": "^3.6.10",
122
- "minami": "^1.2.3",
109
+ "jsdoc": "^4.0.0",
123
110
  "mocha": "^8.2.1",
124
111
  "moment": "^2.27.0",
125
- "pre-commit": "^1.2.2",
126
112
  "raw-loader": "^0.5.1",
127
113
  "shell-quote": "^1.7.2",
128
114
  "showdown": "^1.9.1",
129
115
  "simple-mock": "^0.8.0",
130
- "solc": "^0.7.5",
131
- "truffle": "^5.1.54",
132
- "truffle-contract": "^3.0.7",
133
- "truffle-test-utils": "^0.1.0",
116
+ "taffydb": "^2.7.3",
134
117
  "webpack": "^4.20.2",
135
118
  "webpack-bundle-analyzer": "^3.3.2",
136
119
  "webpack-cli": "^3.1.2",
@@ -116,6 +116,7 @@ class AuthorizationClient {
116
116
  audienceData,
117
117
  context,
118
118
  update=false,
119
+ makeAccessRequest=false,
119
120
  channelAuth=false,
120
121
  oauthToken,
121
122
  noCache=false,
@@ -171,7 +172,7 @@ class AuthorizationClient {
171
172
  partHash,
172
173
  encryption,
173
174
  update,
174
- noAuth
175
+ makeAccessRequest
175
176
  });
176
177
  }
177
178
 
@@ -183,7 +184,7 @@ class AuthorizationClient {
183
184
  }
184
185
  }
185
186
 
186
- async GenerateAuthorizationToken({libraryId, objectId, versionHash, partHash, encryption, update=false, noAuth=false}) {
187
+ async GenerateAuthorizationToken({libraryId, objectId, versionHash, partHash, encryption, update=false, makeAccessRequest=false}) {
187
188
  if(versionHash) { objectId = Utils.DecodeVersionHash(versionHash).objectId; }
188
189
 
189
190
  // Generate AFGH public key if encryption is specified
@@ -204,15 +205,14 @@ class AuthorizationClient {
204
205
  addr: Utils.FormatAddress(((this.client.signer && this.client.signer.address) || ""))
205
206
  };
206
207
 
207
- if(update) {
208
+ if(update || makeAccessRequest) {
208
209
  const { transactionHash } = await this.MakeAccessRequest({
209
210
  libraryId,
210
211
  objectId,
211
212
  versionHash,
212
213
  update,
213
214
  publicKey,
214
- noCache: this.noCache,
215
- noAuth: this.noAuth || noAuth
215
+ noCache: this.noCache
216
216
  });
217
217
 
218
218
  if(transactionHash) {
@@ -809,7 +809,7 @@ exports.DownloadPart = async function({
809
809
  const encryption = encrypted ? "cgck" : undefined;
810
810
  const path = UrlJoin("q", writeToken || versionHash || objectId, "data", partHash);
811
811
 
812
- let headers = await this.authClient.AuthorizationHeader({libraryId, objectId, versionHash, encryption});
812
+ let headers = await this.authClient.AuthorizationHeader({libraryId, objectId, versionHash, encryption, makeAccessRequest: true});
813
813
 
814
814
  const bytesTotal = (await this.ContentPart({libraryId, objectId, versionHash, partHash})).part.size;
815
815