wip endpoints

This commit is contained in:
tamaina 2023-05-12 07:54:50 +00:00
parent 2afa664864
commit 5e268f0611
2 changed files with 71 additions and 0 deletions

View File

@ -159,4 +159,74 @@ export const endpoints = {
res: undefined, res: undefined,
}], }],
}, },
"admin/ad/create": {
tags: ['admin'],
requireCredential: true,
requireModerator: true,
defines: [{
req: {
type: 'object',
properties: {
url: { type: 'string', minLength: 1 },
memo: { type: 'string' },
place: { type: 'string' },
priority: { type: 'string' },
ratio: { type: 'integer' },
expiresAt: { type: 'integer' },
startsAt: { type: 'integer' },
imageUrl: { type: 'string', minLength: 1 },
},
required: ['url', 'memo', 'place', 'priority', 'ratio', 'expiresAt', 'startsAt', 'imageUrl'],
},
res: undefined,
}]
},
"admin/ad/delete": {
tags: ['admin'],
requireCredential: true,
requireModerator: true,
errors: {
noSuchAd: {
message: 'No such ad.',
code: 'NO_SUCH_AD',
id: 'ccac9863-3a03-416e-b899-8a64041118b1',
},
},
defines: [{
req: {
type: 'object',
properties: {
id: { type: 'string', format: 'misskey:id' },
},
required: ['id'],
},
res: undefined,
}],
},
"admin/ad/list": {
tags: ['admin'],
requireCredential: true,
requireModerator: true,
defines: [{
req: {
type: 'object',
properties: {
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' },
},
required: [],
},
res: {
type: 'array',
},
}],
},
} as const satisfies { [x: string]: IEndpointMeta; }; } as const satisfies { [x: string]: IEndpointMeta; };

View File

@ -477,6 +477,7 @@ export const packedUserDetailedSchema = {
}], }],
} as const satisfies JSONSchema7Definition; } as const satisfies JSONSchema7Definition;
// NOTE: 極力この型を使うのは避け、UserLite か UserDetailed か明示するように
export const packedUserSchema = { export const packedUserSchema = {
$id: 'https://misskey-hub.net/api/schemas/User', $id: 'https://misskey-hub.net/api/schemas/User',