summaryrefslogtreecommitdiff
path: root/packages/backend/src/models/json-schema/invite-code.ts
blob: 08d1b8fd0c5d314d095663095f19b8589cc2971a (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * SPDX-FileCopyrightText: syuilo and misskey-project
 * SPDX-License-Identifier: AGPL-3.0-only
 */

export const packedInviteCodeSchema = {
	type: 'object',
	properties: {
		id: {
			type: 'string',
			optional: false, nullable: false,
			format: 'id',
			example: 'xxxxxxxxxx',
		},
		code: {
			type: 'string',
			optional: false, nullable: false,
			example: 'GR6S02ERUA5VR',
		},
		expiresAt: {
			type: 'string',
			optional: false, nullable: true,
			format: 'date-time',
		},
		createdAt: {
			type: 'string',
			optional: false, nullable: false,
			format: 'date-time',
		},
		createdBy: {
			type: 'object',
			optional: false, nullable: true,
			ref: 'UserLite',
		},
		usedBy: {
			type: 'object',
			optional: false, nullable: true,
			ref: 'UserLite',
		},
		usedAt: {
			type: 'string',
			optional: false, nullable: true,
			format: 'date-time',
		},
		used: {
			type: 'boolean',
			optional: false, nullable: false,
		},
	},
} as const;