Comparing version 1.4.0 to 1.5.0
## History | ||
## 1.5.0 | ||
* Add async support and typings with typescript and convert to node-fetch (thanks @Rob9315) | ||
## 1.4.0 | ||
@@ -4,0 +7,0 @@ * Add ability to request user from token refresh (thanks @ph0t0shop) |
{ | ||
"name": "yggdrasil", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"author": "Zeke Sonxx <zeke@zekesonxx.com>", | ||
"description": "Mojang authentication (Yggdrasil) client", | ||
"files": [ | ||
"dist/**/*" | ||
], | ||
"scripts": { | ||
"test": "mocha -R spec", | ||
"pretest": "npm run lint", | ||
"lint": "standard", | ||
"fix": "standard --fix" | ||
"pretest": "npm run lint && npm run build", | ||
"prepublish": "npm run lint && npm run build", | ||
"lint": "ts-standard", | ||
"fix": "ts-standard --fix", | ||
"build": "npx tsc" | ||
}, | ||
@@ -26,3 +31,3 @@ "main": "./lib/index", | ||
"dependencies": { | ||
"phin": "^3.4.1", | ||
"node-fetch": "^2.6.1", | ||
"uuid": "^8.2.0" | ||
@@ -32,6 +37,10 @@ }, | ||
"devDependencies": { | ||
"mocha": "^7.0.1", | ||
"@types/node": "^14.14.19", | ||
"@types/node-fetch": "^2.5.8", | ||
"@types/uuid": "^8.3.0", | ||
"mocha": "^7.2.0", | ||
"nock": "^13.0.2", | ||
"standard": "^16.0.1" | ||
"ts-standard": "^10.0.0", | ||
"typescript": "^4.1.3" | ||
} | ||
} |
@@ -31,13 +31,25 @@ # yggdrasil | ||
requestUser: false //Optional. Request the user object to be included in response | ||
}, function(err, data){}); | ||
}).then( | ||
(response)=>{}, | ||
(error)=>{} | ||
); | ||
//Refresh an accessToken | ||
ygg.refresh(oldtoken, clienttoken, true, function(err, newtoken, response body){}); | ||
ygg.refresh(oldAccessToken, clientToken, true).then( | ||
({accessToken, clientToken, user?})=>{}, | ||
(error)=>{} | ||
); | ||
// Note that requestUser is an optional parameter. If set to true, it requests the user object from Mojang's authentication servers as well. | ||
//Validate an accessToken | ||
ygg.validate(token, function(err){}); | ||
ygg.validate(token).then( | ||
(response)=>{}, | ||
(error)=>{} | ||
); | ||
//Invalidate all accessTokens | ||
ygg.signout(username, password, function(err)); | ||
ygg.signout(username, password).then( | ||
(response)=>{}, | ||
(error)=>{} | ||
); | ||
``` | ||
@@ -53,6 +65,12 @@ | ||
//Join a server (clientside) | ||
yggserver.join(token, profile, serverid, sharedsecret, serverkey, function(err, response body){}); | ||
yggserver.join(token, profile, serverid, sharedsecret, serverkey).then( | ||
(response)=>{}, | ||
(error)=>{} | ||
); | ||
//Join a server (serverside) | ||
yggserver.hasJoined(username, serverid, sharedsecret, serverkey, function(err, client info){}); | ||
yggserver.hasJoined(username, serverid, sharedsecret, serverkey).then( | ||
(clientInfo)=>{}, | ||
(error)=>{} | ||
); | ||
``` | ||
@@ -74,2 +92,3 @@ ## Proxy Support | ||
* Note that the library is stateless when imported this way vs the CommonJS way. | ||
* You have typings though ;D | ||
*/ | ||
@@ -80,5 +99,11 @@ import { Client as ygg, Server as yggServ } from 'yggdrasil/es6' | ||
ygg.validate(token, function(err){}) | ||
ygg.validate(token).then( | ||
(response)=>{}, | ||
(error)=>{} | ||
); | ||
yggServ.join(token, profile, serverid, sharedsecret, serverkey, function(err, response body){}); | ||
yggServ.join(token, profile, serverid, sharedsecret, serverkey).then( | ||
response=>{}, | ||
error=>{} | ||
); | ||
``` | ||
@@ -85,0 +110,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110
5893
7
4
0
2
+ Addednode-fetch@^2.6.1
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
- Removedphin@^3.4.1
- Removedcentra@2.7.0(transitive)
- Removedfollow-redirects@1.15.9(transitive)
- Removedphin@3.7.1(transitive)