2022-09-17 21:27:08 +03:00
|
|
|
import { Inject, Injectable } from '@nestjs/common';
|
|
|
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
2022-02-19 07:05:32 +02:00
|
|
|
|
|
|
|
export const meta = {
|
2022-06-10 08:25:20 +03:00
|
|
|
tags: ['non-productive'],
|
|
|
|
|
|
|
|
description: 'Endpoint for testing input validation.',
|
|
|
|
|
2022-02-19 07:05:32 +02:00
|
|
|
requireCredential: false,
|
|
|
|
} as const;
|
|
|
|
|
2022-02-20 06:15:40 +02:00
|
|
|
export const paramDef = {
|
2022-02-19 07:05:32 +02:00
|
|
|
type: 'object',
|
|
|
|
properties: {
|
|
|
|
required: { type: 'boolean' },
|
|
|
|
string: { type: 'string' },
|
|
|
|
default: { type: 'string', default: 'hello' },
|
|
|
|
nullableDefault: { type: 'string', nullable: true, default: 'hello' },
|
|
|
|
id: { type: 'string', format: 'misskey:id' },
|
|
|
|
},
|
|
|
|
required: ['required'],
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
// eslint-disable-next-line import/no-default-export
|
2022-09-17 21:27:08 +03:00
|
|
|
@Injectable()
|
|
|
|
export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|
|
|
constructor(
|
|
|
|
) {
|
|
|
|
super(meta, paramDef, async (ps, me) => {
|
|
|
|
return ps;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|