@eluvio/elv-client-js 3.2.4 → 3.2.5
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/ElvClient-min.js +15 -11
- package/dist/ElvClient-node-min.js +17 -13
- package/dist/ElvFrameClient-min.js +12 -8
- package/dist/ElvPermissionsClient-min.js +13 -9
- package/dist/ElvWalletClient-min.js +58 -0
- package/dist/ElvWalletClient-node-min.js +78 -0
- package/dist/src/AuthorizationClient.js +2248 -1990
- package/dist/src/ContentObjectVerification.js +164 -173
- package/dist/src/Crypto.js +376 -324
- package/dist/src/ElvClient.js +1185 -1019
- package/dist/src/ElvWallet.js +119 -95
- package/dist/src/EthClient.js +1040 -896
- package/dist/src/FrameClient.js +331 -300
- package/dist/src/HttpClient.js +153 -147
- package/dist/src/Id.js +1 -3
- package/dist/src/PermissionsClient.js +1294 -1168
- package/dist/src/RemoteSigner.js +263 -211
- package/dist/src/UserProfileClient.js +1164 -1023
- package/dist/src/Utils.js +229 -184
- package/dist/src/client/ABRPublishing.js +895 -858
- package/dist/src/client/AccessGroups.js +1102 -959
- package/dist/src/client/ContentAccess.js +3724 -3431
- package/dist/src/client/ContentManagement.js +2252 -2068
- package/dist/src/client/Contracts.js +647 -563
- package/dist/src/client/Files.js +1886 -1757
- package/dist/src/client/NFT.js +126 -112
- package/dist/src/client/NTP.js +478 -422
- package/dist/src/index.js +11 -0
- package/dist/src/marketplaceClient/ClientMethods.js +1918 -0
- package/dist/src/marketplaceClient/Configuration.js +29 -0
- package/dist/src/marketplaceClient/Utils.js +304 -0
- package/dist/src/marketplaceClient/index.js +1553 -0
- package/dist/src/walletClient/ClientMethods.js +1978 -0
- package/dist/src/walletClient/Configuration.js +29 -0
- package/dist/src/walletClient/Utils.js +304 -0
- package/dist/src/walletClient/index.js +1571 -0
- package/package.json +8 -4
- package/src/ElvClient.js +4 -1
- package/src/Utils.js +22 -4
- package/src/index.js +7 -0
- package/src/walletClient/ClientMethods.js +1048 -0
- package/src/walletClient/Configuration.js +40 -0
- package/src/walletClient/README.md +185 -0
- package/src/walletClient/Utils.js +234 -0
- package/src/walletClient/index.js +884 -0
- package/testScripts/TestMarketplaceClient.js +25 -0
package/package.json
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eluvio/elv-client-js",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.5",
|
|
4
4
|
"description": "Javascript client for the Eluvio Content Fabric",
|
|
5
|
-
"main": "src/
|
|
5
|
+
"main": "src/index.js",
|
|
6
6
|
"author": "Kevin Talmadge",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/eluv-io/elv-client-js",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"bump-version": "npm --git-tag-version --no-commit-hooks version patch",
|
|
11
|
-
"build": "npm run build-docs && npm run build-dist && npm run build-frame-client && npm run build-permissions-client && npm run build-prod",
|
|
12
|
-
"build-docs": "node build/BuildDocs.js &&
|
|
11
|
+
"build": "npm run build-docs && npm run build-dist && npm run build-frame-client && npm run build-permissions-client && npm run build-wallet-client-web && npm run build-wallet-client-node && npm run build-prod",
|
|
12
|
+
"build-docs": "node build/BuildDocs.js && npm run build-client-docs && npm run build-wallet-client-docs",
|
|
13
|
+
"build-client-docs": "./node_modules/.bin/jsdoc --configure ./.jsdoc.json --readme README.md",
|
|
14
|
+
"build-wallet-client-docs": "./node_modules/.bin/jsdoc --configure ./.jsdoc-mc.json --readme ./src/walletClient/README.md",
|
|
13
15
|
"build-dist": "node ./node_modules/@babel/cli/bin/babel.js --source-type=unambiguous --presets=@babel/preset-env --plugins @babel/plugin-transform-runtime src --out-dir dist/src",
|
|
14
16
|
"build-contracts": "node build/BuildContracts.js",
|
|
15
17
|
"build-frame-client": "webpack -p --progress --entry ./dist/src/FrameClient.js --output-filename ElvFrameClient-min.js --devtool none --optimize-minimize && mv test/bundle-analysis/index.html test/bundle-analysis/frame-client.html",
|
|
16
18
|
"build-permissions-client": "webpack -p --progress --entry ./dist/src/PermissionsClient.js --output-filename ElvPermissionsClient-min.js --devtool none --optimize-minimize && mv test/bundle-analysis/index.html test/bundle-analysis/permissions-client.html",
|
|
19
|
+
"build-wallet-client-web": "webpack -p --progress --mode production --entry ./dist/src/walletClient/index.js --target web --output-filename ElvWalletClient-min.js --devtool none --optimize-minimize && mv test/bundle-analysis/index.html test/bundle-analysis/wallet-client.html",
|
|
20
|
+
"build-wallet-client-node": "webpack -p --progress --mode production --entry ./dist/src/walletClient/index.js --target node --output-filename ElvWalletClient-node-min.js --devtool none --optimize-minimize && mv test/bundle-analysis/index.html test/bundle-analysis/wallet-client.html",
|
|
17
21
|
"build-prod": "npm run build-web && npm run build-node",
|
|
18
22
|
"build-web": "webpack --progress --mode production --target web --output-filename ElvClient-min.js --devtool none && mv test/bundle-analysis/index.html test/bundle-analysis/web.html",
|
|
19
23
|
"build-node": "webpack --progress --mode production --target node --output-filename ElvClient-node-min.js --devtool none && mv test/bundle-analysis/index.html test/bundle-analysis/node.html",
|
package/src/ElvClient.js
CHANGED
|
@@ -39,6 +39,9 @@ if(Utils.Platform() === Utils.PLATFORM_NODE) {
|
|
|
39
39
|
/**
|
|
40
40
|
* See the Modules section on the sidebar for details about methods related to interacting with the Fabric.
|
|
41
41
|
*
|
|
42
|
+
* <br/>
|
|
43
|
+
*
|
|
44
|
+
* For information about the Eluvio Wallet Client, go <a href="wallet-client/index.html">here</a>.
|
|
42
45
|
*/
|
|
43
46
|
class ElvClient {
|
|
44
47
|
Log(message, error = false) {
|
|
@@ -116,7 +119,7 @@ class ElvClient {
|
|
|
116
119
|
/**
|
|
117
120
|
* Create a new ElvClient
|
|
118
121
|
*
|
|
119
|
-
* NOTE: It is highly recommended to use
|
|
122
|
+
* NOTE: It is highly recommended to use the <a href="#.FromConfigurationUrl">FromConfigurationUrl</a> or <a href="#.FromNetworkName">FromNetworkName</a> method
|
|
120
123
|
* automatically import the client settings from the fabric
|
|
121
124
|
*
|
|
122
125
|
* @constructor
|
package/src/Utils.js
CHANGED
|
@@ -18,14 +18,14 @@ const {
|
|
|
18
18
|
*
|
|
19
19
|
* Utils can be imported separately from the client:
|
|
20
20
|
*
|
|
21
|
-
* const Utils = require("@eluvio/elv-client-js/src/Utils)
|
|
21
|
+
* `const Utils = require("@eluvio/elv-client-js/src/Utils)`
|
|
22
22
|
*
|
|
23
23
|
* or
|
|
24
24
|
*
|
|
25
|
-
* import Utils from "@eluvio/elv-client-js/src/Utils"
|
|
25
|
+
* `import Utils from "@eluvio/elv-client-js/src/Utils"`
|
|
26
26
|
*
|
|
27
27
|
*
|
|
28
|
-
* It can be accessed from ElvClient and FrameClient as client.utils
|
|
28
|
+
* It can be accessed from ElvClient and FrameClient as `client.utils`
|
|
29
29
|
*/
|
|
30
30
|
const Utils = {
|
|
31
31
|
name: "Utils",
|
|
@@ -399,7 +399,6 @@ const Utils = {
|
|
|
399
399
|
getAddress(address);
|
|
400
400
|
return true;
|
|
401
401
|
} catch(error) {
|
|
402
|
-
this.Log(error);
|
|
403
402
|
return false;
|
|
404
403
|
}
|
|
405
404
|
},
|
|
@@ -442,6 +441,21 @@ const Utils = {
|
|
|
442
441
|
return Buffer.from(str, "base64").toString("utf-8");
|
|
443
442
|
},
|
|
444
443
|
|
|
444
|
+
FromB64URL: str => {
|
|
445
|
+
str = str.replace(/-/g, "+").replace(/_/g, "/");
|
|
446
|
+
|
|
447
|
+
const pad = str.length % 4;
|
|
448
|
+
if(pad) {
|
|
449
|
+
if(pad === 1) {
|
|
450
|
+
throw new Error("InvalidLengthError: Input base64url string is the wrong length to determine padding");
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
str += new Array(5-pad).join("=");
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
return Utils.FromB64(str);
|
|
457
|
+
},
|
|
458
|
+
|
|
445
459
|
B58: arr => {
|
|
446
460
|
return bs58.encode(Buffer.from(arr));
|
|
447
461
|
},
|
|
@@ -450,6 +464,10 @@ const Utils = {
|
|
|
450
464
|
return bs58.decode(str);
|
|
451
465
|
},
|
|
452
466
|
|
|
467
|
+
FromB58ToStr: str => {
|
|
468
|
+
return new TextDecoder().decode(Utils.FromB58(str));
|
|
469
|
+
},
|
|
470
|
+
|
|
453
471
|
/**
|
|
454
472
|
* Decode the given fabric authorization token
|
|
455
473
|
*
|
package/src/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const {ElvClient} = require("./ElvClient.js");
|
|
2
|
+
const {ElvMarketplaceClient} = require("./walletClient/index.js");
|
|
3
|
+
const Utils = require("./Utils.js");
|
|
4
|
+
|
|
5
|
+
exports.ElvClient = ElvClient;
|
|
6
|
+
exports.ElvMarketplaceClient = ElvMarketplaceClient;
|
|
7
|
+
exports.Utils = Utils;
|