Skip to content

Commit 553178a

Browse files
committed
API lib cleanup, 404 hosts WIP
1 parent 17f40dd commit 553178a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1375
-647
lines changed

frontend/package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,45 @@
1616
},
1717
"dependencies": {
1818
"@tabler/core": "^1.4.0",
19-
"@tabler/icons-react": "^3.34.1",
20-
"@tanstack/react-query": "^5.85.6",
19+
"@tabler/icons-react": "^3.35.0",
20+
"@tanstack/react-query": "^5.89.0",
2121
"@tanstack/react-table": "^8.21.3",
2222
"classnames": "^2.5.1",
23-
"country-flag-icons": "^1.5.19",
23+
"country-flag-icons": "^1.5.20",
2424
"date-fns": "^4.1.0",
2525
"formik": "^2.4.6",
2626
"generate-password-browser": "^1.1.0",
2727
"humps": "^2.0.1",
28-
"query-string": "^9.2.2",
28+
"query-string": "^9.3.1",
2929
"react": "^19.1.1",
3030
"react-bootstrap": "^2.10.10",
3131
"react-dom": "^19.1.1",
3232
"react-intl": "^7.1.11",
33-
"react-router-dom": "^7.8.2",
33+
"react-router-dom": "^7.9.1",
34+
"react-select": "^5.10.2",
3435
"react-toastify": "^11.0.5",
35-
"rooks": "^9.2.0"
36+
"rooks": "^9.3.0"
3637
},
3738
"devDependencies": {
3839
"@biomejs/biome": "^2.2.4",
3940
"@formatjs/cli": "^6.7.2",
40-
"@tanstack/react-query-devtools": "^5.85.6",
41+
"@tanstack/react-query-devtools": "^5.89.0",
4142
"@testing-library/dom": "^10.4.1",
4243
"@testing-library/jest-dom": "^6.8.0",
4344
"@testing-library/react": "^16.3.0",
4445
"@types/country-flag-icons": "^1.2.2",
4546
"@types/humps": "^2.0.6",
46-
"@types/react": "^19.1.12",
47+
"@types/react": "^19.1.13",
4748
"@types/react-dom": "^19.1.9",
4849
"@types/react-table": "^7.7.20",
49-
"@vitejs/plugin-react": "^5.0.2",
50+
"@vitejs/plugin-react": "^5.0.3",
5051
"happy-dom": "^18.0.1",
5152
"postcss": "^8.5.6",
5253
"postcss-simple-vars": "^7.0.1",
53-
"sass": "^1.91.0",
54+
"sass": "^1.93.0",
5455
"tmp": "^0.2.5",
5556
"typescript": "5.9.2",
56-
"vite": "^7.1.4",
57+
"vite": "^7.1.6",
5758
"vite-plugin-checker": "^0.10.3",
5859
"vite-tsconfig-paths": "^5.1.4",
5960
"vitest": "^3.2.4"
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import * as api from "./base";
22
import type { AccessList } from "./models";
33

4-
export async function createAccessList(item: AccessList, abortController?: AbortController): Promise<AccessList> {
5-
return await api.post(
6-
{
7-
url: "/nginx/access-lists",
8-
// todo: only use whitelist of fields for this data
9-
data: item,
10-
},
11-
abortController,
12-
);
4+
export async function createAccessList(item: AccessList): Promise<AccessList> {
5+
return await api.post({
6+
url: "/nginx/access-lists",
7+
// todo: only use whitelist of fields for this data
8+
data: item,
9+
});
1310
}
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import * as api from "./base";
22
import type { Certificate } from "./models";
33

4-
export async function createCertificate(item: Certificate, abortController?: AbortController): Promise<Certificate> {
5-
return await api.post(
6-
{
7-
url: "/nginx/certificates",
8-
// todo: only use whitelist of fields for this data
9-
data: item,
10-
},
11-
abortController,
12-
);
4+
export async function createCertificate(item: Certificate): Promise<Certificate> {
5+
return await api.post({
6+
url: "/nginx/certificates",
7+
// todo: only use whitelist of fields for this data
8+
data: item,
9+
});
1310
}
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import * as api from "./base";
22
import type { DeadHost } from "./models";
33

4-
export async function createDeadHost(item: DeadHost, abortController?: AbortController): Promise<DeadHost> {
5-
return await api.post(
6-
{
7-
url: "/nginx/dead-hosts",
8-
// todo: only use whitelist of fields for this data
9-
data: item,
10-
},
11-
abortController,
12-
);
4+
export async function createDeadHost(item: DeadHost): Promise<DeadHost> {
5+
return await api.post({
6+
url: "/nginx/dead-hosts",
7+
// todo: only use whitelist of fields for this data
8+
data: item,
9+
});
1310
}
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import * as api from "./base";
22
import type { ProxyHost } from "./models";
33

4-
export async function createProxyHost(item: ProxyHost, abortController?: AbortController): Promise<ProxyHost> {
5-
return await api.post(
6-
{
7-
url: "/nginx/proxy-hosts",
8-
// todo: only use whitelist of fields for this data
9-
data: item,
10-
},
11-
abortController,
12-
);
4+
export async function createProxyHost(item: ProxyHost): Promise<ProxyHost> {
5+
return await api.post({
6+
url: "/nginx/proxy-hosts",
7+
// todo: only use whitelist of fields for this data
8+
data: item,
9+
});
1310
}
Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
import * as api from "./base";
22
import type { RedirectionHost } from "./models";
33

4-
export async function createRedirectionHost(
5-
item: RedirectionHost,
6-
abortController?: AbortController,
7-
): Promise<RedirectionHost> {
8-
return await api.post(
9-
{
10-
url: "/nginx/redirection-hosts",
11-
// todo: only use whitelist of fields for this data
12-
data: item,
13-
},
14-
abortController,
15-
);
4+
export async function createRedirectionHost(item: RedirectionHost): Promise<RedirectionHost> {
5+
return await api.post({
6+
url: "/nginx/redirection-hosts",
7+
// todo: only use whitelist of fields for this data
8+
data: item,
9+
});
1610
}
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import * as api from "./base";
22
import type { Stream } from "./models";
33

4-
export async function createStream(item: Stream, abortController?: AbortController): Promise<Stream> {
5-
return await api.post(
6-
{
7-
url: "/nginx/streams",
8-
// todo: only use whitelist of fields for this data
9-
data: item,
10-
},
11-
abortController,
12-
);
4+
export async function createStream(item: Stream): Promise<Stream> {
5+
return await api.post({
6+
url: "/nginx/streams",
7+
// todo: only use whitelist of fields for this data
8+
data: item,
9+
});
1310
}

frontend/src/api/backend/createUser.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@ export interface NewUser {
1515
roles?: string[];
1616
}
1717

18-
export async function createUser(item: NewUser, noAuth?: boolean, abortController?: AbortController): Promise<User> {
19-
return await api.post(
20-
{
21-
url: "/users",
22-
// todo: only use whitelist of fields for this data
23-
data: item,
24-
noAuth,
25-
},
26-
abortController,
27-
);
18+
export async function createUser(item: NewUser, noAuth?: boolean): Promise<User> {
19+
return await api.post({
20+
url: "/users",
21+
// todo: only use whitelist of fields for this data
22+
data: item,
23+
noAuth,
24+
});
2825
}
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import * as api from "./base";
22

3-
export async function deleteAccessList(id: number, abortController?: AbortController): Promise<boolean> {
4-
return await api.del(
5-
{
6-
url: `/nginx/access-lists/${id}`,
7-
},
8-
abortController,
9-
);
3+
export async function deleteAccessList(id: number): Promise<boolean> {
4+
return await api.del({
5+
url: `/nginx/access-lists/${id}`,
6+
});
107
}
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import * as api from "./base";
22

3-
export async function deleteCertificate(id: number, abortController?: AbortController): Promise<boolean> {
4-
return await api.del(
5-
{
6-
url: `/nginx/certificates/${id}`,
7-
},
8-
abortController,
9-
);
3+
export async function deleteCertificate(id: number): Promise<boolean> {
4+
return await api.del({
5+
url: `/nginx/certificates/${id}`,
6+
});
107
}

0 commit comments

Comments
 (0)