Skip to content

Commit ffbdfd9

Browse files
committed
Update dependencies
1 parent 70171f0 commit ffbdfd9

20 files changed

Lines changed: 817 additions & 1143 deletions

‎.github/workflows/build.yml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,26 @@ jobs:
2323

2424
steps:
2525
- name: Checkout repository
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v4
2727

2828
- name: Log in to the Container registry
29-
uses: docker/login-action@v1
29+
if: github.event_name != 'pull_request'
30+
uses: docker/login-action@v3
3031
with:
3132
registry: ${{ env.REGISTRY }}
3233
username: ${{ github.actor }}
3334
password: ${{ secrets.GITHUB_TOKEN }}
3435

3536
- name: Extract metadata for Docker
3637
id: meta
37-
uses: docker/metadata-action@v3
38+
uses: docker/metadata-action@v5
3839
with:
3940
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4041
flavor: |
4142
latest=${{ github.ref == 'refs/heads/master' }}
4243
4344
- name: Build and push Docker image
44-
uses: docker/build-push-action@v2
45+
uses: docker/build-push-action@v6
4546
with:
4647
context: .
4748
push: ${{ github.event_name != 'pull_request' }}

‎Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# --------------
22
# BUILD STAGE
33
# --------------
4-
FROM node:lts as build
4+
FROM node:lts-alpine AS build
55
WORKDIR /app
66

77
# get dependencies
@@ -11,7 +11,7 @@ RUN yarn install --frozen-lockfile
1111
# compile typescript
1212
COPY tsconfig.json ./
1313
COPY src/ ./src/
14-
RUN npx tsc
14+
RUN yarn tsc
1515

1616
# get production dependencies
1717
RUN yarn install --frozen-lockfile --production

‎README.md‎

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A HTTP API which collects and serves various information about the LuckPerms pro
44

55
The base URL is https://metadata.luckperms.net/
66

7-
Data is periodically collected from various other APIs (Jenkins, Discord, Patreon, Crowdin), then cached and served according to the routes listed below.
7+
Data is periodically collected from various other APIs (Jenkins, Discord, Crowdin), then cached and served according to the routes listed below.
88

99
You can append the `?pretty` query parameter to get nicely formatted JSON from any of the supported routes. Otherwise, the JSON output is compacted.
1010

@@ -31,8 +31,7 @@ Gets all metadata about the project (combines the data from all subroutes listed
3131
"extensions": { },
3232
"additionalPlugins": { },
3333
"placeholderExpansions": { },
34-
"discordUserCount": 0,
35-
"patreonCount": 0
34+
"discordUserCount": 0
3635
}
3736
```
3837

@@ -145,16 +144,6 @@ Gets the current number of users on the LuckPerms Discord server.
145144
}
146145
```
147146

148-
##### GET `/data/patreon-count`
149-
150-
Gets the current number of people subscribed to @lucko's Patreon.
151-
152-
```json
153-
{
154-
"patreonCount": 35
155-
}
156-
```
157-
158147
---
159148

160149
### GET `/data/translations`
@@ -196,37 +185,6 @@ Gets information about the available translations for the plugin.
196185

197186
---
198187

199-
### GET `/data/donors`
200-
201-
Gets information about the projects donors.
202-
203-
#### Response (success, `200`, `application/json`)
204-
205-
```json
206-
{
207-
"donors": [
208-
{
209-
"name": "Sample",
210-
"discord": 253217226783940124,
211-
"tiers": [
212-
"Patron"
213-
]
214-
}
215-
]
216-
}
217-
```
218-
219-
* `discord` refers to the users Discord snowflake ID - can be null.
220-
* `tiers` refers to the Patreon tiers the user currently has - can be empty.
221-
222-
#### Response (error, `500`)
223-
224-
```
225-
<error message>
226-
```
227-
228-
---
229-
230188
### GET `/translation/<id>`
231189

232190
Gets a translation bundle file.

‎docker-compose.yml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ services:
66
ports:
77
- 3000:3000
88
environment:
9-
METADATA_API_GITHUB_API_KEY: example
10-
METADATA_API_PATREON_API_KEY: example
119
METADATA_API_CROWDIN_API_KEY: example

‎package.json‎

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,26 @@
44
"license": "MIT",
55
"main": "src/index.ts",
66
"scripts": {
7-
"start": "npx ts-node src/index.ts",
8-
"dev": "nodemon",
7+
"start": "tsx src/index.ts",
98
"format": "prettier --write '**/*.ts'"
109
},
1110
"devDependencies": {
12-
"@types/cors": "^2.8.12",
13-
"@types/express": "^4.17.13",
14-
"@types/morgan": "^1.9.3",
15-
"@types/node": "^16.11.7",
16-
"nodemon": "^2.0.15",
17-
"prettier": "^2.6.2",
18-
"prettier-plugin-organize-imports": "^2.3.4",
19-
"ts-node": "^10.4.0",
20-
"typescript": "^4.4.4"
11+
"@types/cors": "^2.8.19",
12+
"@types/express": "^5.0.6",
13+
"@types/morgan": "^1.9.10",
14+
"@types/node": "^26.1.2",
15+
"prettier": "^3.9.6",
16+
"prettier-plugin-organize-imports": "^4.3.0",
17+
"tsx": "^4.23.8",
18+
"typescript": "^7.0.2"
2119
},
2220
"dependencies": {
23-
"@octokit/graphql": "^4.8.0",
24-
"axios": "^0.24.0",
25-
"cors": "^2.8.5",
26-
"dotenv": "^10.0.0",
27-
"express": "^4.17.1",
28-
"express-prom-bundle": "^6.4.1",
29-
"morgan": "^1.10.0",
30-
"prom-client": "^14.0.1"
21+
"axios": "^1.19.0",
22+
"cors": "^2.8.6",
23+
"dotenv": "^17.4.2",
24+
"express": "^5.2.1",
25+
"express-prom-bundle": "^8.0.0",
26+
"morgan": "^1.11.0",
27+
"prom-client": "^15.1.3"
3128
}
3229
}

‎src/data-manager.ts‎

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,14 @@ import {
33
TranslationsData,
44
} from './fetchers/crowdin/info';
55
import { DiscordData, fetchData as fetchDiscordData } from './fetchers/discord';
6-
import { fetchData as fetchSponsorsData } from './fetchers/github/sponsors';
76
import { fetchData as fetchJenkinsData, JenkinsData } from './fetchers/jenkins';
8-
import { fetchData as fetchPatreonData, PatreonData } from './fetchers/patreon';
9-
import {
10-
fetchData as fetchDonorsData,
11-
PatreonDonorsData,
12-
PatreonDonorsInfo,
13-
} from './fetchers/patreon/donors';
147

158
/**
169
* Manages data served by the API.
1710
*/
1811
export class DataManager {
1912
jenkins?: JenkinsData;
2013
discord?: DiscordData;
21-
patreon?: PatreonData;
22-
donors?: PatreonDonorsData;
2314
translations?: TranslationsData;
2415

2516
setup: Promise<void>;
@@ -34,8 +25,6 @@ export class DataManager {
3425

3526
setInterval(async () => {
3627
await this.refreshDiscord();
37-
await this.refreshPatreon();
38-
await this.refreshDonors();
3928
}, 3600000); // 1 hour
4029

4130
setInterval(async () => {
@@ -52,8 +41,6 @@ export class DataManager {
5241
return Promise.all([
5342
this.refreshJenkins(),
5443
this.refreshDiscord(),
55-
this.refreshPatreon(),
56-
this.refreshDonors(),
5744
this.refreshTranslations(),
5845
]);
5946
}
@@ -66,27 +53,6 @@ export class DataManager {
6653
this.discord = (await fetch(fetchDiscordData)) || this.discord;
6754
}
6855

69-
async refreshPatreon() {
70-
this.patreon = (await fetch(fetchPatreonData)) || this.patreon;
71-
}
72-
73-
async refreshDonors() {
74-
const resp = await Promise.all([
75-
fetch(fetchDonorsData),
76-
fetch(fetchSponsorsData),
77-
]);
78-
79-
const newDonors: PatreonDonorsInfo[] = [];
80-
81-
for (const res of resp) {
82-
if (res) {
83-
newDonors.push(...res.donors);
84-
}
85-
}
86-
87-
this.donors = { donors: newDonors };
88-
}
89-
9056
async refreshTranslations() {
9157
this.translations =
9258
(await fetch(fetchTranslationsData)) || this.translations;

‎src/fetchers/github/sponsors.ts‎

Lines changed: 0 additions & 63 deletions
This file was deleted.

‎src/fetchers/github/utils.ts‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎src/fetchers/index.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { DiscordData } from './discord';
22
import { JenkinsData } from './jenkins';
3-
import { PatreonData } from './patreon';
43

5-
export type CombinedData = JenkinsData & DiscordData & PatreonData;
4+
export type CombinedData = JenkinsData & DiscordData;

‎src/fetchers/jenkins/changelog.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export interface JenkinsChangeData {
1212
commit: string;
1313
}
1414

15-
const url = jenkinsUrl +
15+
const url =
16+
jenkinsUrl +
1617
'job/LuckPerms/api/json?tree=builds[timestamp,result,artifacts[fileName],changeSet[items[msg,commitId]]]';
1718

1819
export async function fetchData(): Promise<JenkinsChangelogData> {

0 commit comments

Comments
 (0)