├── .gitignore ├── LICENSE.md ├── README.md ├── docs ├── README.md ├── classes │ ├── _customerrors_.httperror.md │ ├── _customerrors_.jwtexpirederror.md │ ├── _customerrors_.nexuserror.md │ ├── _customerrors_.parameterinvalid.md │ ├── _customerrors_.protocolerror.md │ ├── _customerrors_.ratelimiterror.md │ ├── _customerrors_.timeouterror.md │ ├── _nexus_.nexus.md │ └── _quota_.quota.md ├── globals.md ├── interfaces │ ├── _nexus_.irequestargs.md │ ├── _types_.icategory.md │ ├── _types_.ichangelogs.md │ ├── _types_.icolourscheme.md │ ├── _types_.idownloadurl.md │ ├── _types_.iendorsement.md │ ├── _types_.iendorseresponse.md │ ├── _types_.ifeedbackresponse.md │ ├── _types_.ifileinfo.md │ ├── _types_.ifileupdate.md │ ├── _types_.igameinfo.md │ ├── _types_.igamelistentry.md │ ├── _types_.igithubissue.md │ ├── _types_.iissue.md │ ├── _types_.imd5result.md │ ├── _types_.imodfiles.md │ ├── _types_.imodinfo.md │ ├── _types_.imodinfoex.md │ ├── _types_.inexusevents.md │ ├── _types_.ioauthconfig.md │ ├── _types_.ioauthcredentials.md │ ├── _types_.itrackedmod.md │ ├── _types_.itrackresponse.md │ ├── _types_.iupdateentry.md │ ├── _types_.iuser.md │ └── _types_.ivalidatekeyresponse.md └── modules │ ├── _customerrors_.md │ ├── _index_.md │ ├── _nexus_.md │ ├── _parameters_.md │ ├── _quota_.md │ └── _types_.md ├── lib ├── Nexus.d.ts ├── Nexus.js ├── Nexus.js.map ├── OAuthCredentials.d.ts ├── OAuthCredentials.js ├── OAuthCredentials.js.map ├── Quota.d.ts ├── Quota.js ├── Quota.js.map ├── customErrors.d.ts ├── customErrors.js ├── customErrors.js.map ├── index.d.ts ├── index.js ├── index.js.map ├── parameters.d.ts ├── parameters.js ├── parameters.js.map ├── types.d.ts ├── types.js ├── types.js.map ├── typesGraphQL.d.ts ├── typesGraphQL.js └── typesGraphQL.js.map ├── package.json ├── samples ├── downloadlinks.rest ├── fileinfo.rest ├── filelist.rest ├── game.rest ├── games.rest ├── modinfo.rest ├── readme.txt └── validate.rest ├── src ├── Nexus.ts ├── Quota.ts ├── customErrors.ts ├── index.ts ├── parameters.ts ├── types.ts └── typesGraphQL.ts ├── tsconfig.json ├── yarn-error.log └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modulesyarn-error.log 2 | node_modules 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nexus API 2 | 3 | ## Introduction 4 | 5 | The Nexus API provides applications access to Nexus Mods metadata including lists of games, mods and individual files, version information and so on. 6 | 7 | ## Authorization 8 | 9 | All requests must identify the user and the application which is making the request. To achieve this, a set of parameters must be set in the header of all requests. 10 | 11 | ### APIKEY 12 | 13 | An APIKEY can be created for a specific user and a specific application on the Nexus Mods website. This key can be manually copied into your application and used when generating requests. Alternatively, a websocket-based Single Sign-On system can be used as described further down. 14 | 15 | Based on this key, access for individual users or applications can be revoked (by Nexus Mods or the user himself), and access rights can be restricted (e.g. an application might be allowed to read mod meta data but not to make endorsements in the name of the user), finally, the key can also be used for network traffic throttling. 16 | 17 | For this reason it's not acceptable for an application to use API keys created for other applications. 18 | 19 | Before API Keys for your application can be generated you have to register your application with Nexus Mods. You will be assigned an appid. 20 | 21 | ### Protocol-Version 22 | 23 | The protocol version identifies the exact protocol the client expects from the server and allows us to make improvements to the API without breaking older clients. 24 | This version is set automatically by this library and there is no good reason to override it. 25 | 26 | ### Application-Version 27 | 28 | The application version - which has to follow semantic versioning guidelines - identifies the version of your application and may be used to work around problems without affecting all users of the application. 29 | 30 | E.g. if one version of your application has a bug that leads to it spamming a certain request, we might block that request for that application version without affecting other versions which don't have the problem. 31 | 32 | Therefore it's in your, and your users best interest to provide a version in the right format and keeping it up-to-date. 33 | 34 | ## Single Sign-On 35 | 36 | As described above, an APIKEY can be generated using a websocket-based protocol. This is *not* part of this library. 37 | 38 | ### Process 39 | 40 | - Generate a random unique id (we suggest uuid v4) 41 | - Create a websocket connection to wss://sso.nexusmods.com 42 | - When the connection is established, send a JSON encoded message containing the id you just generated and the appid you got on registration. 43 | Example: { "id": "4c694264-1fdb-48c6-a5a0-8edd9e53c7a6", "appid": "your_fancy_app" } 44 | - From now on, until the connection is closed, send a websocket ping once every 30 seconds. 45 | - Have the user open _https://www.nexusmods.com/sso?id=xyz_ (_id_ being the random id you generated in step 1) _in the default browser_ 46 | - On the website users will be asked to log-in to Nexus Mods if they aren't already. Then they will be asked to authorize your application to use their account. 47 | - Once the user confirms, a message will be sent to your websocket with the APIKEY (not encoded, just the plain key). This is the only non-error message you will ever receive from the server. 48 | - Save away the key and close the connection. 49 | 50 | ## API Reference 51 | 52 | All relevant functionality is accessible through the [Nexus class](https://github.com/Nexus-Mods/node-nexus-api/blob/master/docs/classes/_nexus_.nexus.md). 53 | 54 | The API may throw a bunch of [Custom Errors](https://github.com/Nexus-Mods/node-nexus-api/blob/master/docs/modules/_customerrors_.md). 55 | 56 | ### Throttling 57 | 58 | The library implements request throttling to avoid spamming the API. 59 | This is done on two levels: The client will use a quota of 300 (600 for premium) requests that can be used in bursts but only recover one request per second so it won't allow for sustained high traffic. 60 | 61 | the server will also reject requests if traffic is to high both total traffic and per user by replying with a HTTP message code 429. In this event the api will reset it's quota to 0. 62 | 63 | Please note that tampering with this throttling may lead to more requests being blocked, resulting in even worse performance for your users, or - in extreme cases - even revocation of API Keys. 64 | 65 | ### Feedback API 66 | 67 | The library contains a feedback API but it's only intended for internal use 68 | 69 | ## OAuth support 70 | 71 | Experimental support for OAuth/JWT has been added to this library. 72 | 73 | Gaining a JWT is not part of this library. 74 | 75 | Once you have a JWT, refreshToken and fingerprint you can create a client like so: 76 | 77 | ``` 78 | const credentials = { 79 | token: '<>', 80 | refreshToken: '<>', 81 | fingerprint: '<>', 82 | }; 83 | 84 | const config = { 85 | id: '<>', 86 | secret: '<>', 87 | }; 88 | 89 | const appName = '<>'; 90 | const appVersion = '<>'; 91 | const defaultGame = '1'; 92 | 93 | const client = Nexus.createWithOAuth(credentials, config, appName, appVersion, defaultGame).then(nexus => { 94 | console.log(`Hello your Nexus client is here: ${nexus}`); 95 | }); 96 | ``` 97 | 98 | The client handles dealing with expired tokens by calling a refresh token endpoint. An instance of the client will retain these new credentials for the next time a request is made. But when you next create a client instance, it is your responsibility to provide these new credentials from your storage mechanism. 99 | 100 | You can listen to credential refreshes and pass them to your app for storage and later re-use: 101 | 102 | ``` 103 | const callback = () => { 104 | console.log(`We have received new credentials: ${credentials}. They should now be stored somewhere.`); 105 | } 106 | 107 | const client = Nexus.createWithOAuth(credentials, config, appName, appVersion, defaultGame, timeout, callback).then(nexus => { 108 | ... 109 | }); 110 | ``` 111 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](README.md) › [Globals](globals.md) 2 | 3 | # @nexusmods/nexus-api 4 | 5 | # Nexus API 6 | 7 | ## Introduction 8 | 9 | The Nexus API provides applications access to Nexus Mods metadata including lists of games, mods and individual files, version information and so on. 10 | 11 | ## Authorization 12 | 13 | All requests must identify the user and the application which is making the request. To achieve this, a set of parameters must be set in the header of all requests. 14 | 15 | ### APIKEY 16 | 17 | An APIKEY can be created for a specific user and a specific application on the Nexus Mods website. This key can be manually copied into your application and used when generating requests. Alternatively, a websocket-based Single Sign-On system can be used as described further down. 18 | 19 | Based on this key, access for individual users or applications can be revoked (by Nexus Mods or the user himself), and access rights can be restricted (e.g. an application might be allowed to read mod meta data but not to make endorsements in the name of the user), finally, the key can also be used for network traffic throttling. 20 | 21 | For this reason it's not acceptable for an application to use API keys created for other applications. 22 | 23 | Before API Keys for your application can be generated you have to register your application with Nexus Mods. You will be assigned an appid. 24 | 25 | ### Protocol-Version 26 | 27 | The protocol version identifies the exact protocol the client expects from the server and allows us to make improvements to the API without breaking older clients. 28 | This version is set automatically by this library and there is no good reason to override it. 29 | 30 | ### Application-Version 31 | 32 | The application version - which has to follow semantic versioning guidelines - identifies the version of your application and may be used to work around problems without affecting all users of the application. 33 | 34 | E.g. if one version of your application has a bug that leads to it spamming a certain request, we might block that request for that application version without affecting other versions which don't have the problem. 35 | 36 | Therefore it's in your, and your users best interest to provide a version in the right format and keeping it up-to-date. 37 | 38 | ## Single Sign-On 39 | 40 | As described above, an APIKEY can be generated using a websocket-based protocol. This is *not* part of this library. 41 | 42 | ### Process 43 | 44 | - Generate a random unique id (we suggest uuid v4) 45 | - Create a websocket connection to wss://sso.nexusmods.com 46 | - When the connection is established, send a JSON encoded message containing the id you just generated and the appid you got on registration. 47 | Example: { "id": "4c694264-1fdb-48c6-a5a0-8edd9e53c7a6", "appid": "your_fancy_app" } 48 | - From now on, until the connection is closed, send a websocket ping once every 30 seconds. 49 | - Have the user open _https://www.nexusmods.com/sso?id=xyz_ (_id_ being the random id you generated in step 1) _in the default browser_ 50 | - On the website users will be asked to log-in to Nexus Mods if they aren't already. Then they will be asked to authorize your application to use their account. 51 | - Once the user confirms, a message will be sent to your websocket with the APIKEY (not encoded, just the plain key). This is the only non-error message you will ever receive from the server. 52 | - Save away the key and close the connection. 53 | 54 | ## API Reference 55 | 56 | All relevant functionality is accessible through the [Nexus class](https://github.com/Nexus-Mods/node-nexus-api/blob/master/docs/classes/_nexus_.nexus.md). 57 | 58 | The API may throw a bunch of [Custom Errors](https://github.com/Nexus-Mods/node-nexus-api/blob/master/docs/modules/_customerrors_.md). 59 | 60 | ### Throttling 61 | 62 | The library implements request throttling to avoid spamming the API. 63 | This is done on two levels: The client will use a quota of 300 (600 for premium) requests that can be used in bursts but only recover one request per second so it won't allow for sustained high traffic. 64 | 65 | the server will also reject requests if traffic is to high both total traffic and per user by replying with a HTTP message code 429. In this event the api will reset it's quota to 0. 66 | 67 | Please note that tampering with this throttling may lead to more requests being blocked, resulting in even worse performance for your users, or - in extreme cases - even revocation of API Keys. 68 | 69 | ### Feedback API 70 | 71 | The library contains a feedback API but it's only intended for internal use 72 | 73 | ## OAuth support 74 | 75 | Experimental support for OAuth/JWT has been added to this library. 76 | 77 | Gaining a JWT is not part of this library. 78 | 79 | Once you have a JWT, refreshToken and fingerprint you can create a client like so: 80 | 81 | ``` 82 | const credentials = { 83 | token: '<>', 84 | refreshToken: '<>', 85 | fingerprint: '<>', 86 | }; 87 | 88 | const config = { 89 | id: '<>', 90 | secret: '<>', 91 | }; 92 | 93 | const appName = '<>'; 94 | const appVersion = '<>'; 95 | const defaultGame = '1'; 96 | 97 | const client = Nexus.createWithOAuth(credentials, config, appName, appVersion, defaultGame).then(nexus => { 98 | console.log(`Hello your Nexus client is here: ${nexus}`); 99 | }); 100 | ``` 101 | 102 | The client handles dealing with expired tokens by calling a refresh token endpoint. An instance of the client will retain these new credentials for the next time a request is made. But when you next create a client instance, it is your responsibility to provide these new credentials from your storage mechanism. 103 | 104 | You can listen to credential refreshes and pass them to your app for storage and later re-use: 105 | 106 | ``` 107 | const client = Nexus.createWithOAuth(credentials, config, appName, appVersion, defaultGame).then(nexus => { 108 | nexus.events.on('oauth-credentials-updated', (credentials) => { 109 | console.log(`We have received new credentials: ${credentials}. They should now be stored somewhere.`); 110 | }); 111 | }); 112 | ``` 113 | -------------------------------------------------------------------------------- /docs/classes/_customerrors_.httperror.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["customErrors"](../modules/_customerrors_.md) › [HTTPError](_customerrors_.httperror.md) 2 | 3 | # Class: HTTPError 4 | 5 | Error thrown if an HTTP error is reported (HTTP code 4xx or 5xx) 6 | 7 | ## Hierarchy 8 | 9 | * [Error](_customerrors_.timeouterror.md#static-error) 10 | 11 | ↳ **HTTPError** 12 | 13 | ## Index 14 | 15 | ### Constructors 16 | 17 | * [constructor](_customerrors_.httperror.md#constructor) 18 | 19 | ### Properties 20 | 21 | * [message](_customerrors_.httperror.md#message) 22 | * [name](_customerrors_.httperror.md#name) 23 | * [stack](_customerrors_.httperror.md#optional-stack) 24 | * [Error](_customerrors_.httperror.md#static-error) 25 | 26 | ### Accessors 27 | 28 | * [body](_customerrors_.httperror.md#body) 29 | 30 | ## Constructors 31 | 32 | ### constructor 33 | 34 | \+ **new HTTPError**(`statusCode`: number, `message`: string, `body`: string): *[HTTPError](_customerrors_.httperror.md)* 35 | 36 | *Defined in [src/customErrors.ts:36](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/customErrors.ts#L36)* 37 | 38 | **Parameters:** 39 | 40 | Name | Type | 41 | ------ | ------ | 42 | `statusCode` | number | 43 | `message` | string | 44 | `body` | string | 45 | 46 | **Returns:** *[HTTPError](_customerrors_.httperror.md)* 47 | 48 | ## Properties 49 | 50 | ### message 51 | 52 | • **message**: *string* 53 | 54 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[message](_customerrors_.timeouterror.md#message)* 55 | 56 | Defined in node_modules/typescript/lib/lib.es5.d.ts:974 57 | 58 | ___ 59 | 60 | ### name 61 | 62 | • **name**: *string* 63 | 64 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[name](_customerrors_.timeouterror.md#name)* 65 | 66 | Defined in node_modules/typescript/lib/lib.es5.d.ts:973 67 | 68 | ___ 69 | 70 | ### `Optional` stack 71 | 72 | • **stack**? : *string* 73 | 74 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 75 | 76 | *Overrides [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 77 | 78 | Defined in node_modules/typescript/lib/lib.es5.d.ts:975 79 | 80 | ___ 81 | 82 | ### `Static` Error 83 | 84 | ▪ **Error**: *ErrorConstructor* 85 | 86 | Defined in node_modules/typescript/lib/lib.es5.d.ts:984 87 | 88 | ## Accessors 89 | 90 | ### body 91 | 92 | • **get body**(): *string* 93 | 94 | *Defined in [src/customErrors.ts:42](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/customErrors.ts#L42)* 95 | 96 | **Returns:** *string* 97 | -------------------------------------------------------------------------------- /docs/classes/_customerrors_.jwtexpirederror.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["customErrors"](../modules/_customerrors_.md) › [JwtExpiredError](_customerrors_.jwtexpirederror.md) 2 | 3 | # Class: JwtExpiredError 4 | 5 | Error thrown when the JWT has expired 6 | You should not see this error in your application as a refresh is performed when encountering it 7 | 8 | ## Hierarchy 9 | 10 | * [Error](_customerrors_.timeouterror.md#static-error) 11 | 12 | ↳ **JwtExpiredError** 13 | 14 | ## Index 15 | 16 | ### Constructors 17 | 18 | * [constructor](_customerrors_.jwtexpirederror.md#constructor) 19 | 20 | ### Properties 21 | 22 | * [message](_customerrors_.jwtexpirederror.md#message) 23 | * [name](_customerrors_.jwtexpirederror.md#name) 24 | * [stack](_customerrors_.jwtexpirederror.md#optional-stack) 25 | * [Error](_customerrors_.jwtexpirederror.md#static-error) 26 | 27 | ## Constructors 28 | 29 | ### constructor 30 | 31 | \+ **new JwtExpiredError**(): *[JwtExpiredError](_customerrors_.jwtexpirederror.md)* 32 | 33 | *Defined in [src/customErrors.ts:82](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/customErrors.ts#L82)* 34 | 35 | **Returns:** *[JwtExpiredError](_customerrors_.jwtexpirederror.md)* 36 | 37 | ## Properties 38 | 39 | ### message 40 | 41 | • **message**: *string* 42 | 43 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[message](_customerrors_.timeouterror.md#message)* 44 | 45 | Defined in node_modules/typescript/lib/lib.es5.d.ts:974 46 | 47 | ___ 48 | 49 | ### name 50 | 51 | • **name**: *string* 52 | 53 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[name](_customerrors_.timeouterror.md#name)* 54 | 55 | Defined in node_modules/typescript/lib/lib.es5.d.ts:973 56 | 57 | ___ 58 | 59 | ### `Optional` stack 60 | 61 | • **stack**? : *string* 62 | 63 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 64 | 65 | *Overrides [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 66 | 67 | Defined in node_modules/typescript/lib/lib.es5.d.ts:975 68 | 69 | ___ 70 | 71 | ### `Static` Error 72 | 73 | ▪ **Error**: *ErrorConstructor* 74 | 75 | Defined in node_modules/typescript/lib/lib.es5.d.ts:984 76 | -------------------------------------------------------------------------------- /docs/classes/_customerrors_.nexuserror.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["customErrors"](../modules/_customerrors_.md) › [NexusError](_customerrors_.nexuserror.md) 2 | 3 | # Class: NexusError 4 | 5 | Error reported by the nexus api 6 | 7 | ## Hierarchy 8 | 9 | * [Error](_customerrors_.timeouterror.md#static-error) 10 | 11 | ↳ **NexusError** 12 | 13 | ## Index 14 | 15 | ### Constructors 16 | 17 | * [constructor](_customerrors_.nexuserror.md#constructor) 18 | 19 | ### Properties 20 | 21 | * [message](_customerrors_.nexuserror.md#message) 22 | * [name](_customerrors_.nexuserror.md#name) 23 | * [stack](_customerrors_.nexuserror.md#optional-stack) 24 | * [Error](_customerrors_.nexuserror.md#static-error) 25 | 26 | ### Accessors 27 | 28 | * [request](_customerrors_.nexuserror.md#request) 29 | * [statusCode](_customerrors_.nexuserror.md#statuscode) 30 | 31 | ## Constructors 32 | 33 | ### constructor 34 | 35 | \+ **new NexusError**(`message`: string, `statusCode`: number, `url`: string): *[NexusError](_customerrors_.nexuserror.md)* 36 | 37 | *Defined in [src/customErrors.ts:52](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/customErrors.ts#L52)* 38 | 39 | **Parameters:** 40 | 41 | Name | Type | 42 | ------ | ------ | 43 | `message` | string | 44 | `statusCode` | number | 45 | `url` | string | 46 | 47 | **Returns:** *[NexusError](_customerrors_.nexuserror.md)* 48 | 49 | ## Properties 50 | 51 | ### message 52 | 53 | • **message**: *string* 54 | 55 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[message](_customerrors_.timeouterror.md#message)* 56 | 57 | Defined in node_modules/typescript/lib/lib.es5.d.ts:974 58 | 59 | ___ 60 | 61 | ### name 62 | 63 | • **name**: *string* 64 | 65 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[name](_customerrors_.timeouterror.md#name)* 66 | 67 | Defined in node_modules/typescript/lib/lib.es5.d.ts:973 68 | 69 | ___ 70 | 71 | ### `Optional` stack 72 | 73 | • **stack**? : *string* 74 | 75 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 76 | 77 | *Overrides [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 78 | 79 | Defined in node_modules/typescript/lib/lib.es5.d.ts:975 80 | 81 | ___ 82 | 83 | ### `Static` Error 84 | 85 | ▪ **Error**: *ErrorConstructor* 86 | 87 | Defined in node_modules/typescript/lib/lib.es5.d.ts:984 88 | 89 | ## Accessors 90 | 91 | ### request 92 | 93 | • **get request**(): *string* 94 | 95 | *Defined in [src/customErrors.ts:63](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/customErrors.ts#L63)* 96 | 97 | **Returns:** *string* 98 | 99 | ___ 100 | 101 | ### statusCode 102 | 103 | • **get statusCode**(): *number* 104 | 105 | *Defined in [src/customErrors.ts:59](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/customErrors.ts#L59)* 106 | 107 | **Returns:** *number* 108 | -------------------------------------------------------------------------------- /docs/classes/_customerrors_.parameterinvalid.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["customErrors"](../modules/_customerrors_.md) › [ParameterInvalid](_customerrors_.parameterinvalid.md) 2 | 3 | # Class: ParameterInvalid 4 | 5 | API called with an invalid parameter 6 | 7 | ## Hierarchy 8 | 9 | * [Error](_customerrors_.timeouterror.md#static-error) 10 | 11 | ↳ **ParameterInvalid** 12 | 13 | ## Index 14 | 15 | ### Constructors 16 | 17 | * [constructor](_customerrors_.parameterinvalid.md#constructor) 18 | 19 | ### Properties 20 | 21 | * [message](_customerrors_.parameterinvalid.md#message) 22 | * [name](_customerrors_.parameterinvalid.md#name) 23 | * [stack](_customerrors_.parameterinvalid.md#optional-stack) 24 | * [Error](_customerrors_.parameterinvalid.md#static-error) 25 | 26 | ## Constructors 27 | 28 | ### constructor 29 | 30 | \+ **new ParameterInvalid**(`message`: any): *[ParameterInvalid](_customerrors_.parameterinvalid.md)* 31 | 32 | *Defined in [src/customErrors.ts:71](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/customErrors.ts#L71)* 33 | 34 | **Parameters:** 35 | 36 | Name | Type | 37 | ------ | ------ | 38 | `message` | any | 39 | 40 | **Returns:** *[ParameterInvalid](_customerrors_.parameterinvalid.md)* 41 | 42 | ## Properties 43 | 44 | ### message 45 | 46 | • **message**: *string* 47 | 48 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[message](_customerrors_.timeouterror.md#message)* 49 | 50 | Defined in node_modules/typescript/lib/lib.es5.d.ts:974 51 | 52 | ___ 53 | 54 | ### name 55 | 56 | • **name**: *string* 57 | 58 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[name](_customerrors_.timeouterror.md#name)* 59 | 60 | Defined in node_modules/typescript/lib/lib.es5.d.ts:973 61 | 62 | ___ 63 | 64 | ### `Optional` stack 65 | 66 | • **stack**? : *string* 67 | 68 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 69 | 70 | *Overrides [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 71 | 72 | Defined in node_modules/typescript/lib/lib.es5.d.ts:975 73 | 74 | ___ 75 | 76 | ### `Static` Error 77 | 78 | ▪ **Error**: *ErrorConstructor* 79 | 80 | Defined in node_modules/typescript/lib/lib.es5.d.ts:984 81 | -------------------------------------------------------------------------------- /docs/classes/_customerrors_.protocolerror.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["customErrors"](../modules/_customerrors_.md) › [ProtocolError](_customerrors_.protocolerror.md) 2 | 3 | # Class: ProtocolError 4 | 5 | Error thrown when a protocol error is reported. 6 | 7 | ## Hierarchy 8 | 9 | * [Error](_customerrors_.timeouterror.md#static-error) 10 | 11 | ↳ **ProtocolError** 12 | 13 | ## Index 14 | 15 | ### Constructors 16 | 17 | * [constructor](_customerrors_.protocolerror.md#constructor) 18 | 19 | ### Properties 20 | 21 | * [message](_customerrors_.protocolerror.md#message) 22 | * [name](_customerrors_.protocolerror.md#name) 23 | * [stack](_customerrors_.protocolerror.md#optional-stack) 24 | * [Error](_customerrors_.protocolerror.md#static-error) 25 | 26 | ## Constructors 27 | 28 | ### constructor 29 | 30 | \+ **new ProtocolError**(`message`: string): *[ProtocolError](_customerrors_.protocolerror.md)* 31 | 32 | *Defined in [src/customErrors.ts:14](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/customErrors.ts#L14)* 33 | 34 | **Parameters:** 35 | 36 | Name | Type | 37 | ------ | ------ | 38 | `message` | string | 39 | 40 | **Returns:** *[ProtocolError](_customerrors_.protocolerror.md)* 41 | 42 | ## Properties 43 | 44 | ### message 45 | 46 | • **message**: *string* 47 | 48 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[message](_customerrors_.timeouterror.md#message)* 49 | 50 | Defined in node_modules/typescript/lib/lib.es5.d.ts:974 51 | 52 | ___ 53 | 54 | ### name 55 | 56 | • **name**: *string* 57 | 58 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[name](_customerrors_.timeouterror.md#name)* 59 | 60 | Defined in node_modules/typescript/lib/lib.es5.d.ts:973 61 | 62 | ___ 63 | 64 | ### `Optional` stack 65 | 66 | • **stack**? : *string* 67 | 68 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 69 | 70 | *Overrides [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 71 | 72 | Defined in node_modules/typescript/lib/lib.es5.d.ts:975 73 | 74 | ___ 75 | 76 | ### `Static` Error 77 | 78 | ▪ **Error**: *ErrorConstructor* 79 | 80 | Defined in node_modules/typescript/lib/lib.es5.d.ts:984 81 | -------------------------------------------------------------------------------- /docs/classes/_customerrors_.ratelimiterror.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["customErrors"](../modules/_customerrors_.md) › [RateLimitError](_customerrors_.ratelimiterror.md) 2 | 3 | # Class: RateLimitError 4 | 5 | Error thrown when too many requests were made to the api 6 | You should not see this error in your application as it is handled internally 7 | 8 | ## Hierarchy 9 | 10 | * [Error](_customerrors_.timeouterror.md#static-error) 11 | 12 | ↳ **RateLimitError** 13 | 14 | ## Index 15 | 16 | ### Constructors 17 | 18 | * [constructor](_customerrors_.ratelimiterror.md#constructor) 19 | 20 | ### Properties 21 | 22 | * [message](_customerrors_.ratelimiterror.md#message) 23 | * [name](_customerrors_.ratelimiterror.md#name) 24 | * [stack](_customerrors_.ratelimiterror.md#optional-stack) 25 | * [Error](_customerrors_.ratelimiterror.md#static-error) 26 | 27 | ## Constructors 28 | 29 | ### constructor 30 | 31 | \+ **new RateLimitError**(): *[RateLimitError](_customerrors_.ratelimiterror.md)* 32 | 33 | *Defined in [src/customErrors.ts:25](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/customErrors.ts#L25)* 34 | 35 | **Returns:** *[RateLimitError](_customerrors_.ratelimiterror.md)* 36 | 37 | ## Properties 38 | 39 | ### message 40 | 41 | • **message**: *string* 42 | 43 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[message](_customerrors_.timeouterror.md#message)* 44 | 45 | Defined in node_modules/typescript/lib/lib.es5.d.ts:974 46 | 47 | ___ 48 | 49 | ### name 50 | 51 | • **name**: *string* 52 | 53 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[name](_customerrors_.timeouterror.md#name)* 54 | 55 | Defined in node_modules/typescript/lib/lib.es5.d.ts:973 56 | 57 | ___ 58 | 59 | ### `Optional` stack 60 | 61 | • **stack**? : *string* 62 | 63 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 64 | 65 | *Overrides [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 66 | 67 | Defined in node_modules/typescript/lib/lib.es5.d.ts:975 68 | 69 | ___ 70 | 71 | ### `Static` Error 72 | 73 | ▪ **Error**: *ErrorConstructor* 74 | 75 | Defined in node_modules/typescript/lib/lib.es5.d.ts:984 76 | -------------------------------------------------------------------------------- /docs/classes/_customerrors_.timeouterror.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["customErrors"](../modules/_customerrors_.md) › [TimeoutError](_customerrors_.timeouterror.md) 2 | 3 | # Class: TimeoutError 4 | 5 | Error thrown if a request timed out 6 | 7 | ## Hierarchy 8 | 9 | * [Error](_customerrors_.timeouterror.md#static-error) 10 | 11 | ↳ **TimeoutError** 12 | 13 | ## Index 14 | 15 | ### Constructors 16 | 17 | * [constructor](_customerrors_.timeouterror.md#constructor) 18 | 19 | ### Properties 20 | 21 | * [message](_customerrors_.timeouterror.md#message) 22 | * [name](_customerrors_.timeouterror.md#name) 23 | * [stack](_customerrors_.timeouterror.md#optional-stack) 24 | * [Error](_customerrors_.timeouterror.md#static-error) 25 | 26 | ## Constructors 27 | 28 | ### constructor 29 | 30 | \+ **new TimeoutError**(`message`: any): *[TimeoutError](_customerrors_.timeouterror.md)* 31 | 32 | *Defined in [src/customErrors.ts:4](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/customErrors.ts#L4)* 33 | 34 | **Parameters:** 35 | 36 | Name | Type | 37 | ------ | ------ | 38 | `message` | any | 39 | 40 | **Returns:** *[TimeoutError](_customerrors_.timeouterror.md)* 41 | 42 | ## Properties 43 | 44 | ### message 45 | 46 | • **message**: *string* 47 | 48 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[message](_customerrors_.timeouterror.md#message)* 49 | 50 | Defined in node_modules/typescript/lib/lib.es5.d.ts:974 51 | 52 | ___ 53 | 54 | ### name 55 | 56 | • **name**: *string* 57 | 58 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[name](_customerrors_.timeouterror.md#name)* 59 | 60 | Defined in node_modules/typescript/lib/lib.es5.d.ts:973 61 | 62 | ___ 63 | 64 | ### `Optional` stack 65 | 66 | • **stack**? : *string* 67 | 68 | *Inherited from [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 69 | 70 | *Overrides [TimeoutError](_customerrors_.timeouterror.md).[stack](_customerrors_.timeouterror.md#optional-stack)* 71 | 72 | Defined in node_modules/typescript/lib/lib.es5.d.ts:975 73 | 74 | ___ 75 | 76 | ### `Static` Error 77 | 78 | ▪ **Error**: *ErrorConstructor* 79 | 80 | Defined in node_modules/typescript/lib/lib.es5.d.ts:984 81 | -------------------------------------------------------------------------------- /docs/classes/_nexus_.nexus.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["Nexus"](../modules/_nexus_.md) › [Nexus](_nexus_.nexus.md) 2 | 3 | # Class: Nexus 4 | 5 | Main class of the api 6 | 7 | ## Hierarchy 8 | 9 | * **Nexus** 10 | 11 | ## Index 12 | 13 | ### Constructors 14 | 15 | * [constructor](_nexus_.nexus.md#constructor) 16 | 17 | ### Properties 18 | 19 | * [events](_nexus_.nexus.md#events) 20 | 21 | ### Methods 22 | 23 | * [endorseMod](_nexus_.nexus.md#endorsemod) 24 | * [getChangelogs](_nexus_.nexus.md#getchangelogs) 25 | * [getColorschemes](_nexus_.nexus.md#getcolorschemes) 26 | * [getColourschemes](_nexus_.nexus.md#getcolourschemes) 27 | * [getDownloadURLs](_nexus_.nexus.md#getdownloadurls) 28 | * [getEndorsements](_nexus_.nexus.md#getendorsements) 29 | * [getFileByMD5](_nexus_.nexus.md#getfilebymd5) 30 | * [getFileInfo](_nexus_.nexus.md#getfileinfo) 31 | * [getGameInfo](_nexus_.nexus.md#getgameinfo) 32 | * [getGames](_nexus_.nexus.md#getgames) 33 | * [getLatestAdded](_nexus_.nexus.md#getlatestadded) 34 | * [getLatestUpdated](_nexus_.nexus.md#getlatestupdated) 35 | * [getModFiles](_nexus_.nexus.md#getmodfiles) 36 | * [getModInfo](_nexus_.nexus.md#getmodinfo) 37 | * [getOwnIssues](_nexus_.nexus.md#getownissues) 38 | * [getRateLimits](_nexus_.nexus.md#getratelimits) 39 | * [getRecentlyUpdatedMods](_nexus_.nexus.md#getrecentlyupdatedmods) 40 | * [getTrackedMods](_nexus_.nexus.md#gettrackedmods) 41 | * [getTrending](_nexus_.nexus.md#gettrending) 42 | * [getValidationResult](_nexus_.nexus.md#getvalidationresult) 43 | * [sendFeedback](_nexus_.nexus.md#sendfeedback) 44 | * [setGame](_nexus_.nexus.md#setgame) 45 | * [setKey](_nexus_.nexus.md#setkey) 46 | * [trackMod](_nexus_.nexus.md#trackmod) 47 | * [untrackMod](_nexus_.nexus.md#untrackmod) 48 | * [validateKey](_nexus_.nexus.md#validatekey) 49 | * [create](_nexus_.nexus.md#static-create) 50 | * [createWithOAuth](_nexus_.nexus.md#static-createwithoauth) 51 | 52 | ## Constructors 53 | 54 | ### constructor 55 | 56 | \+ **new Nexus**(`appName`: string, `appVersion`: string, `defaultGame`: string, `timeout?`: number): *[Nexus](_nexus_.nexus.md)* 57 | 58 | *Defined in [src/Nexus.ts:200](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L200)* 59 | 60 | Constructor 61 | please don't use this directly, use Nexus.create 62 | 63 | **Parameters:** 64 | 65 | Name | Type | Description | 66 | ------ | ------ | ------ | 67 | `appName` | string | Name of the client application | 68 | `appVersion` | string | Version number of the client application (Needs to be semantic format) | 69 | `defaultGame` | string | (nexus) id of the game requests are made for. Can be overridden per request | 70 | `timeout?` | number | Request timeout in milliseconds. Defaults to 30 seconds | 71 | 72 | **Returns:** *[Nexus](_nexus_.nexus.md)* 73 | 74 | ## Properties 75 | 76 | ### events 77 | 78 | • **events**: *TypedEmitter‹[INexusEvents](../interfaces/_types_.inexusevents.md)›* = new EventEmitter() as TypedEmitter 79 | 80 | *Defined in [src/Nexus.ts:191](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L191)* 81 | 82 | ## Methods 83 | 84 | ### endorseMod 85 | 86 | ▸ **endorseMod**(`modId`: number, `modVersion`: string, `endorseStatus`: "endorse" | "abstain", `gameId?`: string): *Promise‹[IEndorseResponse](../interfaces/_types_.iendorseresponse.md)›* 87 | 88 | *Defined in [src/Nexus.ts:471](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L471)* 89 | 90 | Endorse/Unendorse a mod 91 | 92 | **Parameters:** 93 | 94 | Name | Type | Description | 95 | ------ | ------ | ------ | 96 | `modId` | number | (nexus) id of the mod to endorse | 97 | `modVersion` | string | version of the mod the user has installed (has to correspond to a version that actually exists) | 98 | `endorseStatus` | "endorse" | "abstain" | the new endorsement state | 99 | `gameId?` | string | (nexus) id of the game to endorse | 100 | 101 | **Returns:** *Promise‹[IEndorseResponse](../interfaces/_types_.iendorseresponse.md)›* 102 | 103 | ___ 104 | 105 | ### getChangelogs 106 | 107 | ▸ **getChangelogs**(`modId`: number, `gameId?`: string): *Promise‹[IChangelogs](../interfaces/_types_.ichangelogs.md)›* 108 | 109 | *Defined in [src/Nexus.ts:500](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L500)* 110 | 111 | retrieve all changelogs for a mod 112 | 113 | **Parameters:** 114 | 115 | Name | Type | Description | 116 | ------ | ------ | ------ | 117 | `modId` | number | (nexus) id of the mod | 118 | `gameId?` | string | (nexus) game id | 119 | 120 | **Returns:** *Promise‹[IChangelogs](../interfaces/_types_.ichangelogs.md)›* 121 | 122 | ___ 123 | 124 | ### getColorschemes 125 | 126 | ▸ **getColorschemes**(): *Promise‹[IColourScheme](../interfaces/_types_.icolourscheme.md)[]›* 127 | 128 | *Defined in [src/Nexus.ts:428](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L428)* 129 | 130 | get list of colorschemes 131 | 132 | **Returns:** *Promise‹[IColourScheme](../interfaces/_types_.icolourscheme.md)[]›* 133 | 134 | ___ 135 | 136 | ### getColourschemes 137 | 138 | ▸ **getColourschemes**(): *Promise‹[IColourScheme](../interfaces/_types_.icolourscheme.md)[]›* 139 | 140 | *Defined in [src/Nexus.ts:420](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L420)* 141 | 142 | get list of colourschemes 143 | 144 | **Returns:** *Promise‹[IColourScheme](../interfaces/_types_.icolourscheme.md)[]›* 145 | 146 | ___ 147 | 148 | ### getDownloadURLs 149 | 150 | ▸ **getDownloadURLs**(`modId`: number, `fileId`: number, `key?`: string, `expires?`: number, `gameId?`: string): *Promise‹[IDownloadURL](../interfaces/_types_.idownloadurl.md)[]›* 151 | 152 | *Defined in [src/Nexus.ts:547](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L547)* 153 | 154 | generate download links for a file 155 | If the user isn't premium on Nexus Mods, this requires a key that can only 156 | be generated on the website. The key is part of the nxm links that are generated by the "Download with Manager" buttons. 157 | 158 | **Parameters:** 159 | 160 | Name | Type | Description | 161 | ------ | ------ | ------ | 162 | `modId` | number | id of the mod | 163 | `fileId` | number | id of the file | 164 | `key?` | string | a download key | 165 | `expires?` | number | expiry time of the key | 166 | `gameId?` | string | id of the game | 167 | 168 | **Returns:** *Promise‹[IDownloadURL](../interfaces/_types_.idownloadurl.md)[]›* 169 | 170 | ___ 171 | 172 | ### getEndorsements 173 | 174 | ▸ **getEndorsements**(): *Promise‹[IEndorsement](../interfaces/_types_.iendorsement.md)[]›* 175 | 176 | *Defined in [src/Nexus.ts:412](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L412)* 177 | 178 | get list of endorsements the user has given 179 | 180 | **Returns:** *Promise‹[IEndorsement](../interfaces/_types_.iendorsement.md)[]›* 181 | 182 | ___ 183 | 184 | ### getFileByMD5 185 | 186 | ▸ **getFileByMD5**(`hash`: string, `gameId?`: string): *Promise‹[IMD5Result](../interfaces/_types_.imd5result.md)[]›* 187 | 188 | *Defined in [src/Nexus.ts:572](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L572)* 189 | 190 | find information about a file based on its md5 hash 191 | This can be used to find info about a file when you don't have its modid and fileid 192 | Note that technically there may be multiple results for the same md5 hash, either the same 193 | file uploaded in different places or (less likely) different files that just happen to have 194 | the same hash. 195 | This function will return all of them, you will have to sort out from the result which file 196 | you were actually looking for (e.g. by comparing size) 197 | 198 | **Parameters:** 199 | 200 | Name | Type | Description | 201 | ------ | ------ | ------ | 202 | `hash` | string | the md5 hash of the file | 203 | `gameId?` | string | the game to search in | 204 | 205 | **Returns:** *Promise‹[IMD5Result](../interfaces/_types_.imd5result.md)[]›* 206 | 207 | ___ 208 | 209 | ### getFileInfo 210 | 211 | ▸ **getFileInfo**(`modId`: number, `fileId`: number, `gameId?`: string): *Promise‹[IFileInfo](../interfaces/_types_.ifileinfo.md)›* 212 | 213 | *Defined in [src/Nexus.ts:528](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L528)* 214 | 215 | get details about a file 216 | 217 | **Parameters:** 218 | 219 | Name | Type | Description | 220 | ------ | ------ | ------ | 221 | `modId` | number | (nexus) id of the mod | 222 | `fileId` | number | (nexus) id of the file | 223 | `gameId?` | string | (nexus) id of the game | 224 | 225 | **Returns:** *Promise‹[IFileInfo](../interfaces/_types_.ifileinfo.md)›* 226 | 227 | ___ 228 | 229 | ### getGameInfo 230 | 231 | ▸ **getGameInfo**(`gameId?`: string): *Promise‹[IGameInfo](../interfaces/_types_.igameinfo.md)›* 232 | 233 | *Defined in [src/Nexus.ts:440](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L440)* 234 | 235 | retrieve details about a specific game 236 | 237 | **Parameters:** 238 | 239 | Name | Type | Description | 240 | ------ | ------ | ------ | 241 | `gameId?` | string | (nexus) game id to request | 242 | 243 | **Returns:** *Promise‹[IGameInfo](../interfaces/_types_.igameinfo.md)›* 244 | 245 | ___ 246 | 247 | ### getGames 248 | 249 | ▸ **getGames**(): *Promise‹[IGameListEntry](../interfaces/_types_.igamelistentry.md)[]›* 250 | 251 | *Defined in [src/Nexus.ts:371](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L371)* 252 | 253 | retrieve a list of all games currently supported by Nexus Mods 254 | 255 | **Returns:** *Promise‹[IGameListEntry](../interfaces/_types_.igamelistentry.md)[]›* 256 | 257 | list of games 258 | 259 | ___ 260 | 261 | ### getLatestAdded 262 | 263 | ▸ **getLatestAdded**(`gameId?`: string): *Promise‹[IModInfo](../interfaces/_types_.imodinfo.md)[]›* 264 | 265 | *Defined in [src/Nexus.ts:380](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L380)* 266 | 267 | get list of the latest added mods 268 | 269 | **Parameters:** 270 | 271 | Name | Type | Description | 272 | ------ | ------ | ------ | 273 | `gameId?` | string | id of the game to query | 274 | 275 | **Returns:** *Promise‹[IModInfo](../interfaces/_types_.imodinfo.md)[]›* 276 | 277 | ___ 278 | 279 | ### getLatestUpdated 280 | 281 | ▸ **getLatestUpdated**(`gameId?`: string): *Promise‹[IModInfo](../interfaces/_types_.imodinfo.md)[]›* 282 | 283 | *Defined in [src/Nexus.ts:391](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L391)* 284 | 285 | get list of the latest updated mods 286 | 287 | **Parameters:** 288 | 289 | Name | Type | Description | 290 | ------ | ------ | ------ | 291 | `gameId?` | string | id of the game to query | 292 | 293 | **Returns:** *Promise‹[IModInfo](../interfaces/_types_.imodinfo.md)[]›* 294 | 295 | ___ 296 | 297 | ### getModFiles 298 | 299 | ▸ **getModFiles**(`modId`: number, `gameId?`: string): *Promise‹[IModFiles](../interfaces/_types_.imodfiles.md)›* 300 | 301 | *Defined in [src/Nexus.ts:512](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L512)* 302 | 303 | get list of all files uploaded for a mod 304 | 305 | **Parameters:** 306 | 307 | Name | Type | Description | 308 | ------ | ------ | ------ | 309 | `modId` | number | (nexus) id of the mod | 310 | `gameId?` | string | (nexus) game id | 311 | 312 | **Returns:** *Promise‹[IModFiles](../interfaces/_types_.imodfiles.md)›* 313 | 314 | ___ 315 | 316 | ### getModInfo 317 | 318 | ▸ **getModInfo**(`modId`: number, `gameId?`: string): *Promise‹[IModInfo](../interfaces/_types_.imodinfo.md)›* 319 | 320 | *Defined in [src/Nexus.ts:488](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L488)* 321 | 322 | retrieve details about a mod 323 | 324 | **Parameters:** 325 | 326 | Name | Type | Description | 327 | ------ | ------ | ------ | 328 | `modId` | number | (nexus) id of the mod | 329 | `gameId?` | string | (nexus) game id | 330 | 331 | **Returns:** *Promise‹[IModInfo](../interfaces/_types_.imodinfo.md)›* 332 | 333 | ___ 334 | 335 | ### getOwnIssues 336 | 337 | ▸ **getOwnIssues**(): *Promise‹[IIssue](../interfaces/_types_.iissue.md)[]›* 338 | 339 | *Defined in [src/Nexus.ts:598](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L598)* 340 | 341 | get list of issues reported by this user 342 | FOR INTERNAL USE ONLY 343 | 344 | **Returns:** *Promise‹[IIssue](../interfaces/_types_.iissue.md)[]›* 345 | 346 | ___ 347 | 348 | ### getRateLimits 349 | 350 | ▸ **getRateLimits**(): *object* 351 | 352 | *Defined in [src/Nexus.ts:300](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L300)* 353 | 354 | **Returns:** *object* 355 | 356 | * **daily**: *number* 357 | 358 | * **hourly**: *number* 359 | 360 | ___ 361 | 362 | ### getRecentlyUpdatedMods 363 | 364 | ▸ **getRecentlyUpdatedMods**(`period`: types.UpdatePeriod, `gameId?`: string): *Promise‹[IUpdateEntry](../interfaces/_types_.iupdateentry.md)[]›* 365 | 366 | *Defined in [src/Nexus.ts:453](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L453)* 367 | 368 | retrieve list of mods for a game that has recently been updated 369 | 370 | **Parameters:** 371 | 372 | Name | Type | Description | 373 | ------ | ------ | ------ | 374 | `period` | types.UpdatePeriod | rough time range to retrieve. This is limited to specific periods (1d, 1w, 1m) because the list is cached on the server | 375 | `gameId?` | string | (nexus) game id to request | 376 | 377 | **Returns:** *Promise‹[IUpdateEntry](../interfaces/_types_.iupdateentry.md)[]›* 378 | 379 | ___ 380 | 381 | ### getTrackedMods 382 | 383 | ▸ **getTrackedMods**(): *Promise‹[ITrackedMod](../interfaces/_types_.itrackedmod.md)[]›* 384 | 385 | *Defined in [src/Nexus.ts:323](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L323)* 386 | 387 | Get list of all mods being tracked by the user 388 | 389 | **Returns:** *Promise‹[ITrackedMod](../interfaces/_types_.itrackedmod.md)[]›* 390 | 391 | ___ 392 | 393 | ### getTrending 394 | 395 | ▸ **getTrending**(`gameId?`: string): *Promise‹[IModInfo](../interfaces/_types_.imodinfo.md)[]›* 396 | 397 | *Defined in [src/Nexus.ts:402](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L402)* 398 | 399 | get list of trending mods 400 | 401 | **Parameters:** 402 | 403 | Name | Type | Description | 404 | ------ | ------ | ------ | 405 | `gameId?` | string | id of the game to query | 406 | 407 | **Returns:** *Promise‹[IModInfo](../interfaces/_types_.imodinfo.md)[]›* 408 | 409 | ___ 410 | 411 | ### getValidationResult 412 | 413 | ▸ **getValidationResult**(): *[IValidateKeyResponse](../interfaces/_types_.ivalidatekeyresponse.md)* 414 | 415 | *Defined in [src/Nexus.ts:274](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L274)* 416 | 417 | retrieve the result of the last key validation. 418 | This is useful primarily after creating the object with Nexus.create 419 | 420 | **Returns:** *[IValidateKeyResponse](../interfaces/_types_.ivalidatekeyresponse.md)* 421 | 422 | ___ 423 | 424 | ### sendFeedback 425 | 426 | ▸ **sendFeedback**(`title`: string, `message`: string, `fileBundle`: string, `anonymous`: boolean, `groupingKey?`: string, `id?`: string): *Promise‹[IFeedbackResponse](../interfaces/_types_.ifeedbackresponse.md)›* 427 | 428 | *Defined in [src/Nexus.ts:615](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L615)* 429 | 430 | send a feedback message 431 | FOR INTERNAL USE ONLY 432 | 433 | **Parameters:** 434 | 435 | Name | Type | Description | 436 | ------ | ------ | ------ | 437 | `title` | string | title of the message | 438 | `message` | string | content | 439 | `fileBundle` | string | path to an archive that is sent along | 440 | `anonymous` | boolean | whether the report should be made anonymously | 441 | `groupingKey?` | string | a key that is used to group identical reports | 442 | `id?` | string | reference id | 443 | 444 | **Returns:** *Promise‹[IFeedbackResponse](../interfaces/_types_.ifeedbackresponse.md)›* 445 | 446 | ___ 447 | 448 | ### setGame 449 | 450 | ▸ **setGame**(`gameId`: string): *void* 451 | 452 | *Defined in [src/Nexus.ts:266](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L266)* 453 | 454 | change the default game id 455 | 456 | **Parameters:** 457 | 458 | Name | Type | Description | 459 | ------ | ------ | ------ | 460 | `gameId` | string | game id | 461 | 462 | **Returns:** *void* 463 | 464 | ___ 465 | 466 | ### setKey 467 | 468 | ▸ **setKey**(`apiKey`: string): *Promise‹[IValidateKeyResponse](../interfaces/_types_.ivalidatekeyresponse.md)›* 469 | 470 | *Defined in [src/Nexus.ts:283](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L283)* 471 | 472 | change the API Key and validate it This can also be used to unset the key 473 | 474 | **Parameters:** 475 | 476 | Name | Type | Description | 477 | ------ | ------ | ------ | 478 | `apiKey` | string | the new api key to set | 479 | 480 | **Returns:** *Promise‹[IValidateKeyResponse](../interfaces/_types_.ivalidatekeyresponse.md)›* 481 | 482 | A promise that resolves to the user info on success or null if the apikey was undefined 483 | 484 | ___ 485 | 486 | ### trackMod 487 | 488 | ▸ **trackMod**(`modId`: string, `gameId?`: string): *Promise‹[ITrackResponse](../interfaces/_types_.itrackresponse.md)›* 489 | 490 | *Defined in [src/Nexus.ts:334](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L334)* 491 | 492 | start tracking a mod 493 | 494 | **Parameters:** 495 | 496 | Name | Type | Description | 497 | ------ | ------ | ------ | 498 | `modId` | string | id of the mod | 499 | `gameId?` | string | id of the game | 500 | 501 | **Returns:** *Promise‹[ITrackResponse](../interfaces/_types_.itrackresponse.md)›* 502 | 503 | ___ 504 | 505 | ### untrackMod 506 | 507 | ▸ **untrackMod**(`modId`: string, `gameId?`: string): *Promise‹[ITrackResponse](../interfaces/_types_.itrackresponse.md)›* 508 | 509 | *Defined in [src/Nexus.ts:353](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L353)* 510 | 511 | stop tracking a mod 512 | 513 | **Parameters:** 514 | 515 | Name | Type | Description | 516 | ------ | ------ | ------ | 517 | `modId` | string | id of the mod | 518 | `gameId?` | string | id of the game | 519 | 520 | **Returns:** *Promise‹[ITrackResponse](../interfaces/_types_.itrackresponse.md)›* 521 | 522 | ___ 523 | 524 | ### validateKey 525 | 526 | ▸ **validateKey**(`key?`: string): *Promise‹[IValidateKeyResponse](../interfaces/_types_.ivalidatekeyresponse.md)›* 527 | 528 | *Defined in [src/Nexus.ts:314](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L314)* 529 | 530 | validate a specific API key 531 | This does not update the request quota or the cached validation result so it's 532 | not useful for re-checking the key after a validation error. 533 | 534 | **Parameters:** 535 | 536 | Name | Type | Description | 537 | ------ | ------ | ------ | 538 | `key?` | string | the API key to validate. Tests the current one if left undefined | 539 | 540 | **Returns:** *Promise‹[IValidateKeyResponse](../interfaces/_types_.ivalidatekeyresponse.md)›* 541 | 542 | ___ 543 | 544 | ### `Static` create 545 | 546 | ▸ **create**(`apiKey`: string, `appName`: string, `appVersion`: string, `defaultGame`: string, `timeout?`: number): *Promise‹[Nexus](_nexus_.nexus.md)›* 547 | 548 | *Defined in [src/Nexus.ts:248](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L248)* 549 | 550 | create a Nexus instance and immediately verify the API Key 551 | 552 | **Parameters:** 553 | 554 | Name | Type | Description | 555 | ------ | ------ | ------ | 556 | `apiKey` | string | the api key to use for connections | 557 | `appName` | string | name of the client application | 558 | `appVersion` | string | Version number of the client application (Needs to be semantic format) | 559 | `defaultGame` | string | (nexus) id of the game requests are made for. Can be overridden per request | 560 | `timeout?` | number | Request timeout in milliseconds. Defaults to 5000ms | 561 | 562 | **Returns:** *Promise‹[Nexus](_nexus_.nexus.md)›* 563 | 564 | ___ 565 | 566 | ### `Static` createWithOAuth 567 | 568 | ▸ **createWithOAuth**(`credentials`: [IOAuthCredentials](../interfaces/_types_.ioauthcredentials.md), `config`: [IOAuthConfig](../interfaces/_types_.ioauthconfig.md), `appName`: string, `appVersion`: string, `defaultGame`: string, `timeout?`: number): *Promise‹[Nexus](_nexus_.nexus.md)›* 569 | 570 | *Defined in [src/Nexus.ts:254](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L254)* 571 | 572 | **Parameters:** 573 | 574 | Name | Type | 575 | ------ | ------ | 576 | `credentials` | [IOAuthCredentials](../interfaces/_types_.ioauthcredentials.md) | 577 | `config` | [IOAuthConfig](../interfaces/_types_.ioauthconfig.md) | 578 | `appName` | string | 579 | `appVersion` | string | 580 | `defaultGame` | string | 581 | `timeout?` | number | 582 | 583 | **Returns:** *Promise‹[Nexus](_nexus_.nexus.md)›* 584 | -------------------------------------------------------------------------------- /docs/classes/_quota_.quota.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["Quota"](../modules/_quota_.md) › [Quota](_quota_.quota.md) 2 | 3 | # Class: Quota 4 | 5 | ## Hierarchy 6 | 7 | * **Quota** 8 | 9 | ## Index 10 | 11 | ### Constructors 12 | 13 | * [constructor](_quota_.quota.md#constructor) 14 | 15 | ### Methods 16 | 17 | * [block](_quota_.quota.md#block) 18 | * [updateLimit](_quota_.quota.md#updatelimit) 19 | * [wait](_quota_.quota.md#wait) 20 | 21 | ## Constructors 22 | 23 | ### constructor 24 | 25 | \+ **new Quota**(`init`: number, `max`: number, `msPerIncrement`: number): *[Quota](_quota_.quota.md)* 26 | 27 | *Defined in [src/Quota.ts:17](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Quota.ts#L17)* 28 | 29 | **Parameters:** 30 | 31 | Name | Type | 32 | ------ | ------ | 33 | `init` | number | 34 | `max` | number | 35 | `msPerIncrement` | number | 36 | 37 | **Returns:** *[Quota](_quota_.quota.md)* 38 | 39 | ## Methods 40 | 41 | ### block 42 | 43 | ▸ **block**(): *boolean* 44 | 45 | *Defined in [src/Quota.ts:35](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Quota.ts#L35)* 46 | 47 | signal that the request was blocked by the server with an error code that 48 | indicates client is sending too many requests 49 | returns true if the rate limit is actually used up so we won't be able to 50 | make requests for a while, false if it's likely a temporary problem. 51 | 52 | **Returns:** *boolean* 53 | 54 | ___ 55 | 56 | ### updateLimit 57 | 58 | ▸ **updateLimit**(`limit`: number): *void* 59 | 60 | *Defined in [src/Quota.ts:25](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Quota.ts#L25)* 61 | 62 | **Parameters:** 63 | 64 | Name | Type | 65 | ------ | ------ | 66 | `limit` | number | 67 | 68 | **Returns:** *void* 69 | 70 | ___ 71 | 72 | ### wait 73 | 74 | ▸ **wait**(): *Promise‹void›* 75 | 76 | *Defined in [src/Quota.ts:47](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Quota.ts#L47)* 77 | 78 | **Returns:** *Promise‹void›* 79 | -------------------------------------------------------------------------------- /docs/globals.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](README.md) › [Globals](globals.md) 2 | 3 | # @nexusmods/nexus-api 4 | 5 | ## Index 6 | 7 | ### Modules 8 | 9 | * ["Nexus"](modules/_nexus_.md) 10 | * ["Quota"](modules/_quota_.md) 11 | * ["customErrors"](modules/_customerrors_.md) 12 | * ["index"](modules/_index_.md) 13 | * ["parameters"](modules/_parameters_.md) 14 | * ["types"](modules/_types_.md) 15 | -------------------------------------------------------------------------------- /docs/interfaces/_nexus_.irequestargs.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["Nexus"](../modules/_nexus_.md) › [IRequestArgs](_nexus_.irequestargs.md) 2 | 3 | # Interface: IRequestArgs 4 | 5 | ## Hierarchy 6 | 7 | * **IRequestArgs** 8 | 9 | ## Index 10 | 11 | ### Properties 12 | 13 | * [cookies](_nexus_.irequestargs.md#optional-cookies) 14 | * [data](_nexus_.irequestargs.md#optional-data) 15 | * [headers](_nexus_.irequestargs.md#optional-headers) 16 | * [method](_nexus_.irequestargs.md#optional-method) 17 | * [path](_nexus_.irequestargs.md#optional-path) 18 | * [requestConfig](_nexus_.irequestargs.md#optional-requestconfig) 19 | * [responseConfig](_nexus_.irequestargs.md#optional-responseconfig) 20 | 21 | ## Properties 22 | 23 | ### `Optional` cookies 24 | 25 | • **cookies**? : *any* 26 | 27 | *Defined in [src/Nexus.ts:21](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L21)* 28 | 29 | ___ 30 | 31 | ### `Optional` data 32 | 33 | • **data**? : *any* 34 | 35 | *Defined in [src/Nexus.ts:23](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L23)* 36 | 37 | ___ 38 | 39 | ### `Optional` headers 40 | 41 | • **headers**? : *any* 42 | 43 | *Defined in [src/Nexus.ts:20](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L20)* 44 | 45 | ___ 46 | 47 | ### `Optional` method 48 | 49 | • **method**? : *[REST_METHOD](../modules/_nexus_.md#rest_method)* 50 | 51 | *Defined in [src/Nexus.ts:24](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L24)* 52 | 53 | ___ 54 | 55 | ### `Optional` path 56 | 57 | • **path**? : *any* 58 | 59 | *Defined in [src/Nexus.ts:22](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L22)* 60 | 61 | ___ 62 | 63 | ### `Optional` requestConfig 64 | 65 | • **requestConfig**? : *object* 66 | 67 | *Defined in [src/Nexus.ts:25](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L25)* 68 | 69 | #### Type declaration: 70 | 71 | * **noDelay**: *boolean* 72 | 73 | * **securityProtocol**: *string* 74 | 75 | * **timeout**: *number* 76 | 77 | ___ 78 | 79 | ### `Optional` responseConfig 80 | 81 | • **responseConfig**? : *object* 82 | 83 | *Defined in [src/Nexus.ts:30](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L30)* 84 | 85 | #### Type declaration: 86 | 87 | * **timeout**: *number* 88 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.icategory.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [ICategory](_types_.icategory.md) 2 | 3 | # Interface: ICategory 4 | 5 | Nexus Mods category 6 | 7 | ## Hierarchy 8 | 9 | * **ICategory** 10 | 11 | ## Index 12 | 13 | ### Properties 14 | 15 | * [category_id](_types_.icategory.md#category_id) 16 | * [name](_types_.icategory.md#name) 17 | * [parent_category](_types_.icategory.md#parent_category) 18 | 19 | ## Properties 20 | 21 | ### category_id 22 | 23 | • **category_id**: *number* 24 | 25 | *Defined in [src/types.ts:280](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L280)* 26 | 27 | numerical id 28 | 29 | ___ 30 | 31 | ### name 32 | 33 | • **name**: *string* 34 | 35 | *Defined in [src/types.ts:284](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L284)* 36 | 37 | display name 38 | 39 | ___ 40 | 41 | ### parent_category 42 | 43 | • **parent_category**: *number | false* 44 | 45 | *Defined in [src/types.ts:292](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L292)* 46 | 47 | id of the parent category or false if it's a top-level 48 | category. 49 | Note: often there is only a single root category named after the game. 50 | But in some cases there are additional roots, e.g. the game 'skyrim' has 51 | the roots 'Skyrim' and 'Sure AI: Enderal' 52 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.ichangelogs.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IChangelogs](_types_.ichangelogs.md) 2 | 3 | # Interface: IChangelogs 4 | 5 | response to a request for changelogs 6 | 7 | ## Hierarchy 8 | 9 | * **IChangelogs** 10 | 11 | ## Indexable 12 | 13 | * \[ **versionNumber**: *string*\]: string[] 14 | 15 | response to a request for changelogs 16 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.icolourscheme.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IColourScheme](_types_.icolourscheme.md) 2 | 3 | # Interface: IColourScheme 4 | 5 | colourscheme entry as returned by getColourSchemes 6 | 7 | ## Hierarchy 8 | 9 | * **IColourScheme** 10 | 11 | ## Index 12 | 13 | ### Properties 14 | 15 | * [darker_colour](_types_.icolourscheme.md#darker_colour) 16 | * [id](_types_.icolourscheme.md#id) 17 | * [name](_types_.icolourscheme.md#name) 18 | * [primary_colour](_types_.icolourscheme.md#primary_colour) 19 | * [secondary_colour](_types_.icolourscheme.md#secondary_colour) 20 | 21 | ## Properties 22 | 23 | ### darker_colour 24 | 25 | • **darker_colour**: *string* 26 | 27 | *Defined in [src/types.ts:481](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L481)* 28 | 29 | ___ 30 | 31 | ### id 32 | 33 | • **id**: *number* 34 | 35 | *Defined in [src/types.ts:477](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L477)* 36 | 37 | ___ 38 | 39 | ### name 40 | 41 | • **name**: *string* 42 | 43 | *Defined in [src/types.ts:478](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L478)* 44 | 45 | ___ 46 | 47 | ### primary_colour 48 | 49 | • **primary_colour**: *string* 50 | 51 | *Defined in [src/types.ts:479](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L479)* 52 | 53 | ___ 54 | 55 | ### secondary_colour 56 | 57 | • **secondary_colour**: *string* 58 | 59 | *Defined in [src/types.ts:480](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L480)* 60 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.idownloadurl.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IDownloadURL](_types_.idownloadurl.md) 2 | 3 | # Interface: IDownloadURL 4 | 5 | direct download url for a file from nexus 6 | Please note that these links have an expiry time, it's not 7 | useful to store it for more than a few minutes 8 | 9 | ## Hierarchy 10 | 11 | * **IDownloadURL** 12 | 13 | ## Index 14 | 15 | ### Properties 16 | 17 | * [URI](_types_.idownloadurl.md#uri) 18 | * [name](_types_.idownloadurl.md#name) 19 | * [short_name](_types_.idownloadurl.md#short_name) 20 | 21 | ## Properties 22 | 23 | ### URI 24 | 25 | • **URI**: *string* 26 | 27 | *Defined in [src/types.ts:361](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L361)* 28 | 29 | the url itself 30 | 31 | ___ 32 | 33 | ### name 34 | 35 | • **name**: *string* 36 | 37 | *Defined in [src/types.ts:365](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L365)* 38 | 39 | Display name of the download server hosting the file 40 | 41 | ___ 42 | 43 | ### short_name 44 | 45 | • **short_name**: *string* 46 | 47 | *Defined in [src/types.ts:369](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L369)* 48 | 49 | short name (id?) of the download server 50 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.iendorsement.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IEndorsement](_types_.iendorsement.md) 2 | 3 | # Interface: IEndorsement 4 | 5 | response to a request for endorsements 6 | 7 | ## Hierarchy 8 | 9 | * **IEndorsement** 10 | 11 | ## Index 12 | 13 | ### Properties 14 | 15 | * [date](_types_.iendorsement.md#date) 16 | * [domain_name](_types_.iendorsement.md#domain_name) 17 | * [mod_id](_types_.iendorsement.md#mod_id) 18 | * [status](_types_.iendorsement.md#status) 19 | * [version](_types_.iendorsement.md#version) 20 | 21 | ## Properties 22 | 23 | ### date 24 | 25 | • **date**: *number* 26 | 27 | *Defined in [src/types.ts:447](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L447)* 28 | 29 | ___ 30 | 31 | ### domain_name 32 | 33 | • **domain_name**: *string* 34 | 35 | *Defined in [src/types.ts:446](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L446)* 36 | 37 | ___ 38 | 39 | ### mod_id 40 | 41 | • **mod_id**: *number* 42 | 43 | *Defined in [src/types.ts:445](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L445)* 44 | 45 | ___ 46 | 47 | ### status 48 | 49 | • **status**: *[EndorsedStatus](../modules/_types_.md#endorsedstatus)* 50 | 51 | *Defined in [src/types.ts:449](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L449)* 52 | 53 | ___ 54 | 55 | ### version 56 | 57 | • **version**: *string* 58 | 59 | *Defined in [src/types.ts:448](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L448)* 60 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.iendorseresponse.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IEndorseResponse](_types_.iendorseresponse.md) 2 | 3 | # Interface: IEndorseResponse 4 | 5 | (success) response to a endorse/abstain request 6 | 7 | ## Hierarchy 8 | 9 | * **IEndorseResponse** 10 | 11 | ## Index 12 | 13 | ### Properties 14 | 15 | * [message](_types_.iendorseresponse.md#message) 16 | * [status](_types_.iendorseresponse.md#status) 17 | 18 | ## Properties 19 | 20 | ### message 21 | 22 | • **message**: *string* 23 | 24 | *Defined in [src/types.ts:459](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L459)* 25 | 26 | textual reply to the request, something like "Updated to: Endorsed" 27 | 28 | ___ 29 | 30 | ### status 31 | 32 | • **status**: *[EndorsedStatus](../modules/_types_.md#endorsedstatus)* 33 | 34 | *Defined in [src/types.ts:460](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L460)* 35 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.ifeedbackresponse.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IFeedbackResponse](_types_.ifeedbackresponse.md) 2 | 3 | # Interface: IFeedbackResponse 4 | 5 | response to a feedback request 6 | INTERNAL USE ONLY 7 | 8 | ## Hierarchy 9 | 10 | * **IFeedbackResponse** 11 | 12 | ## Index 13 | 14 | ### Properties 15 | 16 | * [count](_types_.ifeedbackresponse.md#count) 17 | * [created_at](_types_.ifeedbackresponse.md#created_at) 18 | * [github_issue](_types_.ifeedbackresponse.md#github_issue) 19 | * [grouping_key](_types_.ifeedbackresponse.md#grouping_key) 20 | * [id](_types_.ifeedbackresponse.md#id) 21 | * [reference](_types_.ifeedbackresponse.md#reference) 22 | * [status](_types_.ifeedbackresponse.md#status) 23 | * [updated_at](_types_.ifeedbackresponse.md#updated_at) 24 | * [user_blacklisted](_types_.ifeedbackresponse.md#user_blacklisted) 25 | 26 | ## Properties 27 | 28 | ### count 29 | 30 | • **count**: *number* 31 | 32 | *Defined in [src/types.ts:423](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L423)* 33 | 34 | ___ 35 | 36 | ### created_at 37 | 38 | • **created_at**: *string* 39 | 40 | *Defined in [src/types.ts:417](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L417)* 41 | 42 | ___ 43 | 44 | ### github_issue 45 | 46 | • **github_issue**: *[IGithubIssue](_types_.igithubissue.md)* 47 | 48 | *Defined in [src/types.ts:421](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L421)* 49 | 50 | ___ 51 | 52 | ### grouping_key 53 | 54 | • **grouping_key**: *string* 55 | 56 | *Defined in [src/types.ts:420](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L420)* 57 | 58 | ___ 59 | 60 | ### id 61 | 62 | • **id**: *number* 63 | 64 | *Defined in [src/types.ts:415](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L415)* 65 | 66 | ___ 67 | 68 | ### reference 69 | 70 | • **reference**: *string* 71 | 72 | *Defined in [src/types.ts:419](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L419)* 73 | 74 | ___ 75 | 76 | ### status 77 | 78 | • **status**: *number* 79 | 80 | *Defined in [src/types.ts:416](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L416)* 81 | 82 | ___ 83 | 84 | ### updated_at 85 | 86 | • **updated_at**: *string* 87 | 88 | *Defined in [src/types.ts:418](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L418)* 89 | 90 | ___ 91 | 92 | ### user_blacklisted 93 | 94 | • **user_blacklisted**: *boolean* 95 | 96 | *Defined in [src/types.ts:422](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L422)* 97 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.ifileinfo.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IFileInfo](_types_.ifileinfo.md) 2 | 3 | # Interface: IFileInfo 4 | 5 | Information about a specific mod file 6 | 7 | ## Hierarchy 8 | 9 | * **IFileInfo** 10 | 11 | ## Index 12 | 13 | ### Properties 14 | 15 | * [category_id](_types_.ifileinfo.md#category_id) 16 | * [category_name](_types_.ifileinfo.md#category_name) 17 | * [changelog_html](_types_.ifileinfo.md#changelog_html) 18 | * [content_preview_link](_types_.ifileinfo.md#content_preview_link) 19 | * [description](_types_.ifileinfo.md#description) 20 | * [external_virus_scan_url](_types_.ifileinfo.md#external_virus_scan_url) 21 | * [file_id](_types_.ifileinfo.md#file_id) 22 | * [file_name](_types_.ifileinfo.md#file_name) 23 | * [is_primary](_types_.ifileinfo.md#is_primary) 24 | * [mod_version](_types_.ifileinfo.md#mod_version) 25 | * [name](_types_.ifileinfo.md#name) 26 | * [size](_types_.ifileinfo.md#size) 27 | * [size_kb](_types_.ifileinfo.md#size_kb) 28 | * [uploaded_time](_types_.ifileinfo.md#uploaded_time) 29 | * [uploaded_timestamp](_types_.ifileinfo.md#uploaded_timestamp) 30 | * [version](_types_.ifileinfo.md#version) 31 | 32 | ## Properties 33 | 34 | ### category_id 35 | 36 | • **category_id**: *number* 37 | 38 | *Defined in [src/types.ts:165](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L165)* 39 | 40 | File type as a number (1 = main, 2 = patch, 3 = optional, 4 = old, 6 = deleted) 41 | 42 | ___ 43 | 44 | ### category_name 45 | 46 | • **category_name**: *string* 47 | 48 | *Defined in [src/types.ts:169](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L169)* 49 | 50 | File type as a string ('MAIN', 'PATCH', 'OPTION', 'OLD_VERSION', 'DELETED') 51 | 52 | ___ 53 | 54 | ### changelog_html 55 | 56 | • **changelog_html**: *string* 57 | 58 | *Defined in [src/types.ts:174](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L174)* 59 | 60 | html encoded changelog (matched via file version) 61 | null if there is none 62 | 63 | ___ 64 | 65 | ### content_preview_link 66 | 67 | • **content_preview_link**: *string* 68 | 69 | *Defined in [src/types.ts:178](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L178)* 70 | 71 | url of the content preview (json file containing list of files) 72 | 73 | ___ 74 | 75 | ### description 76 | 77 | • **description**: *string* 78 | 79 | *Defined in [src/types.ts:186](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L186)* 80 | 81 | file description 82 | 83 | ___ 84 | 85 | ### external_virus_scan_url 86 | 87 | • **external_virus_scan_url**: *string* 88 | 89 | *Defined in [src/types.ts:219](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L219)* 90 | 91 | link to the virus scan results 92 | null if there is none 93 | 94 | ___ 95 | 96 | ### file_id 97 | 98 | • **file_id**: *number* 99 | 100 | *Defined in [src/types.ts:161](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L161)* 101 | 102 | file id 103 | 104 | ___ 105 | 106 | ### file_name 107 | 108 | • **file_name**: *string* 109 | 110 | *Defined in [src/types.ts:202](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L202)* 111 | 112 | actual file name (derived from name with id and version appended) 113 | 114 | ___ 115 | 116 | ### is_primary 117 | 118 | • **is_primary**: *boolean* 119 | 120 | *Defined in [src/types.ts:224](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L224)* 121 | 122 | whether this is the primary download for the mod 123 | (the one that users download through the link in the top right of the mod page) 124 | 125 | ___ 126 | 127 | ### mod_version 128 | 129 | • **mod_version**: *string* 130 | 131 | *Defined in [src/types.ts:214](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L214)* 132 | 133 | version of the mod (at the time this was uploaded?) 134 | 135 | ___ 136 | 137 | ### name 138 | 139 | • **name**: *string* 140 | 141 | *Defined in [src/types.ts:182](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L182)* 142 | 143 | readable file name 144 | 145 | ___ 146 | 147 | ### size 148 | 149 | • **size**: *number* 150 | 151 | *Defined in [src/types.ts:194](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L194)* 152 | 153 | File size in kilobytes 154 | 155 | ___ 156 | 157 | ### size_kb 158 | 159 | • **size_kb**: *number* 160 | 161 | *Defined in [src/types.ts:198](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L198)* 162 | 163 | File size. also in kilobytes. Because - ugh, don't ask 164 | 165 | ___ 166 | 167 | ### uploaded_time 168 | 169 | • **uploaded_time**: *string* 170 | 171 | *Defined in [src/types.ts:210](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L210)* 172 | 173 | readable representation of the file time 174 | 175 | ___ 176 | 177 | ### uploaded_timestamp 178 | 179 | • **uploaded_timestamp**: *number* 180 | 181 | *Defined in [src/types.ts:206](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L206)* 182 | 183 | unix timestamp of the time this file was uploaded 184 | 185 | ___ 186 | 187 | ### version 188 | 189 | • **version**: *string* 190 | 191 | *Defined in [src/types.ts:190](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L190)* 192 | 193 | File version (doesn't actually have to match any mod version) 194 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.ifileupdate.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IFileUpdate](_types_.ifileupdate.md) 2 | 3 | # Interface: IFileUpdate 4 | 5 | details about a file update 6 | These exist only if the author sets the field "this file is 7 | a newer version of ...". 8 | 9 | ## Hierarchy 10 | 11 | * **IFileUpdate** 12 | 13 | ## Index 14 | 15 | ### Properties 16 | 17 | * [new_file_id](_types_.ifileupdate.md#new_file_id) 18 | * [new_file_name](_types_.ifileupdate.md#new_file_name) 19 | * [old_file_id](_types_.ifileupdate.md#old_file_id) 20 | * [old_file_name](_types_.ifileupdate.md#old_file_name) 21 | * [uploaded_time](_types_.ifileupdate.md#uploaded_time) 22 | * [uploaded_timestamp](_types_.ifileupdate.md#uploaded_timestamp) 23 | 24 | ## Properties 25 | 26 | ### new_file_id 27 | 28 | • **new_file_id**: *number* 29 | 30 | *Defined in [src/types.ts:250](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L250)* 31 | 32 | id of the new file 33 | 34 | ___ 35 | 36 | ### new_file_name 37 | 38 | • **new_file_name**: *string* 39 | 40 | *Defined in [src/types.ts:254](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L254)* 41 | 42 | name of the new file 43 | 44 | ___ 45 | 46 | ### old_file_id 47 | 48 | • **old_file_id**: *number* 49 | 50 | *Defined in [src/types.ts:258](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L258)* 51 | 52 | id of the old file 53 | 54 | ___ 55 | 56 | ### old_file_name 57 | 58 | • **old_file_name**: *string* 59 | 60 | *Defined in [src/types.ts:262](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L262)* 61 | 62 | name of the old file 63 | 64 | ___ 65 | 66 | ### uploaded_time 67 | 68 | • **uploaded_time**: *string* 69 | 70 | *Defined in [src/types.ts:266](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L266)* 71 | 72 | readable upload time of the new file 73 | 74 | ___ 75 | 76 | ### uploaded_timestamp 77 | 78 | • **uploaded_timestamp**: *number* 79 | 80 | *Defined in [src/types.ts:270](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L270)* 81 | 82 | unix timestamp of when the new file was uploaded 83 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.igameinfo.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IGameInfo](_types_.igameinfo.md) 2 | 3 | # Interface: IGameInfo 4 | 5 | extended information about a game 6 | 7 | ## Hierarchy 8 | 9 | * [IGameListEntry](_types_.igamelistentry.md) 10 | 11 | ↳ **IGameInfo** 12 | 13 | ## Index 14 | 15 | ### Properties 16 | 17 | * [approved_date](_types_.igameinfo.md#approved_date) 18 | * [categories](_types_.igameinfo.md#categories) 19 | * [domain_name](_types_.igameinfo.md#domain_name) 20 | * [downloads](_types_.igameinfo.md#downloads) 21 | * [file_count](_types_.igameinfo.md#file_count) 22 | * [forum_url](_types_.igameinfo.md#forum_url) 23 | * [genre](_types_.igameinfo.md#genre) 24 | * [id](_types_.igameinfo.md#id) 25 | * [mods](_types_.igameinfo.md#mods) 26 | * [name](_types_.igameinfo.md#name) 27 | * [nexusmods_url](_types_.igameinfo.md#nexusmods_url) 28 | 29 | ## Properties 30 | 31 | ### approved_date 32 | 33 | • **approved_date**: *number* 34 | 35 | *Inherited from [IGameListEntry](_types_.igamelistentry.md).[approved_date](_types_.igamelistentry.md#approved_date)* 36 | 37 | *Defined in [src/types.ts:339](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L339)* 38 | 39 | unix timestamp of when this game was added to nexuis mods 40 | 41 | ___ 42 | 43 | ### categories 44 | 45 | • **categories**: *[ICategory](_types_.icategory.md)[]* 46 | 47 | *Defined in [src/types.ts:349](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L349)* 48 | 49 | list of categories for this game 50 | 51 | ___ 52 | 53 | ### domain_name 54 | 55 | • **domain_name**: *string* 56 | 57 | *Inherited from [IGameListEntry](_types_.igamelistentry.md).[domain_name](_types_.igamelistentry.md#domain_name)* 58 | 59 | *Defined in [src/types.ts:306](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L306)* 60 | 61 | domain name (as used in urls and as the game id in all other requests) 62 | 63 | ___ 64 | 65 | ### downloads 66 | 67 | • **downloads**: *number* 68 | 69 | *Inherited from [IGameListEntry](_types_.igamelistentry.md).[downloads](_types_.igamelistentry.md#downloads)* 70 | 71 | *Defined in [src/types.ts:335](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L335)* 72 | 73 | number of downloads from nexus for files for this game 74 | 75 | ___ 76 | 77 | ### file_count 78 | 79 | • **file_count**: *number* 80 | 81 | *Inherited from [IGameListEntry](_types_.igamelistentry.md).[file_count](_types_.igamelistentry.md#file_count)* 82 | 83 | *Defined in [src/types.ts:331](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L331)* 84 | 85 | number of files hosted on nexus for this game 86 | 87 | ___ 88 | 89 | ### forum_url 90 | 91 | • **forum_url**: *string* 92 | 93 | *Inherited from [IGameListEntry](_types_.igamelistentry.md).[forum_url](_types_.igamelistentry.md#forum_url)* 94 | 95 | *Defined in [src/types.ts:314](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L314)* 96 | 97 | url for the corresponding forum section 98 | 99 | ___ 100 | 101 | ### genre 102 | 103 | • **genre**: *string* 104 | 105 | *Inherited from [IGameListEntry](_types_.igamelistentry.md).[genre](_types_.igamelistentry.md#genre)* 106 | 107 | *Defined in [src/types.ts:323](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L323)* 108 | 109 | genre of the game 110 | (possible values?) 111 | 112 | ___ 113 | 114 | ### id 115 | 116 | • **id**: *number* 117 | 118 | *Inherited from [IGameListEntry](_types_.igamelistentry.md).[id](_types_.igamelistentry.md#id)* 119 | 120 | *Defined in [src/types.ts:302](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L302)* 121 | 122 | numerical id 123 | 124 | ___ 125 | 126 | ### mods 127 | 128 | • **mods**: *number* 129 | 130 | *Inherited from [IGameListEntry](_types_.igamelistentry.md).[mods](_types_.igamelistentry.md#mods)* 131 | 132 | *Defined in [src/types.ts:327](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L327)* 133 | 134 | number of mods hosted on nexus for this game 135 | 136 | ___ 137 | 138 | ### name 139 | 140 | • **name**: *string* 141 | 142 | *Inherited from [IGameListEntry](_types_.igamelistentry.md).[name](_types_.igamelistentry.md#name)* 143 | 144 | *Defined in [src/types.ts:310](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L310)* 145 | 146 | display name 147 | 148 | ___ 149 | 150 | ### nexusmods_url 151 | 152 | • **nexusmods_url**: *string* 153 | 154 | *Inherited from [IGameListEntry](_types_.igamelistentry.md).[nexusmods_url](_types_.igamelistentry.md#nexusmods_url)* 155 | 156 | *Defined in [src/types.ts:318](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L318)* 157 | 158 | url for the primary nexusmods page (should be https://www.nexusmods.com/) 159 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.igamelistentry.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IGameListEntry](_types_.igamelistentry.md) 2 | 3 | # Interface: IGameListEntry 4 | 5 | basic information about a game 6 | 7 | ## Hierarchy 8 | 9 | * **IGameListEntry** 10 | 11 | ↳ [IGameInfo](_types_.igameinfo.md) 12 | 13 | ## Index 14 | 15 | ### Properties 16 | 17 | * [approved_date](_types_.igamelistentry.md#approved_date) 18 | * [domain_name](_types_.igamelistentry.md#domain_name) 19 | * [downloads](_types_.igamelistentry.md#downloads) 20 | * [file_count](_types_.igamelistentry.md#file_count) 21 | * [forum_url](_types_.igamelistentry.md#forum_url) 22 | * [genre](_types_.igamelistentry.md#genre) 23 | * [id](_types_.igamelistentry.md#id) 24 | * [mods](_types_.igamelistentry.md#mods) 25 | * [name](_types_.igamelistentry.md#name) 26 | * [nexusmods_url](_types_.igamelistentry.md#nexusmods_url) 27 | 28 | ## Properties 29 | 30 | ### approved_date 31 | 32 | • **approved_date**: *number* 33 | 34 | *Defined in [src/types.ts:339](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L339)* 35 | 36 | unix timestamp of when this game was added to nexuis mods 37 | 38 | ___ 39 | 40 | ### domain_name 41 | 42 | • **domain_name**: *string* 43 | 44 | *Defined in [src/types.ts:306](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L306)* 45 | 46 | domain name (as used in urls and as the game id in all other requests) 47 | 48 | ___ 49 | 50 | ### downloads 51 | 52 | • **downloads**: *number* 53 | 54 | *Defined in [src/types.ts:335](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L335)* 55 | 56 | number of downloads from nexus for files for this game 57 | 58 | ___ 59 | 60 | ### file_count 61 | 62 | • **file_count**: *number* 63 | 64 | *Defined in [src/types.ts:331](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L331)* 65 | 66 | number of files hosted on nexus for this game 67 | 68 | ___ 69 | 70 | ### forum_url 71 | 72 | • **forum_url**: *string* 73 | 74 | *Defined in [src/types.ts:314](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L314)* 75 | 76 | url for the corresponding forum section 77 | 78 | ___ 79 | 80 | ### genre 81 | 82 | • **genre**: *string* 83 | 84 | *Defined in [src/types.ts:323](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L323)* 85 | 86 | genre of the game 87 | (possible values?) 88 | 89 | ___ 90 | 91 | ### id 92 | 93 | • **id**: *number* 94 | 95 | *Defined in [src/types.ts:302](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L302)* 96 | 97 | numerical id 98 | 99 | ___ 100 | 101 | ### mods 102 | 103 | • **mods**: *number* 104 | 105 | *Defined in [src/types.ts:327](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L327)* 106 | 107 | number of mods hosted on nexus for this game 108 | 109 | ___ 110 | 111 | ### name 112 | 113 | • **name**: *string* 114 | 115 | *Defined in [src/types.ts:310](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L310)* 116 | 117 | display name 118 | 119 | ___ 120 | 121 | ### nexusmods_url 122 | 123 | • **nexusmods_url**: *string* 124 | 125 | *Defined in [src/types.ts:318](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L318)* 126 | 127 | url for the primary nexusmods page (should be https://www.nexusmods.com/) 128 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.igithubissue.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IGithubIssue](_types_.igithubissue.md) 2 | 3 | # Interface: IGithubIssue 4 | 5 | Info about a feedback report exported to github 6 | INTERNAL USE ONLY 7 | 8 | ## Hierarchy 9 | 10 | * **IGithubIssue** 11 | 12 | ## Index 13 | 14 | ### Properties 15 | 16 | * [created_at](_types_.igithubissue.md#created_at) 17 | * [grouping_key](_types_.igithubissue.md#grouping_key) 18 | * [id](_types_.igithubissue.md#id) 19 | * [issue_number](_types_.igithubissue.md#issue_number) 20 | * [issue_state](_types_.igithubissue.md#issue_state) 21 | * [issue_title](_types_.igithubissue.md#issue_title) 22 | * [updated_at](_types_.igithubissue.md#updated_at) 23 | 24 | ## Properties 25 | 26 | ### created_at 27 | 28 | • **created_at**: *string* 29 | 30 | *Defined in [src/types.ts:406](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L406)* 31 | 32 | ___ 33 | 34 | ### grouping_key 35 | 36 | • **grouping_key**: *string* 37 | 38 | *Defined in [src/types.ts:405](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L405)* 39 | 40 | ___ 41 | 42 | ### id 43 | 44 | • **id**: *number* 45 | 46 | *Defined in [src/types.ts:401](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L401)* 47 | 48 | ___ 49 | 50 | ### issue_number 51 | 52 | • **issue_number**: *number* 53 | 54 | *Defined in [src/types.ts:402](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L402)* 55 | 56 | ___ 57 | 58 | ### issue_state 59 | 60 | • **issue_state**: *string* 61 | 62 | *Defined in [src/types.ts:404](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L404)* 63 | 64 | ___ 65 | 66 | ### issue_title 67 | 68 | • **issue_title**: *string* 69 | 70 | *Defined in [src/types.ts:403](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L403)* 71 | 72 | ___ 73 | 74 | ### updated_at 75 | 76 | • **updated_at**: *string* 77 | 78 | *Defined in [src/types.ts:407](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L407)* 79 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.iissue.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IIssue](_types_.iissue.md) 2 | 3 | # Interface: IIssue 4 | 5 | Info about a Feedback report 6 | INTERNAL USE ONLY 7 | 8 | ## Hierarchy 9 | 10 | * **IIssue** 11 | 12 | ## Index 13 | 14 | ### Properties 15 | 16 | * [id](_types_.iissue.md#id) 17 | * [issue_number](_types_.iissue.md#issue_number) 18 | * [issue_state](_types_.iissue.md#issue_state) 19 | * [issue_title](_types_.iissue.md#issue_title) 20 | 21 | ## Properties 22 | 23 | ### id 24 | 25 | • **id**: *number* 26 | 27 | *Defined in [src/types.ts:390](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L390)* 28 | 29 | ___ 30 | 31 | ### issue_number 32 | 33 | • **issue_number**: *number* 34 | 35 | *Defined in [src/types.ts:391](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L391)* 36 | 37 | ___ 38 | 39 | ### issue_state 40 | 41 | • **issue_state**: *string* 42 | 43 | *Defined in [src/types.ts:392](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L392)* 44 | 45 | ___ 46 | 47 | ### issue_title 48 | 49 | • **issue_title**: *string* 50 | 51 | *Defined in [src/types.ts:393](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L393)* 52 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.imd5result.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IMD5Result](_types_.imd5result.md) 2 | 3 | # Interface: IMD5Result 4 | 5 | Result from a md5 lookup 6 | 7 | ## Hierarchy 8 | 9 | * **IMD5Result** 10 | 11 | ## Index 12 | 13 | ### Properties 14 | 15 | * [file_details](_types_.imd5result.md#file_details) 16 | * [mod](_types_.imd5result.md#mod) 17 | 18 | ## Properties 19 | 20 | ### file_details 21 | 22 | • **file_details**: *[IFileInfo](_types_.ifileinfo.md)* 23 | 24 | *Defined in [src/types.ts:382](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L382)* 25 | 26 | ___ 27 | 28 | ### mod 29 | 30 | • **mod**: *[IModInfoEx](_types_.imodinfoex.md)* 31 | 32 | *Defined in [src/types.ts:381](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L381)* 33 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.imodfiles.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IModFiles](_types_.imodfiles.md) 2 | 3 | # Interface: IModFiles 4 | 5 | list of files (and update chain) associated with a mod 6 | 7 | ## Hierarchy 8 | 9 | * **IModFiles** 10 | 11 | ## Index 12 | 13 | ### Properties 14 | 15 | * [file_updates](_types_.imodfiles.md#file_updates) 16 | * [files](_types_.imodfiles.md#files) 17 | 18 | ## Properties 19 | 20 | ### file_updates 21 | 22 | • **file_updates**: *[IFileUpdate](_types_.ifileupdate.md)[]* 23 | 24 | *Defined in [src/types.ts:234](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L234)* 25 | 26 | list of file updates stored with a mod 27 | 28 | ___ 29 | 30 | ### files 31 | 32 | • **files**: *[IFileInfo](_types_.ifileinfo.md)[]* 33 | 34 | *Defined in [src/types.ts:238](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L238)* 35 | 36 | list of files stored for a mod 37 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.imodinfo.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IModInfo](_types_.imodinfo.md) 2 | 3 | # Interface: IModInfo 4 | 5 | Details about a mod 6 | 7 | ## Hierarchy 8 | 9 | * **IModInfo** 10 | 11 | ↳ [IModInfoEx](_types_.imodinfoex.md) 12 | 13 | ## Index 14 | 15 | ### Properties 16 | 17 | * [allow_rating](_types_.imodinfo.md#allow_rating) 18 | * [author](_types_.imodinfo.md#author) 19 | * [available](_types_.imodinfo.md#available) 20 | * [category_id](_types_.imodinfo.md#category_id) 21 | * [contains_adult_content](_types_.imodinfo.md#contains_adult_content) 22 | * [created_time](_types_.imodinfo.md#created_time) 23 | * [created_timestamp](_types_.imodinfo.md#created_timestamp) 24 | * [description](_types_.imodinfo.md#optional-description) 25 | * [domain_name](_types_.imodinfo.md#domain_name) 26 | * [endorsement](_types_.imodinfo.md#optional-endorsement) 27 | * [endorsement_count](_types_.imodinfo.md#endorsement_count) 28 | * [game_id](_types_.imodinfo.md#game_id) 29 | * [mod_id](_types_.imodinfo.md#mod_id) 30 | * [name](_types_.imodinfo.md#optional-name) 31 | * [picture_url](_types_.imodinfo.md#optional-picture_url) 32 | * [status](_types_.imodinfo.md#status) 33 | * [summary](_types_.imodinfo.md#optional-summary) 34 | * [updated_time](_types_.imodinfo.md#updated_time) 35 | * [updated_timestamp](_types_.imodinfo.md#updated_timestamp) 36 | * [uploaded_by](_types_.imodinfo.md#uploaded_by) 37 | * [uploaded_users_profile_url](_types_.imodinfo.md#uploaded_users_profile_url) 38 | * [user](_types_.imodinfo.md#user) 39 | * [version](_types_.imodinfo.md#version) 40 | 41 | ## Properties 42 | 43 | ### allow_rating 44 | 45 | • **allow_rating**: *boolean* 46 | 47 | *Defined in [src/types.ts:139](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L139)* 48 | 49 | whether this mod allows endorsements 50 | 51 | ___ 52 | 53 | ### author 54 | 55 | • **author**: *string* 56 | 57 | *Defined in [src/types.ts:92](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L92)* 58 | 59 | Author of the mod 60 | 61 | ___ 62 | 63 | ### available 64 | 65 | • **available**: *boolean* 66 | 67 | *Defined in [src/types.ts:115](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L115)* 68 | 69 | whether the mod is currently available/visible to users 70 | If a mod isn't available the api returns very limited information, essentially 71 | hiding all textual info that could contain offensive content but certain "maintenance" info 72 | is still provided. 73 | 74 | ___ 75 | 76 | ### category_id 77 | 78 | • **category_id**: *number* 79 | 80 | *Defined in [src/types.ts:67](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L67)* 81 | 82 | id of the category 83 | 84 | ___ 85 | 86 | ### contains_adult_content 87 | 88 | • **contains_adult_content**: *boolean* 89 | 90 | *Defined in [src/types.ts:71](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L71)* 91 | 92 | whether this mod is tagged as adult 93 | 94 | ___ 95 | 96 | ### created_time 97 | 98 | • **created_time**: *string* 99 | 100 | *Defined in [src/types.ts:127](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L127)* 101 | 102 | readable time of when the mod was created 103 | 104 | ___ 105 | 106 | ### created_timestamp 107 | 108 | • **created_timestamp**: *number* 109 | 110 | *Defined in [src/types.ts:123](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L123)* 111 | 112 | unix timestamp of when the mod was created 113 | 114 | ___ 115 | 116 | ### `Optional` description 117 | 118 | • **description**? : *string* 119 | 120 | *Defined in [src/types.ts:84](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L84)* 121 | 122 | long description (bbcode) 123 | 124 | ___ 125 | 126 | ### domain_name 127 | 128 | • **domain_name**: *string* 129 | 130 | *Defined in [src/types.ts:63](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L63)* 131 | 132 | domain name (as used in urls and as the game id in all other requests) 133 | 134 | ___ 135 | 136 | ### `Optional` endorsement 137 | 138 | • **endorsement**? : *object* 139 | 140 | *Defined in [src/types.ts:147](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L147)* 141 | 142 | obsolete - will be removed in the near future 143 | 144 | #### Type declaration: 145 | 146 | * **endorse_status**: *[EndorsedStatus](../modules/_types_.md#endorsedstatus)* 147 | 148 | * **timestamp**: *number* 149 | 150 | * **version**: *number* 151 | 152 | ___ 153 | 154 | ### endorsement_count 155 | 156 | • **endorsement_count**: *number* 157 | 158 | *Defined in [src/types.ts:143](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L143)* 159 | 160 | endorsement count 161 | 162 | ___ 163 | 164 | ### game_id 165 | 166 | • **game_id**: *number* 167 | 168 | *Defined in [src/types.ts:59](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L59)* 169 | 170 | internal id of the game this mod belongs to 171 | 172 | ___ 173 | 174 | ### mod_id 175 | 176 | • **mod_id**: *number* 177 | 178 | *Defined in [src/types.ts:55](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L55)* 179 | 180 | id of this mod (should be the same you queried for) 181 | 182 | ___ 183 | 184 | ### `Optional` name 185 | 186 | • **name**? : *string* 187 | 188 | *Defined in [src/types.ts:76](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L76)* 189 | 190 | Name of the mod 191 | (not present if the file is under moderation) 192 | 193 | ___ 194 | 195 | ### `Optional` picture_url 196 | 197 | • **picture_url**? : *string* 198 | 199 | *Defined in [src/types.ts:119](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L119)* 200 | 201 | url of the primary screenshot 202 | 203 | ___ 204 | 205 | ### status 206 | 207 | • **status**: *[ModStatus](../modules/_types_.md#modstatus)* 208 | 209 | *Defined in [src/types.ts:108](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L108)* 210 | 211 | current status of the mod 212 | 213 | ___ 214 | 215 | ### `Optional` summary 216 | 217 | • **summary**? : *string* 218 | 219 | *Defined in [src/types.ts:80](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L80)* 220 | 221 | short description 222 | 223 | ___ 224 | 225 | ### updated_time 226 | 227 | • **updated_time**: *string* 228 | 229 | *Defined in [src/types.ts:135](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L135)* 230 | 231 | readable time of when the mod was updated 232 | 233 | ___ 234 | 235 | ### updated_timestamp 236 | 237 | • **updated_timestamp**: *number* 238 | 239 | *Defined in [src/types.ts:131](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L131)* 240 | 241 | unix timestamp of when the mod was updated 242 | 243 | ___ 244 | 245 | ### uploaded_by 246 | 247 | • **uploaded_by**: *string* 248 | 249 | *Defined in [src/types.ts:100](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L100)* 250 | 251 | name of the user who uploaded this mod 252 | 253 | ___ 254 | 255 | ### uploaded_users_profile_url 256 | 257 | • **uploaded_users_profile_url**: *string* 258 | 259 | *Defined in [src/types.ts:104](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L104)* 260 | 261 | url of the profile image of the uploader 262 | 263 | ___ 264 | 265 | ### user 266 | 267 | • **user**: *[IUser](_types_.iuser.md)* 268 | 269 | *Defined in [src/types.ts:96](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L96)* 270 | 271 | more detailed info about the author 272 | 273 | ___ 274 | 275 | ### version 276 | 277 | • **version**: *string* 278 | 279 | *Defined in [src/types.ts:88](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L88)* 280 | 281 | mod version 282 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.imodinfoex.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IModInfoEx](_types_.imodinfoex.md) 2 | 3 | # Interface: IModInfoEx 4 | 5 | ## Hierarchy 6 | 7 | * [IModInfo](_types_.imodinfo.md) 8 | 9 | ↳ **IModInfoEx** 10 | 11 | ## Index 12 | 13 | ### Properties 14 | 15 | * [allow_rating](_types_.imodinfoex.md#allow_rating) 16 | * [author](_types_.imodinfoex.md#author) 17 | * [available](_types_.imodinfoex.md#available) 18 | * [category_id](_types_.imodinfoex.md#category_id) 19 | * [contains_adult_content](_types_.imodinfoex.md#contains_adult_content) 20 | * [created_time](_types_.imodinfoex.md#created_time) 21 | * [created_timestamp](_types_.imodinfoex.md#created_timestamp) 22 | * [description](_types_.imodinfoex.md#optional-description) 23 | * [domain_name](_types_.imodinfoex.md#domain_name) 24 | * [endorsement](_types_.imodinfoex.md#optional-endorsement) 25 | * [endorsement_count](_types_.imodinfoex.md#endorsement_count) 26 | * [game_id](_types_.imodinfoex.md#game_id) 27 | * [mod_id](_types_.imodinfoex.md#mod_id) 28 | * [name](_types_.imodinfoex.md#optional-name) 29 | * [picture_url](_types_.imodinfoex.md#optional-picture_url) 30 | * [status](_types_.imodinfoex.md#status) 31 | * [summary](_types_.imodinfoex.md#optional-summary) 32 | * [updated_time](_types_.imodinfoex.md#updated_time) 33 | * [updated_timestamp](_types_.imodinfoex.md#updated_timestamp) 34 | * [uploaded_by](_types_.imodinfoex.md#uploaded_by) 35 | * [uploaded_users_profile_url](_types_.imodinfoex.md#uploaded_users_profile_url) 36 | * [user](_types_.imodinfoex.md#user) 37 | * [version](_types_.imodinfoex.md#version) 38 | 39 | ## Properties 40 | 41 | ### allow_rating 42 | 43 | • **allow_rating**: *boolean* 44 | 45 | *Inherited from [IModInfo](_types_.imodinfo.md).[allow_rating](_types_.imodinfo.md#allow_rating)* 46 | 47 | *Defined in [src/types.ts:139](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L139)* 48 | 49 | whether this mod allows endorsements 50 | 51 | ___ 52 | 53 | ### author 54 | 55 | • **author**: *string* 56 | 57 | *Inherited from [IModInfo](_types_.imodinfo.md).[author](_types_.imodinfo.md#author)* 58 | 59 | *Defined in [src/types.ts:92](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L92)* 60 | 61 | Author of the mod 62 | 63 | ___ 64 | 65 | ### available 66 | 67 | • **available**: *boolean* 68 | 69 | *Inherited from [IModInfo](_types_.imodinfo.md).[available](_types_.imodinfo.md#available)* 70 | 71 | *Defined in [src/types.ts:115](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L115)* 72 | 73 | whether the mod is currently available/visible to users 74 | If a mod isn't available the api returns very limited information, essentially 75 | hiding all textual info that could contain offensive content but certain "maintenance" info 76 | is still provided. 77 | 78 | ___ 79 | 80 | ### category_id 81 | 82 | • **category_id**: *number* 83 | 84 | *Inherited from [IModInfo](_types_.imodinfo.md).[category_id](_types_.imodinfo.md#category_id)* 85 | 86 | *Defined in [src/types.ts:67](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L67)* 87 | 88 | id of the category 89 | 90 | ___ 91 | 92 | ### contains_adult_content 93 | 94 | • **contains_adult_content**: *boolean* 95 | 96 | *Inherited from [IModInfo](_types_.imodinfo.md).[contains_adult_content](_types_.imodinfo.md#contains_adult_content)* 97 | 98 | *Defined in [src/types.ts:71](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L71)* 99 | 100 | whether this mod is tagged as adult 101 | 102 | ___ 103 | 104 | ### created_time 105 | 106 | • **created_time**: *string* 107 | 108 | *Inherited from [IModInfo](_types_.imodinfo.md).[created_time](_types_.imodinfo.md#created_time)* 109 | 110 | *Defined in [src/types.ts:127](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L127)* 111 | 112 | readable time of when the mod was created 113 | 114 | ___ 115 | 116 | ### created_timestamp 117 | 118 | • **created_timestamp**: *number* 119 | 120 | *Inherited from [IModInfo](_types_.imodinfo.md).[created_timestamp](_types_.imodinfo.md#created_timestamp)* 121 | 122 | *Defined in [src/types.ts:123](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L123)* 123 | 124 | unix timestamp of when the mod was created 125 | 126 | ___ 127 | 128 | ### `Optional` description 129 | 130 | • **description**? : *string* 131 | 132 | *Inherited from [IModInfo](_types_.imodinfo.md).[description](_types_.imodinfo.md#optional-description)* 133 | 134 | *Defined in [src/types.ts:84](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L84)* 135 | 136 | long description (bbcode) 137 | 138 | ___ 139 | 140 | ### domain_name 141 | 142 | • **domain_name**: *string* 143 | 144 | *Inherited from [IModInfo](_types_.imodinfo.md).[domain_name](_types_.imodinfo.md#domain_name)* 145 | 146 | *Defined in [src/types.ts:63](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L63)* 147 | 148 | domain name (as used in urls and as the game id in all other requests) 149 | 150 | ___ 151 | 152 | ### `Optional` endorsement 153 | 154 | • **endorsement**? : *object* 155 | 156 | *Inherited from [IModInfo](_types_.imodinfo.md).[endorsement](_types_.imodinfo.md#optional-endorsement)* 157 | 158 | *Defined in [src/types.ts:147](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L147)* 159 | 160 | obsolete - will be removed in the near future 161 | 162 | #### Type declaration: 163 | 164 | * **endorse_status**: *[EndorsedStatus](../modules/_types_.md#endorsedstatus)* 165 | 166 | * **timestamp**: *number* 167 | 168 | * **version**: *number* 169 | 170 | ___ 171 | 172 | ### endorsement_count 173 | 174 | • **endorsement_count**: *number* 175 | 176 | *Inherited from [IModInfo](_types_.imodinfo.md).[endorsement_count](_types_.imodinfo.md#endorsement_count)* 177 | 178 | *Defined in [src/types.ts:143](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L143)* 179 | 180 | endorsement count 181 | 182 | ___ 183 | 184 | ### game_id 185 | 186 | • **game_id**: *number* 187 | 188 | *Overrides [IModInfo](_types_.imodinfo.md).[game_id](_types_.imodinfo.md#game_id)* 189 | 190 | *Defined in [src/types.ts:374](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L374)* 191 | 192 | ___ 193 | 194 | ### mod_id 195 | 196 | • **mod_id**: *number* 197 | 198 | *Overrides [IModInfo](_types_.imodinfo.md).[mod_id](_types_.imodinfo.md#mod_id)* 199 | 200 | *Defined in [src/types.ts:373](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L373)* 201 | 202 | ___ 203 | 204 | ### `Optional` name 205 | 206 | • **name**? : *string* 207 | 208 | *Inherited from [IModInfo](_types_.imodinfo.md).[name](_types_.imodinfo.md#optional-name)* 209 | 210 | *Defined in [src/types.ts:76](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L76)* 211 | 212 | Name of the mod 213 | (not present if the file is under moderation) 214 | 215 | ___ 216 | 217 | ### `Optional` picture_url 218 | 219 | • **picture_url**? : *string* 220 | 221 | *Inherited from [IModInfo](_types_.imodinfo.md).[picture_url](_types_.imodinfo.md#optional-picture_url)* 222 | 223 | *Defined in [src/types.ts:119](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L119)* 224 | 225 | url of the primary screenshot 226 | 227 | ___ 228 | 229 | ### status 230 | 231 | • **status**: *[ModStatus](../modules/_types_.md#modstatus)* 232 | 233 | *Inherited from [IModInfo](_types_.imodinfo.md).[status](_types_.imodinfo.md#status)* 234 | 235 | *Defined in [src/types.ts:108](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L108)* 236 | 237 | current status of the mod 238 | 239 | ___ 240 | 241 | ### `Optional` summary 242 | 243 | • **summary**? : *string* 244 | 245 | *Inherited from [IModInfo](_types_.imodinfo.md).[summary](_types_.imodinfo.md#optional-summary)* 246 | 247 | *Defined in [src/types.ts:80](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L80)* 248 | 249 | short description 250 | 251 | ___ 252 | 253 | ### updated_time 254 | 255 | • **updated_time**: *string* 256 | 257 | *Inherited from [IModInfo](_types_.imodinfo.md).[updated_time](_types_.imodinfo.md#updated_time)* 258 | 259 | *Defined in [src/types.ts:135](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L135)* 260 | 261 | readable time of when the mod was updated 262 | 263 | ___ 264 | 265 | ### updated_timestamp 266 | 267 | • **updated_timestamp**: *number* 268 | 269 | *Inherited from [IModInfo](_types_.imodinfo.md).[updated_timestamp](_types_.imodinfo.md#updated_timestamp)* 270 | 271 | *Defined in [src/types.ts:131](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L131)* 272 | 273 | unix timestamp of when the mod was updated 274 | 275 | ___ 276 | 277 | ### uploaded_by 278 | 279 | • **uploaded_by**: *string* 280 | 281 | *Inherited from [IModInfo](_types_.imodinfo.md).[uploaded_by](_types_.imodinfo.md#uploaded_by)* 282 | 283 | *Defined in [src/types.ts:100](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L100)* 284 | 285 | name of the user who uploaded this mod 286 | 287 | ___ 288 | 289 | ### uploaded_users_profile_url 290 | 291 | • **uploaded_users_profile_url**: *string* 292 | 293 | *Inherited from [IModInfo](_types_.imodinfo.md).[uploaded_users_profile_url](_types_.imodinfo.md#uploaded_users_profile_url)* 294 | 295 | *Defined in [src/types.ts:104](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L104)* 296 | 297 | url of the profile image of the uploader 298 | 299 | ___ 300 | 301 | ### user 302 | 303 | • **user**: *[IUser](_types_.iuser.md)* 304 | 305 | *Inherited from [IModInfo](_types_.imodinfo.md).[user](_types_.imodinfo.md#user)* 306 | 307 | *Defined in [src/types.ts:96](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L96)* 308 | 309 | more detailed info about the author 310 | 311 | ___ 312 | 313 | ### version 314 | 315 | • **version**: *string* 316 | 317 | *Inherited from [IModInfo](_types_.imodinfo.md).[version](_types_.imodinfo.md#version)* 318 | 319 | *Defined in [src/types.ts:88](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L88)* 320 | 321 | mod version 322 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.inexusevents.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [INexusEvents](_types_.inexusevents.md) 2 | 3 | # Interface: INexusEvents 4 | 5 | ## Hierarchy 6 | 7 | * **INexusEvents** 8 | 9 | ## Index 10 | 11 | ### Properties 12 | 13 | * [oauth-credentials-updated](_types_.inexusevents.md#oauth-credentials-updated) 14 | 15 | ## Properties 16 | 17 | ### oauth-credentials-updated 18 | 19 | • **oauth-credentials-updated**: *function* 20 | 21 | *Defined in [src/types.ts:510](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L510)* 22 | 23 | #### Type declaration: 24 | 25 | ▸ (`credentials`: [IOAuthCredentials](_types_.ioauthcredentials.md)): *void* 26 | 27 | **Parameters:** 28 | 29 | Name | Type | 30 | ------ | ------ | 31 | `credentials` | [IOAuthCredentials](_types_.ioauthcredentials.md) | 32 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.ioauthconfig.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IOAuthConfig](_types_.ioauthconfig.md) 2 | 3 | # Interface: IOAuthConfig 4 | 5 | ## Hierarchy 6 | 7 | * **IOAuthConfig** 8 | 9 | ## Index 10 | 11 | ### Properties 12 | 13 | * [id](_types_.ioauthconfig.md#id) 14 | * [secret](_types_.ioauthconfig.md#secret) 15 | 16 | ## Properties 17 | 18 | ### id 19 | 20 | • **id**: *string* 21 | 22 | *Defined in [src/types.ts:505](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L505)* 23 | 24 | ___ 25 | 26 | ### secret 27 | 28 | • **secret**: *string* 29 | 30 | *Defined in [src/types.ts:506](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L506)* 31 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.ioauthcredentials.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IOAuthCredentials](_types_.ioauthcredentials.md) 2 | 3 | # Interface: IOAuthCredentials 4 | 5 | ## Hierarchy 6 | 7 | * **IOAuthCredentials** 8 | 9 | ## Index 10 | 11 | ### Properties 12 | 13 | * [fingerprint](_types_.ioauthcredentials.md#fingerprint) 14 | * [refreshToken](_types_.ioauthcredentials.md#refreshtoken) 15 | * [token](_types_.ioauthcredentials.md#token) 16 | 17 | ## Properties 18 | 19 | ### fingerprint 20 | 21 | • **fingerprint**: *string* 22 | 23 | *Defined in [src/types.ts:501](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L501)* 24 | 25 | ___ 26 | 27 | ### refreshToken 28 | 29 | • **refreshToken**: *string* 30 | 31 | *Defined in [src/types.ts:500](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L500)* 32 | 33 | ___ 34 | 35 | ### token 36 | 37 | • **token**: *string* 38 | 39 | *Defined in [src/types.ts:499](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L499)* 40 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.itrackedmod.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [ITrackedMod](_types_.itrackedmod.md) 2 | 3 | # Interface: ITrackedMod 4 | 5 | response to a request for tracked mods 6 | 7 | ## Hierarchy 8 | 9 | * **ITrackedMod** 10 | 11 | ## Index 12 | 13 | ### Properties 14 | 15 | * [domain_name](_types_.itrackedmod.md#domain_name) 16 | * [mod_id](_types_.itrackedmod.md#mod_id) 17 | 18 | ## Properties 19 | 20 | ### domain_name 21 | 22 | • **domain_name**: *string* 23 | 24 | *Defined in [src/types.ts:438](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L438)* 25 | 26 | ___ 27 | 28 | ### mod_id 29 | 30 | • **mod_id**: *number* 31 | 32 | *Defined in [src/types.ts:437](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L437)* 33 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.itrackresponse.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [ITrackResponse](_types_.itrackresponse.md) 2 | 3 | # Interface: ITrackResponse 4 | 5 | (success) response to a track/untrack request 6 | 7 | ## Hierarchy 8 | 9 | * **ITrackResponse** 10 | 11 | ## Index 12 | 13 | ### Properties 14 | 15 | * [message](_types_.itrackresponse.md#message) 16 | 17 | ## Properties 18 | 19 | ### message 20 | 21 | • **message**: *string* 22 | 23 | *Defined in [src/types.ts:470](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L470)* 24 | 25 | textual result of the action, something like "User 123 is now Tracking Mod: 456" 26 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.iupdateentry.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IUpdateEntry](_types_.iupdateentry.md) 2 | 3 | # Interface: IUpdateEntry 4 | 5 | an entry in the update list 6 | 7 | ## Hierarchy 8 | 9 | * **IUpdateEntry** 10 | 11 | ## Index 12 | 13 | ### Properties 14 | 15 | * [latest_file_update](_types_.iupdateentry.md#latest_file_update) 16 | * [latest_mod_activity](_types_.iupdateentry.md#latest_mod_activity) 17 | * [mod_id](_types_.iupdateentry.md#mod_id) 18 | 19 | ## Properties 20 | 21 | ### latest_file_update 22 | 23 | • **latest_file_update**: *number* 24 | 25 | *Defined in [src/types.ts:494](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L494)* 26 | 27 | ___ 28 | 29 | ### latest_mod_activity 30 | 31 | • **latest_mod_activity**: *number* 32 | 33 | *Defined in [src/types.ts:495](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L495)* 34 | 35 | ___ 36 | 37 | ### mod_id 38 | 39 | • **mod_id**: *number* 40 | 41 | *Defined in [src/types.ts:493](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L493)* 42 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.iuser.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IUser](_types_.iuser.md) 2 | 3 | # Interface: IUser 4 | 5 | ## Hierarchy 6 | 7 | * **IUser** 8 | 9 | ## Index 10 | 11 | ### Properties 12 | 13 | * [member_group_id](_types_.iuser.md#member_group_id) 14 | * [member_id](_types_.iuser.md#member_id) 15 | * [name](_types_.iuser.md#name) 16 | 17 | ## Properties 18 | 19 | ### member_group_id 20 | 21 | • **member_group_id**: *number* 22 | 23 | *Defined in [src/types.ts:37](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L37)* 24 | 25 | ___ 26 | 27 | ### member_id 28 | 29 | • **member_id**: *number* 30 | 31 | *Defined in [src/types.ts:36](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L36)* 32 | 33 | ___ 34 | 35 | ### name 36 | 37 | • **name**: *string* 38 | 39 | *Defined in [src/types.ts:38](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L38)* 40 | -------------------------------------------------------------------------------- /docs/interfaces/_types_.ivalidatekeyresponse.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](../modules/_types_.md) › [IValidateKeyResponse](_types_.ivalidatekeyresponse.md) 2 | 3 | # Interface: IValidateKeyResponse 4 | 5 | result of the validateKey request 6 | 7 | ## Hierarchy 8 | 9 | * **IValidateKeyResponse** 10 | 11 | ## Index 12 | 13 | ### Properties 14 | 15 | * [email](_types_.ivalidatekeyresponse.md#email) 16 | * [is_premium](_types_.ivalidatekeyresponse.md#is_premium) 17 | * [is_supporter](_types_.ivalidatekeyresponse.md#is_supporter) 18 | * [key](_types_.ivalidatekeyresponse.md#key) 19 | * [name](_types_.ivalidatekeyresponse.md#name) 20 | * [profile_url](_types_.ivalidatekeyresponse.md#profile_url) 21 | * [user_id](_types_.ivalidatekeyresponse.md#user_id) 22 | 23 | ## Properties 24 | 25 | ### email 26 | 27 | • **email**: *string* 28 | 29 | *Defined in [src/types.ts:28](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L28)* 30 | 31 | email address of the user 32 | 33 | ___ 34 | 35 | ### is_premium 36 | 37 | • **is_premium**: *boolean* 38 | 39 | *Defined in [src/types.ts:20](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L20)* 40 | 41 | user is premium 42 | 43 | ___ 44 | 45 | ### is_supporter 46 | 47 | • **is_supporter**: *boolean* 48 | 49 | *Defined in [src/types.ts:24](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L24)* 50 | 51 | user is supporter 52 | 53 | ___ 54 | 55 | ### key 56 | 57 | • **key**: *string* 58 | 59 | *Defined in [src/types.ts:12](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L12)* 60 | 61 | the api key 62 | 63 | ___ 64 | 65 | ### name 66 | 67 | • **name**: *string* 68 | 69 | *Defined in [src/types.ts:16](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L16)* 70 | 71 | User Name 72 | 73 | ___ 74 | 75 | ### profile_url 76 | 77 | • **profile_url**: *string* 78 | 79 | *Defined in [src/types.ts:32](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L32)* 80 | 81 | url of the user image 82 | 83 | ___ 84 | 85 | ### user_id 86 | 87 | • **user_id**: *number* 88 | 89 | *Defined in [src/types.ts:8](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L8)* 90 | 91 | nexus user id 92 | -------------------------------------------------------------------------------- /docs/modules/_customerrors_.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["customErrors"](_customerrors_.md) 2 | 3 | # Module: "customErrors" 4 | 5 | ## Index 6 | 7 | ### Classes 8 | 9 | * [HTTPError](../classes/_customerrors_.httperror.md) 10 | * [JwtExpiredError](../classes/_customerrors_.jwtexpirederror.md) 11 | * [NexusError](../classes/_customerrors_.nexuserror.md) 12 | * [ParameterInvalid](../classes/_customerrors_.parameterinvalid.md) 13 | * [ProtocolError](../classes/_customerrors_.protocolerror.md) 14 | * [RateLimitError](../classes/_customerrors_.ratelimiterror.md) 15 | * [TimeoutError](../classes/_customerrors_.timeouterror.md) 16 | -------------------------------------------------------------------------------- /docs/modules/_index_.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["index"](_index_.md) 2 | 3 | # Module: "index" 4 | 5 | ## Index 6 | 7 | ### References 8 | 9 | * [EndorsedStatus](_index_.md#endorsedstatus) 10 | * [ICategory](_index_.md#icategory) 11 | * [IChangelogs](_index_.md#ichangelogs) 12 | * [IColourScheme](_index_.md#icolourscheme) 13 | * [IDownloadURL](_index_.md#idownloadurl) 14 | * [IEndorseResponse](_index_.md#iendorseresponse) 15 | * [IEndorsement](_index_.md#iendorsement) 16 | * [IFeedbackResponse](_index_.md#ifeedbackresponse) 17 | * [IFileInfo](_index_.md#ifileinfo) 18 | * [IFileUpdate](_index_.md#ifileupdate) 19 | * [IGameInfo](_index_.md#igameinfo) 20 | * [IGameListEntry](_index_.md#igamelistentry) 21 | * [IGithubIssue](_index_.md#igithubissue) 22 | * [IIssue](_index_.md#iissue) 23 | * [IMD5Result](_index_.md#imd5result) 24 | * [IModFiles](_index_.md#imodfiles) 25 | * [IModInfo](_index_.md#imodinfo) 26 | * [IModInfoEx](_index_.md#imodinfoex) 27 | * [INexusEvents](_index_.md#inexusevents) 28 | * [IOAuthConfig](_index_.md#ioauthconfig) 29 | * [IOAuthCredentials](_index_.md#ioauthcredentials) 30 | * [ITrackResponse](_index_.md#itrackresponse) 31 | * [ITrackedMod](_index_.md#itrackedmod) 32 | * [IUpdateEntry](_index_.md#iupdateentry) 33 | * [IUser](_index_.md#iuser) 34 | * [IValidateKeyResponse](_index_.md#ivalidatekeyresponse) 35 | * [ModStatus](_index_.md#modstatus) 36 | * [NexusError](_index_.md#nexuserror) 37 | * [ParameterInvalid](_index_.md#parameterinvalid) 38 | * [RateLimitError](_index_.md#ratelimiterror) 39 | * [TimeoutError](_index_.md#timeouterror) 40 | * [UpdatePeriod](_index_.md#updateperiod) 41 | 42 | ## References 43 | 44 | ### EndorsedStatus 45 | 46 | • **EndorsedStatus**: 47 | 48 | ___ 49 | 50 | ### ICategory 51 | 52 | • **ICategory**: 53 | 54 | ___ 55 | 56 | ### IChangelogs 57 | 58 | • **IChangelogs**: 59 | 60 | ___ 61 | 62 | ### IColourScheme 63 | 64 | • **IColourScheme**: 65 | 66 | ___ 67 | 68 | ### IDownloadURL 69 | 70 | • **IDownloadURL**: 71 | 72 | ___ 73 | 74 | ### IEndorseResponse 75 | 76 | • **IEndorseResponse**: 77 | 78 | ___ 79 | 80 | ### IEndorsement 81 | 82 | • **IEndorsement**: 83 | 84 | ___ 85 | 86 | ### IFeedbackResponse 87 | 88 | • **IFeedbackResponse**: 89 | 90 | ___ 91 | 92 | ### IFileInfo 93 | 94 | • **IFileInfo**: 95 | 96 | ___ 97 | 98 | ### IFileUpdate 99 | 100 | • **IFileUpdate**: 101 | 102 | ___ 103 | 104 | ### IGameInfo 105 | 106 | • **IGameInfo**: 107 | 108 | ___ 109 | 110 | ### IGameListEntry 111 | 112 | • **IGameListEntry**: 113 | 114 | ___ 115 | 116 | ### IGithubIssue 117 | 118 | • **IGithubIssue**: 119 | 120 | ___ 121 | 122 | ### IIssue 123 | 124 | • **IIssue**: 125 | 126 | ___ 127 | 128 | ### IMD5Result 129 | 130 | • **IMD5Result**: 131 | 132 | ___ 133 | 134 | ### IModFiles 135 | 136 | • **IModFiles**: 137 | 138 | ___ 139 | 140 | ### IModInfo 141 | 142 | • **IModInfo**: 143 | 144 | ___ 145 | 146 | ### IModInfoEx 147 | 148 | • **IModInfoEx**: 149 | 150 | ___ 151 | 152 | ### INexusEvents 153 | 154 | • **INexusEvents**: 155 | 156 | ___ 157 | 158 | ### IOAuthConfig 159 | 160 | • **IOAuthConfig**: 161 | 162 | ___ 163 | 164 | ### IOAuthCredentials 165 | 166 | • **IOAuthCredentials**: 167 | 168 | ___ 169 | 170 | ### ITrackResponse 171 | 172 | • **ITrackResponse**: 173 | 174 | ___ 175 | 176 | ### ITrackedMod 177 | 178 | • **ITrackedMod**: 179 | 180 | ___ 181 | 182 | ### IUpdateEntry 183 | 184 | • **IUpdateEntry**: 185 | 186 | ___ 187 | 188 | ### IUser 189 | 190 | • **IUser**: 191 | 192 | ___ 193 | 194 | ### IValidateKeyResponse 195 | 196 | • **IValidateKeyResponse**: 197 | 198 | ___ 199 | 200 | ### ModStatus 201 | 202 | • **ModStatus**: 203 | 204 | ___ 205 | 206 | ### NexusError 207 | 208 | • **NexusError**: 209 | 210 | ___ 211 | 212 | ### ParameterInvalid 213 | 214 | • **ParameterInvalid**: 215 | 216 | ___ 217 | 218 | ### RateLimitError 219 | 220 | • **RateLimitError**: 221 | 222 | ___ 223 | 224 | ### TimeoutError 225 | 226 | • **TimeoutError**: 227 | 228 | ___ 229 | 230 | ### UpdatePeriod 231 | 232 | • **UpdatePeriod**: 233 | -------------------------------------------------------------------------------- /docs/modules/_nexus_.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["Nexus"](_nexus_.md) 2 | 3 | # Module: "Nexus" 4 | 5 | ## Index 6 | 7 | ### Classes 8 | 9 | * [Nexus](../classes/_nexus_.nexus.md) 10 | 11 | ### Interfaces 12 | 13 | * [IRequestArgs](../interfaces/_nexus_.irequestargs.md) 14 | 15 | ### Type aliases 16 | 17 | * [REST_METHOD](_nexus_.md#rest_method) 18 | 19 | ### Variables 20 | 21 | * [format](_nexus_.md#format) 22 | * [jwt](_nexus_.md#jwt) 23 | * [request](_nexus_.md#request) 24 | * [setCookieParser](_nexus_.md#setcookieparser) 25 | 26 | ### Functions 27 | 28 | * [handleRestResult](_nexus_.md#handlerestresult) 29 | * [parseRequestCookies](_nexus_.md#parserequestcookies) 30 | * [rest](_nexus_.md#rest) 31 | * [restGet](_nexus_.md#restget) 32 | * [restPost](_nexus_.md#restpost) 33 | * [transformJwtToValidationResult](_nexus_.md#transformjwttovalidationresult) 34 | 35 | ## Type aliases 36 | 37 | ### REST_METHOD 38 | 39 | Ƭ **REST_METHOD**: *"DELETE" | "POST"* 40 | 41 | *Defined in [src/Nexus.ts:16](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L16)* 42 | 43 | ## Variables 44 | 45 | ### format 46 | 47 | • **format**: *any* 48 | 49 | *Defined in [src/Nexus.ts:9](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L9)* 50 | 51 | ___ 52 | 53 | ### jwt 54 | 55 | • **jwt**: *any* 56 | 57 | *Defined in [src/Nexus.ts:11](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L11)* 58 | 59 | ___ 60 | 61 | ### request 62 | 63 | • **request**: *RequestAPI‹Request‹›, CoreOptions, UriOptions | UrlOptions›* 64 | 65 | *Defined in [src/Nexus.ts:8](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L8)* 66 | 67 | ___ 68 | 69 | ### setCookieParser 70 | 71 | • **setCookieParser**: *any* 72 | 73 | *Defined in [src/Nexus.ts:10](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L10)* 74 | 75 | ## Functions 76 | 77 | ### handleRestResult 78 | 79 | ▸ **handleRestResult**(`resolve`: any, `reject`: any, `url`: string, `error`: any, `response`: request.RequestResponse, `body`: any, `onUpdateLimit`: function): *any* 80 | 81 | *Defined in [src/Nexus.ts:35](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L35)* 82 | 83 | **Parameters:** 84 | 85 | ▪ **resolve**: *any* 86 | 87 | ▪ **reject**: *any* 88 | 89 | ▪ **url**: *string* 90 | 91 | ▪ **error**: *any* 92 | 93 | ▪ **response**: *request.RequestResponse* 94 | 95 | ▪ **body**: *any* 96 | 97 | ▪ **onUpdateLimit**: *function* 98 | 99 | ▸ (`daily`: number, `hourly`: number): *void* 100 | 101 | **Parameters:** 102 | 103 | Name | Type | 104 | ------ | ------ | 105 | `daily` | number | 106 | `hourly` | number | 107 | 108 | **Returns:** *any* 109 | 110 | ___ 111 | 112 | ### parseRequestCookies 113 | 114 | ▸ **parseRequestCookies**(`args`: [IRequestArgs](../interfaces/_nexus_.irequestargs.md)): *[IRequestArgs](../interfaces/_nexus_.irequestargs.md)* 115 | 116 | *Defined in [src/Nexus.ts:155](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L155)* 117 | 118 | **Parameters:** 119 | 120 | Name | Type | 121 | ------ | ------ | 122 | `args` | [IRequestArgs](../interfaces/_nexus_.irequestargs.md) | 123 | 124 | **Returns:** *[IRequestArgs](../interfaces/_nexus_.irequestargs.md)* 125 | 126 | ___ 127 | 128 | ### rest 129 | 130 | ▸ **rest**(`url`: string, `args`: [IRequestArgs](../interfaces/_nexus_.irequestargs.md), `onUpdateLimit`: function, `method?`: [REST_METHOD](_nexus_.md#rest_method)): *Promise‹any›* 131 | 132 | *Defined in [src/Nexus.ts:164](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L164)* 133 | 134 | **Parameters:** 135 | 136 | ▪ **url**: *string* 137 | 138 | ▪ **args**: *[IRequestArgs](../interfaces/_nexus_.irequestargs.md)* 139 | 140 | ▪ **onUpdateLimit**: *function* 141 | 142 | ▸ (`daily`: number, `hourly`: number): *void* 143 | 144 | **Parameters:** 145 | 146 | Name | Type | 147 | ------ | ------ | 148 | `daily` | number | 149 | `hourly` | number | 150 | 151 | ▪`Optional` **method**: *[REST_METHOD](_nexus_.md#rest_method)* 152 | 153 | **Returns:** *Promise‹any›* 154 | 155 | ___ 156 | 157 | ### restGet 158 | 159 | ▸ **restGet**(`url`: string, `args`: [IRequestArgs](../interfaces/_nexus_.irequestargs.md), `onUpdateLimit`: function): *Promise‹any›* 160 | 161 | *Defined in [src/Nexus.ts:107](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L107)* 162 | 163 | **Parameters:** 164 | 165 | ▪ **url**: *string* 166 | 167 | ▪ **args**: *[IRequestArgs](../interfaces/_nexus_.irequestargs.md)* 168 | 169 | ▪ **onUpdateLimit**: *function* 170 | 171 | ▸ (`daily`: number, `hourly`: number): *void* 172 | 173 | **Parameters:** 174 | 175 | Name | Type | 176 | ------ | ------ | 177 | `daily` | number | 178 | `hourly` | number | 179 | 180 | **Returns:** *Promise‹any›* 181 | 182 | ___ 183 | 184 | ### restPost 185 | 186 | ▸ **restPost**(`method`: [REST_METHOD](_nexus_.md#rest_method), `url`: string, `args`: [IRequestArgs](../interfaces/_nexus_.irequestargs.md), `onUpdateLimit`: function): *Promise‹any›* 187 | 188 | *Defined in [src/Nexus.ts:130](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L130)* 189 | 190 | **Parameters:** 191 | 192 | ▪ **method**: *[REST_METHOD](_nexus_.md#rest_method)* 193 | 194 | ▪ **url**: *string* 195 | 196 | ▪ **args**: *[IRequestArgs](../interfaces/_nexus_.irequestargs.md)* 197 | 198 | ▪ **onUpdateLimit**: *function* 199 | 200 | ▸ (`daily`: number, `hourly`: number): *void* 201 | 202 | **Parameters:** 203 | 204 | Name | Type | 205 | ------ | ------ | 206 | `daily` | number | 207 | `hourly` | number | 208 | 209 | **Returns:** *Promise‹any›* 210 | 211 | ___ 212 | 213 | ### transformJwtToValidationResult 214 | 215 | ▸ **transformJwtToValidationResult**(`oAuthCredentials`: [IOAuthCredentials](../interfaces/_types_.ioauthcredentials.md)): *[IValidateKeyResponse](../interfaces/_types_.ivalidatekeyresponse.md)* 216 | 217 | *Defined in [src/Nexus.ts:170](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Nexus.ts#L170)* 218 | 219 | **Parameters:** 220 | 221 | Name | Type | 222 | ------ | ------ | 223 | `oAuthCredentials` | [IOAuthCredentials](../interfaces/_types_.ioauthcredentials.md) | 224 | 225 | **Returns:** *[IValidateKeyResponse](../interfaces/_types_.ivalidatekeyresponse.md)* 226 | -------------------------------------------------------------------------------- /docs/modules/_parameters_.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["parameters"](_parameters_.md) 2 | 3 | # Module: "parameters" 4 | 5 | ## Index 6 | 7 | ### Variables 8 | 9 | * [API_URL](_parameters_.md#const-api_url) 10 | * [DEFAULT_TIMEOUT_MS](_parameters_.md#const-default_timeout_ms) 11 | * [DELAY_AFTER_429_MS](_parameters_.md#const-delay_after_429_ms) 12 | * [MAX_FILE_SIZE](_parameters_.md#const-max_file_size) 13 | * [MAX_JWT_REFRESH_TRIES](_parameters_.md#const-max_jwt_refresh_tries) 14 | * [PROTOCOL_VERSION](_parameters_.md#const-protocol_version) 15 | * [QUOTA_MAX](_parameters_.md#const-quota_max) 16 | * [QUOTA_MAX_PREMIUM](_parameters_.md#const-quota_max_premium) 17 | * [QUOTA_RATE_MS](_parameters_.md#const-quota_rate_ms) 18 | * [SECURITY_PROTOCOL_VERSION](_parameters_.md#const-security_protocol_version) 19 | * [USER_SERVICE_API_URL](_parameters_.md#const-user_service_api_url) 20 | 21 | ## Variables 22 | 23 | ### `Const` API_URL 24 | 25 | • **API_URL**: *string* = "https://api.nexusmods.com/v1" 26 | 27 | *Defined in [src/parameters.ts:17](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/parameters.ts#L17)* 28 | 29 | ___ 30 | 31 | ### `Const` DEFAULT_TIMEOUT_MS 32 | 33 | • **DEFAULT_TIMEOUT_MS**: *number* = 30000 34 | 35 | *Defined in [src/parameters.ts:11](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/parameters.ts#L11)* 36 | 37 | ___ 38 | 39 | ### `Const` DELAY_AFTER_429_MS 40 | 41 | • **DELAY_AFTER_429_MS**: *number* = 1000 42 | 43 | *Defined in [src/parameters.ts:15](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/parameters.ts#L15)* 44 | 45 | ___ 46 | 47 | ### `Const` MAX_FILE_SIZE 48 | 49 | • **MAX_FILE_SIZE**: *number* = 20 * 1024 * 1024 50 | 51 | *Defined in [src/parameters.ts:30](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/parameters.ts#L30)* 52 | 53 | ___ 54 | 55 | ### `Const` MAX_JWT_REFRESH_TRIES 56 | 57 | • **MAX_JWT_REFRESH_TRIES**: *number* = 3 58 | 59 | *Defined in [src/parameters.ts:32](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/parameters.ts#L32)* 60 | 61 | ___ 62 | 63 | ### `Const` PROTOCOL_VERSION 64 | 65 | • **PROTOCOL_VERSION**: *string* = require('../package.json').version.split('-')[0] 66 | 67 | *Defined in [src/parameters.ts:23](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/parameters.ts#L23)* 68 | 69 | ___ 70 | 71 | ### `Const` QUOTA_MAX 72 | 73 | • **QUOTA_MAX**: *number* = 50 74 | 75 | *Defined in [src/parameters.ts:7](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/parameters.ts#L7)* 76 | 77 | ___ 78 | 79 | ### `Const` QUOTA_MAX_PREMIUM 80 | 81 | • **QUOTA_MAX_PREMIUM**: *number* = 50 82 | 83 | *Defined in [src/parameters.ts:9](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/parameters.ts#L9)* 84 | 85 | ___ 86 | 87 | ### `Const` QUOTA_RATE_MS 88 | 89 | • **QUOTA_RATE_MS**: *number* = 1000 90 | 91 | *Defined in [src/parameters.ts:5](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/parameters.ts#L5)* 92 | 93 | ___ 94 | 95 | ### `Const` SECURITY_PROTOCOL_VERSION 96 | 97 | • **SECURITY_PROTOCOL_VERSION**: *string* = "TLSv1_2_method" 98 | 99 | *Defined in [src/parameters.ts:27](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/parameters.ts#L27)* 100 | 101 | ___ 102 | 103 | ### `Const` USER_SERVICE_API_URL 104 | 105 | • **USER_SERVICE_API_URL**: *string* = "https://users.nexusmods.com" 106 | 107 | *Defined in [src/parameters.ts:19](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/parameters.ts#L19)* 108 | -------------------------------------------------------------------------------- /docs/modules/_quota_.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["Quota"](_quota_.md) 2 | 3 | # Module: "Quota" 4 | 5 | ## Index 6 | 7 | ### Classes 8 | 9 | * [Quota](../classes/_quota_.quota.md) 10 | 11 | ### Functions 12 | 13 | * [delay](_quota_.md#delay) 14 | 15 | ## Functions 16 | 17 | ### delay 18 | 19 | ▸ **delay**(`milliseconds`: number): *Promise‹void›* 20 | 21 | *Defined in [src/Quota.ts:3](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/Quota.ts#L3)* 22 | 23 | **Parameters:** 24 | 25 | Name | Type | 26 | ------ | ------ | 27 | `milliseconds` | number | 28 | 29 | **Returns:** *Promise‹void›* 30 | -------------------------------------------------------------------------------- /docs/modules/_types_.md: -------------------------------------------------------------------------------- 1 | [@nexusmods/nexus-api](../README.md) › [Globals](../globals.md) › ["types"](_types_.md) 2 | 3 | # Module: "types" 4 | 5 | ## Index 6 | 7 | ### Interfaces 8 | 9 | * [ICategory](../interfaces/_types_.icategory.md) 10 | * [IChangelogs](../interfaces/_types_.ichangelogs.md) 11 | * [IColourScheme](../interfaces/_types_.icolourscheme.md) 12 | * [IDownloadURL](../interfaces/_types_.idownloadurl.md) 13 | * [IEndorseResponse](../interfaces/_types_.iendorseresponse.md) 14 | * [IEndorsement](../interfaces/_types_.iendorsement.md) 15 | * [IFeedbackResponse](../interfaces/_types_.ifeedbackresponse.md) 16 | * [IFileInfo](../interfaces/_types_.ifileinfo.md) 17 | * [IFileUpdate](../interfaces/_types_.ifileupdate.md) 18 | * [IGameInfo](../interfaces/_types_.igameinfo.md) 19 | * [IGameListEntry](../interfaces/_types_.igamelistentry.md) 20 | * [IGithubIssue](../interfaces/_types_.igithubissue.md) 21 | * [IIssue](../interfaces/_types_.iissue.md) 22 | * [IMD5Result](../interfaces/_types_.imd5result.md) 23 | * [IModFiles](../interfaces/_types_.imodfiles.md) 24 | * [IModInfo](../interfaces/_types_.imodinfo.md) 25 | * [IModInfoEx](../interfaces/_types_.imodinfoex.md) 26 | * [INexusEvents](../interfaces/_types_.inexusevents.md) 27 | * [IOAuthConfig](../interfaces/_types_.ioauthconfig.md) 28 | * [IOAuthCredentials](../interfaces/_types_.ioauthcredentials.md) 29 | * [ITrackResponse](../interfaces/_types_.itrackresponse.md) 30 | * [ITrackedMod](../interfaces/_types_.itrackedmod.md) 31 | * [IUpdateEntry](../interfaces/_types_.iupdateentry.md) 32 | * [IUser](../interfaces/_types_.iuser.md) 33 | * [IValidateKeyResponse](../interfaces/_types_.ivalidatekeyresponse.md) 34 | 35 | ### Type aliases 36 | 37 | * [EndorsedStatus](_types_.md#endorsedstatus) 38 | * [ModStatus](_types_.md#modstatus) 39 | * [UpdatePeriod](_types_.md#updateperiod) 40 | 41 | ## Type aliases 42 | 43 | ### EndorsedStatus 44 | 45 | Ƭ **EndorsedStatus**: *"Undecided" | "Abstained" | "Endorsed"* 46 | 47 | *Defined in [src/types.ts:41](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L41)* 48 | 49 | ___ 50 | 51 | ### ModStatus 52 | 53 | Ƭ **ModStatus**: *"under_moderation" | "published" | "not_published" | "publish_with_game" | "removed" | "wastebinned" | "hidden"* 54 | 55 | *Defined in [src/types.ts:46](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L46)* 56 | 57 | possible states the mod can be in 58 | 59 | ___ 60 | 61 | ### UpdatePeriod 62 | 63 | Ƭ **UpdatePeriod**: *"1d" | "1w" | "1m"* 64 | 65 | *Defined in [src/types.ts:487](https://github.com/Nexus-Mods/node-nexus-api/blob/af3f187/src/types.ts#L487)* 66 | 67 | range of updates to query 68 | -------------------------------------------------------------------------------- /lib/Nexus.d.ts: -------------------------------------------------------------------------------- 1 | import * as types from './types'; 2 | import * as graphQL from './typesGraphQL'; 3 | import { IGraphQLError, LogFunc } from './types'; 4 | import { RatingOptions } from '.'; 5 | declare class Nexus { 6 | private mBaseData; 7 | private mBaseURL; 8 | private mUserServiceBaseURL; 9 | private mGraphBaseURL; 10 | private mQuota; 11 | private mValidationResult; 12 | private mRateLimit; 13 | private mLogCB; 14 | private mOAuthCredentials; 15 | private mOAuthConfig; 16 | private mJWTRefreshCallback; 17 | private mJwtRefreshTries; 18 | constructor(appName: string, appVersion: string, defaultGame: string, timeout?: number); 19 | static create(apiKey: string, appName: string, appVersion: string, defaultGame: string, timeout?: number): Promise; 20 | setLogger(logCB: LogFunc): void; 21 | static createWithOAuth(credentials: types.IOAuthCredentials, config: types.IOAuthConfig, appName: string, appVersion: string, defaultGame: string, timeout?: number, onJWTRefresh?: (credentials: types.IOAuthCredentials) => void): Promise; 22 | setGame(gameId: string): void; 23 | revalidate(): Promise; 24 | getValidationResult(): types.IValidateKeyResponse; 25 | setOAuthCredentials(credentials: types.IOAuthCredentials, config: types.IOAuthConfig, onJWTRefresh: (credentials: types.IOAuthCredentials) => void): Promise; 26 | setKey(apiKey: string): Promise; 27 | getRateLimits(): { 28 | daily: number; 29 | hourly: number; 30 | }; 31 | validateKey(key?: string): Promise; 32 | getUserInfo(): Promise; 33 | getTrackedMods(): Promise; 34 | trackMod(modId: string, gameId?: string): Promise; 35 | untrackMod(modId: string, gameId?: string): Promise; 36 | getGames(): Promise; 37 | getLatestAdded(gameId?: string): Promise; 38 | getLatestUpdated(gameId?: string): Promise; 39 | getTrending(gameId?: string): Promise; 40 | getEndorsements(): Promise; 41 | getColourschemes(): Promise; 42 | getColorschemes(): Promise; 43 | getGameInfo(gameId?: string): Promise; 44 | getRecentlyUpdatedMods(period: types.UpdatePeriod, gameId?: string): Promise; 45 | endorseMod(modId: number, modVersion: string, endorseStatus: 'endorse' | 'abstain', gameId?: string): Promise; 46 | private isValidValue; 47 | getModInfo(modId: number, gameId?: string): Promise; 48 | getChangelogs(modId: number, gameId?: string): Promise; 49 | getModFiles(modId: number, gameId?: string): Promise; 50 | getFileInfo(modId: number, fileId: number, gameId?: string): Promise; 51 | getDownloadURLs(modId: number, fileId: number, key?: string, expires?: number, gameId?: string): Promise; 52 | getFileByMD5(hash: string, gameId?: string): Promise; 53 | userById(query: graphQL.IUserQuery, userId: number): Promise; 54 | modsByUid(query: graphQL.IModQuery, uids: string[]): Promise[]>; 55 | modFilesByUid(query: graphQL.IModFileQuery, uids: string[]): Promise[]>; 56 | fileHashes(query: graphQL.IFileHashQuery, md5Hashes: string[]): Promise<{ 57 | data: Partial[]; 58 | errors: IGraphQLError[]; 59 | }>; 60 | getCollectionDownloadLink(downloadLink: string): Promise; 61 | createCollection(data: types.ICollectionPayload, assetFileUUID: string, retQuery?: graphQL.ICreateCollectionQuery): Promise; 62 | updateCollection(data: types.ICollectionPayload, assetFileUUID: string, collectionId: number, retQuery?: graphQL.ICreateCollectionQuery): Promise; 63 | createOrUpdateRevision(data: types.ICollectionPayload, assetFileUUID: string, collectionId: number, retQuery?: graphQL.ICreateCollectionQuery): Promise; 64 | editCollection(collectionId: number, name: string, summary?: string, description?: string, category?: number): Promise; 65 | publishRevision(revisionId: number): Promise; 66 | attachCollectionsToCategory(categoryId: number, collectionIds: number[]): Promise; 67 | getCollectionGraph(query: graphQL.ICollectionQuery, slug: string, ignoreAdultBlock?: boolean): Promise>; 68 | getCollectionListGraph(query: graphQL.ICollectionQuery, gameId?: string, count?: number, offset?: number): Promise[]>; 69 | getMyCollections(query: graphQL.ICollectionQuery, gameId?: string, count?: number, offset?: number): Promise[]>; 70 | getCollectionRevisionGraph(query: graphQL.IRevisionQuery, collectionSlug: string, revisionNumber: number, ignoreAdultBlock?: boolean): Promise>; 71 | getRevisionUploadUrl(): Promise; 72 | endorseCollection(collectionId: number, endorseStatus: 'abstain' | 'endorse', gameId?: string): Promise<{ 73 | success: boolean; 74 | }>; 75 | rateRevision(revisionId: number, rating: RatingOptions): Promise<{ 76 | success: boolean; 77 | averageRating: types.IRating; 78 | }>; 79 | getCollectionVideo(collectionId: number, videoId: string): Promise; 80 | getOwnIssues(): Promise; 81 | sendFeedback(title: string, message: string, fileBundle: string, anonymous: boolean, groupingKey?: string, id?: string): Promise; 82 | private defaultCreateQuery; 83 | private checkFileSize; 84 | private request; 85 | private makeQueryImpl; 86 | private makeParameters; 87 | private makeFilter; 88 | private makeQuery; 89 | private makeMutation; 90 | private genError; 91 | private requestGraph; 92 | private requestGraphWithErrors; 93 | private convertErrDetail; 94 | private mutateGraph; 95 | private set oAuthCredentials(value); 96 | private handleJwtRefresh; 97 | private filter; 98 | private args; 99 | } 100 | export default Nexus; 101 | -------------------------------------------------------------------------------- /lib/OAuthCredentials.d.ts: -------------------------------------------------------------------------------- 1 | export default class OAuthCredentials { 2 | token: string; 3 | refreshToken: string; 4 | fingerprint: string; 5 | constructor(token: string, refreshToken: string, fingerprint: string); 6 | } 7 | -------------------------------------------------------------------------------- /lib/OAuthCredentials.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | class OAuthCredentials { 4 | constructor(token, refreshToken, fingerprint) { 5 | this.token = token; 6 | this.refreshToken = refreshToken; 7 | this.fingerprint = fingerprint; 8 | } 9 | } 10 | exports.default = OAuthCredentials; 11 | //# sourceMappingURL=OAuthCredentials.js.map -------------------------------------------------------------------------------- /lib/OAuthCredentials.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"OAuthCredentials.js","sourceRoot":"","sources":["../src/OAuthCredentials.ts"],"names":[],"mappings":";;AAAA,MAAqB,gBAAgB;IAKjC,YAAY,KAAa,EAAE,YAAoB,EAAE,WAAmB;QAChE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;CACJ;AAVD,mCAUC"} -------------------------------------------------------------------------------- /lib/Quota.d.ts: -------------------------------------------------------------------------------- 1 | declare class Quota { 2 | private mCount; 3 | private mMaximum; 4 | private mMSPerIncrement; 5 | private mLastCheck; 6 | private mBlockHour; 7 | private mLimit; 8 | private mInitBlock; 9 | private mOnInitDone; 10 | constructor(init: number, max: number, msPerIncrement: number); 11 | updateLimit(limit: number): void; 12 | finishInit(): void; 13 | block(): boolean; 14 | wait(): Promise; 15 | } 16 | export default Quota; 17 | -------------------------------------------------------------------------------- /lib/Quota.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | Object.defineProperty(exports, "__esModule", { value: true }); 12 | const customErrors_1 = require("./customErrors"); 13 | function delay(milliseconds) { 14 | return new Promise((resolve) => { 15 | setTimeout(() => { 16 | resolve(); 17 | }, milliseconds); 18 | }); 19 | } 20 | class Quota { 21 | constructor(init, max, msPerIncrement) { 22 | this.mLastCheck = Date.now(); 23 | this.mLimit = 1000; 24 | this.mCount = init; 25 | this.mMaximum = max; 26 | this.mMSPerIncrement = msPerIncrement; 27 | } 28 | updateLimit(limit) { 29 | this.mLimit = limit; 30 | } 31 | finishInit() { 32 | var _a; 33 | (_a = this.mOnInitDone) === null || _a === void 0 ? void 0 : _a.call(this); 34 | this.mOnInitDone = undefined; 35 | } 36 | block() { 37 | this.mCount = 0; 38 | this.mLastCheck = Date.now(); 39 | if (this.mLimit <= 0) { 40 | this.mBlockHour = (new Date()).getHours(); 41 | return true; 42 | } 43 | return false; 44 | } 45 | wait() { 46 | return __awaiter(this, void 0, void 0, function* () { 47 | const now = new Date(); 48 | if (this.mInitBlock === undefined) { 49 | this.mInitBlock = new Promise(resolve => { this.mOnInitDone = resolve; }); 50 | } 51 | else { 52 | yield this.mInitBlock; 53 | } 54 | if ((this.mBlockHour !== undefined) 55 | && (now.getHours() === this.mBlockHour)) { 56 | if (now.getMinutes() === 59) { 57 | return delay((60 - now.getSeconds()) * 1000); 58 | } 59 | else { 60 | return Promise.reject(new customErrors_1.RateLimitError()); 61 | } 62 | } 63 | const recovered = Math.floor((now.getTime() - this.mLastCheck) / this.mMSPerIncrement); 64 | this.mCount = Math.min(this.mCount + recovered, this.mMaximum); 65 | this.mLastCheck = now.getTime(); 66 | --this.mCount; 67 | if (this.mCount >= 0) { 68 | return Promise.resolve(); 69 | } 70 | else { 71 | return delay(this.mCount * this.mMSPerIncrement * -1); 72 | } 73 | }); 74 | } 75 | } 76 | exports.default = Quota; 77 | //# sourceMappingURL=Quota.js.map -------------------------------------------------------------------------------- /lib/Quota.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Quota.js","sourceRoot":"","sources":["../src/Quota.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iDAAgD;AAEhD,SAAS,KAAK,CAAC,YAAoB;IACjC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,UAAU,CAAC,GAAG,EAAE;YACd,OAAO,EAAE,CAAC;QACZ,CAAC,EAAE,YAAY,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,KAAK;IAcT,YAAY,IAAY,EAAE,GAAW,EAAE,cAAsB;QAVrD,eAAU,GAAW,IAAI,CAAC,GAAG,EAAE,CAAC;QAEhC,WAAM,GAAW,IAAI,CAAC;QAS5B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CAAC;IAEM,WAAW,CAAC,KAAa;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAEM,UAAU;;QACf,MAAA,IAAI,CAAC,WAAW,+CAAhB,IAAI,EAAiB;QACrB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;IAC/B,CAAC;IAQM,KAAK;QACV,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;YAEpB,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAEY,IAAI;;YACf,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;YAEvB,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE;gBACjC,IAAI,CAAC,UAAU,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,WAAW,GAAG,OAAO,CAAA,CAAC,CAAC,CAAC,CAAC;aAC1E;iBAAM;gBACL,MAAM,IAAI,CAAC,UAAU,CAAC;aACvB;YAED,IAAI,CAAC,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC;mBAC5B,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,UAAU,CAAC,EAAE;gBAI3C,IAAI,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;oBAC3B,OAAO,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;iBAC9C;qBAAM;oBACL,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,6BAAc,EAAE,CAAC,CAAC;iBAC7C;aACF;YAED,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC;YACvF,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC/D,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;YAChC,EAAE,IAAI,CAAC,MAAM,CAAC;YACd,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;gBACpB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;aAC1B;iBAAM;gBACL,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC;aACvD;QACH,CAAC;KAAA;CACF;AAED,kBAAe,KAAK,CAAC"} -------------------------------------------------------------------------------- /lib/customErrors.d.ts: -------------------------------------------------------------------------------- 1 | import { GraphErrorAttribute, GraphErrorCode, GraphErrorEntity, GraphErrorItemCode, GraphErrorType } from "./types"; 2 | export declare class TimeoutError extends Error { 3 | constructor(message: any); 4 | } 5 | export declare class ProtocolError extends Error { 6 | constructor(message: string); 7 | } 8 | export declare class RateLimitError extends Error { 9 | constructor(); 10 | } 11 | export declare class HTTPError extends Error { 12 | private mStatusCode; 13 | private mBody; 14 | private mURL; 15 | constructor(statusCode: number, message: string, body?: string, url?: string); 16 | get statusCode(): number; 17 | get body(): string; 18 | get url(): string; 19 | } 20 | export declare class NexusError extends Error { 21 | private mStatusCode; 22 | private mRequest; 23 | private mCode; 24 | private mDescription; 25 | constructor(message: string, statusCode: number, url: string, code: string, description?: string); 26 | get statusCode(): number; 27 | get request(): string; 28 | get code(): string; 29 | get description(): string; 30 | } 31 | export interface IGraphErrorDetail { 32 | attribute: GraphErrorAttribute; 33 | code: GraphErrorItemCode; 34 | entity: GraphErrorEntity; 35 | message: string; 36 | type: GraphErrorType; 37 | value: any; 38 | } 39 | export declare class GraphError extends Error { 40 | private mCode; 41 | private mDetails; 42 | constructor(message: string, code: GraphErrorCode, details: IGraphErrorDetail[]); 43 | get code(): GraphErrorCode; 44 | get details(): IGraphErrorDetail[]; 45 | } 46 | export declare class ParameterInvalid extends Error { 47 | constructor(message: any); 48 | } 49 | export declare class JwtExpiredError extends Error { 50 | constructor(); 51 | } 52 | -------------------------------------------------------------------------------- /lib/customErrors.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | class TimeoutError extends Error { 4 | constructor(message) { 5 | super(message); 6 | this.name = this.constructor.name; 7 | } 8 | } 9 | exports.TimeoutError = TimeoutError; 10 | class ProtocolError extends Error { 11 | constructor(message) { 12 | super(message); 13 | this.name = this.constructor.name; 14 | } 15 | } 16 | exports.ProtocolError = ProtocolError; 17 | class RateLimitError extends Error { 18 | constructor() { 19 | super('Rate Limit Exceeded'); 20 | this.name = this.constructor.name; 21 | } 22 | } 23 | exports.RateLimitError = RateLimitError; 24 | class HTTPError extends Error { 25 | constructor(statusCode, message, body, url) { 26 | super(`HTTP (${statusCode}) - ${message}`); 27 | this.mStatusCode = statusCode; 28 | this.name = this.constructor.name; 29 | this.mStatusCode = statusCode; 30 | this.mBody = body !== null && body !== void 0 ? body : ''; 31 | this.mURL = url !== null && url !== void 0 ? url : ''; 32 | } 33 | get statusCode() { 34 | return this.mStatusCode; 35 | } 36 | get body() { 37 | return this.mBody; 38 | } 39 | get url() { 40 | return this.mURL; 41 | } 42 | } 43 | exports.HTTPError = HTTPError; 44 | class NexusError extends Error { 45 | constructor(message, statusCode, url, code, description) { 46 | super(message); 47 | this.mStatusCode = statusCode; 48 | this.mRequest = url; 49 | this.mCode = code; 50 | this.mDescription = description; 51 | } 52 | get statusCode() { 53 | return this.mStatusCode; 54 | } 55 | get request() { 56 | return this.mRequest; 57 | } 58 | get code() { 59 | return this.mCode; 60 | } 61 | get description() { 62 | return this.mDescription; 63 | } 64 | } 65 | exports.NexusError = NexusError; 66 | class GraphError extends Error { 67 | constructor(message, code, details) { 68 | super(message); 69 | this.mCode = code; 70 | this.mDetails = details; 71 | } 72 | get code() { 73 | return this.mCode; 74 | } 75 | get details() { 76 | return this.mDetails; 77 | } 78 | } 79 | exports.GraphError = GraphError; 80 | class ParameterInvalid extends Error { 81 | constructor(message) { 82 | super(message); 83 | this.name = this.constructor.name; 84 | } 85 | } 86 | exports.ParameterInvalid = ParameterInvalid; 87 | class JwtExpiredError extends Error { 88 | constructor() { 89 | super('JWT has expired'); 90 | this.name = this.constructor.name; 91 | } 92 | } 93 | exports.JwtExpiredError = JwtExpiredError; 94 | //# sourceMappingURL=customErrors.js.map -------------------------------------------------------------------------------- /lib/customErrors.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"customErrors.js","sourceRoot":"","sources":["../src/customErrors.ts"],"names":[],"mappings":";;AAKA,MAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAO;QACjB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AALD,oCAKC;AAKD,MAAa,aAAc,SAAQ,KAAK;IACtC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AALD,sCAKC;AAMD,MAAa,cAAe,SAAQ,KAAK;IACvC;QACE,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AALD,wCAKC;AAKD,MAAa,SAAU,SAAQ,KAAK;IAIlC,YAAY,UAAkB,EAAE,OAAe,EAAE,IAAa,EAAE,GAAY;QAC1E,KAAK,CAAC,SAAS,UAAU,OAAO,OAAO,EAAE,CAAC,CAAC;QAC3C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAClC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,CAAC;IACxB,CAAC;IACD,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IACD,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IACD,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AArBD,8BAqBC;AAKD,MAAa,UAAW,SAAQ,KAAK;IAKnC,YAAY,OAAe,EAAE,UAAkB,EAAE,GAAW,EAAE,IAAY,EAAE,WAAoB;QAC9F,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;CACF;AA5BD,gCA4BC;AAWD,MAAa,UAAW,SAAQ,KAAK;IAGnC,YAAY,OAAe,EAAE,IAAoB,EAAE,OAA4B;QAC7E,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AAhBD,gCAgBC;AAKD,MAAa,gBAAiB,SAAQ,KAAK;IACzC,YAAY,OAAO;QACjB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AALD,4CAKC;AAMD,MAAa,eAAgB,SAAQ,KAAK;IACxC;QACE,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AALD,0CAKC"} -------------------------------------------------------------------------------- /lib/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './types'; 2 | export * from './typesGraphQL'; 3 | export * from './customErrors'; 4 | import Nexus from './Nexus'; 5 | export default Nexus; 6 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | __export(require("./customErrors")); 7 | const Nexus_1 = require("./Nexus"); 8 | exports.default = Nexus_1.default; 9 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /lib/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAEA,oCAA+B;AAC/B,mCAA4B;AAE5B,kBAAe,eAAK,CAAC"} -------------------------------------------------------------------------------- /lib/parameters.d.ts: -------------------------------------------------------------------------------- 1 | export declare const QUOTA_RATE_MS: number; 2 | export declare const QUOTA_MAX: number; 3 | export declare const QUOTA_MAX_PREMIUM: number; 4 | export declare const DEFAULT_TIMEOUT_MS: number; 5 | export declare const DELAY_AFTER_429_MS: number; 6 | export declare const BASE_URL: string; 7 | export declare const API_URL: string; 8 | export declare const GRAPHQL_URL: string; 9 | export declare const API_DEV_URL: string; 10 | export declare const APIKEY_DEV: string; 11 | export declare const USER_SERVICE_API_URL: string; 12 | export declare const PROTOCOL_VERSION: string; 13 | export declare const MAX_FILE_SIZE: number; 14 | export declare const MAX_JWT_REFRESH_TRIES: number; 15 | export declare const MAX_BATCH_SIZE: number; 16 | -------------------------------------------------------------------------------- /lib/parameters.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.QUOTA_RATE_MS = 1000; 4 | exports.QUOTA_MAX = 50; 5 | exports.QUOTA_MAX_PREMIUM = 50; 6 | exports.DEFAULT_TIMEOUT_MS = 30000; 7 | exports.DELAY_AFTER_429_MS = 1000; 8 | const NEXUS_DOMAIN = process.env['NEXUS_DOMAIN'] || 'nexusmods.com'; 9 | const API_SUBDOMAIN = process.env['API_SUBDOMAIN'] || 'api'; 10 | const USERS_SUBDOMAIN = process.env['USERS_SUBDOMAIN'] || 'users'; 11 | exports.BASE_URL = `https://${API_SUBDOMAIN}.${NEXUS_DOMAIN}`; 12 | exports.API_URL = `${exports.BASE_URL}/v1`; 13 | exports.GRAPHQL_URL = `${exports.BASE_URL}/v2/graphql`; 14 | exports.API_DEV_URL = ''; 15 | exports.APIKEY_DEV = ''; 16 | exports.USER_SERVICE_API_URL = `https://${USERS_SUBDOMAIN}.${NEXUS_DOMAIN}`; 17 | exports.PROTOCOL_VERSION = require('../package.json').version.split('-')[0]; 18 | exports.MAX_FILE_SIZE = 40 * 1024 * 1024; 19 | exports.MAX_JWT_REFRESH_TRIES = 3; 20 | exports.MAX_BATCH_SIZE = 500; 21 | //# sourceMappingURL=parameters.js.map -------------------------------------------------------------------------------- /lib/parameters.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../src/parameters.ts"],"names":[],"mappings":";;AAIa,QAAA,aAAa,GAAW,IAAI,CAAC;AAE7B,QAAA,SAAS,GAAW,EAAE,CAAC;AAEvB,QAAA,iBAAiB,GAAW,EAAE,CAAC;AAE/B,QAAA,kBAAkB,GAAW,KAAK,CAAC;AAInC,QAAA,kBAAkB,GAAW,IAAI,CAAC;AAE/C,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,eAAe,CAAC;AAEpE,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC;AAC5D,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,OAAO,CAAC;AAErD,QAAA,QAAQ,GAAW,WAAW,aAAa,IAAI,YAAY,EAAE,CAAC;AAC9D,QAAA,OAAO,GAAW,GAAG,gBAAQ,KAAK,CAAC;AACnC,QAAA,WAAW,GAAW,GAAG,gBAAQ,aAAa,CAAC;AAI/C,QAAA,WAAW,GAAW,EAAE,CAAC;AACzB,QAAA,UAAU,GAAW,EAAE,CAAC;AAExB,QAAA,oBAAoB,GAAW,WAAW,eAAe,IAAI,YAAY,EAAE,CAAC;AAI5E,QAAA,gBAAgB,GAAW,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAG5E,QAAA,aAAa,GAAW,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEzC,QAAA,qBAAqB,GAAW,CAAC,CAAC;AAElC,QAAA,cAAc,GAAW,GAAG,CAAC"} -------------------------------------------------------------------------------- /lib/types.d.ts: -------------------------------------------------------------------------------- 1 | export interface IValidateKeyResponse { 2 | user_id: number; 3 | key: string; 4 | name: string; 5 | is_premium: boolean; 6 | is_supporter: boolean; 7 | email: string; 8 | profile_url: string; 9 | } 10 | export interface IUser { 11 | member_id: number; 12 | member_group_id: number; 13 | name: string; 14 | avatar?: string; 15 | } 16 | export interface IUserInfo { 17 | sub: string; 18 | name: string; 19 | email: string; 20 | avatar: string; 21 | group_id: number; 22 | membership_roles: string[]; 23 | premium_expiry: number; 24 | } 25 | export declare type EndorsedStatus = 'Undecided' | 'Abstained' | 'Endorsed'; 26 | export declare type ModStatus = 'under_moderation' | 'published' | 'not_published' | 'publish_with_game' | 'removed' | 'wastebinned' | 'hidden'; 27 | export interface IModInfo { 28 | mod_id: number; 29 | game_id: number; 30 | domain_name: string; 31 | category_id: number; 32 | contains_adult_content: boolean; 33 | name?: string; 34 | summary?: string; 35 | description?: string; 36 | version: string; 37 | author: string; 38 | user: IUser; 39 | uploaded_by: string; 40 | uploaded_users_profile_url: string; 41 | status: ModStatus; 42 | available: boolean; 43 | picture_url?: string; 44 | created_timestamp: number; 45 | created_time: string; 46 | updated_timestamp: number; 47 | updated_time: string; 48 | allow_rating: boolean; 49 | endorsement_count: number; 50 | mod_downloads: number; 51 | mod_unique_downloads: number; 52 | endorsement?: { 53 | endorse_status: EndorsedStatus; 54 | timestamp: number; 55 | version: number; 56 | }; 57 | } 58 | export interface IFileInfo { 59 | file_id: number; 60 | category_id: number; 61 | category_name: string; 62 | changelog_html: string; 63 | content_preview_link: string; 64 | name: string; 65 | description: string; 66 | version: string; 67 | size: number; 68 | size_kb: number; 69 | file_name: string; 70 | uploaded_timestamp: number; 71 | uploaded_time: string; 72 | mod_version: string; 73 | external_virus_scan_url: string; 74 | is_primary: boolean; 75 | } 76 | export interface IModFiles { 77 | file_updates: IFileUpdate[]; 78 | files: IFileInfo[]; 79 | } 80 | export interface IFileUpdate { 81 | new_file_id: number; 82 | new_file_name: string; 83 | old_file_id: number; 84 | old_file_name: string; 85 | uploaded_time: string; 86 | uploaded_timestamp: number; 87 | } 88 | export interface IModCategory { 89 | category_id: number; 90 | name: string; 91 | parent_category: number | false; 92 | } 93 | export interface IGameListEntry { 94 | id: number; 95 | domain_name: string; 96 | name: string; 97 | forum_url: string; 98 | nexusmods_url: string; 99 | genre: string; 100 | mods: number; 101 | file_count: number; 102 | downloads: number; 103 | approved_date: number; 104 | } 105 | export interface IGameInfo extends IGameListEntry { 106 | categories: IModCategory[]; 107 | } 108 | export interface IDownloadURL { 109 | URI: string; 110 | name: string; 111 | short_name: string; 112 | } 113 | export interface IModInfoEx extends IModInfo { 114 | mod_id: number; 115 | game_id: number; 116 | } 117 | export interface IMD5Result { 118 | mod: IModInfoEx; 119 | file_details: IFileInfo; 120 | } 121 | export interface IIssue { 122 | id: number; 123 | issue_number: number; 124 | issue_state: string; 125 | issue_title: string; 126 | } 127 | export interface IGithubIssue { 128 | id: number; 129 | issue_number: number; 130 | issue_title: string; 131 | issue_state: string; 132 | grouping_key: string; 133 | created_at: string; 134 | updated_at: string; 135 | } 136 | export interface ICollectionInfo { 137 | collection_id?: number; 138 | author: string; 139 | author_url: string; 140 | name: string; 141 | version: string; 142 | description: string; 143 | domain_name: string; 144 | adult_content: boolean; 145 | } 146 | export declare type UpdatePolicy = 'exact' | 'latest' | 'prefer'; 147 | export declare type SourceType = 'browse' | 'manual' | 'direct' | 'nexus'; 148 | export interface IFeedbackResponse { 149 | id: number; 150 | status: number; 151 | created_at: string; 152 | updated_at: string; 153 | reference: string; 154 | grouping_key: string; 155 | github_issue: IGithubIssue; 156 | user_blacklisted: boolean; 157 | count: number; 158 | } 159 | export interface IChangelogs { 160 | [versionNumber: string]: string[]; 161 | } 162 | export interface ITrackedMod { 163 | mod_id: number; 164 | domain_name: string; 165 | } 166 | export interface IEndorsement { 167 | mod_id: number; 168 | domain_name: string; 169 | date: number; 170 | version: string; 171 | status: EndorsedStatus; 172 | } 173 | export interface IEndorseResponse { 174 | message: string; 175 | status: EndorsedStatus; 176 | } 177 | export interface ITrackResponse { 178 | message: string; 179 | } 180 | export interface IColourScheme { 181 | id: number; 182 | name: string; 183 | primary_colour: string; 184 | secondary_colour: string; 185 | darker_colour: string; 186 | } 187 | export declare type UpdatePeriod = '1d' | '1w' | '1m'; 188 | export interface IUpdateEntry { 189 | mod_id: number; 190 | latest_file_update: number; 191 | latest_mod_activity: number; 192 | } 193 | export declare type IDateTime = string; 194 | export interface ITimestamped { 195 | updatedAt: IDateTime; 196 | createdAt: IDateTime; 197 | } 198 | export interface IGraphUser { 199 | avatar: string; 200 | memberId: number; 201 | name: string; 202 | } 203 | export interface ICollectionMetadata { 204 | endorsementValue: number; 205 | } 206 | export interface IGame { 207 | id: number; 208 | domainName: string; 209 | name: string; 210 | } 211 | export interface ICategory { 212 | approved: boolean; 213 | approvedBy?: number; 214 | categoryGames: IGame[]; 215 | createdAt: IDateTime; 216 | description: string; 217 | discardedAt?: IDateTime; 218 | id: number; 219 | name: string; 220 | parentId: number; 221 | suggestedBy: number; 222 | updatedAt: IDateTime; 223 | } 224 | export interface ITagCategory extends ITimestamped { 225 | discardedAt?: IDateTime; 226 | id: string; 227 | name: string; 228 | tags: ITag[]; 229 | } 230 | export interface ITag extends ITimestamped { 231 | adult: boolean; 232 | category?: ITagCategory; 233 | discardedAt: IDateTime; 234 | global: boolean; 235 | id: string; 236 | name: string; 237 | } 238 | export interface ICollectionImage extends ITimestamped { 239 | altText: string; 240 | collection: ICollection; 241 | discardedAt?: IDateTime; 242 | id: string; 243 | position: number; 244 | revision?: IRevision; 245 | url: string; 246 | user: IGraphUser; 247 | } 248 | export interface ICollectionVideo extends ITimestamped { 249 | collection: ICollection; 250 | description: string; 251 | discardedAt?: IDateTime; 252 | id: string; 253 | position: number; 254 | revision?: IRevision; 255 | title: string; 256 | url: string; 257 | user: IGraphUser; 258 | } 259 | export declare type ICollectionMedia = ICollectionImage & ICollectionVideo; 260 | export interface IForumPost { 261 | authorId: number; 262 | authorName: string; 263 | id: number; 264 | post: string; 265 | postDate: IDateTime; 266 | user: IGraphUser; 267 | } 268 | export interface IForumTopic { 269 | approved: boolean; 270 | description: string; 271 | forumId: number; 272 | id: number; 273 | pinned: boolean; 274 | posts: IForumPost[]; 275 | postsCount: number; 276 | state: string; 277 | title: string; 278 | views: number; 279 | visible: string; 280 | } 281 | export interface ICollection extends ITimestamped { 282 | category?: ICategory; 283 | contentPreviewLink: string; 284 | currentRevision: IRevision; 285 | downloadLink: string; 286 | enableDonations: boolean; 287 | endorsements: number; 288 | forumTopic?: IForumTopic; 289 | game: IGame; 290 | gameId: number; 291 | headerImage?: ICollectionImage; 292 | id: number; 293 | slug: string; 294 | media: ICollectionMedia[]; 295 | metadata?: ICollectionMetadata; 296 | name: string; 297 | revisions: IRevision[]; 298 | tags: ITag[]; 299 | tileImage?: ICollectionImage; 300 | user: IGraphUser; 301 | userId: number; 302 | visible: boolean; 303 | description: string; 304 | summary: string; 305 | commentLink: string; 306 | overallRating: string; 307 | overallRatingCount: number; 308 | recentRating: string; 309 | recentRatingCount: number; 310 | } 311 | export interface IExternalResource { 312 | collectionRevisionId: number; 313 | fileExpression: string; 314 | id: number; 315 | instructions: string; 316 | name: string; 317 | optional: boolean; 318 | resourceType: string; 319 | resourceUrl: string; 320 | version: string; 321 | } 322 | export declare type RevisionStatus = 'is_private' | 'is_public' | 'is_hidden' | 'is_testing' | 'is_nuked'; 323 | export interface ICollectionSchema extends ITimestamped { 324 | id: number; 325 | version: string; 326 | } 327 | export interface ICollectionBugReport extends ITimestamped { 328 | collectionBugStatusId: number; 329 | collectionRevisionId: number; 330 | description: string; 331 | id: number; 332 | title: string; 333 | user: IGraphUser; 334 | userId: number; 335 | } 336 | export interface IModCategory { 337 | date?: number; 338 | gameId: number; 339 | id: string; 340 | name: string; 341 | tags?: string; 342 | } 343 | export interface ITrackingState { 344 | test?: number; 345 | } 346 | export interface IMod { 347 | author?: string; 348 | category: string; 349 | description: string; 350 | game: IGame; 351 | gameId: number; 352 | id: number; 353 | ipAddress: string; 354 | modCategory: IModCategory; 355 | modId: number; 356 | name: string; 357 | pictureUrl?: string; 358 | status: string; 359 | summary: string; 360 | trackingData: ITrackingState; 361 | uid: string; 362 | uploader: IGraphUser; 363 | version: string; 364 | } 365 | export interface IModFile { 366 | categoryId: number; 367 | count: number; 368 | date: number; 369 | description: string; 370 | fileId: number; 371 | game: IGame; 372 | manager: number; 373 | mod: IMod; 374 | modId: number; 375 | name: string; 376 | owner: IGraphUser; 377 | primary: number; 378 | reportLink: string; 379 | requirementsAlert: number; 380 | scanned: number; 381 | size: number; 382 | sizeInBytes?: string; 383 | uCount: number; 384 | uid: string; 385 | uri: string; 386 | version: string; 387 | } 388 | export interface ICollectionRevisionMod { 389 | collectionRevisionId: number; 390 | file?: IModFile; 391 | fileId: number; 392 | gameId: number; 393 | id: number; 394 | optional: boolean; 395 | updatePolicy: string; 396 | version: string; 397 | } 398 | export interface IPreSignedUrl { 399 | url: string; 400 | uuid: string; 401 | } 402 | export interface IRating { 403 | average: number; 404 | positive: number; 405 | total: number; 406 | } 407 | export interface IRevisionMetadata { 408 | ratingValue: RatingOptions; 409 | } 410 | export interface IGameVersion { 411 | id: number; 412 | reference: string; 413 | } 414 | export interface ICollectionChangelog { 415 | collectionRevisionId: number; 416 | createdAt: IDateTime; 417 | description: string; 418 | id: number; 419 | revisionNumber: number; 420 | updatedAt: IDateTime; 421 | } 422 | export interface IRevision extends ITimestamped { 423 | adultContent: string; 424 | bugReports: ICollectionBugReport[]; 425 | collection: ICollection; 426 | collectionChangelog: ICollectionChangelog; 427 | collectionId: number; 428 | collectionSchema: ICollectionSchema; 429 | collectionSchemaId: number; 430 | contentPreviewLink: string; 431 | downloadLink: string; 432 | externalResources: IExternalResource[]; 433 | fileSize: number; 434 | gameVersions: IGameVersion[]; 435 | id: number; 436 | installationInfo?: string; 437 | latest: boolean; 438 | metadata: IRevisionMetadata; 439 | modFiles: ICollectionRevisionMod[]; 440 | rating: IRating; 441 | revisionNumber: number; 442 | revisionStatus: string; 443 | status: string; 444 | } 445 | export interface ICollectionManifestInfo { 446 | author: string; 447 | authorUrl?: string; 448 | name: string; 449 | description?: string; 450 | summary?: string; 451 | domainName: string; 452 | gameVersions?: string[]; 453 | } 454 | export interface ICollectionManifestModSource { 455 | type: SourceType; 456 | modId?: number; 457 | fileId?: number; 458 | md5?: string; 459 | fileSize?: number; 460 | updatePolicy?: UpdatePolicy; 461 | logicalFilename?: string; 462 | fileExpression?: string; 463 | url?: string; 464 | adultContent?: boolean; 465 | } 466 | export interface ICollectionManifestMod { 467 | name: string; 468 | version: string; 469 | optional: boolean; 470 | domainName: string; 471 | source: ICollectionManifestModSource; 472 | author?: string; 473 | } 474 | export interface ICollectionManifest { 475 | info: ICollectionManifestInfo; 476 | mods: ICollectionManifestMod[]; 477 | } 478 | export interface ICollectionPayload { 479 | adultContent: boolean; 480 | collectionSchemaId: number; 481 | collectionManifest: ICollectionManifest; 482 | } 483 | export interface ICreateCollectionResult { 484 | collection?: Partial; 485 | revision?: Partial; 486 | success: boolean; 487 | } 488 | export interface IFileHash { 489 | createdAt: IDateTime; 490 | fileName: string; 491 | fileSize: string; 492 | fileType: string; 493 | gameId: number; 494 | md5: string; 495 | modFile: IModFile; 496 | modFileId: number; 497 | } 498 | export declare type RatingOptions = 'positive' | 'negative' | 'abstained'; 499 | export declare type GraphErrorCode = 'REVISION_INVALID'; 500 | export declare type GraphErrorAttribute = 'modId' | 'fileId'; 501 | export declare type GraphErrorItemCode = 'NOT_AVAILABLE' | 'NOT_FOUND' | 'DELETED'; 502 | export declare type GraphErrorEntity = 'Mod' | 'ModFile'; 503 | export declare type GraphErrorType = 'LOCATE_ERROR'; 504 | export interface IGraphQLError { 505 | message: string; 506 | extensions?: { 507 | attribute?: GraphErrorAttribute; 508 | code?: GraphErrorItemCode; 509 | entity?: GraphErrorEntity; 510 | message?: string; 511 | type?: GraphErrorType; 512 | value?: any; 513 | parameter?: any; 514 | }; 515 | } 516 | export declare type LogLevel = 'info' | 'error'; 517 | export declare type LogFunc = (level: LogLevel, message: string, meta: any) => void; 518 | export interface IOAuthCredentials { 519 | token: string; 520 | refreshToken: string; 521 | fingerprint: string; 522 | } 523 | export interface IOAuthConfig { 524 | id: string; 525 | secret?: string; 526 | } 527 | -------------------------------------------------------------------------------- /lib/types.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | //# sourceMappingURL=types.js.map -------------------------------------------------------------------------------- /lib/types.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /lib/typesGraphQL.d.ts: -------------------------------------------------------------------------------- 1 | import { ICreateCollectionResult } from '.'; 2 | import { ICollection, IDateTime, IFileHash, IGraphUser, IMod, IModFile, IRevision } from './types'; 3 | export declare type PODs = number | string | boolean | IDateTime; 4 | export interface IFilter { 5 | [key: string]: any; 6 | } 7 | export declare type ValuesOf = T[number]; 8 | export declare type Boolify = T extends PODs ? boolean : T extends any[] ? Querify> : Querify; 9 | export declare type QuerifyImpl = { 10 | [P in keyof T]?: Boolify; 11 | }; 12 | export declare type Querify = QuerifyImpl & { 13 | $filter?: IFilter; 14 | }; 15 | export declare type GraphQLType = 'Int' | 'Float' | 'String' | 'Boolean' | 'DateTime' | string; 16 | export interface GraphQueryParameters { 17 | [key: string]: { 18 | type: GraphQLType; 19 | optional: boolean; 20 | }; 21 | } 22 | export declare type ICollectionQuery = Querify; 23 | export declare type IRevisionQuery = Querify; 24 | export declare type ICreateCollectionQuery = Querify; 25 | export declare type IModQuery = Querify; 26 | export declare type IModFileQuery = Querify; 27 | export declare type IUserQuery = Querify; 28 | export declare type IFileHashQuery = Querify; 29 | -------------------------------------------------------------------------------- /lib/typesGraphQL.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | ; 4 | //# sourceMappingURL=typesGraphQL.js.map -------------------------------------------------------------------------------- /lib/typesGraphQL.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"typesGraphQL.js","sourceRoot":"","sources":["../src/typesGraphQL.ts"],"names":[],"mappings":";;AAaC,CAAC"} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@nexusmods/nexus-api", 3 | "version": "1.4.26", 4 | "main": "./lib/index.js", 5 | "typings": "lib/index", 6 | "homepage": "https://www.nexusmods.com/", 7 | "repository": "Nexus-Mods/node-nexus-api", 8 | "files": [ 9 | "lib/" 10 | ], 11 | "description": "API for the Nexus Mods page", 12 | "scripts": { 13 | "docs": "typedoc --theme markdown --excludePrivate --excludeProtected --out docs src", 14 | "build": "tsc -p ." 15 | }, 16 | "author": "Black Tree Gaming Ltd.", 17 | "license": "LGPL-3.0", 18 | "devDependencies": { 19 | "@types/form-data": "^0.0.32", 20 | "@types/node": "^6.0.45", 21 | "@types/ref": "^0.0.28", 22 | "@types/ref-struct": "^0.0.28", 23 | "@types/ref-union": "^0.0.28", 24 | "@types/request": "^2.47.0", 25 | "@types/typescript": "^2.0.0", 26 | "typedoc": "^0.17.0", 27 | "typedoc-plugin-markdown": "^2.2.17", 28 | "typescript": "^3.8.3" 29 | }, 30 | "dependencies": { 31 | "form-data": "^4.0.0", 32 | "jsonwebtoken": "^9.0.0", 33 | "request": "^2.85.0", 34 | "set-cookie-parser": "^2.4.6", 35 | "string-template": "^1.0.0", 36 | "typed-emitter": "^1.3.1" 37 | }, 38 | "packageManager": "yarn@1.22.19" 39 | } 40 | -------------------------------------------------------------------------------- /samples/downloadlinks.rest: -------------------------------------------------------------------------------- 1 | GET https://api.nexusmods.com/v1/games/skyrim/mods/3863/files/11209/download_link 2 | content-type: application/json 3 | APIKEY: {{$apikey}} 4 | 5 | # Expected: 6 | # [ 7 | # { 8 | # "name": "Nexus Global Content Delivery Network", 9 | # "short_name": "Nexus CDN", 10 | # "URI": "some url" 11 | # } 12 | # ] 13 | -------------------------------------------------------------------------------- /samples/fileinfo.rest: -------------------------------------------------------------------------------- 1 | GET https://api.nexusmods.com/v1/games/skyrim/mods/3863/files/11209 2 | content-type: application/json 3 | APIKEY: {{$apikey}} 4 | 5 | # Expected: 6 | # { 7 | # "file_id": 11209, 8 | # "name": "SkyUI_1_0", 9 | # "version": "1.0", 10 | # "size": 1060, 11 | # "file_name": "SkyUI_1_0-3863.7z", 12 | # "uploaded_timestamp": 1324086840, 13 | # "uploaded_time": "2011-12-17T01:54:00.000+00:00", 14 | # "mod_version": "1.0", 15 | # "external_virus_scan_url": "https://www.virustotal.com/file/c23f1bc97a38c5a2448b1df1ff1d209af7544c66e93e2057fe0a8e070ae4e164/analysis/1406527807/" 16 | # } 17 | -------------------------------------------------------------------------------- /samples/filelist.rest: -------------------------------------------------------------------------------- 1 | GET https://api.nexusmods.com/v1/games/skyrim/mods/3863/files 2 | content-type: application/json 3 | APIKEY: {{$apikey}} 4 | 5 | # Expected: 6 | # [ 7 | # { 8 | # "file_id": 11209, 9 | # "name": "SkyUI_1_0", 10 | # "version": "1.0", 11 | # "size": 1060, 12 | # "file_name": "SkyUI_1_0-3863.7z", 13 | # "uploaded_timestamp": 1324086840, 14 | # "uploaded_time": "2011-12-17T01:54:00.000+00:00", 15 | # "mod_version": "1.0", 16 | # "external_virus_scan_url": "https://www.virustotal.com/file/c23f1bc97a38c5a2448b1df1ff1d209af7544c66e93e2057fe0a8e070ae4e164/analysis/1406527807/" 17 | # }, 18 | # ... 19 | # ] 20 | -------------------------------------------------------------------------------- /samples/game.rest: -------------------------------------------------------------------------------- 1 | GET https://api.nexusmods.com/v1/games/morrowind 2 | content-type: application/json 3 | APIKEY: {{$apikey}} 4 | 5 | # Expected: 6 | # { 7 | # "id": 100, 8 | # "name": "Morrowind", 9 | # "forum_url": "https://forums.nexusmods.com/index.php?/forum/111-morrowind/", 10 | # "nexusmods_url": "http://www.nexusmods.com/morrowind", 11 | # "genre": "RPG", 12 | # "mod_count": 1234, 13 | # "file_count": 2345, 14 | # "downloads": 34567, 15 | # "categories": [ 16 | # { 17 | # "category_id": 1, 18 | # "name": "Morrowind", 19 | # "parent_category": false 20 | # }, 21 | # { 22 | # "category_id": 2, 23 | # "name": "Buildings", 24 | # "parent_category": 1 25 | # }, 26 | # ... 27 | # ] 28 | # } 29 | # 30 | -------------------------------------------------------------------------------- /samples/games.rest: -------------------------------------------------------------------------------- 1 | GET https://api.nexusmods.com/v1/games 2 | content-type: application/json 3 | APIKEY: {{$apikey}} 4 | 5 | # Expected: 6 | #[ 7 | # { 8 | # "id": 100, 9 | # "name": "Morrowind", 10 | # "forum_url": "https://forums.nexusmods.com/index.php?/forum/111-morrowind/", 11 | # "nexusmods_url": "http://www.nexusmods.com/morrowind", 12 | # "genre": "RPG", 13 | # "mod_count": 1234, 14 | # "file_count": 2345, 15 | # "downloads": 34567 16 | # }, 17 | # ... 18 | #] 19 | -------------------------------------------------------------------------------- /samples/modinfo.rest: -------------------------------------------------------------------------------- 1 | GET https://api.nexusmods.com/v1/games/skyrim/mods/3863/ 2 | content-type: application/json 3 | APIKEY: {{$apikey}} 4 | 5 | # Expected: 6 | # { 7 | # "name": "SkyUI", 8 | # "summary": "..." 9 | # "description": "...", 10 | # "category_id": 42, 11 | # "version": "5.1", 12 | # "author": "SkyUI Team", 13 | # "created_timestamp": 1324081488, 14 | # "created_time": "2011-12-17T00:24:48.000+00:00", 15 | # "updated_timestamp": 1440427123, 16 | # "updated_time": "2015-08-24T15:38:43.000+01:00", 17 | # "contains_adult_content?": false, 18 | # "uploaded_by": "schlangster", 19 | # "uploaded_users_profile_url": "http://www.nexusmods.com/games/users/28794", 20 | # "picture_url": "https://staticdelivery.nexusmods.com/mods/110/images/3863-0-1436879491.png" 21 | # } 22 | -------------------------------------------------------------------------------- /samples/readme.txt: -------------------------------------------------------------------------------- 1 | Each file in this directory contains one sample request 2 | and the expected output. 3 | 4 | If you're using the VS Code extension "REST Client" by Huachao Mao 5 | you can test the requests immediately through the extension ( 6 | not at the time of writing because it doesn't support user-set 7 | variables yet) and generate sample code for various programming 8 | languages. -------------------------------------------------------------------------------- /samples/validate.rest: -------------------------------------------------------------------------------- 1 | GET https://api.nexusmods.com/v1/users/validate 2 | content-type: application/json 3 | APIKEY: {{$apikey}} 4 | 5 | # Expected: 6 | # { 7 | # "user_id": 1234, 8 | # "key": "yourkey", 9 | # "name": "yourname", 10 | # "is_premium?": true, 11 | # "is_supporter?": true, 12 | # "email": "user@host.com", 13 | # "profile_url": "avatar url" 14 | # } 15 | -------------------------------------------------------------------------------- /src/Quota.ts: -------------------------------------------------------------------------------- 1 | import { RateLimitError } from './customErrors'; 2 | 3 | function delay(milliseconds: number): Promise { 4 | return new Promise((resolve) => { 5 | setTimeout(() => { 6 | resolve(); 7 | }, milliseconds); 8 | }); 9 | } 10 | 11 | class Quota { 12 | private mCount: number; 13 | private mMaximum: number; 14 | private mMSPerIncrement: number; 15 | private mLastCheck: number = Date.now(); 16 | private mBlockHour: number; 17 | private mLimit: number = 1000; 18 | // to avoid making multiple requests with an expired jwt token during 19 | // application startup, we only allow a single request, all others are 20 | // blocked until that first one has succeeded, refreshing the token in 21 | // the process if necessary 22 | private mInitBlock: Promise; 23 | private mOnInitDone: () => void; 24 | 25 | constructor(init: number, max: number, msPerIncrement: number) { 26 | this.mCount = init; 27 | this.mMaximum = max; 28 | this.mMSPerIncrement = msPerIncrement; 29 | } 30 | 31 | public updateLimit(limit: number) { 32 | this.mLimit = limit; 33 | } 34 | 35 | public finishInit() { 36 | this.mOnInitDone?.(); 37 | this.mOnInitDone = undefined; 38 | } 39 | 40 | /** 41 | * signal that the request was blocked by the server with an error code that 42 | * indicates client is sending too many requests 43 | * returns true if the rate limit is actually used up so we won't be able to 44 | * make requests for a while, false if it's likely a temporary problem. 45 | */ 46 | public block(): boolean { 47 | this.mCount = 0; 48 | this.mLastCheck = Date.now(); 49 | 50 | if (this.mLimit <= 0) { 51 | // rate limit exceeded, block until the next full hour 52 | this.mBlockHour = (new Date()).getHours(); 53 | return true; 54 | } 55 | return false; 56 | } 57 | 58 | public async wait(): Promise { 59 | const now = new Date(); 60 | 61 | if (this.mInitBlock === undefined) { 62 | this.mInitBlock = new Promise(resolve => { this.mOnInitDone = resolve }); 63 | } else { 64 | await this.mInitBlock; 65 | } 66 | 67 | if ((this.mBlockHour !== undefined) 68 | && (now.getHours() === this.mBlockHour)) { 69 | // if the hourly and daily limit was exceeded, don't make any new requests 70 | // until the next full hour. If the time is almost up, wait, otherwise report 71 | // an error 72 | if (now.getMinutes() === 59) { 73 | return delay((60 - now.getSeconds()) * 1000); 74 | } else { 75 | return Promise.reject(new RateLimitError()); 76 | } 77 | } 78 | 79 | const recovered = Math.floor((now.getTime() - this.mLastCheck) / this.mMSPerIncrement); 80 | this.mCount = Math.min(this.mCount + recovered, this.mMaximum); 81 | this.mLastCheck = now.getTime(); 82 | --this.mCount; 83 | if (this.mCount >= 0) { 84 | return Promise.resolve(); 85 | } else { 86 | return delay(this.mCount * this.mMSPerIncrement * -1); 87 | } 88 | } 89 | } 90 | 91 | export default Quota; 92 | -------------------------------------------------------------------------------- /src/customErrors.ts: -------------------------------------------------------------------------------- 1 | import { GraphErrorAttribute, GraphErrorCode, GraphErrorEntity, GraphErrorItemCode, GraphErrorType } from "./types"; 2 | 3 | /** 4 | * Error thrown if a request timed out 5 | */ 6 | export class TimeoutError extends Error { 7 | constructor(message) { 8 | super(message); 9 | this.name = this.constructor.name; 10 | } 11 | } 12 | 13 | /** 14 | * Error thrown when a protocol error is reported. 15 | */ 16 | export class ProtocolError extends Error { 17 | constructor(message: string) { 18 | super(message); 19 | this.name = this.constructor.name; 20 | } 21 | } 22 | 23 | /** 24 | * Error thrown when too many requests were made to the api 25 | * You should not see this error in your application as it is handled internally 26 | */ 27 | export class RateLimitError extends Error { 28 | constructor() { 29 | super('Rate Limit Exceeded'); 30 | this.name = this.constructor.name; 31 | } 32 | } 33 | 34 | /** 35 | * Error thrown if an HTTP error is reported (HTTP code 4xx or 5xx) 36 | */ 37 | export class HTTPError extends Error { 38 | private mStatusCode: number; 39 | private mBody: string; 40 | private mURL: string; 41 | constructor(statusCode: number, message: string, body?: string, url?: string) { 42 | super(`HTTP (${statusCode}) - ${message}`); 43 | this.mStatusCode = statusCode; 44 | this.name = this.constructor.name; 45 | this.mStatusCode = statusCode; 46 | this.mBody = body ?? ''; 47 | this.mURL = url ?? ''; 48 | } 49 | public get statusCode(): number { 50 | return this.mStatusCode; 51 | } 52 | public get body(): string { 53 | return this.mBody; 54 | } 55 | public get url(): string { 56 | return this.mURL; 57 | } 58 | } 59 | 60 | /** 61 | * Error reported by the nexus api 62 | */ 63 | export class NexusError extends Error { 64 | private mStatusCode: number; 65 | private mRequest: string; 66 | private mCode: string; 67 | private mDescription: string 68 | constructor(message: string, statusCode: number, url: string, code: string, description?: string) { 69 | super(message); 70 | this.mStatusCode = statusCode; 71 | this.mRequest = url; 72 | this.mCode = code; 73 | this.mDescription = description; 74 | } 75 | 76 | public get statusCode() { 77 | return this.mStatusCode; 78 | } 79 | 80 | public get request() { 81 | return this.mRequest; 82 | } 83 | 84 | public get code() { 85 | return this.mCode; 86 | } 87 | 88 | public get description() { 89 | return this.mDescription; 90 | } 91 | } 92 | 93 | export interface IGraphErrorDetail { 94 | attribute: GraphErrorAttribute; 95 | code: GraphErrorItemCode; 96 | entity: GraphErrorEntity; 97 | message: string; 98 | type: GraphErrorType; 99 | value: any; 100 | } 101 | 102 | export class GraphError extends Error { 103 | private mCode: GraphErrorCode; 104 | private mDetails: IGraphErrorDetail[]; 105 | constructor(message: string, code: GraphErrorCode, details: IGraphErrorDetail[]) { 106 | super(message); 107 | this.mCode = code; 108 | this.mDetails = details; 109 | } 110 | 111 | public get code(): GraphErrorCode { 112 | return this.mCode; 113 | } 114 | 115 | public get details(): IGraphErrorDetail[] { 116 | return this.mDetails; 117 | } 118 | } 119 | 120 | /** 121 | * API called with an invalid parameter 122 | */ 123 | export class ParameterInvalid extends Error { 124 | constructor(message) { 125 | super(message); 126 | this.name = this.constructor.name; 127 | } 128 | } 129 | 130 | /** 131 | * Error thrown when the JWT has expired 132 | * You should not see this error in your application as a refresh is performed when encountering it 133 | */ 134 | export class JwtExpiredError extends Error { 135 | constructor() { 136 | super('JWT has expired'); 137 | this.name = this.constructor.name; 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './types'; 2 | export * from './typesGraphQL'; 3 | export * from './customErrors'; 4 | import Nexus from './Nexus'; 5 | 6 | export default Nexus; 7 | -------------------------------------------------------------------------------- /src/parameters.ts: -------------------------------------------------------------------------------- 1 | // note: quota settings are coordinated with the server, manipulating 2 | // them can cause network errors or IP bans 3 | 4 | // quota recovers one request per second 5 | export const QUOTA_RATE_MS: number = 1000; 6 | // limit short-term bursts 7 | export const QUOTA_MAX: number = 50; 8 | // limit short-term bursts 9 | export const QUOTA_MAX_PREMIUM: number = 50; 10 | 11 | export const DEFAULT_TIMEOUT_MS: number = 30000; 12 | 13 | // time to wait before retrying a request that failed with a 429 (too many requests) error 14 | // applies only when the request limit for the hour hasn't been exceeded yet 15 | export const DELAY_AFTER_429_MS: number = 1000; 16 | 17 | const NEXUS_DOMAIN = process.env['NEXUS_DOMAIN'] || 'nexusmods.com'; 18 | 19 | const API_SUBDOMAIN = process.env['API_SUBDOMAIN'] || 'api'; 20 | const USERS_SUBDOMAIN = process.env['USERS_SUBDOMAIN'] || 'users'; 21 | 22 | export const BASE_URL: string = `https://${API_SUBDOMAIN}.${NEXUS_DOMAIN}`; 23 | export const API_URL: string = `${BASE_URL}/v1`; 24 | export const GRAPHQL_URL: string = `${BASE_URL}/v2/graphql`; 25 | 26 | // can be used to redirect requests for in-development requests to a different server and separate 27 | // api key 28 | export const API_DEV_URL: string = ''; 29 | export const APIKEY_DEV: string = ''; 30 | 31 | export const USER_SERVICE_API_URL: string = `https://${USERS_SUBDOMAIN}.${NEXUS_DOMAIN}`; 32 | 33 | // used so the server can provide compatibility behaviour with older protocols. 34 | // Please don't mess with this unless you're in contact with NexusMods 35 | export const PROTOCOL_VERSION: string = require('../package.json').version.split('-')[0]; 36 | 37 | // server will reject feedback if attachments are > 40mb large 38 | export const MAX_FILE_SIZE: number = 40 * 1024 * 1024; 39 | 40 | export const MAX_JWT_REFRESH_TRIES: number = 3; 41 | 42 | export const MAX_BATCH_SIZE: number = 500; 43 | -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * result of the validateKey request 3 | */ 4 | export interface IValidateKeyResponse { 5 | /** 6 | * nexus user id 7 | */ 8 | user_id: number; 9 | /** 10 | * the api key 11 | */ 12 | key: string; 13 | /** 14 | * User Name 15 | */ 16 | name: string; 17 | /** 18 | * user is premium 19 | */ 20 | is_premium: boolean; 21 | /** 22 | * user is supporter 23 | */ 24 | is_supporter: boolean; 25 | /** 26 | * email address of the user 27 | */ 28 | email: string; 29 | /** 30 | * url of the user image 31 | */ 32 | profile_url: string; 33 | } 34 | 35 | export interface IUser { 36 | member_id: number; 37 | member_group_id: number; 38 | name: string; 39 | avatar?: string; 40 | } 41 | 42 | export interface IUserInfo { 43 | sub: string; 44 | name: string; 45 | email: string; 46 | avatar: string; 47 | group_id: number; 48 | membership_roles: string[]; 49 | premium_expiry: number; 50 | } 51 | 52 | 53 | export type EndorsedStatus = 'Undecided' | 'Abstained' | 'Endorsed'; 54 | 55 | /** 56 | * possible states the mod can be in 57 | */ 58 | export type ModStatus = 'under_moderation' | 'published' | 'not_published' | 'publish_with_game' | 'removed' | 'wastebinned' | 'hidden'; 59 | 60 | /** 61 | * Details about a mod 62 | */ 63 | export interface IModInfo { 64 | /** 65 | * id of this mod (should be the same you queried for) 66 | */ 67 | mod_id: number; 68 | /** 69 | * internal id of the game this mod belongs to 70 | */ 71 | game_id: number; 72 | /** 73 | * domain name (as used in urls and as the game id in all other requests) 74 | */ 75 | domain_name: string; 76 | /** 77 | * id of the category 78 | */ 79 | category_id: number; 80 | /** 81 | * whether this mod is tagged as adult 82 | */ 83 | contains_adult_content: boolean; 84 | /** 85 | * Name of the mod 86 | * (not present if the file is under moderation) 87 | */ 88 | name?: string; 89 | /** 90 | * short description 91 | */ 92 | summary?: string; 93 | /** 94 | * long description (bbcode) 95 | */ 96 | description?: string; 97 | /** 98 | * mod version 99 | */ 100 | version: string; 101 | /** 102 | * Author of the mod 103 | */ 104 | author: string; 105 | /** 106 | * more detailed info about the author 107 | */ 108 | user: IUser; 109 | /** 110 | * name of the user who uploaded this mod 111 | */ 112 | uploaded_by: string; 113 | /** 114 | * url of the profile image of the uploader 115 | */ 116 | uploaded_users_profile_url: string; 117 | /** 118 | * current status of the mod 119 | */ 120 | status: ModStatus; 121 | /** 122 | * whether the mod is currently available/visible to users 123 | * If a mod isn't available the api returns very limited information, essentially 124 | * hiding all textual info that could contain offensive content but certain "maintenance" info 125 | * is still provided. 126 | */ 127 | available: boolean; 128 | /** 129 | * url of the primary screenshot 130 | */ 131 | picture_url?: string; 132 | /** 133 | * unix timestamp of when the mod was created 134 | */ 135 | created_timestamp: number; 136 | /** 137 | * readable time of when the mod was created 138 | */ 139 | created_time: string; 140 | /** 141 | * unix timestamp of when the mod was updated 142 | */ 143 | updated_timestamp: number; 144 | /** 145 | * readable time of when the mod was updated 146 | */ 147 | updated_time: string; 148 | /** 149 | * whether this mod allows endorsements 150 | */ 151 | allow_rating: boolean; 152 | /** 153 | * endorsement count 154 | */ 155 | endorsement_count: number; 156 | /** 157 | * number of total downloads 158 | */ 159 | mod_downloads: number; 160 | /** 161 | * number of unique downloads 162 | */ 163 | mod_unique_downloads: number; 164 | /** 165 | * obsolete - will be removed in the near future 166 | */ 167 | endorsement?: { 168 | endorse_status: EndorsedStatus, 169 | timestamp: number, 170 | version: number, 171 | }; 172 | } 173 | 174 | /** 175 | * Information about a specific mod file 176 | */ 177 | export interface IFileInfo { 178 | /** 179 | * file id 180 | */ 181 | file_id: number; 182 | /** 183 | * File type as a number (1 = main, 2 = patch, 3 = optional, 4 = old, 6 = deleted, 7 = archived) 184 | */ 185 | category_id: number; 186 | /** 187 | * File type as a string ('MAIN', 'PATCH', 'OPTION', 'OLD_VERSION', 'DELETED', 'ARCHIVED') 188 | */ 189 | category_name: string; 190 | /** 191 | * html encoded changelog (matched via file version) 192 | * null if there is none 193 | */ 194 | changelog_html: string; 195 | /** 196 | * url of the content preview (json file containing list of files) 197 | */ 198 | content_preview_link: string; 199 | /** 200 | * readable file name 201 | */ 202 | name: string; 203 | /** 204 | * file description 205 | */ 206 | description: string; 207 | /** 208 | * File version (doesn't actually have to match any mod version) 209 | */ 210 | version: string; 211 | /** 212 | * File size in kilobytes 213 | */ 214 | size: number; 215 | /** 216 | * File size. also in kilobytes. Because - ugh, don't ask 217 | */ 218 | size_kb: number; 219 | /** 220 | * actual file name (derived from name with id and version appended) 221 | */ 222 | file_name: string; 223 | /** 224 | * unix timestamp of the time this file was uploaded 225 | */ 226 | uploaded_timestamp: number; 227 | /** 228 | * readable representation of the file time 229 | */ 230 | uploaded_time: string; 231 | /** 232 | * version of the mod (at the time this was uploaded?) 233 | */ 234 | mod_version: string; 235 | /** 236 | * link to the virus scan results 237 | * null if there is none 238 | */ 239 | external_virus_scan_url: string; 240 | /** 241 | * whether this is the primary download for the mod 242 | * (the one that users download through the link in the top right of the mod page) 243 | */ 244 | is_primary: boolean; 245 | } 246 | 247 | /** 248 | * list of files (and update chain) associated with a mod 249 | */ 250 | export interface IModFiles { 251 | /** 252 | * list of file updates stored with a mod 253 | */ 254 | file_updates: IFileUpdate[]; 255 | /** 256 | * list of files stored for a mod 257 | */ 258 | files: IFileInfo[]; 259 | } 260 | 261 | /** 262 | * details about a file update 263 | * These exist only if the author sets the field "this file is 264 | * a newer version of ...". 265 | */ 266 | export interface IFileUpdate { 267 | /** 268 | * id of the new file 269 | */ 270 | new_file_id: number; 271 | /** 272 | * name of the new file 273 | */ 274 | new_file_name: string; 275 | /** 276 | * id of the old file 277 | */ 278 | old_file_id: number; 279 | /** 280 | * name of the old file 281 | */ 282 | old_file_name: string; 283 | /** 284 | * readable upload time of the new file 285 | */ 286 | uploaded_time: string; 287 | /** 288 | * unix timestamp of when the new file was uploaded 289 | */ 290 | uploaded_timestamp: number; 291 | } 292 | 293 | /** 294 | * Nexus Mods category 295 | */ 296 | export interface IModCategory { 297 | /** 298 | * numerical id 299 | */ 300 | category_id: number; 301 | /** 302 | * display name 303 | */ 304 | name: string; 305 | /** 306 | * id of the parent category or false if it's a top-level 307 | * category. 308 | * Note: often there is only a single root category named after the game. 309 | * But in some cases there are additional roots, e.g. the game 'skyrim' has 310 | * the roots 'Skyrim' and 'Sure AI: Enderal' 311 | */ 312 | parent_category: number | false; 313 | } 314 | 315 | /** 316 | * basic information about a game 317 | */ 318 | export interface IGameListEntry { 319 | /** 320 | * numerical id 321 | */ 322 | id: number; 323 | /** 324 | * domain name (as used in urls and as the game id in all other requests) 325 | */ 326 | domain_name: string; 327 | /** 328 | * display name 329 | */ 330 | name: string; 331 | /** 332 | * url for the corresponding forum section 333 | */ 334 | forum_url: string; 335 | /** 336 | * url for the primary nexusmods page (should be https://www.nexusmods.com/) 337 | */ 338 | nexusmods_url: string; 339 | /** 340 | * genre of the game 341 | * (possible values?) 342 | */ 343 | genre: string; 344 | /** 345 | * number of mods hosted on nexus for this game 346 | */ 347 | mods: number; 348 | /** 349 | * number of files hosted on nexus for this game 350 | */ 351 | file_count: number; 352 | /** 353 | * number of downloads from nexus for files for this game 354 | */ 355 | downloads: number; 356 | /** 357 | * unix timestamp of when this game was added to nexuis mods 358 | */ 359 | approved_date: number; 360 | } 361 | 362 | /** 363 | * extended information about a game 364 | */ 365 | export interface IGameInfo extends IGameListEntry { 366 | /** 367 | * list of categories for this game 368 | */ 369 | categories: IModCategory[]; 370 | } 371 | 372 | /** 373 | * direct download url for a file from nexus 374 | * Please note that these links have an expiry time, it's not 375 | * useful to store it for more than a few minutes 376 | */ 377 | export interface IDownloadURL { 378 | /** 379 | * the url itself 380 | */ 381 | URI: string; 382 | /** 383 | * Display name of the download server hosting the file 384 | */ 385 | name: string; 386 | /** 387 | * short name (id?) of the download server 388 | */ 389 | short_name: string; 390 | } 391 | 392 | export interface IModInfoEx extends IModInfo { 393 | mod_id: number; 394 | game_id: number; 395 | } 396 | 397 | /** 398 | * Result from a md5 lookup 399 | */ 400 | export interface IMD5Result { 401 | mod: IModInfoEx, 402 | file_details: IFileInfo, 403 | } 404 | 405 | /** 406 | * Info about a Feedback report 407 | * INTERNAL USE ONLY 408 | */ 409 | export interface IIssue { 410 | id: number; 411 | issue_number: number; 412 | issue_state: string; 413 | issue_title: string; 414 | } 415 | 416 | /** 417 | * Info about a feedback report exported to github 418 | * INTERNAL USE ONLY 419 | */ 420 | export interface IGithubIssue { 421 | id: number; 422 | issue_number: number; 423 | issue_title: string; 424 | issue_state: string; 425 | grouping_key: string; 426 | created_at: string; 427 | updated_at: string; 428 | } 429 | 430 | export interface ICollectionInfo { 431 | collection_id?: number; 432 | author: string; 433 | author_url: string; 434 | name: string; 435 | version: string; 436 | description: string; 437 | domain_name: string; 438 | adult_content: boolean; 439 | } 440 | 441 | export type UpdatePolicy = 'exact' | 'latest' | 'prefer'; 442 | export type SourceType = 'browse' | 'manual' | 'direct' | 'nexus'; 443 | 444 | /** 445 | * response to a feedback request 446 | * INTERNAL USE ONLY 447 | */ 448 | export interface IFeedbackResponse { 449 | id: number; 450 | status: number; 451 | created_at: string; 452 | updated_at: string; 453 | reference: string; 454 | grouping_key: string; 455 | github_issue: IGithubIssue; 456 | user_blacklisted: boolean; 457 | count: number; 458 | } 459 | 460 | /** 461 | * response to a request for changelogs 462 | */ 463 | export interface IChangelogs { 464 | [versionNumber: string]: string[], 465 | } 466 | 467 | /** 468 | * response to a request for tracked mods 469 | */ 470 | export interface ITrackedMod { 471 | mod_id: number; 472 | domain_name: string; 473 | } 474 | 475 | /** 476 | * response to a request for endorsements 477 | */ 478 | export interface IEndorsement { 479 | mod_id: number; 480 | domain_name: string; 481 | date: number; 482 | version: string; 483 | status: EndorsedStatus; 484 | } 485 | 486 | /** 487 | * (success) response to a endorse/abstain request 488 | */ 489 | export interface IEndorseResponse { 490 | /** 491 | * textual reply to the request, something like "Updated to: Endorsed" 492 | */ 493 | message: string; 494 | status: EndorsedStatus; 495 | } 496 | 497 | /** 498 | * (success) response to a track/untrack request 499 | */ 500 | export interface ITrackResponse { 501 | /** 502 | * textual result of the action, something like "User 123 is now Tracking Mod: 456" 503 | */ 504 | message: string; 505 | } 506 | 507 | /** 508 | * colourscheme entry as returned by getColourSchemes 509 | */ 510 | export interface IColourScheme { 511 | id: number; 512 | name: string; 513 | primary_colour: string; 514 | secondary_colour: string; 515 | darker_colour: string; 516 | } 517 | 518 | /** 519 | * range of updates to query 520 | */ 521 | export type UpdatePeriod = '1d' | '1w' | '1m'; 522 | 523 | /** 524 | * an entry in the update list 525 | */ 526 | export interface IUpdateEntry { 527 | mod_id: number; 528 | latest_file_update: number; 529 | latest_mod_activity: number; 530 | } 531 | 532 | 533 | // GraphQL classes 534 | 535 | // just a string in format YYYY-MM-DDTHH:MM:SSZ, see RFC3339 536 | export type IDateTime = string; 537 | 538 | export interface ITimestamped { 539 | updatedAt: IDateTime; 540 | createdAt: IDateTime; 541 | } 542 | 543 | export interface IGraphUser { 544 | avatar: string; 545 | memberId: number; 546 | name: string; 547 | } 548 | 549 | export interface ICollectionMetadata { 550 | endorsementValue: number; 551 | } 552 | 553 | export interface IGame { 554 | id: number; 555 | domainName: string; 556 | name: string; 557 | } 558 | 559 | export interface ICategory { 560 | approved: boolean; 561 | approvedBy?: number; 562 | categoryGames: IGame[]; 563 | createdAt: IDateTime; 564 | description: string; 565 | discardedAt?: IDateTime; 566 | id: number; 567 | name: string; 568 | parentId: number; 569 | suggestedBy: number; 570 | updatedAt: IDateTime; 571 | } 572 | 573 | export interface ITagCategory extends ITimestamped { 574 | discardedAt?: IDateTime; 575 | id: string; 576 | name: string; 577 | tags: ITag[]; 578 | } 579 | 580 | export interface ITag extends ITimestamped { 581 | adult: boolean; 582 | category?: ITagCategory; 583 | discardedAt: IDateTime; 584 | global: boolean; 585 | id: string; 586 | name: string; 587 | } 588 | 589 | /* 590 | export interface IImageType { 591 | description: string; 592 | id: number; 593 | rHorizontal: number; 594 | rVertical: number; 595 | } 596 | */ 597 | 598 | export interface ICollectionImage extends ITimestamped { 599 | altText: string; 600 | collection: ICollection; 601 | discardedAt?: IDateTime; 602 | id: string; 603 | position: number; 604 | revision?: IRevision; 605 | url: string; 606 | user: IGraphUser; 607 | } 608 | 609 | export interface ICollectionVideo extends ITimestamped { 610 | collection: ICollection; 611 | description: string; 612 | discardedAt?: IDateTime; 613 | id: string; 614 | position: number; 615 | revision?: IRevision; 616 | title: string; 617 | url: string; 618 | user: IGraphUser; 619 | } 620 | 621 | export type ICollectionMedia = ICollectionImage & ICollectionVideo; 622 | 623 | export interface IForumPost { 624 | authorId: number; 625 | authorName: string; 626 | id: number; 627 | post: string; 628 | postDate: IDateTime; 629 | user: IGraphUser; 630 | } 631 | 632 | export interface IForumTopic { 633 | approved: boolean; 634 | description: string; 635 | forumId: number; 636 | id: number; 637 | pinned: boolean; 638 | posts: IForumPost[]; 639 | postsCount: number; 640 | state: string; 641 | title: string; 642 | views: number; 643 | visible: string; 644 | } 645 | 646 | /** 647 | * Base information about a collection 648 | */ 649 | export interface ICollection extends ITimestamped { 650 | category?: ICategory; 651 | contentPreviewLink: string; 652 | currentRevision: IRevision; 653 | downloadLink: string; 654 | enableDonations: boolean; 655 | endorsements: number; 656 | forumTopic?: IForumTopic; 657 | game: IGame; 658 | gameId: number; 659 | headerImage?: ICollectionImage; 660 | id: number; 661 | slug: string; 662 | media: ICollectionMedia[]; 663 | metadata?: ICollectionMetadata; 664 | name: string; 665 | revisions: IRevision[]; 666 | tags: ITag[]; 667 | tileImage?: ICollectionImage; 668 | user: IGraphUser; 669 | userId: number; 670 | visible: boolean; 671 | description: string; 672 | summary: string; 673 | commentLink: string; 674 | overallRating: string; 675 | overallRatingCount: number; 676 | recentRating: string; 677 | recentRatingCount: number; 678 | } 679 | 680 | export interface IExternalResource { 681 | collectionRevisionId: number; 682 | fileExpression: string; 683 | id: number; 684 | instructions: string; 685 | name: string; 686 | optional: boolean; 687 | resourceType: string; 688 | resourceUrl: string; 689 | version: string; 690 | } 691 | export type RevisionStatus = 'is_private' | 'is_public' | 'is_hidden' | 'is_testing' | 'is_nuked'; 692 | 693 | export interface ICollectionSchema extends ITimestamped { 694 | id: number; 695 | version: string; 696 | } 697 | 698 | export interface ICollectionBugReport extends ITimestamped { 699 | collectionBugStatusId: number; 700 | collectionRevisionId: number; 701 | description: string; 702 | id: number; 703 | title: string; 704 | user: IGraphUser; 705 | userId: number; 706 | } 707 | 708 | export interface IModCategory { 709 | date?: number; 710 | gameId: number; 711 | id: string; 712 | name: string; 713 | tags?: string; 714 | } 715 | 716 | export interface ITrackingState { 717 | test?: number; 718 | } 719 | 720 | export interface IMod { 721 | author?: string; 722 | category: string; 723 | description: string; 724 | game: IGame; 725 | gameId: number; 726 | id: number; 727 | ipAddress: string; 728 | modCategory: IModCategory; 729 | modId: number; 730 | name: string; 731 | pictureUrl?: string; 732 | status: string; 733 | summary: string; 734 | trackingData: ITrackingState; 735 | uid: string; 736 | uploader: IGraphUser; 737 | version: string; 738 | } 739 | 740 | export interface IModFile { 741 | categoryId: number; 742 | count: number; 743 | date: number; 744 | description: string; 745 | fileId: number; 746 | game: IGame; 747 | manager: number; 748 | mod: IMod; 749 | modId: number; 750 | name: string; 751 | owner: IGraphUser; 752 | primary: number; 753 | reportLink: string; 754 | requirementsAlert: number; 755 | scanned: number; 756 | size: number; 757 | sizeInBytes?: string; 758 | uCount: number; 759 | uid: string; 760 | uri: string; 761 | version: string; 762 | } 763 | 764 | export interface ICollectionRevisionMod { 765 | collectionRevisionId: number; 766 | file?: IModFile; 767 | fileId: number; 768 | gameId: number; 769 | id: number; 770 | optional: boolean; 771 | updatePolicy: string; 772 | version: string; 773 | } 774 | 775 | export interface IPreSignedUrl { 776 | url: string; 777 | uuid: string; 778 | } 779 | export interface IRating { 780 | 781 | average: number; 782 | positive: number; 783 | total: number; 784 | } 785 | 786 | export interface IRevisionMetadata { 787 | ratingValue: RatingOptions; 788 | } 789 | 790 | export interface IGameVersion { 791 | id: number; 792 | reference: string; 793 | } 794 | 795 | export interface ICollectionChangelog { 796 | collectionRevisionId: number; 797 | createdAt: IDateTime; 798 | description: string; 799 | id: number; 800 | revisionNumber: number; 801 | updatedAt: IDateTime; 802 | } 803 | 804 | /** 805 | * a specific revision of a collection 806 | */ 807 | export interface IRevision extends ITimestamped { 808 | adultContent: string; 809 | bugReports: ICollectionBugReport[]; 810 | collection: ICollection; 811 | collectionChangelog: ICollectionChangelog; 812 | collectionId: number; 813 | collectionSchema: ICollectionSchema; 814 | collectionSchemaId: number; 815 | contentPreviewLink: string; 816 | downloadLink: string; 817 | externalResources: IExternalResource[]; 818 | fileSize: number; 819 | gameVersions: IGameVersion[]; 820 | id: number; 821 | installationInfo?: string; 822 | latest: boolean; 823 | metadata: IRevisionMetadata; 824 | modFiles: ICollectionRevisionMod[]; 825 | rating: IRating; 826 | revisionNumber: number; 827 | revisionStatus: string; 828 | status: string; 829 | } 830 | 831 | export interface ICollectionManifestInfo { 832 | author: string; 833 | authorUrl?: string; 834 | name: string; 835 | description?: string; 836 | summary?: string; 837 | domainName: string; 838 | gameVersions?: string[]; 839 | } 840 | 841 | export interface ICollectionManifestModSource { 842 | type: SourceType; 843 | modId?: number; 844 | fileId?: number; 845 | md5?: string; 846 | fileSize?: number; 847 | updatePolicy?: UpdatePolicy; 848 | logicalFilename?: string; 849 | fileExpression?: string; 850 | url?: string; 851 | adultContent?: boolean; 852 | } 853 | 854 | export interface ICollectionManifestMod { 855 | name: string; 856 | version: string; 857 | optional: boolean; 858 | domainName: string; 859 | source: ICollectionManifestModSource; 860 | author?: string; 861 | } 862 | 863 | export interface ICollectionManifest { 864 | info: ICollectionManifestInfo; 865 | mods: ICollectionManifestMod[]; 866 | } 867 | 868 | /** 869 | * payload used to create a collection revision 870 | */ 871 | export interface ICollectionPayload { 872 | adultContent: boolean; 873 | collectionSchemaId: number; 874 | collectionManifest: ICollectionManifest; 875 | } 876 | 877 | export interface ICreateCollectionResult { 878 | collection?: Partial; 879 | revision?: Partial; 880 | success: boolean; 881 | } 882 | 883 | export interface IFileHash { 884 | createdAt: IDateTime; 885 | fileName: string; 886 | fileSize: string; 887 | fileType: string; 888 | gameId: number; 889 | md5: string; 890 | modFile: IModFile; 891 | modFileId: number; 892 | } 893 | 894 | export type RatingOptions = 'positive' | 'negative' | 'abstained'; 895 | 896 | export type GraphErrorCode = 'REVISION_INVALID'; 897 | export type GraphErrorAttribute = 'modId' | 'fileId'; 898 | export type GraphErrorItemCode = 'NOT_AVAILABLE' | 'NOT_FOUND' | 'DELETED'; 899 | export type GraphErrorEntity = 'Mod' | 'ModFile'; 900 | export type GraphErrorType = 'LOCATE_ERROR'; 901 | 902 | export interface IGraphQLError { 903 | message: string; 904 | extensions?: { 905 | attribute?: GraphErrorAttribute; 906 | code?: GraphErrorItemCode; 907 | entity?: GraphErrorEntity; 908 | message?: string; 909 | type?: GraphErrorType; 910 | value?: any; 911 | parameter?: any; 912 | } 913 | } 914 | 915 | export type LogLevel = 'info' | 'error'; 916 | export type LogFunc = (level: LogLevel, message: string, meta: any) => void; 917 | 918 | export interface IOAuthCredentials { 919 | token: string, 920 | refreshToken: string, 921 | fingerprint: string, 922 | } 923 | 924 | export interface IOAuthConfig { 925 | id: string, 926 | secret?: string 927 | } 928 | -------------------------------------------------------------------------------- /src/typesGraphQL.ts: -------------------------------------------------------------------------------- 1 | import { ICreateCollectionResult } from '.'; 2 | import { ICollection, IDateTime, IFileHash, IGraphUser, IMod, IModFile, IRevision, IUser } from './types'; 3 | 4 | // some helper types that convert an interface (with the proper data types) 5 | // into one that can be used to declare a graphql query. 6 | // Every POD gets converted into a boolean (to select which fields to returns), 7 | // every object and array can also have a $filter field to send parameters to the 8 | // graphql getter 9 | 10 | export type PODs = number | string | boolean | IDateTime; 11 | 12 | export interface IFilter { 13 | [key: string]: any; 14 | }; 15 | 16 | export type ValuesOf = T[number]; 17 | 18 | export type Boolify = T extends PODs 19 | ? boolean 20 | : T extends any[] 21 | ? Querify> 22 | : Querify; 23 | 24 | export type QuerifyImpl = { 25 | [P in keyof T]?: Boolify; 26 | }; 27 | 28 | export type Querify = QuerifyImpl & { $filter?: IFilter }; 29 | 30 | export type GraphQLType = 'Int' | 'Float' | 'String' | 'Boolean' | 'DateTime' | string; 31 | 32 | export interface GraphQueryParameters { 33 | [key: string]: { type: GraphQLType, optional: boolean }; 34 | } 35 | 36 | export type ICollectionQuery = Querify; 37 | export type IRevisionQuery = Querify; 38 | export type ICreateCollectionQuery = Querify; 39 | 40 | export type IModQuery = Querify; 41 | export type IModFileQuery = Querify; 42 | 43 | export type IUserQuery = Querify; 44 | 45 | export type IFileHashQuery = Querify; 46 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": true, 3 | "compilerOptions": { 4 | "target": "es6", 5 | "module": "commonjs", 6 | "lib": ["ES2016"], 7 | "moduleResolution": "node", 8 | "noImplicitAny": false, 9 | "removeComments": true, 10 | "preserveConstEnums": true, 11 | "rootDir": "./src", 12 | "outDir": "./lib", 13 | "sourceMap": true, 14 | "skipLibCheck": true, 15 | "declaration": true 16 | }, 17 | "files": [ 18 | "src/types.ts", 19 | "src/Nexus.ts", 20 | "src/index.ts" 21 | ] 22 | } 23 | --------------------------------------------------------------------------------