Merge upstream
This commit is contained in:
commit
67f9e3efd1
28 changed files with 448 additions and 126 deletions
|
@ -40,7 +40,7 @@ export const meta = {
|
|||
|
||||
res: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
optional: true, nullable: false,
|
||||
properties: {
|
||||
createdNote: {
|
||||
type: 'object',
|
||||
|
@ -207,6 +207,7 @@ export const paramDef = {
|
|||
},
|
||||
required: ['choices'],
|
||||
},
|
||||
noCreatedNote: { type: 'boolean', default: false },
|
||||
},
|
||||
// (re)note with text, files and poll are optional
|
||||
if: {
|
||||
|
@ -281,7 +282,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
const note = await this.notesRepository.findOneBy({ id: idempotent });
|
||||
if (note) {
|
||||
logger.info('The request has already been processed.', { noteId: note.id });
|
||||
return { createdNote: await this.noteEntityService.pack(note, me) };
|
||||
if (ps.noCreatedNote) return;
|
||||
else return { createdNote: await this.noteEntityService.pack(note, me) };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -453,7 +455,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
await this.redisForTimelines.set(`note:idempotent:${me.id}:${hash}`, note.id, 'EX', 60);
|
||||
|
||||
logger.info('Successfully created a note.', { noteId: note.id });
|
||||
return {
|
||||
if (ps.noCreatedNote) return;
|
||||
else return {
|
||||
createdNote: await this.noteEntityService.pack(note, me),
|
||||
};
|
||||
} catch (err) {
|
||||
|
|
|
@ -52,7 +52,7 @@ export const paramDef = {
|
|||
type: 'object',
|
||||
properties: {
|
||||
title: { type: 'string' },
|
||||
name: { type: 'string', minLength: 1 },
|
||||
name: { type: 'string', minLength: 1, pattern: /^[a-zA-Z0-9_-]+$/.toString().slice(1, -1) },
|
||||
summary: { type: 'string', nullable: true },
|
||||
content: { type: 'array', items: {
|
||||
type: 'object', additionalProperties: true,
|
||||
|
|
|
@ -57,7 +57,7 @@ export const paramDef = {
|
|||
properties: {
|
||||
pageId: { type: 'string', format: 'misskey:id' },
|
||||
title: { type: 'string' },
|
||||
name: { type: 'string', minLength: 1 },
|
||||
name: { type: 'string', minLength: 1, pattern: /^[a-zA-Z0-9_-]+$/.toString().slice(1, -1) },
|
||||
summary: { type: 'string', nullable: true },
|
||||
content: { type: 'array', items: {
|
||||
type: 'object', additionalProperties: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue