Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions docs/Api/MiscApi.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Aternos\ModrinthApi\MiscApi



All URIs are relative to https://api.modrinth.com/v2, except if the operation defines another base path.

| Method | HTTP request | Description |
Expand All @@ -11,13 +13,13 @@ All URIs are relative to https://api.modrinth.com/v2, except if the operation de
## `forgeUpdates()`

```php
forgeUpdates($id_slug): \Aternos\ModrinthApi\Model\ForgeUpdates
forgeUpdates($id_slug, $neoforge): \Aternos\ModrinthApi\Model\ForgeUpdates
```
### URI(s):
- https://api.modrinth.com Production server- https://staging-api.modrinth.com Staging server
Forge Updates JSON file

If you're a Forge mod developer, your Modrinth mods have an automatically generated `updates.json` using the [Forge Update Checker](https://docs.minecraftforge.net/en/latest/misc/updatechecker/). The only setup is to insert the URL into the `[[mods]]` section of your `mods.toml` file as such: ```toml [[mods]] # the other stuff here - ID, version, display name, etc. updateJSONURL = \"https://api.modrinth.com/updates/{slug|ID}/forge_updates.json\" ``` Replace `{slug|id}` with the slug or ID of your project. Modrinth will handle the rest! When you update your mod, Forge will notify your users that their copy of your mod is out of date. Make sure that the version format you use for your Modrinth releases is the same as the version format you use in your `mods.toml`. If you use a format such as `1.2.3-forge` or `1.2.3+1.19` with your Modrinth releases but your `mods.toml` only has `1.2.3`, the update checker may not function properly.
If you're a Forge mod developer, your Modrinth mods have an automatically generated `updates.json` using the [Forge Update Checker](https://docs.minecraftforge.net/en/latest/misc/updatechecker/). The only setup is to insert the URL into the `[[mods]]` section of your `mods.toml` file as such: ```toml [[mods]] # the other stuff here - ID, version, display name, etc. updateJSONURL = \"https://api.modrinth.com/updates/{slug|ID}/forge_updates.json\" ``` Replace `{slug|id}` with the slug or ID of your project. Modrinth will handle the rest! When you update your mod, Forge will notify your users that their copy of your mod is out of date. Make sure that the version format you use for your Modrinth releases is the same as the version format you use in your `mods.toml`. If you use a format such as `1.2.3-forge` or `1.2.3+1.19` with your Modrinth releases but your `mods.toml` only has `1.2.3`, the update checker may not function properly. If you're using NeoForge, NeoForge versions will, by default, not appear in the default URL. You will need to add `?neoforge=only` to show your NeoForge-only versions, or `?neoforge=include` for both. ```toml [[mods]] # the other stuff here - ID, version, display name, etc. updateJSONURL = \"https://api.modrinth.com/updates/{slug|ID}/forge_updates.json?neoforge=only\" ```

### Example

Expand All @@ -33,13 +35,14 @@ $apiInstance = new Aternos\ModrinthApi\Api\MiscApi(
new GuzzleHttp\Client()
);
$id_slug = ["AABBCCDD","my_project"]; // string | The ID or slug of the project
$neoforge = include; // string | Whether to include NeoForge versions. Can be `only` (NeoForge-only versions), `include` (both Forge and NeoForge versions), or omitted (Forge-only versions).

$hostIndex = 0;
$variables = [
];

