forked from FoundKeyGang/FoundKey
backend: ignore detail parameter on meta endpoint
Also allow meta endpoint to be fetched via GET. Changelog: Removed
This commit is contained in:
parent
4e0f14c0db
commit
9022ab9f2a
1 changed files with 20 additions and 19 deletions
|
@ -10,6 +10,9 @@ export const meta = {
|
||||||
|
|
||||||
requireCredential: false,
|
requireCredential: false,
|
||||||
|
|
||||||
|
allowGet: true,
|
||||||
|
cacheSec: 60,
|
||||||
|
|
||||||
res: {
|
res: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
|
@ -253,7 +256,12 @@ export const meta = {
|
||||||
export const paramDef = {
|
export const paramDef = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
detail: { type: 'boolean', default: true },
|
detail: {
|
||||||
|
deprecated: true,
|
||||||
|
description: 'This parameter is ignored. You will always get all details (as if it was `true`).',
|
||||||
|
type: 'boolean',
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
required: [],
|
required: [],
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -276,7 +284,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const response: any = {
|
return {
|
||||||
maintainerName: instance.maintainerName,
|
maintainerName: instance.maintainerName,
|
||||||
maintainerEmail: instance.maintainerEmail,
|
maintainerEmail: instance.maintainerEmail,
|
||||||
|
|
||||||
|
@ -317,21 +325,16 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
|
|
||||||
translatorAvailable: instance.deeplAuthKey != null,
|
translatorAvailable: instance.deeplAuthKey != null,
|
||||||
|
|
||||||
...(ps.detail ? {
|
pinnedPages: instance.pinnedPages,
|
||||||
pinnedPages: instance.pinnedPages,
|
pinnedClipId: instance.pinnedClipId,
|
||||||
pinnedClipId: instance.pinnedClipId,
|
cacheRemoteFiles: instance.cacheRemoteFiles,
|
||||||
cacheRemoteFiles: instance.cacheRemoteFiles,
|
requireSetup: (await Users.countBy({
|
||||||
requireSetup: (await Users.countBy({
|
host: IsNull(),
|
||||||
host: IsNull(),
|
})) === 0,
|
||||||
})) === 0,
|
|
||||||
} : {}),
|
|
||||||
};
|
|
||||||
|
|
||||||
if (ps.detail) {
|
proxyAccountName: instance.proxyAccountId ? (await Users.pack(instance.proxyAccountId).catch(() => null))?.username : null,
|
||||||
const proxyAccount = instance.proxyAccountId ? await Users.pack(instance.proxyAccountId).catch(() => null) : null;
|
|
||||||
|
|
||||||
response.proxyAccountName = proxyAccount ? proxyAccount.username : null;
|
features: {
|
||||||
response.features = {
|
|
||||||
registration: !instance.disableRegistration,
|
registration: !instance.disableRegistration,
|
||||||
localTimeLine: !instance.disableLocalTimeline,
|
localTimeLine: !instance.disableLocalTimeline,
|
||||||
globalTimeLine: !instance.disableGlobalTimeline,
|
globalTimeLine: !instance.disableGlobalTimeline,
|
||||||
|
@ -345,8 +348,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
discord: instance.enableDiscordIntegration,
|
discord: instance.enableDiscordIntegration,
|
||||||
serviceWorker: instance.enableServiceWorker,
|
serviceWorker: instance.enableServiceWorker,
|
||||||
miauth: true,
|
miauth: true,
|
||||||
};
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
return response;
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue