-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.ts
More file actions
116 lines (105 loc) · 2.02 KB
/
Copy pathmodels.ts
File metadata and controls
116 lines (105 loc) · 2.02 KB
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
export type StrapiID = number | `${number}`
export type StrapiBaseProps = {
id?: StrapiID
createdBy?: User
updatedBy?: User
createdAt?: string
updatedAt?: string
publishedAt?: string | Date
}
export type StrapiSearchParams = {
populate?: string[] | Record<string, any>
pagination?: {
page?: number
pageSize?: number
withCount?: boolean
start?: number
limit?: number
}
sort?: string[]
filters?: Record<string, any>
publicationState?: "live" | "preview"
fields?: string[]
}
export type StrapiResponse<T> = {
data: T
error?: {
status: number
name: string
message: string
details: {
name: string
message: string
}
}
meta?: StrapiMeta
}
export type StrapiMeta = {
pagination: {
page: number
pageCount: number
pageSize: number
total: number
}
}
export type ImageWithDimensions = {
url: string
width: number
height: number
}
export type ImageFormats = "thumbnail" | "small" | "medium" | "large"
/**
* Image file formats as returned by the Strapi API.
*/
export type ImageFormat = {
name: string
hash: string
ext: string
mime: string
path: string | null
width: number
height: number
size: number
url: string
}
export type MediaAttributes = {
name: string
alternativeText: string | null
caption: string | null
width: number
height: number
formats?: {
thumbnail?: ImageFormat
small?: ImageFormat
medium?: ImageFormat
large?: ImageFormat
}
hash: string
ext: string
mime: string
size: number
url: string
previewUrl: string | null
provider: string
provider_metadata?: string
createdAt: string
updatedAt?: string
}
export type Image = StrapiBaseProps &
MediaAttributes & {
id: StrapiID
}
export type User = StrapiBaseProps & {
username: string
email: string
confirmed: boolean
blocked: boolean
provider: string
role?: number
password?: string
}
export type Headers = {
Authorization?: string
"Content-Type"?: "application/json" | "text/plain"
body?: string
}