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 = { export const packedFollowingSchema = {
$id: 'https://misskey-hub.net/api/schemas/Following',
type: 'object', type: 'object',
properties: { properties: {
id: { id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
createdAt: { createdAt: {
type: 'string', type: 'string',
optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
followeeId: { followeeId: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
type: 'string', followee: { $ref: 'https://misskey-hub.net/api/schemas/UserDetailed' },
optional: false, nullable: false, followerId: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
format: 'id', follower: { $ref: 'https://misskey-hub.net/api/schemas/UserDetailed' },
}, },
followee: { required: [
type: 'object', 'id',
optional: true, nullable: false, 'createdAt',
ref: 'UserDetailed', 'followeeId',
}, 'followerId',
followerId: { ],
type: 'string', } as const satisfies JSONSchema7Definition;
optional: false, nullable: false,
format: 'id',
},
follower: {
type: 'object',
optional: true, nullable: false,
ref: 'UserDetailed',
},
},
} as const;

View file

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