1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-05 07:45:54 +02:00
This commit is contained in:
tamaina
2023-06-05 05:46:35 +00:00
parent fd223a8538
commit 9530cb01b9
36 changed files with 310 additions and 254 deletions

View File

@@ -2,6 +2,9 @@ import type { JSONSchema7 } from 'schema-type';
import { IEndpointMeta } from './endpoints.types';
import { localUsernameSchema, passwordSchema } from './schemas/user';
import ms from 'ms';
import { getJsonSchema } from './schemas';
import * as perUserDriveChartSchema from './schemas/charts/per-user-drive';
import * as driveChartSchema from './schemas/charts/drive';
export const endpoints = {
//#region admin
@@ -2984,6 +2987,29 @@ export const endpoints = {
}],
},
//#endregion
//#region charts
'charts/user/drive': {
tags: ['charts', 'drive', 'users'],
allowGet: true,
cacheSec: 60 * 60,
defines: [{
req: {
type: 'object',
properties: {
span: { type: 'string', enum: ['day', 'hour'] },
limit: { type: 'integer', minimum: 1, maximum: 500, default: 30 },
offset: { type: 'integer', nullable: true, default: null },
userId: { type: 'string', format: 'misskey:id' },
},
required: ['span', 'userId'],
},
res: getJsonSchema(perUserDriveChartSchema.schema) satisfies JSONSchema7,
}],
},
//#endregion
} as const satisfies { [x: string]: IEndpointMeta; };
/**