docs: fix schema definitions

This commit is contained in:
Johann150 2023-03-03 20:50:55 +01:00
parent 68c0fa91bc
commit 5aa5344f2e
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1
7 changed files with 44 additions and 3 deletions

View file

@ -22,6 +22,7 @@ import { packedNoteReactionSchema } from '@/models/schema/note-reaction.js';
import { packedHashtagSchema } from '@/models/schema/hashtag.js';
import { packedPageSchema } from '@/models/schema/page.js';
import { packedUserGroupSchema } from '@/models/schema/user-group.js';
import { packedUserGroupInvitationSchema } from '@/models/schema/user-group-invitation.js';
import { packedNoteFavoriteSchema } from '@/models/schema/note-favorite.js';
import { packedChannelSchema } from '@/models/schema/channel.js';
import { packedAntennaSchema } from '@/models/schema/antenna.js';
@ -41,6 +42,7 @@ export const refs = {
UserList: packedUserListSchema,
UserGroup: packedUserGroupSchema,
UserGroupInvitation: packedUserGroupInvitationSchema,
App: packedAppSchema,
MessagingMessage: packedMessagingMessageSchema,
Note: packedNoteSchema,

View file

@ -163,16 +163,20 @@ export const packedNoteSchema = {
optional: false, nullable: false,
},
uri: {
description: 'ActivityPub `id` of this Note',
type: 'string',
optional: true, nullable: false,
},
url: {
description: 'URL to a presentation form intended for humans, if available',
type: 'string',
optional: true, nullable: false,
},
myReaction: {
type: 'object',
description: 'Textual representation of the authenticated users reaction, if they reacted.',
example: ':blobfox@.:',
type: 'string',
optional: true, nullable: true,
},
},

View file

@ -48,6 +48,7 @@ export const packedNotificationSchema = {
},
invitation: {
type: 'object',
ref: 'UserGroupInvitation',
optional: true, nullable: true,
},
body: {

View file

@ -0,0 +1,16 @@
export const packedUserGroupInvitationSchema = {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
group: {
type: 'object',
optional: false, nullable: false,
ref: 'UserGroup',
},
},
} as const;

View file

@ -403,6 +403,24 @@ export const packedMeDetailedOnlySchema = {
items: {
type: 'object',
nullable: false, optional: false,
properties: {
id: {
type: 'string',
optional: false,
nullable: false,
},
name: {
type: 'string',
optional: false,
nullable: false,
},
lastUsed: {
type: 'string',
optional: false,
nullable: false,
example: '1970-01-01T00:00:00Z',
},
},
},
},
//#endregion

View file

@ -52,7 +52,7 @@ export const meta = {
},
bannerUrl: {
type: 'string',
optional: false, nullable: false,
optional: false, nullable: true,
},
iconUrl: {
type: 'string',

View file

@ -114,7 +114,7 @@ export const meta = {
},
bannerUrl: {
type: 'string',
optional: false, nullable: false,
optional: false, nullable: true,
},
iconUrl: {
type: 'string',