Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mastodon
GitHub Repository: mastodon/joinmastodon
Path: blob/main/types/api.ts
1006 views
1
export type ApiPaths =
2
| "jobs"
3
| "categories"
4
| "languages"
5
| "servers"
6
| "statistics"
7
| "v1/donations/campaigns/active"
8
9
export type Category = {
10
category: string
11
servers_count: number
12
}
13
14
export type Language = {
15
locale: string
16
language?: string
17
servers_count: number
18
}
19
20
export type Server = {
21
domain: string
22
version: string
23
description: string
24
languages: string[]
25
region: string
26
categories: string[]
27
proxied_thumbnail: string
28
blurhash?: string
29
last_week_users: number
30
total_users: number
31
approval_required: boolean
32
language: string
33
category: string
34
}
35
36
export type Day = {
37
period: string
38
server_count: string
39
user_count: string
40
active_user_count: string
41
}
42
43
export type Region = {
44
value: string
45
label: string
46
}
47
48
export type Job = {
49
id: string
50
title: string
51
departmentName: string
52
externalLink: string
53
locationName: string
54
employmentType: string
55
}
56
57
export type JobsResponse = {
58
success: boolean
59
results: Job[]
60
}
61
62
export const CURRENCIES = ["EUR", "USD"] as const
63
export type Currency = (typeof CURRENCIES)[number]
64
65
export const DONATION_FREQUENCIES = ["one_time", "monthly", "yearly"] as const
66
export type DonationFrequency = (typeof DONATION_FREQUENCIES)[number]
67
68
export type DonationAmounts = Record<Currency, number[]>
69
70
export type CampaignResponse = {
71
id: string
72
amounts: Record<DonationFrequency, DonationAmounts>
73
donation_url: string
74
banner_message: string
75
banner_button_text: string
76
donation_message: string
77
donation_button_text: string
78
donation_success_post: string
79
default_currency: Currency
80
}
81
82