@lokalise/connector-api-contracts 3.2.0 → 4.0.1
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.
|
@@ -1,139 +1,651 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const MANIFEST_FILTER_OPTION_SCHEMA: z.ZodObject<{
|
|
3
3
|
id: z.ZodString;
|
|
4
|
-
|
|
4
|
+
name: z.ZodString;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
|
-
export type
|
|
6
|
+
export type ManifestFilterOption = z.infer<typeof MANIFEST_FILTER_OPTION_SCHEMA>;
|
|
7
|
+
export declare const SEARCH_FILTER_SCHEMA: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
query: z.ZodString;
|
|
10
|
+
type: z.ZodLiteral<"search">;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const MULTISELECT_FILTER_SCHEMA: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
query: z.ZodString;
|
|
15
|
+
type: z.ZodLiteral<"multiselect">;
|
|
16
|
+
options: z.ZodArray<z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const SELECT_FILTER_SCHEMA: z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
query: z.ZodString;
|
|
25
|
+
type: z.ZodLiteral<"select">;
|
|
26
|
+
options: z.ZodArray<z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export declare const ASYNC_SELECT_FILTER_SCHEMA: z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
query: z.ZodString;
|
|
35
|
+
type: z.ZodLiteral<"async-select">;
|
|
36
|
+
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
37
|
+
dependsOn: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export declare const ASYNC_MULTISELECT_FILTER_SCHEMA: z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
query: z.ZodString;
|
|
42
|
+
type: z.ZodLiteral<"async-multiselect">;
|
|
43
|
+
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
44
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
+
dependsOn: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export declare const DATERANGE_FILTER_SCHEMA: z.ZodObject<{
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
query: z.ZodString;
|
|
50
|
+
type: z.ZodLiteral<"daterange">;
|
|
51
|
+
defaultValue: z.ZodOptional<z.ZodObject<{
|
|
52
|
+
from: z.ZodString;
|
|
53
|
+
to: z.ZodString;
|
|
54
|
+
}, z.core.$strip>>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export declare const MANIFEST_FILTER_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
query: z.ZodString;
|
|
59
|
+
type: z.ZodLiteral<"search">;
|
|
60
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
61
|
+
id: z.ZodString;
|
|
62
|
+
query: z.ZodString;
|
|
63
|
+
type: z.ZodLiteral<"multiselect">;
|
|
64
|
+
options: z.ZodArray<z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
69
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
query: z.ZodString;
|
|
72
|
+
type: z.ZodLiteral<"async-multiselect">;
|
|
73
|
+
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
74
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
|
+
dependsOn: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
77
|
+
id: z.ZodString;
|
|
78
|
+
query: z.ZodString;
|
|
79
|
+
type: z.ZodLiteral<"select">;
|
|
80
|
+
options: z.ZodArray<z.ZodObject<{
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
+
id: z.ZodString;
|
|
87
|
+
query: z.ZodString;
|
|
88
|
+
type: z.ZodLiteral<"async-select">;
|
|
89
|
+
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
90
|
+
dependsOn: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
92
|
+
id: z.ZodString;
|
|
93
|
+
query: z.ZodString;
|
|
94
|
+
type: z.ZodLiteral<"daterange">;
|
|
95
|
+
defaultValue: z.ZodOptional<z.ZodObject<{
|
|
96
|
+
from: z.ZodString;
|
|
97
|
+
to: z.ZodString;
|
|
98
|
+
}, z.core.$strip>>;
|
|
99
|
+
}, z.core.$strip>], "type">;
|
|
100
|
+
export type SearchFilter = z.infer<typeof SEARCH_FILTER_SCHEMA>;
|
|
101
|
+
export type MultiselectFilter = z.infer<typeof MULTISELECT_FILTER_SCHEMA>;
|
|
102
|
+
export type SelectFilter = z.infer<typeof SELECT_FILTER_SCHEMA>;
|
|
103
|
+
export type AsyncMultiselectFilter = z.infer<typeof ASYNC_MULTISELECT_FILTER_SCHEMA>;
|
|
104
|
+
export type DaterangeFilter = z.infer<typeof DATERANGE_FILTER_SCHEMA>;
|
|
105
|
+
export declare const FILTER_SCHEMA: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
106
|
+
id: z.ZodString;
|
|
107
|
+
query: z.ZodString;
|
|
108
|
+
type: z.ZodLiteral<"search">;
|
|
109
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
110
|
+
id: z.ZodString;
|
|
111
|
+
query: z.ZodString;
|
|
112
|
+
type: z.ZodLiteral<"multiselect">;
|
|
113
|
+
options: z.ZodArray<z.ZodObject<{
|
|
114
|
+
id: z.ZodString;
|
|
115
|
+
name: z.ZodString;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
118
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
119
|
+
id: z.ZodString;
|
|
120
|
+
query: z.ZodString;
|
|
121
|
+
type: z.ZodLiteral<"async-multiselect">;
|
|
122
|
+
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
123
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
124
|
+
dependsOn: z.ZodOptional<z.ZodString>;
|
|
125
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
126
|
+
id: z.ZodString;
|
|
127
|
+
query: z.ZodString;
|
|
128
|
+
type: z.ZodLiteral<"select">;
|
|
129
|
+
options: z.ZodArray<z.ZodObject<{
|
|
130
|
+
id: z.ZodString;
|
|
131
|
+
name: z.ZodString;
|
|
132
|
+
}, z.core.$strip>>;
|
|
133
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
135
|
+
id: z.ZodString;
|
|
136
|
+
query: z.ZodString;
|
|
137
|
+
type: z.ZodLiteral<"async-select">;
|
|
138
|
+
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
139
|
+
dependsOn: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
141
|
+
id: z.ZodString;
|
|
142
|
+
query: z.ZodString;
|
|
143
|
+
type: z.ZodLiteral<"daterange">;
|
|
144
|
+
defaultValue: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
from: z.ZodString;
|
|
146
|
+
to: z.ZodString;
|
|
147
|
+
}, z.core.$strip>>;
|
|
148
|
+
}, z.core.$strip>], "type">>;
|
|
149
|
+
export type Filter = z.infer<typeof MANIFEST_FILTER_SCHEMA>;
|
|
150
|
+
export declare const SELECT_ENTRY: z.ZodObject<{
|
|
151
|
+
value: z.ZodString;
|
|
152
|
+
label: z.ZodString;
|
|
153
|
+
}, z.core.$strip>;
|
|
154
|
+
export type SelectEntry = z.infer<typeof SELECT_ENTRY>;
|
|
155
|
+
export declare const BASE_AUTH_FIELD: z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
name: z.ZodString;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
export declare const URL_AUTH_FIELD: z.ZodObject<{
|
|
160
|
+
id: z.ZodString;
|
|
161
|
+
name: z.ZodString;
|
|
162
|
+
type: z.ZodLiteral<"url">;
|
|
163
|
+
}, z.core.$strip>;
|
|
164
|
+
export type UrlAuthField = z.infer<typeof URL_AUTH_FIELD>;
|
|
165
|
+
export declare const PASSWORD_AUTH_FIELD: z.ZodObject<{
|
|
166
|
+
id: z.ZodString;
|
|
167
|
+
name: z.ZodString;
|
|
168
|
+
type: z.ZodLiteral<"password">;
|
|
169
|
+
}, z.core.$strip>;
|
|
170
|
+
export type PasswordAuthField = z.infer<typeof PASSWORD_AUTH_FIELD>;
|
|
171
|
+
export declare const SELECT_AUTH_FIELD: z.ZodObject<{
|
|
172
|
+
id: z.ZodString;
|
|
173
|
+
name: z.ZodString;
|
|
174
|
+
type: z.ZodLiteral<"select">;
|
|
175
|
+
options: z.ZodArray<z.ZodObject<{
|
|
176
|
+
value: z.ZodString;
|
|
177
|
+
label: z.ZodString;
|
|
178
|
+
}, z.core.$strip>>;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
export type SelectAuthField = z.infer<typeof SELECT_AUTH_FIELD>;
|
|
181
|
+
export declare const AUTH_FIELD: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
182
|
+
id: z.ZodString;
|
|
183
|
+
name: z.ZodString;
|
|
184
|
+
type: z.ZodLiteral<"password">;
|
|
185
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
186
|
+
id: z.ZodString;
|
|
187
|
+
name: z.ZodString;
|
|
188
|
+
type: z.ZodLiteral<"select">;
|
|
189
|
+
options: z.ZodArray<z.ZodObject<{
|
|
190
|
+
value: z.ZodString;
|
|
191
|
+
label: z.ZodString;
|
|
192
|
+
}, z.core.$strip>>;
|
|
193
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
194
|
+
id: z.ZodString;
|
|
195
|
+
name: z.ZodString;
|
|
196
|
+
type: z.ZodLiteral<"url">;
|
|
197
|
+
}, z.core.$strip>], "type">;
|
|
198
|
+
export type AuthField = z.infer<typeof AUTH_FIELD>;
|
|
7
199
|
export declare const OAUTH_AUTHENTICATION_SCHEMA: z.ZodObject<{
|
|
8
200
|
type: z.ZodLiteral<"oauth">;
|
|
9
201
|
}, z.core.$strip>;
|
|
10
202
|
export declare const CREDENTIALS_AUTHENTICATION_SCHEMA: z.ZodObject<{
|
|
11
203
|
type: z.ZodLiteral<"credentials">;
|
|
12
|
-
fields: z.ZodArray<z.ZodObject<{
|
|
204
|
+
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
205
|
id: z.ZodString;
|
|
14
|
-
|
|
15
|
-
|
|
206
|
+
name: z.ZodString;
|
|
207
|
+
type: z.ZodLiteral<"password">;
|
|
208
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
name: z.ZodString;
|
|
211
|
+
type: z.ZodLiteral<"select">;
|
|
212
|
+
options: z.ZodArray<z.ZodObject<{
|
|
213
|
+
value: z.ZodString;
|
|
214
|
+
label: z.ZodString;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
217
|
+
id: z.ZodString;
|
|
218
|
+
name: z.ZodString;
|
|
219
|
+
type: z.ZodLiteral<"url">;
|
|
220
|
+
}, z.core.$strip>], "type">>;
|
|
16
221
|
}, z.core.$strip>;
|
|
17
222
|
export declare const AUTHENTICATION_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
18
223
|
type: z.ZodLiteral<"oauth">;
|
|
19
224
|
}, z.core.$strip>, z.ZodObject<{
|
|
20
225
|
type: z.ZodLiteral<"credentials">;
|
|
21
|
-
fields: z.ZodArray<z.ZodObject<{
|
|
226
|
+
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
22
227
|
id: z.ZodString;
|
|
23
|
-
|
|
24
|
-
|
|
228
|
+
name: z.ZodString;
|
|
229
|
+
type: z.ZodLiteral<"password">;
|
|
230
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
231
|
+
id: z.ZodString;
|
|
232
|
+
name: z.ZodString;
|
|
233
|
+
type: z.ZodLiteral<"select">;
|
|
234
|
+
options: z.ZodArray<z.ZodObject<{
|
|
235
|
+
value: z.ZodString;
|
|
236
|
+
label: z.ZodString;
|
|
237
|
+
}, z.core.$strip>>;
|
|
238
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
239
|
+
id: z.ZodString;
|
|
240
|
+
name: z.ZodString;
|
|
241
|
+
type: z.ZodLiteral<"url">;
|
|
242
|
+
}, z.core.$strip>], "type">>;
|
|
25
243
|
}, z.core.$strip>], "type">;
|
|
26
244
|
export type Authentication = z.infer<typeof AUTHENTICATION_SCHEMA>;
|
|
27
|
-
export declare const FILTER_SCHEMA: z.ZodObject<{
|
|
28
|
-
id: z.ZodString;
|
|
29
|
-
type: z.ZodString;
|
|
30
|
-
query: z.ZodString;
|
|
31
|
-
defaultValue: z.ZodOptional<z.ZodAny>;
|
|
32
|
-
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
33
|
-
dependsOn: z.ZodOptional<z.ZodString>;
|
|
34
|
-
}, z.core.$strip>;
|
|
35
|
-
export type Filter = z.infer<typeof FILTER_SCHEMA>;
|
|
36
245
|
export declare const CAPABILITY_SCHEMA: z.ZodObject<{
|
|
37
246
|
version: z.ZodNumber;
|
|
38
247
|
data: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
39
248
|
}, z.core.$strip>;
|
|
40
249
|
export type Capability = z.infer<typeof CAPABILITY_SCHEMA>;
|
|
250
|
+
export declare const BASE_MANIFEST_COLUMN: z.ZodObject<{
|
|
251
|
+
id: z.ZodString;
|
|
252
|
+
}, z.core.$strip>;
|
|
253
|
+
export declare const PRIMARY_COLUMN: z.ZodObject<{
|
|
254
|
+
id: z.ZodString;
|
|
255
|
+
type: z.ZodLiteral<"primary">;
|
|
256
|
+
paths: z.ZodObject<{
|
|
257
|
+
title: z.ZodString;
|
|
258
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
259
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
260
|
+
}, z.core.$strip>;
|
|
261
|
+
}, z.core.$strip>;
|
|
262
|
+
export type PrimaryColumn = z.infer<typeof PRIMARY_COLUMN>;
|
|
263
|
+
export declare const TEXT_COLUMN: z.ZodObject<{
|
|
264
|
+
id: z.ZodString;
|
|
265
|
+
type: z.ZodLiteral<"text">;
|
|
266
|
+
paths: z.ZodObject<{
|
|
267
|
+
text: z.ZodString;
|
|
268
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
269
|
+
}, z.core.$strip>;
|
|
270
|
+
}, z.core.$strip>;
|
|
271
|
+
export type TextColumn = z.infer<typeof TEXT_COLUMN>;
|
|
272
|
+
export declare const MANIFEST_COLUMN: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
273
|
+
id: z.ZodString;
|
|
274
|
+
type: z.ZodLiteral<"primary">;
|
|
275
|
+
paths: z.ZodObject<{
|
|
276
|
+
title: z.ZodString;
|
|
277
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
278
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
279
|
+
}, z.core.$strip>;
|
|
280
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
281
|
+
id: z.ZodString;
|
|
282
|
+
type: z.ZodLiteral<"text">;
|
|
283
|
+
paths: z.ZodObject<{
|
|
284
|
+
text: z.ZodString;
|
|
285
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
286
|
+
}, z.core.$strip>;
|
|
287
|
+
}, z.core.$strip>], "type">;
|
|
288
|
+
export type ManifestColumn = z.infer<typeof MANIFEST_COLUMN>;
|
|
41
289
|
export declare const MANIFEST_SCHEMA: z.ZodObject<{
|
|
290
|
+
name: z.ZodString;
|
|
42
291
|
authentication: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
43
292
|
type: z.ZodLiteral<"oauth">;
|
|
44
293
|
}, z.core.$strip>, z.ZodObject<{
|
|
45
294
|
type: z.ZodLiteral<"credentials">;
|
|
46
|
-
fields: z.ZodArray<z.ZodObject<{
|
|
295
|
+
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
47
296
|
id: z.ZodString;
|
|
48
|
-
|
|
49
|
-
|
|
297
|
+
name: z.ZodString;
|
|
298
|
+
type: z.ZodLiteral<"password">;
|
|
299
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
300
|
+
id: z.ZodString;
|
|
301
|
+
name: z.ZodString;
|
|
302
|
+
type: z.ZodLiteral<"select">;
|
|
303
|
+
options: z.ZodArray<z.ZodObject<{
|
|
304
|
+
value: z.ZodString;
|
|
305
|
+
label: z.ZodString;
|
|
306
|
+
}, z.core.$strip>>;
|
|
307
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
308
|
+
id: z.ZodString;
|
|
309
|
+
name: z.ZodString;
|
|
310
|
+
type: z.ZodLiteral<"url">;
|
|
311
|
+
}, z.core.$strip>], "type">>;
|
|
50
312
|
}, z.core.$strip>], "type">;
|
|
51
|
-
filters: z.ZodArray<z.ZodObject<{
|
|
313
|
+
filters: z.ZodArray<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
314
|
+
id: z.ZodString;
|
|
315
|
+
query: z.ZodString;
|
|
316
|
+
type: z.ZodLiteral<"search">;
|
|
317
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
318
|
+
id: z.ZodString;
|
|
319
|
+
query: z.ZodString;
|
|
320
|
+
type: z.ZodLiteral<"multiselect">;
|
|
321
|
+
options: z.ZodArray<z.ZodObject<{
|
|
322
|
+
id: z.ZodString;
|
|
323
|
+
name: z.ZodString;
|
|
324
|
+
}, z.core.$strip>>;
|
|
325
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
326
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
52
327
|
id: z.ZodString;
|
|
53
|
-
type: z.ZodString;
|
|
54
328
|
query: z.ZodString;
|
|
55
|
-
|
|
329
|
+
type: z.ZodLiteral<"async-multiselect">;
|
|
56
330
|
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
331
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
57
332
|
dependsOn: z.ZodOptional<z.ZodString>;
|
|
58
|
-
}, z.core.$strip
|
|
333
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
334
|
+
id: z.ZodString;
|
|
335
|
+
query: z.ZodString;
|
|
336
|
+
type: z.ZodLiteral<"select">;
|
|
337
|
+
options: z.ZodArray<z.ZodObject<{
|
|
338
|
+
id: z.ZodString;
|
|
339
|
+
name: z.ZodString;
|
|
340
|
+
}, z.core.$strip>>;
|
|
341
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
342
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
343
|
+
id: z.ZodString;
|
|
344
|
+
query: z.ZodString;
|
|
345
|
+
type: z.ZodLiteral<"async-select">;
|
|
346
|
+
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
347
|
+
dependsOn: z.ZodOptional<z.ZodString>;
|
|
348
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
349
|
+
id: z.ZodString;
|
|
350
|
+
query: z.ZodString;
|
|
351
|
+
type: z.ZodLiteral<"daterange">;
|
|
352
|
+
defaultValue: z.ZodOptional<z.ZodObject<{
|
|
353
|
+
from: z.ZodString;
|
|
354
|
+
to: z.ZodString;
|
|
355
|
+
}, z.core.$strip>>;
|
|
356
|
+
}, z.core.$strip>], "type">>>;
|
|
59
357
|
capabilities: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
60
358
|
version: z.ZodNumber;
|
|
61
359
|
data: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
62
360
|
}, z.core.$strip>>;
|
|
361
|
+
columns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
362
|
+
id: z.ZodString;
|
|
363
|
+
type: z.ZodLiteral<"primary">;
|
|
364
|
+
paths: z.ZodObject<{
|
|
365
|
+
title: z.ZodString;
|
|
366
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
367
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
368
|
+
}, z.core.$strip>;
|
|
369
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
370
|
+
id: z.ZodString;
|
|
371
|
+
type: z.ZodLiteral<"text">;
|
|
372
|
+
paths: z.ZodObject<{
|
|
373
|
+
text: z.ZodString;
|
|
374
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
375
|
+
}, z.core.$strip>;
|
|
376
|
+
}, z.core.$strip>], "type">>;
|
|
63
377
|
}, z.core.$strip>;
|
|
64
378
|
export type Manifest = z.infer<typeof MANIFEST_SCHEMA>;
|
|
65
379
|
export declare const MANIFESTS_BY_MODE_SCHEMA: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
380
|
+
name: z.ZodString;
|
|
66
381
|
authentication: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
67
382
|
type: z.ZodLiteral<"oauth">;
|
|
68
383
|
}, z.core.$strip>, z.ZodObject<{
|
|
69
384
|
type: z.ZodLiteral<"credentials">;
|
|
70
|
-
fields: z.ZodArray<z.ZodObject<{
|
|
385
|
+
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
71
386
|
id: z.ZodString;
|
|
72
|
-
|
|
73
|
-
|
|
387
|
+
name: z.ZodString;
|
|
388
|
+
type: z.ZodLiteral<"password">;
|
|
389
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
390
|
+
id: z.ZodString;
|
|
391
|
+
name: z.ZodString;
|
|
392
|
+
type: z.ZodLiteral<"select">;
|
|
393
|
+
options: z.ZodArray<z.ZodObject<{
|
|
394
|
+
value: z.ZodString;
|
|
395
|
+
label: z.ZodString;
|
|
396
|
+
}, z.core.$strip>>;
|
|
397
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
398
|
+
id: z.ZodString;
|
|
399
|
+
name: z.ZodString;
|
|
400
|
+
type: z.ZodLiteral<"url">;
|
|
401
|
+
}, z.core.$strip>], "type">>;
|
|
74
402
|
}, z.core.$strip>], "type">;
|
|
75
|
-
filters: z.ZodArray<z.ZodObject<{
|
|
403
|
+
filters: z.ZodArray<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
404
|
+
id: z.ZodString;
|
|
405
|
+
query: z.ZodString;
|
|
406
|
+
type: z.ZodLiteral<"search">;
|
|
407
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
408
|
+
id: z.ZodString;
|
|
409
|
+
query: z.ZodString;
|
|
410
|
+
type: z.ZodLiteral<"multiselect">;
|
|
411
|
+
options: z.ZodArray<z.ZodObject<{
|
|
412
|
+
id: z.ZodString;
|
|
413
|
+
name: z.ZodString;
|
|
414
|
+
}, z.core.$strip>>;
|
|
415
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
416
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
76
417
|
id: z.ZodString;
|
|
77
|
-
type: z.ZodString;
|
|
78
418
|
query: z.ZodString;
|
|
79
|
-
|
|
419
|
+
type: z.ZodLiteral<"async-multiselect">;
|
|
80
420
|
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
421
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
81
422
|
dependsOn: z.ZodOptional<z.ZodString>;
|
|
82
|
-
}, z.core.$strip
|
|
423
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
424
|
+
id: z.ZodString;
|
|
425
|
+
query: z.ZodString;
|
|
426
|
+
type: z.ZodLiteral<"select">;
|
|
427
|
+
options: z.ZodArray<z.ZodObject<{
|
|
428
|
+
id: z.ZodString;
|
|
429
|
+
name: z.ZodString;
|
|
430
|
+
}, z.core.$strip>>;
|
|
431
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
432
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
433
|
+
id: z.ZodString;
|
|
434
|
+
query: z.ZodString;
|
|
435
|
+
type: z.ZodLiteral<"async-select">;
|
|
436
|
+
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
437
|
+
dependsOn: z.ZodOptional<z.ZodString>;
|
|
438
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
439
|
+
id: z.ZodString;
|
|
440
|
+
query: z.ZodString;
|
|
441
|
+
type: z.ZodLiteral<"daterange">;
|
|
442
|
+
defaultValue: z.ZodOptional<z.ZodObject<{
|
|
443
|
+
from: z.ZodString;
|
|
444
|
+
to: z.ZodString;
|
|
445
|
+
}, z.core.$strip>>;
|
|
446
|
+
}, z.core.$strip>], "type">>>;
|
|
83
447
|
capabilities: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
84
448
|
version: z.ZodNumber;
|
|
85
449
|
data: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
86
450
|
}, z.core.$strip>>;
|
|
451
|
+
columns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
452
|
+
id: z.ZodString;
|
|
453
|
+
type: z.ZodLiteral<"primary">;
|
|
454
|
+
paths: z.ZodObject<{
|
|
455
|
+
title: z.ZodString;
|
|
456
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
457
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
458
|
+
}, z.core.$strip>;
|
|
459
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
460
|
+
id: z.ZodString;
|
|
461
|
+
type: z.ZodLiteral<"text">;
|
|
462
|
+
paths: z.ZodObject<{
|
|
463
|
+
text: z.ZodString;
|
|
464
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
465
|
+
}, z.core.$strip>;
|
|
466
|
+
}, z.core.$strip>], "type">>;
|
|
87
467
|
}, z.core.$strip>>;
|
|
88
468
|
export type ManifestsByMode = z.infer<typeof MANIFESTS_BY_MODE_SCHEMA>;
|
|
89
469
|
export declare const getManifestContract: import("@lokalise/api-contracts").GetRouteDefinition<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
470
|
+
name: z.ZodString;
|
|
90
471
|
authentication: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
91
472
|
type: z.ZodLiteral<"oauth">;
|
|
92
473
|
}, z.core.$strip>, z.ZodObject<{
|
|
93
474
|
type: z.ZodLiteral<"credentials">;
|
|
94
|
-
fields: z.ZodArray<z.ZodObject<{
|
|
475
|
+
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
95
476
|
id: z.ZodString;
|
|
96
|
-
|
|
97
|
-
|
|
477
|
+
name: z.ZodString;
|
|
478
|
+
type: z.ZodLiteral<"password">;
|
|
479
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
480
|
+
id: z.ZodString;
|
|
481
|
+
name: z.ZodString;
|
|
482
|
+
type: z.ZodLiteral<"select">;
|
|
483
|
+
options: z.ZodArray<z.ZodObject<{
|
|
484
|
+
value: z.ZodString;
|
|
485
|
+
label: z.ZodString;
|
|
486
|
+
}, z.core.$strip>>;
|
|
487
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
488
|
+
id: z.ZodString;
|
|
489
|
+
name: z.ZodString;
|
|
490
|
+
type: z.ZodLiteral<"url">;
|
|
491
|
+
}, z.core.$strip>], "type">>;
|
|
98
492
|
}, z.core.$strip>], "type">;
|
|
99
|
-
filters: z.ZodArray<z.ZodObject<{
|
|
493
|
+
filters: z.ZodArray<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
494
|
+
id: z.ZodString;
|
|
495
|
+
query: z.ZodString;
|
|
496
|
+
type: z.ZodLiteral<"search">;
|
|
497
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
498
|
+
id: z.ZodString;
|
|
499
|
+
query: z.ZodString;
|
|
500
|
+
type: z.ZodLiteral<"multiselect">;
|
|
501
|
+
options: z.ZodArray<z.ZodObject<{
|
|
502
|
+
id: z.ZodString;
|
|
503
|
+
name: z.ZodString;
|
|
504
|
+
}, z.core.$strip>>;
|
|
505
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
506
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
100
507
|
id: z.ZodString;
|
|
101
|
-
type: z.ZodString;
|
|
102
508
|
query: z.ZodString;
|
|
103
|
-
|
|
509
|
+
type: z.ZodLiteral<"async-multiselect">;
|
|
104
510
|
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
511
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
105
512
|
dependsOn: z.ZodOptional<z.ZodString>;
|
|
106
|
-
}, z.core.$strip
|
|
513
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
514
|
+
id: z.ZodString;
|
|
515
|
+
query: z.ZodString;
|
|
516
|
+
type: z.ZodLiteral<"select">;
|
|
517
|
+
options: z.ZodArray<z.ZodObject<{
|
|
518
|
+
id: z.ZodString;
|
|
519
|
+
name: z.ZodString;
|
|
520
|
+
}, z.core.$strip>>;
|
|
521
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
522
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
523
|
+
id: z.ZodString;
|
|
524
|
+
query: z.ZodString;
|
|
525
|
+
type: z.ZodLiteral<"async-select">;
|
|
526
|
+
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
527
|
+
dependsOn: z.ZodOptional<z.ZodString>;
|
|
528
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
529
|
+
id: z.ZodString;
|
|
530
|
+
query: z.ZodString;
|
|
531
|
+
type: z.ZodLiteral<"daterange">;
|
|
532
|
+
defaultValue: z.ZodOptional<z.ZodObject<{
|
|
533
|
+
from: z.ZodString;
|
|
534
|
+
to: z.ZodString;
|
|
535
|
+
}, z.core.$strip>>;
|
|
536
|
+
}, z.core.$strip>], "type">>>;
|
|
107
537
|
capabilities: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
108
538
|
version: z.ZodNumber;
|
|
109
539
|
data: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
110
540
|
}, z.core.$strip>>;
|
|
541
|
+
columns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
542
|
+
id: z.ZodString;
|
|
543
|
+
type: z.ZodLiteral<"primary">;
|
|
544
|
+
paths: z.ZodObject<{
|
|
545
|
+
title: z.ZodString;
|
|
546
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
547
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
548
|
+
}, z.core.$strip>;
|
|
549
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
550
|
+
id: z.ZodString;
|
|
551
|
+
type: z.ZodLiteral<"text">;
|
|
552
|
+
paths: z.ZodObject<{
|
|
553
|
+
text: z.ZodString;
|
|
554
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
555
|
+
}, z.core.$strip>;
|
|
556
|
+
}, z.core.$strip>], "type">>;
|
|
111
557
|
}, z.core.$strip>>, undefined, undefined, z.ZodObject<{
|
|
112
558
|
'ce-config': z.ZodString;
|
|
113
559
|
"x-connector-id": z.ZodString;
|
|
114
560
|
}, z.core.$strip>, undefined, false, false, {
|
|
115
561
|
200: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
562
|
+
name: z.ZodString;
|
|
116
563
|
authentication: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
117
564
|
type: z.ZodLiteral<"oauth">;
|
|
118
565
|
}, z.core.$strip>, z.ZodObject<{
|
|
119
566
|
type: z.ZodLiteral<"credentials">;
|
|
120
|
-
fields: z.ZodArray<z.ZodObject<{
|
|
567
|
+
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
121
568
|
id: z.ZodString;
|
|
122
|
-
|
|
123
|
-
|
|
569
|
+
name: z.ZodString;
|
|
570
|
+
type: z.ZodLiteral<"password">;
|
|
571
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
572
|
+
id: z.ZodString;
|
|
573
|
+
name: z.ZodString;
|
|
574
|
+
type: z.ZodLiteral<"select">;
|
|
575
|
+
options: z.ZodArray<z.ZodObject<{
|
|
576
|
+
value: z.ZodString;
|
|
577
|
+
label: z.ZodString;
|
|
578
|
+
}, z.core.$strip>>;
|
|
579
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
580
|
+
id: z.ZodString;
|
|
581
|
+
name: z.ZodString;
|
|
582
|
+
type: z.ZodLiteral<"url">;
|
|
583
|
+
}, z.core.$strip>], "type">>;
|
|
124
584
|
}, z.core.$strip>], "type">;
|
|
125
|
-
filters: z.ZodArray<z.ZodObject<{
|
|
585
|
+
filters: z.ZodArray<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
586
|
+
id: z.ZodString;
|
|
587
|
+
query: z.ZodString;
|
|
588
|
+
type: z.ZodLiteral<"search">;
|
|
589
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
126
590
|
id: z.ZodString;
|
|
127
|
-
type: z.ZodString;
|
|
128
591
|
query: z.ZodString;
|
|
129
|
-
|
|
592
|
+
type: z.ZodLiteral<"multiselect">;
|
|
593
|
+
options: z.ZodArray<z.ZodObject<{
|
|
594
|
+
id: z.ZodString;
|
|
595
|
+
name: z.ZodString;
|
|
596
|
+
}, z.core.$strip>>;
|
|
597
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
598
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
599
|
+
id: z.ZodString;
|
|
600
|
+
query: z.ZodString;
|
|
601
|
+
type: z.ZodLiteral<"async-multiselect">;
|
|
130
602
|
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
603
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
131
604
|
dependsOn: z.ZodOptional<z.ZodString>;
|
|
132
|
-
}, z.core.$strip
|
|
605
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
606
|
+
id: z.ZodString;
|
|
607
|
+
query: z.ZodString;
|
|
608
|
+
type: z.ZodLiteral<"select">;
|
|
609
|
+
options: z.ZodArray<z.ZodObject<{
|
|
610
|
+
id: z.ZodString;
|
|
611
|
+
name: z.ZodString;
|
|
612
|
+
}, z.core.$strip>>;
|
|
613
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
614
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
615
|
+
id: z.ZodString;
|
|
616
|
+
query: z.ZodString;
|
|
617
|
+
type: z.ZodLiteral<"async-select">;
|
|
618
|
+
constraintQuery: z.ZodOptional<z.ZodString>;
|
|
619
|
+
dependsOn: z.ZodOptional<z.ZodString>;
|
|
620
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
621
|
+
id: z.ZodString;
|
|
622
|
+
query: z.ZodString;
|
|
623
|
+
type: z.ZodLiteral<"daterange">;
|
|
624
|
+
defaultValue: z.ZodOptional<z.ZodObject<{
|
|
625
|
+
from: z.ZodString;
|
|
626
|
+
to: z.ZodString;
|
|
627
|
+
}, z.core.$strip>>;
|
|
628
|
+
}, z.core.$strip>], "type">>>;
|
|
133
629
|
capabilities: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
134
630
|
version: z.ZodNumber;
|
|
135
631
|
data: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
136
632
|
}, z.core.$strip>>;
|
|
633
|
+
columns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
634
|
+
id: z.ZodString;
|
|
635
|
+
type: z.ZodLiteral<"primary">;
|
|
636
|
+
paths: z.ZodObject<{
|
|
637
|
+
title: z.ZodString;
|
|
638
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
639
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
640
|
+
}, z.core.$strip>;
|
|
641
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
642
|
+
id: z.ZodString;
|
|
643
|
+
type: z.ZodLiteral<"text">;
|
|
644
|
+
paths: z.ZodObject<{
|
|
645
|
+
text: z.ZodString;
|
|
646
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
647
|
+
}, z.core.$strip>;
|
|
648
|
+
}, z.core.$strip>], "type">>;
|
|
137
649
|
}, z.core.$strip>>;
|
|
138
650
|
403: z.ZodUnion<readonly [z.ZodObject<{
|
|
139
651
|
statusCode: z.ZodNumber;
|
|
@@ -1,37 +1,119 @@
|
|
|
1
1
|
import { buildGetRoute } from '@lokalise/api-contracts';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
import { COMMON_ERROR_RESPONSE_SCHEMA_UNION, CONNECTOR_REQUEST_HEADERS_SCHEMA_PRE_SETUP, } from "./commonSchemas.js";
|
|
4
|
-
export const
|
|
4
|
+
export const MANIFEST_FILTER_OPTION_SCHEMA = z.object({
|
|
5
5
|
id: z.string(),
|
|
6
|
-
|
|
6
|
+
name: z.string(),
|
|
7
7
|
});
|
|
8
|
+
const BASE_FILTER_SCHEMA = z.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
query: z.string(),
|
|
11
|
+
});
|
|
12
|
+
export const SEARCH_FILTER_SCHEMA = BASE_FILTER_SCHEMA.extend({
|
|
13
|
+
type: z.literal('search'),
|
|
14
|
+
});
|
|
15
|
+
export const MULTISELECT_FILTER_SCHEMA = BASE_FILTER_SCHEMA.extend({
|
|
16
|
+
type: z.literal('multiselect'),
|
|
17
|
+
options: z.array(MANIFEST_FILTER_OPTION_SCHEMA).min(1),
|
|
18
|
+
defaultValue: z.array(z.string()).optional(),
|
|
19
|
+
});
|
|
20
|
+
export const SELECT_FILTER_SCHEMA = BASE_FILTER_SCHEMA.extend({
|
|
21
|
+
type: z.literal('select'),
|
|
22
|
+
options: z.array(MANIFEST_FILTER_OPTION_SCHEMA).min(1),
|
|
23
|
+
defaultValue: z.string().optional(),
|
|
24
|
+
});
|
|
25
|
+
export const ASYNC_SELECT_FILTER_SCHEMA = BASE_FILTER_SCHEMA.extend({
|
|
26
|
+
type: z.literal('async-select'),
|
|
27
|
+
constraintQuery: z.string().optional(),
|
|
28
|
+
dependsOn: z.string().optional(),
|
|
29
|
+
});
|
|
30
|
+
export const ASYNC_MULTISELECT_FILTER_SCHEMA = BASE_FILTER_SCHEMA.extend({
|
|
31
|
+
type: z.literal('async-multiselect'),
|
|
32
|
+
constraintQuery: z.string().optional(),
|
|
33
|
+
defaultValue: z.array(z.string()).optional(),
|
|
34
|
+
dependsOn: z.string().optional(),
|
|
35
|
+
});
|
|
36
|
+
export const DATERANGE_FILTER_SCHEMA = BASE_FILTER_SCHEMA.extend({
|
|
37
|
+
type: z.literal('daterange'),
|
|
38
|
+
defaultValue: z
|
|
39
|
+
.object({
|
|
40
|
+
from: z.string(),
|
|
41
|
+
to: z.string(),
|
|
42
|
+
})
|
|
43
|
+
.optional(),
|
|
44
|
+
});
|
|
45
|
+
export const MANIFEST_FILTER_SCHEMA = z.discriminatedUnion('type', [
|
|
46
|
+
SEARCH_FILTER_SCHEMA,
|
|
47
|
+
MULTISELECT_FILTER_SCHEMA,
|
|
48
|
+
ASYNC_MULTISELECT_FILTER_SCHEMA,
|
|
49
|
+
SELECT_FILTER_SCHEMA,
|
|
50
|
+
ASYNC_SELECT_FILTER_SCHEMA,
|
|
51
|
+
DATERANGE_FILTER_SCHEMA,
|
|
52
|
+
]);
|
|
53
|
+
export const FILTER_SCHEMA = z.array(MANIFEST_FILTER_SCHEMA);
|
|
54
|
+
export const SELECT_ENTRY = z.object({
|
|
55
|
+
value: z.string(),
|
|
56
|
+
label: z.string(),
|
|
57
|
+
});
|
|
58
|
+
export const BASE_AUTH_FIELD = z.object({
|
|
59
|
+
id: z.string(),
|
|
60
|
+
name: z.string(),
|
|
61
|
+
});
|
|
62
|
+
export const URL_AUTH_FIELD = BASE_AUTH_FIELD.extend({
|
|
63
|
+
type: z.literal('url'),
|
|
64
|
+
});
|
|
65
|
+
export const PASSWORD_AUTH_FIELD = BASE_AUTH_FIELD.extend({
|
|
66
|
+
type: z.literal('password'),
|
|
67
|
+
});
|
|
68
|
+
export const SELECT_AUTH_FIELD = BASE_AUTH_FIELD.extend({
|
|
69
|
+
type: z.literal('select'),
|
|
70
|
+
options: z.array(SELECT_ENTRY),
|
|
71
|
+
});
|
|
72
|
+
export const AUTH_FIELD = z.discriminatedUnion('type', [
|
|
73
|
+
PASSWORD_AUTH_FIELD,
|
|
74
|
+
SELECT_AUTH_FIELD,
|
|
75
|
+
URL_AUTH_FIELD,
|
|
76
|
+
]);
|
|
8
77
|
export const OAUTH_AUTHENTICATION_SCHEMA = z.object({
|
|
9
78
|
type: z.literal('oauth'),
|
|
10
79
|
});
|
|
11
80
|
export const CREDENTIALS_AUTHENTICATION_SCHEMA = z.object({
|
|
12
81
|
type: z.literal('credentials'),
|
|
13
|
-
fields: z.array(
|
|
82
|
+
fields: z.array(AUTH_FIELD),
|
|
14
83
|
});
|
|
15
84
|
export const AUTHENTICATION_SCHEMA = z.discriminatedUnion('type', [
|
|
16
85
|
OAUTH_AUTHENTICATION_SCHEMA,
|
|
17
86
|
CREDENTIALS_AUTHENTICATION_SCHEMA,
|
|
18
87
|
]);
|
|
19
|
-
export const FILTER_SCHEMA = z.object({
|
|
20
|
-
id: z.string(),
|
|
21
|
-
type: z.string(),
|
|
22
|
-
query: z.string(),
|
|
23
|
-
defaultValue: z.any().optional(),
|
|
24
|
-
constraintQuery: z.string().optional(),
|
|
25
|
-
dependsOn: z.string().optional(),
|
|
26
|
-
});
|
|
27
88
|
export const CAPABILITY_SCHEMA = z.object({
|
|
28
89
|
version: z.number().int().positive(),
|
|
29
90
|
data: z.looseObject({}).optional(),
|
|
30
91
|
});
|
|
92
|
+
export const BASE_MANIFEST_COLUMN = z.object({
|
|
93
|
+
id: z.string(),
|
|
94
|
+
});
|
|
95
|
+
export const PRIMARY_COLUMN = BASE_MANIFEST_COLUMN.extend({
|
|
96
|
+
type: z.literal('primary'),
|
|
97
|
+
paths: z.object({
|
|
98
|
+
title: z.string(),
|
|
99
|
+
updatedAt: z.string().optional(),
|
|
100
|
+
icon: z.string().optional(),
|
|
101
|
+
}),
|
|
102
|
+
});
|
|
103
|
+
export const TEXT_COLUMN = BASE_MANIFEST_COLUMN.extend({
|
|
104
|
+
type: z.literal('text'),
|
|
105
|
+
paths: z.object({
|
|
106
|
+
text: z.string(),
|
|
107
|
+
icon: z.string().optional(),
|
|
108
|
+
}),
|
|
109
|
+
});
|
|
110
|
+
export const MANIFEST_COLUMN = z.discriminatedUnion('type', [PRIMARY_COLUMN, TEXT_COLUMN]);
|
|
31
111
|
export const MANIFEST_SCHEMA = z.object({
|
|
112
|
+
name: z.string(),
|
|
32
113
|
authentication: AUTHENTICATION_SCHEMA,
|
|
33
114
|
filters: z.array(FILTER_SCHEMA),
|
|
34
115
|
capabilities: z.record(z.string(), CAPABILITY_SCHEMA),
|
|
116
|
+
columns: z.array(MANIFEST_COLUMN),
|
|
35
117
|
});
|
|
36
118
|
export const MANIFESTS_BY_MODE_SCHEMA = z.record(z.string(), MANIFEST_SCHEMA);
|
|
37
119
|
export const getManifestContract = buildGetRoute({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifestContracts.js","sourceRoot":"","sources":["../../src/contracts/manifestContracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,EACL,kCAAkC,EAClC,0CAA0C,GAC3C,MAAM,oBAAoB,CAAA;AAE3B,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"manifestContracts.js","sourceRoot":"","sources":["../../src/contracts/manifestContracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,EACL,kCAAkC,EAClC,0CAA0C,GAC3C,MAAM,oBAAoB,CAAA;AAE3B,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAA;AAGF,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,MAAM,CAAC;IAC5D,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;CAC1B,CAAC,CAAA;AACF,MAAM,CAAC,MAAM,yBAAyB,GAAG,kBAAkB,CAAC,MAAM,CAAC;IACjE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC9B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC,GAAG,CAAC,CAAC,CA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