@eluvio/elv-client-js 4.0.43 → 4.0.44

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.0.43",
3
+ "version": "4.0.44",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -52,7 +52,7 @@
52
52
  ],
53
53
  "dependencies": {
54
54
  "@babel/runtime": "^7.8.4",
55
- "@eluvio/crypto": ">=1.0.12",
55
+ "@eluvio/crypto": "1.1.0",
56
56
  "@eluvio/elv-abr-profile": "^1.0.0",
57
57
  "@sindresorhus/slugify": "^1.1.0",
58
58
  "babel-loader": "^8.0.6",
@@ -84,6 +84,7 @@
84
84
  "path": "^0.12.7",
85
85
  "prompt": "^1.1.0",
86
86
  "ramda": "^0.27.1",
87
+ "readable-stream": "^4.4.2",
87
88
  "shell-escape": "^0.2.0",
88
89
  "sjcl": "^1.0.8",
89
90
  "typedarray": "0.0.6",
package/src/Crypto.js CHANGED
@@ -1,28 +1,19 @@
1
1
  if(typeof globalThis.Buffer === "undefined") { globalThis.Buffer = require("buffer/").Buffer; }
2
2
 
3
3
  const bs58 = require("bs58");
4
- const Stream = require("stream");
4
+ const Stream = require("readable-stream");
5
5
  const Utils = require("./Utils");
6
6
 
7
+ if(!globalThis.process) {
8
+ globalThis.process = require("process/browser");
9
+ }
10
+
7
11
  if(typeof crypto === "undefined") {
8
12
  const crypto = require("crypto");
9
13
  crypto.getRandomValues = arr => crypto.randomBytes(arr.length);
10
14
  globalThis.crypto = crypto;
11
15
  }
12
16
 
13
- let ElvCrypto;
14
- switch(Utils.Platform()) {
15
- case Utils.PLATFORM_REACT_NATIVE:
16
- ElvCrypto = require("@eluvio/crypto/dist/elv-crypto.bundle.externals").default;
17
- break;
18
- case Utils.PLATFORM_WEB:
19
- ElvCrypto = require("@eluvio/crypto/dist/elv-crypto.bundle.externals").default;
20
- break;
21
- default:
22
- ElvCrypto = require("@eluvio/crypto/dist/elv-crypto.bundle.node").default;
23
- break;
24
- }
25
-
26
17
  /**
27
18
  * @namespace
28
19
  * @description This namespace contains cryptographic helper methods to encrypt and decrypt
@@ -32,6 +23,7 @@ const Crypto = {
32
23
  ElvCrypto: async () => {
33
24
  try {
34
25
  if(!Crypto.elvCrypto) {
26
+ const ElvCrypto = (await import("@eluvio/crypto")).default;
35
27
  Crypto.elvCrypto = await new ElvCrypto().init();
36
28
  }
37
29
 
package/src/ElvClient.js CHANGED
@@ -579,6 +579,12 @@ class ElvClient {
579
579
  };
580
580
  }
581
581
 
582
+ WriteTokenNodeUrl({writeToken}) {
583
+ const nodeUrl = this.HttpClient.draftURIs[writeToken];
584
+
585
+ return nodeUrl ? nodeUrl.toString() : undefined;
586
+ }
587
+
582
588
  RecordWriteToken({writeToken, fabricNodeUrl}) {
583
589
  this.HttpClient.RecordWriteToken(writeToken, fabricNodeUrl);
584
590
  }