try {
$result = $apiInstance->forgeUpdates($id_slug, $hostIndex, $variables);
$result = $apiInstance->forgeUpdates($id_slug, $neoforge, $hostIndex, $variables);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MiscApi->forgeUpdates: ', $e->getMessage(), PHP_EOL;
Expand All @@ -51,6 +54,7 @@ try {
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id_slug** | **string**| The ID or slug of the project | |
| **neoforge** | **string**| Whether to include NeoForge versions. Can be `only` (NeoForge-only versions), `include` (both Forge and NeoForge versions), or omitted (Forge-only versions). | [optional] |
| hostIndex | null|int | Host index. Defaults to null. If null, then the library will use $this->hostIndex instead | [optional] |
| variables | array | Associative array of variables to pass to the host. Defaults to empty array. | [optional] |

Expand Down
2 changes: 2 additions & 0 deletions docs/Api/NotificationsApi.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Aternos\ModrinthApi\NotificationsApi

Notifications are sent to users for various reasons, including for project updates, team invites, and moderation purposes.

All URIs are relative to https://api.modrinth.com/v2, except if the operation defines another base path.

| Method | HTTP request | Description |
Expand Down
6 changes: 4 additions & 2 deletions docs/Api/ProjectsApi.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Aternos\ModrinthApi\ProjectsApi

Projects are what Modrinth is centered around, be it mods, modpacks, resource packs, etc.

All URIs are relative to https://api.modrinth.com/v2, except if the operation defines another base path.

| Method | HTTP request | Description |
Expand Down Expand Up @@ -1006,7 +1008,7 @@ $apiInstance = new Aternos\ModrinthApi\Api\ProjectsApi(
new GuzzleHttp\Client()
);
$query = gravestones; // string | The query to search for
$facets = [["categories:forge"],["versions:1.17.1"],["project_type:mod"],["license:mit"]]; // string | Facets are an essential concept for understanding how to filter out results. These are the most commonly used facet types: - `project_type` - `categories` (loaders are lumped in with categories in search) - `versions` - `client_side` - `server_side` - `open_source` Several others are also available for use, though these should not be used outside very specific use cases. - `title` - `author` - `follows` - `project_id` - `license` - `downloads` - `color` - `created_timestamp` - `modified_timestamp` In order to then use these facets, you need a value to filter by, as well as an operation to perform on this value. The most common operation is `:` (same as `=`), though you can also use `!=`, `>=`, `>`, `<=`, and `<`. Join together the type, operation, and value, and you've got your string. ``` {type} {operation} {value} ``` Examples: ``` categories = adventure versions != 1.20.1 downloads <= 100 ``` You then join these strings together in arrays to signal `AND` and `OR` operators. ##### OR All elements in a single array are considered to be joined by OR statements. For example, the search `[[\"versions:1.16.5\", \"versions:1.17.1\"]]` translates to `Projects that support 1.16.5 OR 1.17.1`. ##### AND Separate arrays are considered to be joined by AND statements. For example, the search `[[\"versions:1.16.5\"], [\"project_type:modpack\"]]` translates to `Projects that support 1.16.5 AND are modpacks`.
$facets = [["categories:forge"],["versions:1.17.1"],["project_type:mod"],["license:mit"]]; // string | Facets are an essential concept for understanding how to filter out results. These are the most commonly used facet types: - `project_type` - `categories` (loaders are lumped in with categories in search) - `versions` - `client_side` - `server_side` - `open_source` Several others are also available for use, though these should not be used outside very specific use cases. - `title` - `author` - `follows` - `project_id` - `license` - `downloads` - `color` - `created_timestamp` (uses Unix timestamp) - `modified_timestamp` (uses Unix timestamp) - `date_created` (uses ISO-8601 timestamp) - `date_modified` (uses ISO-8601 timestamp) In order to then use these facets, you need a value to filter by, as well as an operation to perform on this value. The most common operation is `:` (same as `=`), though you can also use `!=`, `>=`, `>`, `<=`, and `<`. Join together the type, operation, and value, and you've got your string. ``` {type} {operation} {value} ``` Examples: ``` categories = adventure versions != 1.20.1 downloads <= 100 ``` You then join these strings together in arrays to signal `AND` and `OR` operators. ##### OR All elements in a single array are considered to be joined by OR statements. For example, the search `[[\"versions:1.16.5\", \"versions:1.17.1\"]]` translates to `Projects that support 1.16.5 OR 1.17.1`. ##### AND Separate arrays are considered to be joined by AND statements. For example, the search `[[\"versions:1.16.5\"], [\"project_type:modpack\"]]` translates to `Projects that support 1.16.5 AND are modpacks`.
$index = downloads; // string | The sorting method used for sorting search results
$offset = 20; // int | The offset into the search. Skips this number of results
$limit = 20; // int | The number of results returned by the search
Expand All @@ -1024,7 +1026,7 @@ try {
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **query** | **string**| The query to search for | [optional] |
| **facets** | **string**| Facets are an essential concept for understanding how to filter out results. These are the most commonly used facet types: - &#x60;project_type&#x60; - &#x60;categories&#x60; (loaders are lumped in with categories in search) - &#x60;versions&#x60; - &#x60;client_side&#x60; - &#x60;server_side&#x60; - &#x60;open_source&#x60; Several others are also available for use, though these should not be used outside very specific use cases. - &#x60;title&#x60; - &#x60;author&#x60; - &#x60;follows&#x60; - &#x60;project_id&#x60; - &#x60;license&#x60; - &#x60;downloads&#x60; - &#x60;color&#x60; - &#x60;created_timestamp&#x60; - &#x60;modified_timestamp&#x60; In order to then use these facets, you need a value to filter by, as well as an operation to perform on this value. The most common operation is &#x60;:&#x60; (same as &#x60;&#x3D;&#x60;), though you can also use &#x60;!&#x3D;&#x60;, &#x60;&gt;&#x3D;&#x60;, &#x60;&gt;&#x60;, &#x60;&lt;&#x3D;&#x60;, and &#x60;&lt;&#x60;. Join together the type, operation, and value, and you&#39;ve got your string. &#x60;&#x60;&#x60; {type} {operation} {value} &#x60;&#x60;&#x60; Examples: &#x60;&#x60;&#x60; categories &#x3D; adventure versions !&#x3D; 1.20.1 downloads &lt;&#x3D; 100 &#x60;&#x60;&#x60; You then join these strings together in arrays to signal &#x60;AND&#x60; and &#x60;OR&#x60; operators. ##### OR All elements in a single array are considered to be joined by OR statements. For example, the search &#x60;[[\&quot;versions:1.16.5\&quot;, \&quot;versions:1.17.1\&quot;]]&#x60; translates to &#x60;Projects that support 1.16.5 OR 1.17.1&#x60;. ##### AND Separate arrays are considered to be joined by AND statements. For example, the search &#x60;[[\&quot;versions:1.16.5\&quot;], [\&quot;project_type:modpack\&quot;]]&#x60; translates to &#x60;Projects that support 1.16.5 AND are modpacks&#x60;. | [optional] |
| **facets** | **string**| Facets are an essential concept for understanding how to filter out results. These are the most commonly used facet types: - &#x60;project_type&#x60; - &#x60;categories&#x60; (loaders are lumped in with categories in search) - &#x60;versions&#x60; - &#x60;client_side&#x60; - &#x60;server_side&#x60; - &#x60;open_source&#x60; Several others are also available for use, though these should not be used outside very specific use cases. - &#x60;title&#x60; - &#x60;author&#x60; - &#x60;follows&#x60; - &#x60;project_id&#x60; - &#x60;license&#x60; - &#x60;downloads&#x60; - &#x60;color&#x60; - &#x60;created_timestamp&#x60; (uses Unix timestamp) - &#x60;modified_timestamp&#x60; (uses Unix timestamp) - &#x60;date_created&#x60; (uses ISO-8601 timestamp) - &#x60;date_modified&#x60; (uses ISO-8601 timestamp) In order to then use these facets, you need a value to filter by, as well as an operation to perform on this value. The most common operation is &#x60;:&#x60; (same as &#x60;&#x3D;&#x60;), though you can also use &#x60;!&#x3D;&#x60;, &#x60;&gt;&#x3D;&#x60;, &#x60;&gt;&#x60;, &#x60;&lt;&#x3D;&#x60;, and &#x60;&lt;&#x60;. Join together the type, operation, and value, and you&#39;ve got your string. &#x60;&#x60;&#x60; {type} {operation} {value} &#x60;&#x60;&#x60; Examples: &#x60;&#x60;&#x60; categories &#x3D; adventure versions !&#x3D; 1.20.1 downloads &lt;&#x3D; 100 &#x60;&#x60;&#x60; You then join these strings together in arrays to signal &#x60;AND&#x60; and &#x60;OR&#x60; operators. ##### OR All elements in a single array are considered to be joined by OR statements. For example, the search &#x60;[[\&quot;versions:1.16.5\&quot;, \&quot;versions:1.17.1\&quot;]]&#x60; translates to &#x60;Projects that support 1.16.5 OR 1.17.1&#x60;. ##### AND Separate arrays are considered to be joined by AND statements. For example, the search &#x60;[[\&quot;versions:1.16.5\&quot;], [\&quot;project_type:modpack\&quot;]]&#x60; translates to &#x60;Projects that support 1.16.5 AND are modpacks&#x60;. | [optional] |
| **index** | **string**| The sorting method used for sorting search results | [optional] [default to &#39;relevance&#39;] |
| **offset** | **int**| The offset into the search. Skips this number of results | [optional] [default to 0] |
| **limit** | **int**| The number of results returned by the search | [optional] [default to 10] |
Expand Down
2 changes: 2 additions & 0 deletions docs/Api/TagsApi.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Aternos\ModrinthApi\TagsApi

Tags are common and reusable lists of metadata types such as categories or versions. Some can be applied to projects and/or versions.

All URIs are relative to https://api.modrinth.com/v2, except if the operation defines another base path.

| Method | HTTP request | Description |
Expand Down
2 changes: 2 additions & 0 deletions docs/Api/TeamsApi.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Aternos\ModrinthApi\TeamsApi

Through teams, user permissions limit how team members can modify projects.

All URIs are relative to https://api.modrinth.com/v2, except if the operation defines another base path.

| Method | HTTP request | Description |
Expand Down
2 changes: 2 additions & 0 deletions docs/Api/ThreadsApi.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Aternos\ModrinthApi\ThreadsApi

Threads are a way of communicating between users and moderators, for the purposes of project reviews and reports.

All URIs are relative to https://api.modrinth.com/v2, except if the operation defines another base path.

| Method | HTTP request | Description |
Expand Down
62 changes: 62 additions & 0 deletions docs/Api/UsersApi.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Aternos\ModrinthApi\UsersApi

Users can create projects, join teams, access notifications, manage settings, and follow projects. Admins and moderators have more advanced permissions such as reviewing new projects.

All URIs are relative to https://api.modrinth.com/v2, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**changeUserIcon()**](UsersApi.md#changeUserIcon) | **PATCH** /user/{id|username}/icon | Change user&#39;s avatar |
| [**deleteUserIcon()**](UsersApi.md#deleteUserIcon) | **DELETE** /user/{id|username}/icon | Remove user&#39;s avatar |
| [**getFollowedProjects()**](UsersApi.md#getFollowedProjects) | **GET** /user/{id|username}/follows | Get user&#39;s followed projects |
| [**getPayoutHistory()**](UsersApi.md#getPayoutHistory) | **GET** /user/{id|username}/payouts | Get user&#39;s payout history |
| [**getUser()**](UsersApi.md#getUser) | **GET** /user/{id|username} | Get a user |
Expand Down Expand Up @@ -78,6 +81,65 @@ void (empty response body)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `deleteUserIcon()`

```php
deleteUserIcon($id_username)
```

Remove user's avatar

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: TokenAuth
$config = Aternos\ModrinthApi\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Aternos\ModrinthApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new Aternos\ModrinthApi\Api\UsersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id_username = ["EEFFGGHH","my_user"]; // string | The ID or username of the user

try {
$apiInstance->deleteUserIcon($id_username);
} catch (Exception $e) {
echo 'Exception when calling UsersApi->deleteUserIcon: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id_username** | **string**| The ID or username of the user | |

### Return type

void (empty response body)

### Authorization

[TokenAuth](../../README.md#TokenAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `getFollowedProjects()`

```php
Expand Down
2 changes: 2 additions & 0 deletions docs/Api/VersionFilesApi.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Aternos\ModrinthApi\VersionFilesApi



All URIs are relative to https://api.modrinth.com/v2, except if the operation defines another base path.

| Method | HTTP request | Description |
Expand Down
2 changes: 2 additions & 0 deletions docs/Api/VersionsApi.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Aternos\ModrinthApi\VersionsApi

Versions contain download links to files with additional metadata.

All URIs are relative to https://api.modrinth.com/v2, except if the operation defines another base path.

| Method | HTTP request | Description |
Expand Down
2 changes: 1 addition & 1 deletion docs/Model/Statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**projects** | **int** | Number of projects on Modrinth | [optional]
**versions** | **int** | Number of projects on Modrinth | [optional]
**versions** | **int** | Number of versions on Modrinth | [optional]
**files** | **int** | Number of version files on Modrinth | [optional]
**authors** | **int** | Number of authors (users with projects) on Modrinth | [optional]

Expand Down
Loading