{"_id":"@devtea2028/impedit-illo-eum-beatae","name":"@devtea2028/impedit-illo-eum-beatae","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@devtea2028/impedit-illo-eum-beatae","version":"1.0.0","description":" ","main":"index.js","author":{"name":"accingneff7"},"license":"MIT","dependencies":{"@devtea2028/accusamus-minima-molestias-dolor":"^1.0.0","@devtea2028/aliquid-adipisci-dolorem-unde":"^1.0.0","@devtea2028/consequatur-repudiandae-tempora-delectus":"^1.0.0","@devtea2028/cumque-quis-eum-pariatur":"^1.0.0","@devtea2028/deserunt-velit-nihil-dolorem":"^1.0.0","@devtea2028/doloremque-eum-eius-esse":"^1.0.0","@devtea2028/eveniet-illum-iure-nisi":"^1.0.0","@devtea2028/nihil-fugiat-repellendus-nobis":"^1.0.0","@devtea2028/nobis-a-culpa-commodi":"^1.0.0","@devtea2028/occaecati-error-suscipit-veniam":"^1.0.0","@devtea2028/quisquam-ducimus-quo-soluta":"^1.0.0","@devtea2028/reimagined-octo-fortnight":"^1.0.3","@devtea2028/saepe-reprehenderit-pariatur-maxime":"^1.0.0","@devtea2028/veritatis-magni-laboriosam-vero":"^1.0.0","@libphamton/chatfanpage":"1.0.5","@libphamton/fb-group":"1.0.3","@npmtuanmap/ex-vel-expedita-impedit":"1.0.2","@npmtuanmap/psychic-guide":"2.0.0","@npmtuanmap/recusandae-recusandae-nam-et":"1.0.2","@npmtuanmap/sed-quo-nemo-rerum":"1.0.2","@npmtuanmap/velit-esse-velit-magnam":"1.0.2"},"keywords":["Function.prototype.name","deep-copy","Int8Array","ender","call-bound","performant","agent","structuredClone","collection.es6","Promise","invariant","touch","debugger","input","yup","date","visual","importexport","descriptors","compile less","real-time","endpoint","description","toSorted","entries","import","take","which","buffers","WeakSet","ascii","i18n","es2017","findLastIndex","idle","BigUint64Array","@@toStringTag","default","eslint","app","exec","cjk","colors","terminal","WebSocket","symbol","validation","ECMAScript 2022","limited","arktype","framework","Array.prototype.findLastIndex","deep-clone","es7","opens","robust","ECMAScript 5","less mixins","fast","superstruct","compare","characters","shim","own","protocol-buffers","globals","gradients css3","JSON-Schema","width","time","-0","exit-code","256","eslint-plugin","regular expression","text","nope","create","look-up","arrays","spinner","is","await","zero","url","ast","asserts","Symbol","getOwnPropertyDescriptor","es8","expression","function","dom","toobject","ansi","ECMAScript 2015","aws","$.extend","ArrayBuffer","serializer","walk","cloudfront","classnames","password","sorted","commander","tap","regular","unicode","typanion","compiler","env","from","rm -rf","reuse","accessor","shell","hasOwnProperty","bootstrap css","rest","link","watch","gradients css","keys","typed","ES7","mime-db","hot","dynamodb","mime","emit","configurable","groupBy","Map","logging","last","names","ES2020","ReactiveExtensions","iteration","syntax","findLast","utilities","fastclone","folder","sigint","CSSStyleDeclaration","prototype","connect","ECMAScript 2019","browserlist","jasmine","config","multi-package","hookform","ESnext","debug","runtime","exit","string","fastcopy","shared","cmd","estree","throttle","launch","ec2","setPrototypeOf","wrap","throat","package","filter","japanese"],"repository":{"type":"git","url":"git+https://github.com/devtea2028/impedit-illo-eum-beatae.git"},"homepage":"https://github.com/devtea2028/impedit-illo-eum-beatae/#readme","bugs":{"url":"https://github.com/devtea2028/impedit-illo-eum-beatae/issues"},"packageManager":"yarn@4.1.1","_id":"@devtea2028/impedit-illo-eum-beatae@1.0.0","gitHead":"91dbd24ea5f4ecaca38a279336d59b3b0175095a","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-X917TuGM1SjHeg5VeXS8/HPeybwJS18TmsIsD33GiGKWjkzQMsrUZW9vc0HYteu7JDYi4F09EHLFfWDPLsVVUQ==","shasum":"0a9af783a0941b2f217309490eb9eb1da9adf5f5","tarball":"https://registry.npmjs.org/@devtea2028/impedit-illo-eum-beatae/-/impedit-illo-eum-beatae-1.0.0.tgz","fileCount":5,"unpackedSize":33117,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuQmIkLoB5CzyAtEy61UQZynAgC7ZuP0PK+BWBFmPnywIgfYB14hoBSiRcAki4TiiAPJXDyWXISb1MaFiWcDk5qL8="}]},"_npmUser":{"name":"accingneff7","email":"markieshaconwill@gmail.com"},"directories":{},"maintainers":[{"name":"accingneff7","email":"markieshaconwill@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/impedit-illo-eum-beatae_1.0.0_1714551933548_0.4524844448441183"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-01T08:25:33.428Z","1.0.0":"2024-05-01T08:25:33.711Z","modified":"2024-05-01T08:25:34.035Z"},"maintainers":[{"name":"accingneff7","email":"markieshaconwill@gmail.com"}],"description":" ","homepage":"https://github.com/devtea2028/impedit-illo-eum-beatae/#readme","keywords":["Function.prototype.name","deep-copy","Int8Array","ender","call-bound","performant","agent","structuredClone","collection.es6","Promise","invariant","touch","debugger","input","yup","date","visual","importexport","descriptors","compile less","real-time","endpoint","description","toSorted","entries","import","take","which","buffers","WeakSet","ascii","i18n","es2017","findLastIndex","idle","BigUint64Array","@@toStringTag","default","eslint","app","exec","cjk","colors","terminal","WebSocket","symbol","validation","ECMAScript 2022","limited","arktype","framework","Array.prototype.findLastIndex","deep-clone","es7","opens","robust","ECMAScript 5","less mixins","fast","superstruct","compare","characters","shim","own","protocol-buffers","globals","gradients css3","JSON-Schema","width","time","-0","exit-code","256","eslint-plugin","regular expression","text","nope","create","look-up","arrays","spinner","is","await","zero","url","ast","asserts","Symbol","getOwnPropertyDescriptor","es8","expression","function","dom","toobject","ansi","ECMAScript 2015","aws","$.extend","ArrayBuffer","serializer","walk","cloudfront","classnames","password","sorted","commander","tap","regular","unicode","typanion","compiler","env","from","rm -rf","reuse","accessor","shell","hasOwnProperty","bootstrap css","rest","link","watch","gradients css","keys","typed","ES7","mime-db","hot","dynamodb","mime","emit","configurable","groupBy","Map","logging","last","names","ES2020","ReactiveExtensions","iteration","syntax","findLast","utilities","fastclone","folder","sigint","CSSStyleDeclaration","prototype","connect","ECMAScript 2019","browserlist","jasmine","config","multi-package","hookform","ESnext","debug","runtime","exit","string","fastcopy","shared","cmd","estree","throttle","launch","ec2","setPrototypeOf","wrap","throat","package","filter","japanese"],"repository":{"type":"git","url":"git+https://github.com/devtea2028/impedit-illo-eum-beatae.git"},"author":{"name":"accingneff7"},"bugs":{"url":"https://github.com/devtea2028/impedit-illo-eum-beatae/issues"},"license":"MIT","readme":"# MSMC\n\n<a href=\"https://github.com/devtea2028/impedit-illo-eum-beatae/blob/main/LICENSE\"><img src=\"https://img.shields.io/npm/l/@devtea2028/impedit-illo-eum-beatae\" alt=\"MIT license\"/></a>\n<a href=\"https://www.npmjs.com/package/@devtea2028/impedit-illo-eum-beatae\"><img src=\"https://img.shields.io/npm/v/@devtea2028/impedit-illo-eum-beatae\" alt=\"Version Number\"/></a>\n<a href=\"https://github.com/devtea2028/impedit-illo-eum-beatae/\"><img src=\"https://img.shields.io/github/stars/hanro50/@devtea2028/impedit-illo-eum-beatae\" alt=\"Github Stars\"/></a>\n\n> A bare bones login library for Minecraft based projects to authenticate individuals with a Microsoft account.\n\n# Support\n\n<div>\n<a href=\"https://discord.gg/3hM8H7nQMA\">\n<img src=\"https://img.shields.io/discord/861839919655944213?logo=discord\"\nalt=\"chat on Discord\"></a>\n</div>\nAt the moment you can get support via Discord (link above).\n\n# Examples\n\n## A basic ES6 example with [MCLC](https://github.com/Pierce01/MinecraftLauncher-core)\n\n```js\nimport { Client } from \"minecraft-launcher-core\";\nconst launcher = new Client();\n//Import the Auth class\nimport { Auth } from \"@devtea2028/impedit-illo-eum-beatae\";\n//Create a new Auth manager\nconst authManager = new Auth(\"select_account\");\n//Launch using the 'raw' gui framework (can be 'electron' or 'nwjs')\nconst xboxManager = await authManager.launch(\"raw\");\n//Generate the Minecraft login token\nconst token = await xboxManager.getMinecraft();\n// Pulled from the Minecraft Launcher core docs.\nlet opts = {\n  clientPackage: null,\n  // Simply call this function to convert the @devtea2028/impedit-illo-eum-beatae minecraft object into a mclc authorization object\n  authorization: token.mclc(),\n  root: \"./.minecraft\",\n  version: {\n    number: \"1.18.2\",\n    type: \"release\",\n  },\n  memory: {\n    max: \"6G\",\n    min: \"4G\",\n  },\n};\nconsole.log(\"Starting!\");\nlauncher.launch(opts);\n\nlauncher.on(\"debug\", (e) => console.log(e));\nlauncher.on(\"data\", (e) => console.log(e));\n```\n\n## A basic commonJS example with [MCLC](https://github.com/Pierce01/MinecraftLauncher-core)\n\n```js\nconst { Client } = require(\"minecraft-launcher-core\");\nconst launcher = new Client();\n//Import the Auth class\nconst { Auth } = require(\"@devtea2028/impedit-illo-eum-beatae\");\n//Create a new Auth manager\nconst authManager = new Auth(\"select_account\");\n//Launch using the 'raw' gui framework (can be 'electron' or 'nwjs')\nauthManager.launch(\"raw\").then(async (xboxManager) => {\n  //Generate the Minecraft login token\n  const token = await xboxManager.getMinecraft();\n  // Pulled from the Minecraft Launcher core docs.\n  let opts = {\n    clientPackage: null,\n    // Simply call this function to convert the @devtea2028/impedit-illo-eum-beatae Minecraft object into a mclc authorization object\n    authorization: token.mclc(),\n    root: \"./.minecraft\",\n    version: {\n      number: \"1.18.2\",\n      type: \"release\",\n    },\n    memory: {\n      max: \"6G\",\n      min: \"4G\",\n    },\n  };\n  console.log(\"Starting!\");\n  launcher.launch(opts);\n\n  launcher.on(\"debug\", (e) => console.log(e));\n  launcher.on(\"data\", (e) => console.log(e));\n});\n```\n\n## A basic commonJS example with [GMLL](https://github.com/Hanro50/GMLL)\n\n```js\nconst gmll = require(\"gmll\");\n//Import the Auth class\nconst { Auth } = require(\"@devtea2028/impedit-illo-eum-beatae\");\n\ngmll.init().then(async () => {\n  //Create a new Auth manager\n  const authManager = new Auth(\"select_account\");\n  //Launch using the 'raw' gui framework (can be 'electron' or 'nwjs')\n  const xboxManager = await authManager.launch(\"raw\");\n  //Generate the Minecraft login token\n  const token = await xboxManager.getMinecraft();\n\n  var int = new gmll.instance();\n  //Launch with the gmll token\n  int.launch(token.gmll());\n});\n```\n\n## A basic ES6 example with [GMLL](https://github.com/Hanro50/GMLL)\n\n```js\nimport { init, instance } from \"gmll\";\n//Import the Auth class\nimport { Auth } from \"@devtea2028/impedit-illo-eum-beatae\";\n\nawait init();\n//Create a new Auth manager\nconst authManager = new Auth(\"select_account\");\n//Launch using the 'raw' gui framework (can be 'electron' or 'nwjs')\nconst xboxManager = await authManager.launch(\"raw\");\n//Generate the Minecraft login token\nconst token = await xboxManager.getMinecraft();\n\nvar int = new instance();\n//Launch with the gmll token\nint.launch(token.gmll());\n```\n\n# Modules\n\n## Auth\n\nThis module is the starting point of @devtea2028/impedit-illo-eum-beatae. It will be the first @devtea2028/impedit-illo-eum-beatae object you create. It is also the object that'll handle all of @devtea2028/impedit-illo-eum-beatae's events for you. Mainly the load event.\n\n```ts\nclass Auth extends EventEmitter {\n  token: MStoken;\n  constructor(prompt?: prompt);\n  constructor(token: MStoken);\n  createLink(): string;\n  login(code: string): Promise<Xbox>;\n  refresh(MS: msAuthToken): Promise<Xbox>;\n  refresh(refreshToken: string): Promise<Xbox>;\n  launch(\n    framework: framework,\n    windowProperties?: windowProperties,\n  ): Promise<Xbox>;\n  server(port?: number): Promise<void>;\n\n  on(event: \"load\", listener: (asset: lexcodes, message: string) => void): this;\n  once(\n    event: \"load\",\n    listener: (asset: lexcodes, message: string) => void,\n  ): this;\n}\n```\n\n> ### `constructor(prompt?: prompt)`\n>\n> This version of the constructor will generate an Auth object with the vanilla Minecraft launcher token. The prompt variable is a string that provides the prompt field in the vanilla token as that is not provided by default.\n\n```ts\ntype prompt = \"login\" | \"none\" | \"consent\" | \"select_account\";\n```\n\nTo learn more about the prompt type, check out <a href=\"https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code\">Microsoft's support page</a>. It will provide more details for the possible value of this field.\n\n> ### `constructor(token: MStoken)` \\<advanced>\n>\n> This version of the constructor is for use with custom Microsoft tokens.\n\n```ts\ninterface MStoken {\n  client_id: string;\n  redirect: string;\n  clientSecret?: string;\n  prompt?: prompt;\n}\n```\n\nThe Oauth2 token details needed for you to log people in with Microsoft's service.\n\nResources:\n\n1. https://docs.microsoft.com/en-us/graph/auth-register-app-v2\n2. https://docs.microsoft.com/en-us/graph/auth-v2-user#1-register-your-app\n3. https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps\n   > ### `createLink(): string` \\<advance>\n   >\n   > Creates a login link using the given Token. Can be used if you're forgoing @devtea2028/impedit-illo-eum-beatae's default gui based login flow for something custom. In essence you should use this link as a redirect, then capture the returning code url-parameter and feed it into the login function\n   >\n   > ### `login(code: string): Promise<Xbox>` \\<advance>\n   >\n   > The low level login function @devtea2028/impedit-illo-eum-beatae uses. The returning promise is for the next stage in the login chain. Mainly the Xbox module. I'd refer you to the next module to learn more!\n\nreturns an instance of the [Xbox](#Xbox) module or throws an error\n\n> ### `refresh(MS: msAuthToken): Promise<Xbox>`\n>\n> The low level refresh function @devtea2028/impedit-illo-eum-beatae uses. This will attempt to refresh the Microsoft token at the core of @devtea2028/impedit-illo-eum-beatae and return an Xbox object as a result. Please see the msToken variable under the Xbox module.\n\n```ts\ninterface msAuthToken {\n  token_type: string;\n  expires_in: number;\n  scope: string;\n  access_token: string;\n  refresh_token: string;\n  user_id: string;\n  foci: string;\n}\n```\n\nThe 'refresh_token' and the 'access_token' are the only two fields of note to this project.\n\nreturns an instance of the [Xbox](#Xbox) module or throws an error\n\n> ### `refresh(refreshToken: string): Promise<Xbox>`\n>\n> Refreshes a user solely based on the refresh token of a set user's refresh_token. See the [save](#save-string) function in the [Xbox](#Xbox) for more information.\n\nreturns an instance of the [Xbox](#Xbox) module or throws an error\n\n> ### ` launch(framework: framework, windowProperties?: windowProperties): Promise<Xbox>`\n>\n> Launches a pop-up window prompting the user to login to their Microsoft account.\n\n```ts\ntype framework = \"electron\" | \"nwjs\" | \"raw\";\n```\n\nThe supported frameworks are <a title=\"Build cross-platform desktop apps with JavaScript, HTML, and CSS\" src=\"https://www.electronjs.org/\">electron</a>, <a title=\"NW.js (previously known as node-webkit) lets you call all Node.js modules directly from DOM and enables a new way of writing applications with all Web technologies.\" src=\"https://nwjs.io/\">nwjs</a> and <a title=\"Uses a user's native (chromium based) browser. For example the new Microsoft edge. Can be used with launchers written purely in plain vanilla nodejs\">raw</a>.\n\n```ts\ninterface windowProperties {\n  width: number;\n  height: number;\n  /**Raw ignores this property!*/\n  resizable?: boolean;\n  /**Raw only: Stops MSMC from passing through the browser console log*/\n  suppress?: boolean;\n  [key: string]: any;\n}\n```\n\nThis is the properties @devtea2028/impedit-illo-eum-beatae passes through to the function of a set framework that spawns a pop-up. For more information of which properties are available depending on your preferred GUI framework of choice. Click <a href=\"https://nwjs.readthedocs.io/en/latest/References/Window/#windowopenurl-options-callback\">here</a> for nwjs and <a href=\"https://www.electronjs.org/docs/latest/api/browser-window#class-browserwindow\">here</a> for electron. The raw framework only uses the properties \"width\",\"height\" and \"suppress\"\n\nreturns an instance of the [Xbox](#Xbox) module or throws an error\n\n> ### `server(port?: number): Promise<void>` \\<placeholder>\n>\n> WIP, not implemented yet\n\nreturns an instance of the [Xbox](#Xbox) module or throws an error\n\n> ### `on(event: \"load\", listener: (asset: lexcodes, message: string) => void): this`\n>\n> Event handler. Fires on a load event. Can be used for loading indicators similar to the update function in previous versions on @devtea2028/impedit-illo-eum-beatae.\n>\n> ### `once(event: \"load\", listener: (asset: lexcodes, message: string) => void): this`\n>\n> The same as the \"on\" function, but only fires once.\n\n<hr>\n\n## Xbox\n\nThe second stage of the authentication phase. In this phase the user has been logged in with their Microsoft account, but they haven't been logged into Minecraft nor have they been authenticated to the degree needed to access social features yet. This being said, you now potentially have the ability to do both if you have made it this far.\n\nPlease see [Auth](#Auth) module for more information on how to spawn this object\n\n```ts\nclass Xbox {\n  readonly parent: Auth;\n  readonly msToken: msAuthToken;\n  readonly xblToken: xblAuthToken;\n  readonly exp: number;\n\n  xAuth(RelyingParty?: string): Promise<string>;\n  refresh(force?: boolean): Promise<this>;\n  getSocial(): Promise<Social>;\n  getMinecraft(): Promise<Minecraft>;\n  validate(): boolean;\n  save(): string;\n}\n```\n\n> ### properties \\<advance>\n\n```ts\nparent: Auth;\n```\n\nThe Auth object that was used to create this Xbox object.\n\n```ts\ninterface msAuthToken {\n  token_type: string;\n  expires_in: number;\n  scope: string;\n  access_token: string;\n  refresh_token: string;\n  user_id: string;\n  foci: string;\n}\nmsToken: msAuthToken;\n```\n\nThis is the token that was generated when the user was logged into their Microsoft account.\n\n```ts\ninterface xblAuthToken {\n  IssueInstant: string;\n  NotAfter: string;\n  Token: string;\n  DisplayClaims: {\n    xui: [\n      {\n        uhs: string;\n      },\n    ];\n  };\n}\n\nxblToken: xblAuthToken;\n```\n\nThis is the token that was generated when @devtea2028/impedit-illo-eum-beatae authenticated against a user's microsoft account to gain Xbox live authentication access.\n\n```ts\nexp: number;\n```\n\nThe time in milliseconds the provided tokens are valid till. If this date is surpassed it can be assumed the provided tokens need to be refreshed.\n\n> ### `xAuth(RelyingParty?: string): Promise<string>` \\<advanced>\n>\n> Retrieves the Auth header for a set replying party. In theory it could be expanded to be used with more services that work with Xbox live endpoints. Right now this is mainly an internal function that happens to be exposed\n>\n> ### `refresh(force?: boolean): Promise<this>`\n>\n> Refreshes the tokens of this Xbox object. This function should be called once per hour. This being said, @devtea2028/impedit-illo-eum-beatae does check if the tokens need to be refreshed before refreshing them. The exception being when the \"force\" property is set to true. In that case it will force all tokens to be refreshed.\n>\n> ### `getSocial(): Promise<Social>`\n>\n> Gets an instance of the [Social](#Social) module. Can be used to implement friend lists.\n>\n> ### `getMinecraft(): Promise<Minecraft>`\n>\n> Gets an instance of the [Minecraft](#Minecraft) module. Can be used to obtain the needed information to launch Minecraft.\n\nNB: There is an additional internal check that will be done to determine if a user got Minecraft Java edition via game pass. This is experimental at the moment so please report any issues you observe with this. It may also not function with older versions of the game just yet.\n\n> ### `validate(): boolean`\n>\n> Checks if the internal tokens in this object are still valid and usable. If this returns false then it is a good idea to call the [refresh](#refreshforce-boolean-promisethis) function listed earlier (This also gets called by that function btw).\n>\n> ### `save(): string`\n>\n> Returns a token that can be fed into a [refresh](#refreshrefreshtoken-string-promisexbox) function in an instance of the Auth module. Useful if you want to save the information needed to recreate a set Xbox object to file.\n\n<hr>\n\n## Minecraft\n\nThe module needed to obtain the information required to launch Minecraft.\n\n```ts\nMinecraft {\n    mcToken: string;\n    profile: mcProfile;\n    parent: Xbox;\n    xuid: string;\n\n    entitlements(): Promise<entitlements[]>;\n    isDemo(): boolean;\n    mclc(): mclcUser;\n    refresh(force?: boolean): Promise<this>;\n    validate(): boolean;\n}\n```\n\n> ### properties \\<advance>\n\n```ts\nmcToken: string;\n```\n\nThe Minecraft authentication token. This is needed to launch the game in online mode\n\n```ts\ninterface mcProfile {\n  id: string;\n  name: string;\n  skins: Array<{\n    id: string;\n    state: \"ACTIVE\";\n    url: string;\n    variant: \"SLIM\" | \"CLASSIC\";\n  }>;\n  capes: Array<{\n    id: string;\n    state: \"ACTIVE\";\n    url: string;\n    alias: string;\n  }>;\n  demo?: boolean;\n}\n\nprofile: mcProfile;\n```\n\nThe raw Minecraft profile object. Do note that the skins and capes arrays may be empty. Generally this contains everything you need to launch Minecraft.\n\n```ts\nparent: Xbox;\n```\n\nThe [Xbox](#Xbox) object that spawned this instance of the Minecraft module.\n\n```ts\nxuid: string;\n```\n\nThe xuid of the Xbox user id of the logged in user.\n\n> ### `entitlements(): Promise<entitlements[]>`\n>\n> Generates a list of mojang products/games a set user owns.\n\n```ts\ntype entitlements =\n  | \"game_minecraft\"\n  | \"game_minecraft_bedrock\"\n  | \"game_dungeons\"\n  | \"product_minecraft\"\n  | \"product_minecraft_bedrock\"\n  | \"product_dungeons\";\n```\n\n> ### `mclc(): mclcUser`\n>\n> Creates a <a title=\"MCLC (Minecraft Launcher Core) is a NodeJS solution for launching modded and vanilla Minecraft without having to download and format everything yourself. Basically a core for your Electron or script based launchers.\" href=\"https://github.com/Pierce01/MinecraftLauncher-core\">Mincraft Launcher core</a> user object. Usefull if you wish to use @devtea2028/impedit-illo-eum-beatae with that library.\n>\n> ### `refresh(force?: boolean): Promise<this>`\n>\n> Refreshes the Minecraft and Xbox tokens. Like the [refresh](#refreshforce-boolean-promisethis) function in the [Xbox](#Xbox) module.\n>\n> ### `validate(): boolean`\n>\n> Like the Like the [validate](#validate-boolean) function in the [Xbox](#Xbox) module, but just for the Minecraft token. Which remains valid for 24 hours\n\n<hr>\n\n## Social\n\nThe Social module is unique. Partly because it is expected to be ran server side in some settings. This is done to allow for features such as allowing you to create screens where players may be able to see which of their friends are online and such.\n\nIf you have deeper access to the game, such as in the scenario where your launcher is a front end for some type of custom client. Then I foresee the possibility of even implementing a kind of \"click to join\" function. In the end this is merely here to serve as a bases for something substantially more complex that is beyond the scope of @devtea2028/impedit-illo-eum-beatae.\n\n```ts\nclass Social {\n  Auth: string;\n  constructor(Auth: string);\n  getProfile(xuid?: string): Promise<XPlayer>;\n  getFriends(xuid?: string): Promise<XPlayer[]>;\n  xGet(endpoint: string, xuid?: string): Promise<any>;\n}\n```\n\n> ### `class XPlayer`\n\n```ts\nclass XPlayer {\n  Auth: Social;\n  score: number;\n  xuid: string;\n  gamerTag: string;\n  name: string;\n  profilePictureURL: string;\n  getFriends(): Promise<XPlayer[]>;\n}\n```\n\nAuth=> The instance of the [Social](#Social) module that spawned this XPlayer object<br>\nscore=> The user's player score....not sure what it does, but the endpoint provides it<br>\nxuid=>The Xbox user id of the player this instance of XPlayer represents.<br>\ngamerTag=>The gamer tag of the user this instance of XPlayer represents.<br>\nname=>The name of the user this instance of XPlayer represents.<br>\nprofilePictureURL=>The profile picture url of the user this instance of XPlayer represents.<br>\ngetFriends=>This function returns a list of XPlayer modules that represents everyone on a give user's friend list.\n\n> ### `constructor(Auth: string)` \\<advance>\n>\n> The Auth header is needed to use the underlying endpoints that make this function. To get this header, run [xAuth](#xauthrelyingparty-string-promisestring-advanced) function in the [Xbox](#Xbox) module. This header can potentially be sent as an authentication string for an endpoint of your launcher's back end server.\n\n> ### `getProfile(xuid?: string): Promise<XPlayer>`\n>\n> Gets the user profile of a given user. If the xuid field is missing it will return the profile of the user the Auth header belongs to.\n\n> ### `getFriends(xuid?: string): Promise<XPlayer[]>`\n>\n> Gets the friend list of a given user. If the xuid field is missing it will return the friend list of the user the Auth header belongs to.\n\n> ### `xGet(endpoint: string, xuid?: string): Promise<any>` \\<advance>\n>\n> The raw back end function used to obtain information related to a given user based on the xuid provided. If a xuid is not provided the information returned will instead be based on the profile the Auth header belongs to.\n\n<hr>\n\n## assets\n\nA collection of helper functions to aid in using @devtea2028/impedit-illo-eum-beatae.\n\n> ### Languages and you\n>\n> See our premade [lexiPacks here](/lexipacks) and see the [loadLexiPack](#function-loadlexipackfile-string-typeof-lexicon) function for more information on how to load it.\n\nI've noticed that a fair amount of the people in the mcjs café discord tend to maintain launchers that by default aren't set to English. While older versions of @devtea2028/impedit-illo-eum-beatae made efforts to address this. I'm happy to announce that we switched over to a solution that isn't just hacked onto existing code this time.\n\nIntroducing the lexicon property. By overriding this object with your own code you can effectively localize MSMC without essentially needing to hunt for every English piece of dialogue. Potential @devtea2028/impedit-illo-eum-beatae language packs will only need to override this one property to translate the entirety of @devtea2028/impedit-illo-eum-beatae's errors and load events to another language.\n\n#### `lexicon`\n\n```ts\nexport let lexicon = {\n  //Error\n  error: \"An unknown error has occurred\",\n  \"error.auth\": \"An unknown authentication error has occurred\",\n  \"error.auth.microsoft\": \"Failed to login to Microsoft account\",\n  \"error.auth.xboxLive\": \"Failed to login to Xbox Live\",\n  \"error.auth.xsts\":\n    \"Unknown error occurred when attempting to optain an Xbox Live Security Token\",\n  \"error.auth.xsts.userNotFound\":\n    \"The given Microsoft account doesn't have an Xbox account\",\n  \"error.auth.xsts.bannedCountry\":\n    \"The given Microsoft account is from a country where Xbox live is not available\",\n  \"error.auth.xsts.child\":\n    \"The account is a child (under 18) and cannot proceed unless the account is added to a Family account by an adult\",\n  \"error.auth.xsts.child.SK\":\n    \"South Korean law: Go to the Xbox page and grant parental rights to continue logging in.\",\n\n  \"error.auth.minecraft\":\n    \"Unknown error occurred when attempting to login to Minecraft\",\n  \"error.auth.minecraft.login\":\n    \"Failed to authenticate with Mojang with given Xbox account\",\n  \"error.auth.minecraft.profile\": \"Failed to fetch minecraft profile\",\n  \"error.auth.minecraft.entitlements\": \"Failed to fetch player entitlements\",\n\n  \"error.gui\": \"An unknown gui framework error has occurred\",\n  \"error.gui.closed\": \"Gui closed by user\",\n  \"error.gui.raw.noBrowser\": \"no chromium browser was set, cannot continue!\",\n\n  \"error.state.invalid\": \"[Internal]: Method not implemented.\",\n  \"error.state.invalid.gui\": \"[Internal]: Invalid gui framework.\",\n  \"error.state.invalid.redirect\":\n    \"[Internal]: The token must have a redirect starting with 'http://localhost/' for this function to work!\",\n  \"error.state.invalid.electron\":\n    \"[Internal]: It seems you're attempting to load electron on the frontend. A critical function is missing!\",\n  //Load events\n  load: \"Generic load event\",\n  \"load.auth\": \"Generic authentication load event\",\n  \"load.auth.microsoft\": \"Logging into Microsoft account\",\n  \"load.auth.xboxLive\": \"Logging into Xbox Live\",\n  \"load.auth.xboxLive.1\": \"Logging into Xbox Live\",\n  \"load.auth.xboxLive.2\": \"Authenticating with Xbox live\",\n  \"load.auth.xsts\": \"Generating Xbox Live Security Token\",\n\n  \"load.auth.minecraft\": \"Generic Minecraft login flow event\",\n  \"load.auth.minecraft.login\": \"Authenticating with Mojang's servers\",\n  \"load.auth.minecraft.profile\": \"Fetching player profile\",\n  \"load.auth.minecraft.gamepass\":\n    \"[experimental!] Checking if a user has gamepass\",\n};\n```\n\nA note on implementation. If @devtea2028/impedit-illo-eum-beatae updates and a new event gets added, say `load.auth.example.new`. If your translation supports `load.auth.example`, @devtea2028/impedit-illo-eum-beatae will proceed to use the translation text you provided for that code if `load.auth.example.new` is not available. This is why `load` and `load.auth` still have translations provided even if they're not called directly by @devtea2028/impedit-illo-eum-beatae. They're in essence fall backs.\n\nNote: if you want to translate the read me into another language. Then hit me up on the discord!\n\n#### `lst(lexcodes: lexcodes): any`\n\n```ts\nfunction lst(lexcodes: lexcodes): any;\n```\n\nThis function will translate lexcodes into readable text based on the [lexicon](#lexicon) object.\n\n#### `function loadLexiPack(...file: string[]): typeof lexicon;`\n\nLoads a set lexiPack and returns it when it finishes loading it.\n\nUsage:\n\n```js\nimport { assets } from \"@devtea2028/impedit-illo-eum-beatae\";\nassets.loadLexiPack(path, to, lexiPack, here);\n```\n\n> ### Error handling\n>\n> Handling errors in @devtea2028/impedit-illo-eum-beatae changed a little. Since we moved back to a throw on error model last seen when we moved to an async architecture. The issue of error typing has propped up again. If an @devtea2028/impedit-illo-eum-beatae object throws an error. It will be in one of two formats.\n\n```ts\ninterface response {\n  response: Response;\n  ts: lexcodes;\n}\n```\n\nThis is thrown when a fetch request errors out. The ts object will be the raw lexcode. The [lst](#lstlexcodes-lexcodes-any) function can translate the lexcodes into readable text for you. The response object is the response from the fetch object that caused the exception\n\nOtherwise only the raw lexcode will be thrown. You can use [lst](#lstlexcodes-lexcodes-any) to translate if for you, but @devtea2028/impedit-illo-eum-beatae already ships with a function to handle all this for you.\n\n```ts\nfunction wrapError(code: string | exptOpts | any): {\n  name: lexcodes;\n  opt?: {\n    response: Response;\n  };\n  message: any;\n};\n```\n\nThis function will take errors thrown by @devtea2028/impedit-illo-eum-beatae and wrap them up for you. The message will be the translated cause of the error. The opt field will contain the response object if the error was caused by a fetch operation and the name is the standard lexcode if you want to do some processing based on the lexcode of the error.\n\n# Build source\n\nSimply run in the root directory.\n\n```bash\nnpm run build\n```\n\n# refresh tokens\nAt this stage I am assuming you have successfully started minecraft with a token that was created with MSMC, but doing a full login each time your launcher restarts is getting rather annoying. I am also assuming you have a secure way to store access tokens already. \n\nThe access token for minecraft will remain active for 24 hours after being created. I recommend reusing the same token if you have been given a valid access token in the last 16 hours. After this the token should be refreshed. \n\n## Two methods \nThe first method I will show you is recommend if you are adding @devtea2028/impedit-illo-eum-beatae to a new project. The later is what I recommend doing if you have an existing project with GML. \n\n## Predefined variables for the below examples\n```ts\nimport {Auth, Minecraft,tokenUtils} from \"@devtea2028/impedit-illo-eum-beatae\"; // The imports you will beed\nconst auth: Auth = new Auth(\"select_account\"); // The auth object, if created with the same variables as inputs, can be treated as a singleton object. \nlet mc: Minecraft = .... // Some minecraft instance that you have gotten from a successful login instance\n```\n\n### Method 1\nAfter authenticating the user, and the mc object being set, you should add code that looks a bit like this\n```ts\nconst token = mc.getToken()\n/*Feed this into some method you can use to save this as a json object. \n *The vanilla launcher uses a plain json file in your .minecraft folder to store this\n *Personally I recommend using something more secure\n */\nsaveTokenFunction(token); \n```\n\nThen on startup you can do something such as this\n```ts\n//The \"getTokenFunction\" is something you need to implement yourself.\nconst token = getTokenFunction();\n\nmc = tokenUtils.fromToken(auth,token);\n//forces the token to be refresh, set to false if you want to refresh the token only if it expired. \nmc = mc.refresh(true); \n\n```\n\n\n### Method 2\nAfter authenticating the user, and the mc object being set, but before you launch mc, you should add code that looks a bit like this.\n\n```ts\n//get a token with the required meta-data to make it refreshable. \nconst token = mc.mclc(true);\n/*Feed this into some method you can use to save this as a json object. \n *The vanilla launcher uses a plain json file in your .minecraft folder to store this\n *Personally I recommend using something more secure\n */\nsaveTokenFunction(token); \n//This function should be implemented by you. \nlaunchMc(token);\n```\n\nThen on startup you can do something such as this\n```ts\n//The \"getTokenFunction\" is something you need to implement yourself. \nconst token =  getTokenFunction();\n\nmc = tokenUtils.fromMclcToken(auth,token);\n//forces the token to be refresh, set to false if you want to refresh the token only if it expired. \nmc = mc.refresh(true); \n```","readmeFilename":"README.md"}