minecraft-auth
Advanced tools
Comparing version 1.0.33 to 1.0.34
/// <reference types="node" /> | ||
import 'reflect-metadata'; | ||
import * as http from "http"; | ||
@@ -7,2 +6,3 @@ export declare type ListeningHttpServer = http.Server & { | ||
}; | ||
export declare type AccountType = "mojang" | "cracked" | "microsoft" | "token"; | ||
export declare module MicrosoftAuth { | ||
@@ -136,3 +136,3 @@ let appID: any; | ||
function nameChangeInfo(token: any): Promise<NameChangeInfoResponse>; | ||
function nameAvailability(name: any, token: any): Promise<boolean>; | ||
function nameAvailability(name: string, token: any): Promise<boolean>; | ||
function changeSkin(url: any, variant: "classic" | "slim", token: any): Promise<void>; | ||
@@ -178,8 +178,2 @@ function resetSkin(uuid: any, token: any): Promise<void>; | ||
}; | ||
type StatisticsOption = "item_sold_minecraft" | "prepaid_card_redeemed_minecraft" | "item_sold_cobalt" | "item_sold_scrolls" | "prepaid_card_redeemed_cobalt" | "item_sold_dungeons"; | ||
type StatisticsResponse = { | ||
"total": number; | ||
"last24h": number; | ||
"saleVelocityPerSeconds": number; | ||
}; | ||
type StatusResponse = [ | ||
@@ -264,16 +258,16 @@ { | ||
export declare class Account { | ||
accessToken: string; | ||
accessToken?: string; | ||
ownership: boolean; | ||
uuid: string; | ||
username: string; | ||
type: string; | ||
type: AccountType; | ||
profile: MojangAPI.MCProfileResponse; | ||
properties: any; | ||
alternativeValidation: boolean; | ||
constructor(token: string, type: any); | ||
constructor(token: string, type: AccountType); | ||
checkValidToken(): Promise<boolean>; | ||
checkOwnership(): Promise<boolean>; | ||
getProfile(): any; | ||
changeSkin(url: any, variant: "slim" | "classic"): Promise<boolean>; | ||
checkNameAvailability(name: any): Promise<boolean>; | ||
changeSkin(url: string, variant: "slim" | "classic"): Promise<boolean>; | ||
checkNameAvailability(name: string): Promise<boolean>; | ||
canChangeName(): Promise<boolean>; | ||
@@ -303,7 +297,7 @@ } | ||
export declare class AccountsStorage { | ||
accountList: any[]; | ||
accountList: Account[]; | ||
constructor(); | ||
getAccount(index: any): any; | ||
getAccountByUUID(uuid: any): any; | ||
getAccountByName(name: any): any; | ||
getAccount(index: any): Account; | ||
getAccountByUUID(uuid: any): Account | undefined; | ||
getAccountByName(name: any): Account | undefined; | ||
addAccount(account: Account): void; | ||
@@ -317,16 +311,1 @@ deleteAccount(account: Account): void; | ||
export declare function HttpPost_BEARER(url: any, data: string, token: any, headers?: {}, objectResponse?: boolean): Promise<any>; | ||
export declare class mojangAccount extends MojangAccount { | ||
constructor(); | ||
} | ||
export declare class account extends Account { | ||
constructor(token: string, type: any); | ||
} | ||
export declare class microsoftAccount extends MicrosoftAccount { | ||
constructor(); | ||
} | ||
export declare class crackedAccount extends CrackedAccount { | ||
constructor(username: any); | ||
} | ||
export declare class accountsStorage extends AccountsStorage { | ||
constructor(); | ||
} |
@@ -57,5 +57,3 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.accountsStorage = exports.crackedAccount = exports.microsoftAccount = exports.account = exports.mojangAccount = exports.HttpPost_BEARER = exports.HttpCustom_BEARER = exports.HttpGet_BEARER = exports.AccountsStorage = exports.CrackedAccount = exports.MicrosoftAccount = exports.MojangAccount = exports.Account = exports.OwnershipError = exports.AuthenticationError = exports.MojangAPI = exports.CrackedAuth = exports.MojangAuth = exports.MicrosoftAuth = void 0; | ||
require("reflect-metadata"); | ||
var class_transformer_1 = require("class-transformer"); | ||
exports.HttpPost_BEARER = exports.HttpCustom_BEARER = exports.HttpGet_BEARER = exports.AccountsStorage = exports.CrackedAccount = exports.MicrosoftAccount = exports.MojangAccount = exports.Account = exports.OwnershipError = exports.AuthenticationError = exports.MojangAPI = exports.CrackedAuth = exports.MojangAuth = exports.MicrosoftAuth = void 0; | ||
var crypto_1 = __importDefault(require("crypto")); | ||
@@ -1007,3 +1005,3 @@ var atob_1 = __importDefault(require("atob")); | ||
AccountsStorage.prototype.getAccountByUUID = function (uuid) { | ||
var acc; | ||
var acc = undefined; | ||
this.accountList.forEach(function (el) { | ||
@@ -1017,3 +1015,3 @@ if (el.uuid === uuid) { | ||
AccountsStorage.prototype.getAccountByName = function (name) { | ||
var acc; | ||
var acc = undefined; | ||
this.accountList.forEach(function (el) { | ||
@@ -1043,14 +1041,14 @@ if (el.username === name) { | ||
var accStorage = new AccountsStorage(); | ||
accounts.forEach(function (el) { | ||
if (el.type == "microsoft") { | ||
accStorage.addAccount((0, class_transformer_1.plainToClass)(MicrosoftAccount, el)); | ||
accounts.forEach(function (account) { | ||
if (account.type == "microsoft") { | ||
accStorage.addAccount(Object.setPrototypeOf(account, MicrosoftAccount.prototype)); | ||
} | ||
else if (el.type == "mojang") { | ||
accStorage.addAccount((0, class_transformer_1.plainToClass)(MojangAccount, el)); | ||
else if (account.type == "mojang") { | ||
accStorage.addAccount(Object.setPrototypeOf(account, MojangAccount.prototype)); | ||
} | ||
else if (el.type == "cracked") { | ||
accStorage.addAccount((0, class_transformer_1.plainToClass)(CrackedAccount, el)); | ||
else if (account.type == "cracked") { | ||
accStorage.addAccount(Object.setPrototypeOf(account, CrackedAccount.prototype)); | ||
} | ||
else { | ||
accStorage.addAccount((0, class_transformer_1.plainToClass)(Account, el)); | ||
accStorage.addAccount(Object.setPrototypeOf(account, Account.prototype)); | ||
} | ||
@@ -1099,48 +1097,2 @@ }); | ||
exports.HttpPost_BEARER = HttpPost_BEARER; | ||
//Legacy classes | ||
var mojangAccount = /** @class */ (function (_super) { | ||
__extends(mojangAccount, _super); | ||
function mojangAccount() { | ||
console.warn("Usage of this class is deprecated. Consider using 'MojangAccount'"); | ||
return _super.call(this) || this; | ||
} | ||
return mojangAccount; | ||
}(MojangAccount)); | ||
exports.mojangAccount = mojangAccount; | ||
var account = /** @class */ (function (_super) { | ||
__extends(account, _super); | ||
function account(token, type) { | ||
console.warn("Usage of this class is deprecated. Consider using 'Account'"); | ||
return _super.call(this, token, type) || this; | ||
} | ||
return account; | ||
}(Account)); | ||
exports.account = account; | ||
var microsoftAccount = /** @class */ (function (_super) { | ||
__extends(microsoftAccount, _super); | ||
function microsoftAccount() { | ||
console.warn("Usage of this class is deprecated. Consider using 'MicrosoftAccount'"); | ||
return _super.call(this) || this; | ||
} | ||
return microsoftAccount; | ||
}(MicrosoftAccount)); | ||
exports.microsoftAccount = microsoftAccount; | ||
var crackedAccount = /** @class */ (function (_super) { | ||
__extends(crackedAccount, _super); | ||
function crackedAccount(username) { | ||
console.warn("Usage of this class is deprecated. Consider using 'CrackedAccount'"); | ||
return _super.call(this, username) || this; | ||
} | ||
return crackedAccount; | ||
}(CrackedAccount)); | ||
exports.crackedAccount = crackedAccount; | ||
var accountsStorage = /** @class */ (function (_super) { | ||
__extends(accountsStorage, _super); | ||
function accountsStorage() { | ||
console.warn("Usage of this class is deprecated. Consider using 'AccountsStorage'"); | ||
return _super.call(this) || this; | ||
} | ||
return accountsStorage; | ||
}(AccountsStorage)); | ||
exports.accountsStorage = accountsStorage; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "minecraft-auth", | ||
"version": "1.0.33", | ||
"version": "1.0.34", | ||
"description": "Package to authenticate with minecraft using traditional yggdrasil, new microsoft authentication and non-premium.", | ||
@@ -32,5 +32,3 @@ "main": "dist/index.js", | ||
"atob": "^2.1.2", | ||
"class-transformer": "^0.5.1", | ||
"http-client-methods": "^1.0.3", | ||
"reflect-metadata": "^0.1.13" | ||
"http-client-methods": "^1.0.3" | ||
}, | ||
@@ -37,0 +35,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
3
86274
1398
- Removedclass-transformer@^0.5.1
- Removedreflect-metadata@^0.1.13
- Removedclass-transformer@0.5.1(transitive)
- Removedreflect-metadata@0.1.14(transitive)