-
Notifications
You must be signed in to change notification settings - Fork 49
/
index.d.ts
251 lines (219 loc) 路 5.23 KB
/
index.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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
export type DirectusUser = {
auth_data?: unknown | null;
description?: string | null;
email?: string | null;
email_notifications?: boolean | null;
external_identifier?: string | null;
first_name?: string | null;
id: string;
language?: string | null;
last_access?: string | null;
last_name?: string | null;
last_page?: string | null;
location?: string | null;
password?: string | null;
provider: string;
status: string;
tags?: unknown | null;
tfa_secret?: string | null;
theme?: string | null;
title?: string | null;
token?: string | null;
[key: string]: any;
} | null;
export interface DirectusAuthCredentials {
email: string;
password: string;
otp?: string;
}
export interface DirectusAuthResponse {
user: DirectusUser;
access_token: string;
expires: number;
refresh_token: string;
}
export interface DirectusPasswordForgotCredentials {
email: string;
reset_url?: string;
}
export interface DirectusPasswordResetCredentials {
token: string;
password: string;
}
export interface DirectusQueryParams {
fields?: Array<string>;
sort?: string | Array<string>;
filter?: Record<string, unknown>;
limit?: number;
offset?: number;
page?: number;
alias?: string | Array<string>;
deep?: Record<string, unknown>;
search?: string;
}
export interface DirectusMetaQueryParams extends DirectusQueryParams {
meta?: 'total_count' | 'filter_count' | '*';
}
export interface DirectusItemRequest {
collection: string;
id?: string;
params?: DirectusQueryParams;
}
export interface DirectusItemMetaRequest extends DirectusItemRequest {
params?: DirectusMetaQueryParams;
}
export interface DirectusItemCreation {
collection: string;
items: Array<Object> | Object;
params?: DirectusQueryParams;
}
export interface DirectusItemUpdate {
collection: string;
id: string;
item: Object;
params?: DirectusQueryParams;
}
export interface DirectusItemDeletion {
collection: string;
items: Array<string> | string;
}
// User Interfaces
export interface DirectusUserRequest {
id?: string;
params?: DirectusQueryParams;
}
export interface DirectusUserCreation {
users: Array<Object> | Object;
}
export interface DirectusUserUpdate {
id: string;
user: Object;
}
export interface DirectusUserDeletion {
users: Array<string> | string;
}
export type DirectusThumbnailFormat = 'jpg' | 'png' | 'webp' | 'tiff' | 'avif';
export type DirectusThumbnailFit = 'cover' | 'contain' | 'inside' | 'outside';
export interface DirectusThumbnailOptions {
width?: number;
height?: number;
quality?: number;
fit?: DirectusThumbnailFit;
format?: DirectusThumbnailFormat;
withoutEnlargement?: boolean;
key?: string;
}
export interface DirectusRegisterCredentials {
email: string;
password: string;
}
export type DirectusFile = {
charset?: string | null;
description?: string | null;
duration?: number | null;
embed?: string | null;
filename_disk?: string | null;
filename_download: string;
filesize?: number | null;
folder?: string | DirectusFolders | null;
height?: number | null;
id: string;
location?: string | null;
metadata?: unknown | null;
modified_by?: string | DirectusUser | null;
modified_on: string;
storage: string;
tags?: unknown | null;
title?: string | null;
type?: string | null;
uploaded_by?: string | DirectusUser | null;
uploaded_on: string;
width?: number | null;
[key: string]: any;
} | null;
export type DirectusFolders = {
id: string;
name: string;
parent?: string | DirectusFolders | null;
};
export interface DirectusFileRequest {
id?: string;
params?: DirectusQueryParams;
}
export interface DirectusNotificationObject {
id?: number;
timestamp?: string;
status?: 'inbox' | 'archived';
recipient: Array<string> | string;
sender?: Array<string> | string;
subject: string;
message?: string;
collection?: string;
item?: string;
}
export interface DirectusCollectionRequest {
collection?: string;
}
export interface DirectusCollectionMeta {
collection?: string;
icon?: string;
note?: string;
display_template?: string;
hidden?: boolean;
singleton?: boolean;
translations?: [
{
language?: string;
translation?: string;
}
];
archive_field?: string;
archive_value?: string;
unarchive_value?: string;
archive_app_filter?: boolean;
sort_field?: string;
item_duplication_fields?: string[];
sort?: number;
collapse?: 'open' | 'closed' | 'locked';
}
export interface DirectusCollectionCreation {
collection: string;
meta?: DirectusCollectionMeta;
schema?: {
name?: string;
comment?: string;
};
}
export interface DirectusCollectionUpdate {
collection: string;
meta: DirectusCollectionMeta;
}
export interface DirectusRevision {
id: number;
activity?: any;
collection: string;
item?: string;
data?: Object;
delta?: Object;
parent?: any;
}
export interface DirectusItemMetadata {
total_count?: number;
filter_count?: number;
};
export interface DirectusItems<T> {
data: NonNullable<T[]>;
meta?: DirectusItemMetadata;
};
export interface DirectusItem<T> {
data: NonNullable<T>;
};
export interface DirectusInviteCreation {
email: string;
role: string;
invite_url?: string
};
export interface DirectusAcceptInvite {
token: string;
password: string
};