-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlib.d.ts
182 lines (149 loc) · 5.86 KB
/
lib.d.ts
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
// This file re-exports types from the API schema, and other convenient types
// so that they can be easily imported in other files.
import type { Coordinate } from 'ol/coordinate'
import type * as api from '~/lib/api'
export type AppError = {
error_code: string
details?: string
}
export type InitConfig = api.components['schemas']['StatusResponse']
export type SafeHavenVersion = api.components['schemas']['SafeHavenVersionResponse']
export type SafeHavenOptions = api.components['schemas']['SafeHavenOptions']
export type ConfigurationOption = api.components['schemas']['ConfigurationOption']
export type Category = api.components['schemas']['Category']
export type Tag = api.components['schemas']['Tag']
export type PublicEntity = api.components['schemas']['PublicEntity']
export type PublicListedEntity = api.components['schemas']['PublicListedEntity']
export type PublicNewEntity = api.components['schemas']['PublicNewEntity']
export type PublicNewEntityRequest = api.components['schemas']['PublicNewEntityRequest']
export type PublicNewEntityResponse = api.components['schemas']['PublicNewEntityResponse']
export type Cluster = api.components['schemas']['Cluster']
export type ViewerCachedEntity = api.components['schemas']['ViewerCachedEntity']
export type ViewerSearchedCachedEntity = api.components['schemas']['ViewerSearchedCachedEntity']
export type ViewerPaginatedCachedEntities = PaginatedVec<ViewerSearchedCachedEntity>
export type FetchedEntity = api.components['schemas']['FetchedEntity']
export type ResolvedFetchedEntity = FetchedEntity & {
family: Family
category: Category
tags: Tag[]
}
export type AdminEntity = api.components['schemas']['AdminEntity']
export type AdminListedEntity = api.components['schemas']['AdminListedEntity']
export type AdminEntityWithRelations = api.components['schemas']['AdminEntityWithRelations']
export type AdminNewOrUpdateEntity = api.components['schemas']['AdminNewOrUpdateEntity']
export type AdminSearchRequestBody = api.components['schemas']['AdminSearchRequest']
export type AdminCachedEntity = api.components['schemas']['AdminCachedEntity']
export type AdminPaginatedCachedEntities = PaginatedVec<AdminCachedEntity>
export type PublicComment = api.components['schemas']['PublicComment']
export type PublicNewComment = api.components['schemas']['PublicNewComment']
export type PublicNewCommentRequest = api.components['schemas']['NewCommentRequest']
export type AdminComment = api.components['schemas']['AdminComment']
export type AdminListedComment = api.components['schemas']['AdminListedComment']
export type AdminNewOrUpdateComment = api.components['schemas']['AdminNewOrUpdateComment']
export type ErrorResponse = api.components['schemas']['ErrorResponse']
export type NewOrUpdateCategory = api.components['schemas']['NewOrUpdateCategory']
export type NewOrUpdateTag = api.components['schemas']['NewOrUpdateTag']
export type PermissionPolicy = api.components['schemas']['PermissionPolicy']
export type Permissions = api.components['schemas']['Permissions']
export type NewOrUpdateAccessToken = api.components['schemas']['NewOrUpdateAccessToken']
export type AccessToken = api.components['schemas']['AccessToken']
export type AccessTokenStats = api.components['schemas']['AccessTokenStats']
export type BootstrapPermissions = api.components['schemas']['BootstrapPermissions']
export type User = api.components['schemas']['User']
export type NewOrUpdatedUser = api.components['schemas']['NewOrUpdatedUser']
export type AdminUserTokenClaims = api.components['schemas']['AdminUserTokenClaims']
export type UnprocessedLocation = api.components['schemas']['UnprocessedLocation']
export interface CanBeHighlighted {
highlighted: boolean
}
export interface HasCoordinates {
coordinates: Coordinate
}
export interface HasFamily {
family: Family
}
export interface HasCategory {
category: Category
}
export type DisplayableCachedEntity = ViewerCachedEntity &
HasCoordinates &
HasFamily &
HasCategory &
CanBeHighlighted
export type DisplayableCluster = Cluster & HasCoordinates
export type StringFieldTypeMetadata = {
format: string
}
export type OptionsFieldTypeMetadata = {
options: {
value: string
label: string
hidden?: boolean
}[]
}
export type EventsFieldTypeMetadata = {
event_types: {
value: string
label: string
color: string
}[]
}
export type FieldTypeMetadataEnum = {
field_type: 'SingleLineText'
field_type_metadata: StringFieldTypeMetadata
} | {
field_type: 'EnumSingleOption'
field_type_metadata: OptionsFieldTypeMetadata
} | {
field_type: 'EnumMultiOption'
field_type_metadata: OptionsFieldTypeMetadata
} | {
field_type: 'EventList'
field_type_metadata: EventsFieldTypeMetadata
} | {
field_type_metadata?: null
} | {
field_type: 'MultiLineText' | 'RichText'
} | {
field_type: 'Number'
} | {
field_type: 'Boolean'
} | {
field_type: 'DiscreteScore'
} | {
field_type: 'Date'
}
export type NewOrUpdateFamily = api.components['schemas']['NewOrUpdateFamily']
export type FormField = NewOrUpdateFamily['entity_form']['fields'][number]
export type Family = api.components['schemas']['Family']
export type EntityOrCommentEvent = {
date: Date | undefined
type: string | undefined
details: string | undefined
}
export type FieldContentMap = {
SingleLineText: string
MultiLineText: string
RichText: string
Number: number
Boolean: boolean
DiscreteScore: number
Date: Date
EnumSingleOption: string
EnumMultiOption: string[]
EventList: EntityOrCommentEvent[]
}
export type EntityOrCommentData = Record<string, FieldContentMap[FormField['field_type']]>
export type FamilyRecord = Record<string, Family>
export type CategoryRecord = Record<string, Category>
export type TagRecord = Record<string, Tag>
export type HomePageStats = api.components['schemas']['HomePageStats']
export type EnumFilter = {
key: string
title: string
values: {
label: string
value: string
}[]
active: string[]
}