This commit is contained in:
tamaina 2023-05-10 15:07:37 +00:00
parent 44e819bf6a
commit 00b1fd2ee3
2 changed files with 37 additions and 65 deletions

View file

@ -1,36 +1,24 @@
import type { JSONSchema7Definition } from 'schema-type';
export const packedFollowingSchema = {
$id: 'https://misskey-hub.net/api/schemas/Following',
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
createdAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
followeeId: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
followee: {
type: 'object',
optional: true, nullable: false,
ref: 'UserDetailed',
},
followerId: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
follower: {
type: 'object',
optional: true, nullable: false,
ref: 'UserDetailed',
},
followeeId: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
followee: { $ref: 'https://misskey-hub.net/api/schemas/UserDetailed' },
followerId: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
follower: { $ref: 'https://misskey-hub.net/api/schemas/UserDetailed' },
},
} as const;
required: [
'id',
'createdAt',
'followeeId',
'followerId',
],
} as const satisfies JSONSchema7Definition;

View file

@ -1,69 +1,53 @@
import type { JSONSchema7Definition } from 'schema-type';
export const packedGalleryPostSchema = {
$id: 'https://misskey-hub.net/api/schemas/GalleryPost',
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
createdAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
updatedAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
title: {
type: 'string',
optional: false, nullable: false,
},
description: {
type: 'string',
optional: false, nullable: true,
},
userId: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
user: {
type: 'object',
ref: 'UserLite',
optional: false, nullable: false,
type: ['string', 'null'],
},
userId: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
user: { $ref: 'https://misskey-hub.net/api/schemas/UserLite' },
fileIds: {
type: 'array',
optional: true, nullable: false,
items: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
items: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
},
files: {
type: 'array',
optional: true, nullable: false,
items: {
type: 'object',
optional: false, nullable: false,
ref: 'DriveFile',
},
items: { $ref: 'https://misskey-hub.net/api/schemas/DriveFile' },
},
tags: {
type: 'array',
optional: true, nullable: false,
items: {
type: 'string',
optional: false, nullable: false,
},
},
isSensitive: {
type: 'boolean',
optional: false, nullable: false,
},
},
} as const;
required: [
'id',
'createdAt',
'updatedAt',
'title',
'description',
'userId',
'user',
'isSensitive',
],
} as const satisfies JSONSchema7Definition;