mizzkey/packages/misskey-js/src/schemas/page.ts

52 lines
935 B
TypeScript
Raw Normal View History

2023-05-10 17:58:46 +02:00
import type { JSONSchema7Definition } from 'schema-type';
2023-05-02 14:05:17 +02:00
export const packedPageSchema = {
2023-05-10 17:58:46 +02:00
$id: 'https://misskey-hub.net/api/schemas/Page',
2023-05-02 14:05:17 +02:00
type: 'object',
properties: {
2023-05-10 17:58:46 +02:00
id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
2023-05-02 14:05:17 +02:00
createdAt: {
type: 'string',
format: 'date-time',
},
updatedAt: {
type: 'string',
format: 'date-time',
},
title: {
type: 'string',
},
name: {
type: 'string',
},
summary: {
2023-05-10 17:58:46 +02:00
type: ['string', 'null'],
2023-05-02 14:05:17 +02:00
},
content: {
type: 'array',
},
variables: {
type: 'array',
2023-05-10 17:58:46 +02:00
items: {
type: 'object',
additionalProperties: true,
},
2023-05-02 14:05:17 +02:00
},
2023-05-10 17:58:46 +02:00
userId: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
user: { $ref: 'https://misskey-hub.net/api/schemas/UserLite' },
2023-05-02 14:05:17 +02:00
},
2023-05-10 17:58:46 +02:00
required: [
'id',
'createdAt',
'updatedAt',
'title',
'name',
'summary',
'content',
'variables',
'userId',
'user',
],
} as const satisfies JSONSchema7Definition;