summaryrefslogtreecommitdiff
path: root/packages/backend/src/models/json-schema/achievement.ts
blob: 39a621a5706b1404ec567a1821c55f3e68ed2d72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * SPDX-FileCopyrightText: syuilo and misskey-project
 * SPDX-License-Identifier: AGPL-3.0-only
 */

import { ACHIEVEMENT_TYPES } from '@/models/UserProfile.js';

export const packedAchievementNameSchema = {
	type: 'string',
	enum: ACHIEVEMENT_TYPES,
	optional: false,
} as const;

export const packedAchievementSchema = {
	type: 'object',
	properties: {
		name: {
			ref: 'AchievementName',
		},
		unlockedAt: {
			type: 'number',
			optional: false,
		},
	},
} as const;