@eluvio/elv-client-js 4.0.110 → 4.0.111
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 +1 -1
- package/src/AuthorizationClient.js +1 -1
- package/src/ElvClient.js +6 -7
package/package.json
CHANGED
|
@@ -136,7 +136,7 @@ class AuthorizationClient {
|
|
|
136
136
|
);
|
|
137
137
|
|
|
138
138
|
// User wallet requests can't use static token
|
|
139
|
-
if(this.client.staticToken && !isWalletRequest) {
|
|
139
|
+
if(this.client.staticToken && !isWalletRequest && !update) {
|
|
140
140
|
return this.client.staticToken;
|
|
141
141
|
}
|
|
142
142
|
|
package/src/ElvClient.js
CHANGED
|
@@ -435,7 +435,7 @@ class ElvClient {
|
|
|
435
435
|
const signer = wallet.AddAccountFromMnemonic({mnemonic: wallet.GenerateMnemonic()});
|
|
436
436
|
|
|
437
437
|
this.SetSigner({signer, reset: false});
|
|
438
|
-
|
|
438
|
+
this.SetStaticToken({token: staticToken});
|
|
439
439
|
}
|
|
440
440
|
|
|
441
441
|
this.authClient = new AuthorizationClient({
|
|
@@ -623,7 +623,7 @@ class ElvClient {
|
|
|
623
623
|
*/
|
|
624
624
|
async SpaceNodes({matchEndpoint, matchNodeId}={}) {
|
|
625
625
|
let nodes;
|
|
626
|
-
|
|
626
|
+
this.SetStaticToken();
|
|
627
627
|
|
|
628
628
|
if(matchEndpoint) {
|
|
629
629
|
({nodes} = await this.utils.ResponseToJson(
|
|
@@ -664,7 +664,7 @@ class ElvClient {
|
|
|
664
664
|
return match;
|
|
665
665
|
});
|
|
666
666
|
} else if(matchNodeId) {
|
|
667
|
-
|
|
667
|
+
this.SetStaticToken();
|
|
668
668
|
let node = await this.utils.ResponseToJson(
|
|
669
669
|
this.HttpClient.Request({
|
|
670
670
|
path: UrlJoin("nodes", matchNodeId),
|
|
@@ -1177,12 +1177,11 @@ class ElvClient {
|
|
|
1177
1177
|
* @namedParams
|
|
1178
1178
|
* @param {string=} token - The static token to use. If not provided, the default static token will be set.
|
|
1179
1179
|
*/
|
|
1180
|
-
|
|
1180
|
+
SetStaticToken({token}={}) {
|
|
1181
1181
|
if(token) {
|
|
1182
1182
|
this.staticToken = token;
|
|
1183
1183
|
} else {
|
|
1184
|
-
this.
|
|
1185
|
-
.then(token => this.staticToken = token);
|
|
1184
|
+
this.staticToken = this.utils.B64(JSON.stringify({qspace_id: this.contentSpaceId}));
|
|
1186
1185
|
}
|
|
1187
1186
|
}
|
|
1188
1187
|
|
|
@@ -1203,7 +1202,7 @@ class ElvClient {
|
|
|
1203
1202
|
* @param {string} objectId - The ID of the policy object
|
|
1204
1203
|
*/
|
|
1205
1204
|
async SetPolicyAuthorization({objectId}) {
|
|
1206
|
-
|
|
1205
|
+
this.SetStaticToken({
|
|
1207
1206
|
token: await this.GenerateStateChannelToken({objectId})
|
|
1208
1207
|
});
|
|
1209
1208
|
}
|