@datocms/cma-client 5.1.16 → 5.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,310 @@
1
+ // String matching filter for text-based filters
2
+ export type StringMatchesFilter = {
3
+ /** Pattern to match against */
4
+ pattern: string;
5
+ /** Whether the match should be case sensitive */
6
+ case_sensitive?: boolean;
7
+ /** Whether to treat the pattern as a regular expression */
8
+ regexp?: boolean;
9
+ };
10
+
11
+ // Near filter for latitude/longitude fields
12
+ export type LatLonNearFilter = {
13
+ /** Latitude coordinate */
14
+ latitude: number;
15
+ /** Longitude coordinate */
16
+ longitude: number;
17
+ /** Radius in meters */
18
+ radius: number;
19
+ };
20
+
21
+ // HrefFilter types for all field types
22
+ export type BooleanHrefFilter = {
23
+ /** Search for records with an exact match */
24
+ eq?: boolean;
25
+ };
26
+
27
+ export type IntegerHrefFilter = {
28
+ /** Filter records with a value that's strictly greater than the one specified */
29
+ gt?: number;
30
+ /** Filter records with a value that's less than the one specified */
31
+ lt?: number;
32
+ /** Filter records with a value that's greater than or equal to the one specified */
33
+ gte?: number;
34
+ /** Filter records with a value that's less or equal than the one specified */
35
+ lte?: number;
36
+ /** Filter records with the specified field defined (i.e. with any value) or not */
37
+ exists?: boolean;
38
+ /** Search for records with an exact match */
39
+ eq?: number;
40
+ /** Exclude records with an exact match */
41
+ neq?: number;
42
+ };
43
+
44
+ export type FloatHrefFilter = {
45
+ /** Filter records with a value that's strictly greater than the one specified */
46
+ gt?: number;
47
+ /** Filter records with a value that's less than the one specified */
48
+ lt?: number;
49
+ /** Filter records with a value that's greater than or equal to the one specified */
50
+ gte?: number;
51
+ /** Filter records with a value that's less or equal than the one specified */
52
+ lte?: number;
53
+ /** Filter records with the specified field defined (i.e. with any value) or not */
54
+ exists?: boolean;
55
+ /** Search for records with an exact match */
56
+ eq?: number;
57
+ /** Exclude records with an exact match */
58
+ neq?: number;
59
+ };
60
+
61
+ export type DateHrefFilter = {
62
+ /** Filter records with a value that's strictly greater than the one specified */
63
+ gt?: string;
64
+ /** Filter records with a value that's less than the one specified */
65
+ lt?: string;
66
+ /** Filter records with a value that's greater than or equal to the one specified */
67
+ gte?: string;
68
+ /** Filter records with a value that's less or equal than the one specified */
69
+ lte?: string;
70
+ /** Filter records with the specified field defined (i.e. with any value) or not */
71
+ exists?: boolean;
72
+ /** Search for records with an exact match */
73
+ eq?: string;
74
+ /** Exclude records with an exact match */
75
+ neq?: string;
76
+ };
77
+
78
+ export type ColorHrefFilter = {
79
+ /** Filter records with the specified field defined (i.e. with any value) or not */
80
+ exists?: boolean;
81
+ };
82
+
83
+ export type StringHrefFilter = {
84
+ /** Filter records based on a regular expression */
85
+ matches?: StringMatchesFilter;
86
+ /** Exclude records based on a regular expression */
87
+ not_matches?: StringMatchesFilter;
88
+ /** Filter records with the specified field set as blank (null or empty string) */
89
+ is_blank?: boolean;
90
+ /** Filter records with the specified field present (neither null, nor empty string) */
91
+ is_present?: boolean;
92
+ /** Search for records with an exact match */
93
+ eq?: string;
94
+ /** Exclude records with an exact match */
95
+ neq?: string;
96
+ /** Filter records that equal one of the specified values */
97
+ in?: string[];
98
+ /** Filter records that do not equal one of the specified values */
99
+ not_in?: string[];
100
+ /** @deprecated Use is_present instead. Filter records with the specified field defined (i.e. with any value) or not */
101
+ exists?: boolean;
102
+ };
103
+
104
+ export type DateTimeHrefFilter = {
105
+ /** Filter records with a value that's strictly greater than the one specified. Seconds and milliseconds are truncated from the argument. */
106
+ gt?: string;
107
+ /** Filter records with a value that's less than the one specified. Seconds and milliseconds are truncated from the argument. */
108
+ lt?: string;
109
+ /** Filter records with a value that's greater than or equal to than the one specified. Seconds and milliseconds are truncated from the argument. */
110
+ gte?: string;
111
+ /** Filter records with a value that's less or equal than the one specified. Seconds and milliseconds are truncated from the argument. */
112
+ lte?: string;
113
+ /** Filter records with a value that's within the specified minute range. Seconds and milliseconds are truncated from the argument. */
114
+ eq?: string;
115
+ /** Filter records with a value that's outside the specified minute range. Seconds and milliseconds are truncated from the argument. */
116
+ neq?: string;
117
+ /** Filter records with the specified field defined (i.e. with any value) or not */
118
+ exists?: boolean;
119
+ };
120
+
121
+ export type JsonHrefFilter = {
122
+ /** Filter records with the specified field defined (i.e. with any value) or not */
123
+ exists?: boolean;
124
+ };
125
+
126
+ export type LatLonHrefFilter = {
127
+ /** Filter records within the specified radius in meters */
128
+ near?: LatLonNearFilter;
129
+ /** Filter records with the specified field defined (i.e. with any value) or not */
130
+ exists?: boolean;
131
+ };
132
+
133
+ export type SlugHrefFilter = {
134
+ /** Search for records with an exact match */
135
+ eq?: string;
136
+ /** Exclude records with an exact match */
137
+ neq?: string;
138
+ /** Filter records that have one of the specified slugs */
139
+ in?: string[];
140
+ /** Filter records that do not have one of the specified slugs */
141
+ not_in?: string[];
142
+ };
143
+
144
+ export type VideoHrefFilter = {
145
+ /** Filter records with the specified field defined (i.e. with any value) or not */
146
+ exists?: boolean;
147
+ };
148
+
149
+ export type SeoHrefFilter = {
150
+ /** Filter records with the specified field defined (i.e. with any value) or not */
151
+ exists?: boolean;
152
+ };
153
+
154
+ export type FileHrefFilter = {
155
+ /** Search for records with an exact match. The specified value must be an Upload ID */
156
+ eq?: string;
157
+ /** Exclude records with an exact match. The specified value must be an Upload ID */
158
+ neq?: string;
159
+ /** Filter records that have one of the specified uploads */
160
+ in?: string[];
161
+ /** Filter records that do not have one of the specified uploads */
162
+ not_in?: string[];
163
+ /** Filter records with the specified field defined (i.e. with any value) or not */
164
+ exists?: boolean;
165
+ };
166
+
167
+ export type GalleryHrefFilter = {
168
+ /** Search for records with an exact match. The specified values must be Upload IDs */
169
+ eq?: string[];
170
+ /** Filter records that have all of the specified uploads. The specified values must be Upload IDs */
171
+ all_in?: string[];
172
+ /** Filter records that have one of the specified uploads. The specified values must be Upload IDs */
173
+ any_in?: string[];
174
+ /** Filter records that do not have any of the specified uploads. The specified values must be Upload IDs */
175
+ not_in?: string[];
176
+ /** Filter records with the specified field defined (i.e. with any value) or not */
177
+ exists?: boolean;
178
+ };
179
+
180
+ export type LinkHrefFilter = {
181
+ /** Search for records with an exact match. The specified value must be a Record ID */
182
+ eq?: string;
183
+ /** Exclude records with an exact match. The specified value must be a Record ID */
184
+ neq?: string;
185
+ /** Filter records linked to one of the specified records */
186
+ in?: string[];
187
+ /** Filter records not linked to one of the specified records */
188
+ not_in?: string[];
189
+ /** Filter records with the specified field defined (i.e. with any value) or not */
190
+ exists?: boolean;
191
+ };
192
+
193
+ export type LinksHrefFilter = {
194
+ /** Search for records with an exact match. The specified values must be Record IDs */
195
+ eq?: string[];
196
+ /** Filter records linked to all of the specified records. The specified values must be Record IDs */
197
+ all_in?: string[];
198
+ /** Filter records linked to at least one of the specified records. The specified values must be Record IDs */
199
+ any_in?: string[];
200
+ /** Filter records not linked to any of the specified records. The specified values must be Record IDs */
201
+ not_in?: string[];
202
+ /** Filter records with the specified field defined (i.e. with any value) or not */
203
+ exists?: boolean;
204
+ };
205
+
206
+ export type RichTextHrefFilter = Record<string, never>;
207
+
208
+ export type StructuredTextHrefFilter = {
209
+ /** Filter records based on a regular expression */
210
+ matches?: StringMatchesFilter;
211
+ /** Exclude records based on a regular expression */
212
+ not_matches?: StringMatchesFilter;
213
+ };
214
+
215
+ export type SingleBlockHrefFilter = Record<string, never>;
216
+
217
+ export type TextHrefFilter = {
218
+ /** Filter records based on a regular expression */
219
+ matches?: StringMatchesFilter;
220
+ /** Exclude records based on a regular expression */
221
+ not_matches?: StringMatchesFilter;
222
+ /** Filter records with the specified field set as blank (null or empty string) */
223
+ is_blank?: boolean;
224
+ /** Filter records with the specified field present (neither null, nor empty string) */
225
+ is_present?: boolean;
226
+ /** @deprecated Use is_present instead. Filter records with the specified field defined (i.e. with any value) or not */
227
+ exists?: boolean;
228
+ };
229
+
230
+ // Status filter for item status
231
+ export type StatusFilter = {
232
+ /** Search the record with the specified status */
233
+ eq?: 'draft' | 'updated' | 'published';
234
+ /** Exclude the record with the specified status */
235
+ neq?: 'draft' | 'updated' | 'published';
236
+ /** Search records with the specified statuses */
237
+ in?: ('draft' | 'updated' | 'published')[];
238
+ /** Search records without the specified statuses */
239
+ notIn?: ('draft' | 'updated' | 'published')[];
240
+ };
241
+
242
+ // ID filter for item IDs
243
+ export type ItemIdFilter = {
244
+ /** Search the record with the specified ID */
245
+ eq?: string;
246
+ /** Exclude the record with the specified ID */
247
+ neq?: string;
248
+ /** Search records with the specified IDs */
249
+ in?: string[];
250
+ /** Search records that do not have the specified IDs */
251
+ notIn?: string[];
252
+ };
253
+
254
+ // Parent filter for tree-like collections
255
+ export type ParentIdFilter = {
256
+ /** Filter records children of the specified record. Value must be a Record ID */
257
+ eq?: string;
258
+ /** Filter records with a parent record or not */
259
+ exists?: boolean;
260
+ };
261
+
262
+ // Position filter for sorted and tree-like collections
263
+ export type PositionFilter = {
264
+ /** Filter records with a value that's strictly greater than the one specified */
265
+ gt?: number;
266
+ /** Filter records with a value that's less than the one specified */
267
+ lt?: number;
268
+ /** Filter records with a value that's greater than or equal to the one specified */
269
+ gte?: number;
270
+ /** Filter records with a value that's less or equal than the one specified */
271
+ lte?: number;
272
+ /** Search for records with an exact match */
273
+ eq?: number;
274
+ /** Exclude records with an exact match */
275
+ neq?: number;
276
+ };
277
+
278
+ export type ItemMetaFilter = {
279
+ _created_at?: DateTimeHrefFilter;
280
+ _first_published_at?: DateTimeHrefFilter;
281
+ _is_valid?: BooleanHrefFilter;
282
+ _publication_scheduled_at?: DateTimeHrefFilter;
283
+ _published_at?: DateTimeHrefFilter;
284
+ _status?: StatusFilter;
285
+ _unpublishing_scheduled_at?: DateTimeHrefFilter;
286
+ _updated_at?: DateTimeHrefFilter;
287
+ id?: ItemIdFilter;
288
+ };
289
+
290
+ export type ItemMetaOrderBy =
291
+ | '_created_at_ASC'
292
+ | '_created_at_DESC'
293
+ | 'id_ASC'
294
+ | 'id_DESC'
295
+ | '_first_published_at_ASC'
296
+ | '_first_published_at_DESC'
297
+ | '_publication_scheduled_at_ASC'
298
+ | '_publication_scheduled_at_DESC'
299
+ | '_unpublishing_scheduled_at_ASC'
300
+ | '_unpublishing_scheduled_at_DESC'
301
+ | '_published_at_ASC'
302
+ | '_published_at_DESC'
303
+ | '_status_ASC'
304
+ | '_status_DESC'
305
+ | '_updated_at_ASC'
306
+ | '_updated_at_DESC'
307
+ | '_is_valid_ASC'
308
+ | '_is_valid_DESC'
309
+ | '_rank_ASC'
310
+ | '_rank_DESC';