mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-10 08:18:12 +03:00
Add advancedMode as an option
This commit is contained in:
+1
-1
@@ -82,7 +82,7 @@
|
||||
"rimraf": "3.0.2",
|
||||
"safe-json-stringify": "1.2.0",
|
||||
"seq-logging": "^1.1.1",
|
||||
"tachi-common": "0.3.1",
|
||||
"tachi-common": "0.3.2",
|
||||
"ts-node": "10.0.0",
|
||||
"typescript": "4.3.4",
|
||||
"winston": "3.3.3",
|
||||
|
||||
Generated
+4
-4
@@ -63,7 +63,7 @@ specifiers:
|
||||
safe-json-stringify: 1.2.0
|
||||
seq-logging: ^1.1.1
|
||||
supertest: 6.1.3
|
||||
tachi-common: 0.3.1
|
||||
tachi-common: 0.3.2
|
||||
tap: 15.0.9
|
||||
ts-node: 10.0.0
|
||||
tsconfig-paths: 3.10.1
|
||||
@@ -108,7 +108,7 @@ dependencies:
|
||||
rimraf: 3.0.2
|
||||
safe-json-stringify: 1.2.0
|
||||
seq-logging: 1.1.1
|
||||
tachi-common: 0.3.1
|
||||
tachi-common: 0.3.2
|
||||
ts-node: 10.0.0_83f53b0a0c5616d3fa00ed4e30b9ce1b
|
||||
typescript: 4.3.4
|
||||
winston: 3.3.3
|
||||
@@ -4960,8 +4960,8 @@ packages:
|
||||
strip-ansi: 6.0.0
|
||||
dev: true
|
||||
|
||||
/tachi-common/0.3.1:
|
||||
resolution: {integrity: sha512-MzBOFG0TVEkKkCOyCKx4i4dqlVHhItM1GBx+93RaHdT2Kvu+NJHejVfeel/+1nP1uczZ6CPzzo8pcePBI8pTRA==}
|
||||
/tachi-common/0.3.2:
|
||||
resolution: {integrity: sha512-fX1ffleAJlP6WtjnGxVDfLsz7PQDArIFCMcvOjLB0+PwJ5FwhAO/8CX2B8ksYGuzp8PGWLxQGsPahwN9HV7YVQ==}
|
||||
dependencies:
|
||||
monk: 7.3.4
|
||||
transitivePeerDependencies:
|
||||
|
||||
Vendored
+1
@@ -521,6 +521,7 @@ export const DatabaseSchemas: Record<Databases, ValidatorFunction> = {
|
||||
preferences: {
|
||||
invisible: "boolean",
|
||||
developerMode: "boolean",
|
||||
advancedMode: "boolean",
|
||||
contentiousContent: "boolean",
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -78,6 +78,7 @@ export async function AddNewInvite(user: PublicUserDocument) {
|
||||
|
||||
export const DEFAULT_USER_SETTINGS: UserSettings["preferences"] = {
|
||||
developerMode: false,
|
||||
advancedMode: false,
|
||||
invisible: false,
|
||||
contentiousContent: false,
|
||||
};
|
||||
|
||||
@@ -17,6 +17,8 @@ t.test("GET /api/v1/users/:userID/settings", (t) => {
|
||||
preferences: {
|
||||
invisible: false,
|
||||
developerMode: true,
|
||||
advancedMode: false,
|
||||
contentiousContent: false,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -42,6 +44,8 @@ t.test("PATCH /api/v1/users/:userID/settings", async (t) => {
|
||||
preferences: {
|
||||
invisible: true,
|
||||
developerMode: false,
|
||||
advancedMode: false,
|
||||
contentiousContent: false,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -52,6 +56,8 @@ t.test("PATCH /api/v1/users/:userID/settings", async (t) => {
|
||||
preferences: {
|
||||
invisible: true,
|
||||
developerMode: false,
|
||||
advancedMode: false,
|
||||
contentiousContent: false,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -72,6 +78,8 @@ t.test("PATCH /api/v1/users/:userID/settings", async (t) => {
|
||||
preferences: {
|
||||
invisible: false,
|
||||
developerMode: true,
|
||||
advancedMode: false,
|
||||
contentiousContent: false,
|
||||
},
|
||||
},
|
||||
"User Settings should be unmodified."
|
||||
|
||||
@@ -42,6 +42,8 @@ router.get("/", async (req, res) => {
|
||||
*
|
||||
* @param invisible - Whether to set the user to invisible or not.
|
||||
* @param developerMode - Whether to display developer specific information in the WebUI.
|
||||
* @param advancedMode - Whether to display more advanced options in the WebUI.
|
||||
* @param contentiousContent - Whether to display slightly inappropriate splash messages.
|
||||
*
|
||||
* @name PATCH /api/v1/users/:userID/settings
|
||||
*/
|
||||
@@ -52,6 +54,7 @@ router.patch(
|
||||
invisible: "*boolean",
|
||||
developerMode: "*boolean",
|
||||
contentiousContent: "*boolean",
|
||||
advancedMode: "*boolean",
|
||||
}),
|
||||
async (req, res) => {
|
||||
const user = req[SYMBOL_TachiData]!.requestedUser!;
|
||||
@@ -60,6 +63,7 @@ router.patch(
|
||||
invisible: req.body.invisible,
|
||||
developerMode: req.body.developerMode,
|
||||
contentiousContent: req.body.contentiousContent,
|
||||
advancedMode: req.body.advancedMode,
|
||||
};
|
||||
|
||||
DeleteUndefinedProps(preferences);
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
[
|
||||
{
|
||||
"userID": 1,
|
||||
"preferences": {
|
||||
"developerMode": true,
|
||||
"invisible": false
|
||||
}
|
||||
}
|
||||
{
|
||||
"userID": 1,
|
||||
"preferences": {
|
||||
"developerMode": true,
|
||||
"invisible": false,
|
||||
"advancedMode": false,
|
||||
"contentiousContent": false
|
||||
}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user