diff --git a/packages/misskey-js/src/schemas/ad.ts b/packages/misskey-js/src/schemas/ad.ts new file mode 100644 index 0000000000..f198fc759a --- /dev/null +++ b/packages/misskey-js/src/schemas/ad.ts @@ -0,0 +1,48 @@ +import type { JSONSchema7Definition } from 'schema-type'; + +export const packedAdSchema = { + $id: 'https://misskey-hub.net/api/schemas/Ad', + + type: 'object', + properties: { + id: { $ref: 'https://misskey-hub.net/api/schemas/Id' }, + createdAt: { + type: 'string', + format: 'date-time', + }, + expiresAt: { + type: 'string', + format: 'date-time', + }, + startsAt: { + type: 'string', + format: 'date-time', + }, + place: { + type: 'string', + }, + property: { + type: 'string', + }, + ratio: { + type: 'number', + }, + imageUrl: { + type: ['string', 'null'], + }, + memo: { + type: 'string', + }, + }, + required: [ + 'id', + 'createdAt', + 'expiresAt', + 'startsAt', + 'place', + 'property', + 'ratio', + 'imageUrl', + 'memo', + ], +} as const satisfies JSONSchema7Definition; diff --git a/packages/misskey-js/src/schemas/announcement.ts b/packages/misskey-js/src/schemas/announcement.ts new file mode 100644 index 0000000000..eb8b945b5c --- /dev/null +++ b/packages/misskey-js/src/schemas/announcement.ts @@ -0,0 +1,35 @@ +import type { JSONSchema7Definition } from 'schema-type'; + +export const packedAnnouncementSchema = { + $id: 'https://misskey-hub.net/api/schemas/Announcement', + + type: 'object', + properties: { + id: { $ref: 'https://misskey-hub.net/api/schemas/Id' }, + createdAt: { + type: 'string', + format: 'date-time', + }, + updatedAt: { + type: 'string', + format: 'date-time', + }, + title: { + type: 'string', + }, + text: { + type: 'string', + }, + imageUrl: { + type: ['string', 'null'], + }, + }, + required: [ + 'id', + 'createdAt', + 'updatedAt', + 'title', + 'text', + 'imageUrl', + ], +} as const satisfies JSONSchema7Definition;