@tulip-systems/drive-local 0.11.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.
- package/LICENSE +662 -0
- package/dist/client.d.mts +12 -0
- package/dist/client.mjs +12 -0
- package/dist/database/drizzle/lib/adapter.d.mts +310 -0
- package/dist/database/drizzle/lib/adapter.mjs +520 -0
- package/dist/database/drizzle/lib/compilers.d.mts +395 -0
- package/dist/database/drizzle/lib/compilers.mjs +21 -0
- package/dist/database/drizzle/lib/schema.d.mts +61 -0
- package/dist/drizzle.d.mts +4 -0
- package/dist/drizzle.mjs +3 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.mjs +8 -0
- package/dist/root/components/command-file-update.d.mts +11 -0
- package/dist/root/components/command-file-update.mjs +44 -0
- package/dist/root/components/command-file-upload.d.mts +5 -0
- package/dist/root/components/command-file-upload.mjs +31 -0
- package/dist/root/components/command-folder-create.d.mts +11 -0
- package/dist/root/components/command-folder-create.mjs +50 -0
- package/dist/root/components/command-folder-update.d.mts +11 -0
- package/dist/root/components/command-folder-update.mjs +44 -0
- package/dist/root/components/content.client.d.mts +5 -0
- package/dist/root/components/content.client.mjs +5 -0
- package/dist/root/components/navigation.client.d.mts +11 -0
- package/dist/root/components/navigation.client.mjs +12 -0
- package/dist/root/components/provider.client.d.mts +16 -0
- package/dist/root/components/provider.client.mjs +65 -0
- package/dist/root/components/upload-zone-context.client.d.mts +36 -0
- package/dist/root/components/upload-zone-context.client.mjs +19 -0
- package/dist/root/components/upload-zone.client.d.mts +16 -0
- package/dist/root/components/upload-zone.client.mjs +147 -0
- package/dist/root/components/view.client.d.mts +20 -0
- package/dist/root/components/view.client.mjs +86 -0
- package/dist/root/config/columns-data.d.mts +6 -0
- package/dist/root/config/columns-data.mjs +62 -0
- package/dist/root/config/filters.d.mts +404 -0
- package/dist/root/config/filters.mjs +122 -0
- package/dist/root/config/sorting.d.mts +38 -0
- package/dist/root/config/sorting.mjs +26 -0
- package/dist/root/lib/constants.d.mts +12 -0
- package/dist/root/lib/constants.mjs +27 -0
- package/dist/root/lib/database/contracts.d.mts +112 -0
- package/dist/root/lib/database/filters.d.mts +28 -0
- package/dist/root/lib/database/filters.mjs +73 -0
- package/dist/root/lib/helpers.d.mts +33 -0
- package/dist/root/lib/helpers.mjs +78 -0
- package/dist/root/lib/route-handler.server.d.mts +36 -0
- package/dist/root/lib/route-handler.server.mjs +111 -0
- package/dist/root/lib/router.server.d.mts +819 -0
- package/dist/root/lib/router.server.mjs +87 -0
- package/dist/root/lib/search-params.d.mts +15 -0
- package/dist/root/lib/search-params.mjs +6 -0
- package/dist/root/lib/service.server.d.mts +522 -0
- package/dist/root/lib/service.server.mjs +613 -0
- package/dist/root/lib/upload.client.d.mts +60 -0
- package/dist/root/lib/upload.client.mjs +97 -0
- package/dist/root/lib/validators.d.mts +710 -0
- package/dist/root/lib/validators.mjs +116 -0
- package/dist/server.d.mts +5 -0
- package/dist/server.mjs +4 -0
- package/package.json +83 -0
- package/styles.css +1 -0
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { z as z$1 } from "zod";
|
|
2
|
+
//#region src/root/config/filters.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Node filters
|
|
5
|
+
*/
|
|
6
|
+
declare const localDriveFilters: {
|
|
7
|
+
readonly search: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string>, z$1.ZodString, {
|
|
8
|
+
readonly field: "name";
|
|
9
|
+
readonly operator: "ilike";
|
|
10
|
+
readonly value: `%${string}%`;
|
|
11
|
+
} | null>;
|
|
12
|
+
readonly types: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<("folder" | "file")[]>, z$1.ZodArray<z$1.ZodEnum<{
|
|
13
|
+
readonly folder: "folder";
|
|
14
|
+
readonly file: "file";
|
|
15
|
+
}>>, {
|
|
16
|
+
readonly field: "type";
|
|
17
|
+
readonly operator: "in";
|
|
18
|
+
readonly value: ("folder" | "file")[];
|
|
19
|
+
} | null>;
|
|
20
|
+
readonly contentTypes: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
21
|
+
readonly field: "contentType";
|
|
22
|
+
readonly operator: "in";
|
|
23
|
+
readonly value: string[];
|
|
24
|
+
} | null>;
|
|
25
|
+
readonly nodeIds: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
26
|
+
readonly field: "id";
|
|
27
|
+
readonly operator: "in";
|
|
28
|
+
readonly value: string[];
|
|
29
|
+
} | null>;
|
|
30
|
+
readonly assetIds: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
31
|
+
readonly field: "assetId";
|
|
32
|
+
readonly operator: "in";
|
|
33
|
+
readonly value: string[];
|
|
34
|
+
} | null>;
|
|
35
|
+
readonly namespace: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string>, z$1.ZodString, {
|
|
36
|
+
readonly field: "namespace";
|
|
37
|
+
readonly operator: "eq";
|
|
38
|
+
readonly value: string;
|
|
39
|
+
} | null>;
|
|
40
|
+
readonly parentId: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string>, z$1.ZodNullable<z$1.ZodString>, {
|
|
41
|
+
readonly field: "parentId";
|
|
42
|
+
readonly operator: "isNull";
|
|
43
|
+
readonly value?: undefined;
|
|
44
|
+
} | {
|
|
45
|
+
readonly field: "parentId";
|
|
46
|
+
readonly operator: "eq";
|
|
47
|
+
readonly value: string;
|
|
48
|
+
} | null>;
|
|
49
|
+
readonly subtypes: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[]>, z$1.ZodArray<z$1.ZodEnum<{
|
|
50
|
+
readonly image: "image";
|
|
51
|
+
readonly document: "document";
|
|
52
|
+
readonly spreadsheet: "spreadsheet";
|
|
53
|
+
readonly video: "video";
|
|
54
|
+
readonly audio: "audio";
|
|
55
|
+
readonly archive: "archive";
|
|
56
|
+
readonly other: "other";
|
|
57
|
+
}>>, {
|
|
58
|
+
readonly field: "subtype";
|
|
59
|
+
readonly operator: "in";
|
|
60
|
+
readonly value: ("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[];
|
|
61
|
+
} | null>;
|
|
62
|
+
readonly isArchived: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<boolean>, z$1.ZodBoolean, {
|
|
63
|
+
readonly field: "archivedAt";
|
|
64
|
+
readonly operator: "isNull" | "isNotNull";
|
|
65
|
+
}>;
|
|
66
|
+
readonly hidden: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<boolean>, z$1.ZodBoolean, {
|
|
67
|
+
readonly field: "hidden";
|
|
68
|
+
readonly operator: "eq";
|
|
69
|
+
readonly value: boolean;
|
|
70
|
+
}>;
|
|
71
|
+
};
|
|
72
|
+
declare const localDriveFiltersSchema: z$1.ZodObject<{
|
|
73
|
+
search: z$1.ZodOptional<z$1.ZodString>;
|
|
74
|
+
types: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
75
|
+
readonly folder: "folder";
|
|
76
|
+
readonly file: "file";
|
|
77
|
+
}>>>;
|
|
78
|
+
contentTypes: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
79
|
+
nodeIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
80
|
+
assetIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
81
|
+
namespace: z$1.ZodOptional<z$1.ZodString>;
|
|
82
|
+
parentId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
83
|
+
subtypes: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
84
|
+
readonly image: "image";
|
|
85
|
+
readonly document: "document";
|
|
86
|
+
readonly spreadsheet: "spreadsheet";
|
|
87
|
+
readonly video: "video";
|
|
88
|
+
readonly audio: "audio";
|
|
89
|
+
readonly archive: "archive";
|
|
90
|
+
readonly other: "other";
|
|
91
|
+
}>>>;
|
|
92
|
+
isArchived: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
93
|
+
hidden: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
94
|
+
}, z$1.core.$strip>;
|
|
95
|
+
type LocalDriveFiltersInput = z$1.input<typeof localDriveFiltersSchema>;
|
|
96
|
+
type LocalDriveFiltersSchema = z$1.infer<typeof localDriveFiltersSchema>;
|
|
97
|
+
declare const localDriveFiltersParser: import("@tulip-systems/query").FilteringParser<Partial<import("@tulip-systems/query").ResolvedFilters<{
|
|
98
|
+
readonly search: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string>, z$1.ZodString, {
|
|
99
|
+
readonly field: "name";
|
|
100
|
+
readonly operator: "ilike";
|
|
101
|
+
readonly value: `%${string}%`;
|
|
102
|
+
} | null>;
|
|
103
|
+
readonly types: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<("folder" | "file")[]>, z$1.ZodArray<z$1.ZodEnum<{
|
|
104
|
+
readonly folder: "folder";
|
|
105
|
+
readonly file: "file";
|
|
106
|
+
}>>, {
|
|
107
|
+
readonly field: "type";
|
|
108
|
+
readonly operator: "in";
|
|
109
|
+
readonly value: ("folder" | "file")[];
|
|
110
|
+
} | null>;
|
|
111
|
+
readonly contentTypes: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
112
|
+
readonly field: "contentType";
|
|
113
|
+
readonly operator: "in";
|
|
114
|
+
readonly value: string[];
|
|
115
|
+
} | null>;
|
|
116
|
+
readonly nodeIds: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
117
|
+
readonly field: "id";
|
|
118
|
+
readonly operator: "in";
|
|
119
|
+
readonly value: string[];
|
|
120
|
+
} | null>;
|
|
121
|
+
readonly assetIds: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
122
|
+
readonly field: "assetId";
|
|
123
|
+
readonly operator: "in";
|
|
124
|
+
readonly value: string[];
|
|
125
|
+
} | null>;
|
|
126
|
+
readonly namespace: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string>, z$1.ZodString, {
|
|
127
|
+
readonly field: "namespace";
|
|
128
|
+
readonly operator: "eq";
|
|
129
|
+
readonly value: string;
|
|
130
|
+
} | null>;
|
|
131
|
+
readonly parentId: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string>, z$1.ZodNullable<z$1.ZodString>, {
|
|
132
|
+
readonly field: "parentId";
|
|
133
|
+
readonly operator: "isNull";
|
|
134
|
+
readonly value?: undefined;
|
|
135
|
+
} | {
|
|
136
|
+
readonly field: "parentId";
|
|
137
|
+
readonly operator: "eq";
|
|
138
|
+
readonly value: string;
|
|
139
|
+
} | null>;
|
|
140
|
+
readonly subtypes: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[]>, z$1.ZodArray<z$1.ZodEnum<{
|
|
141
|
+
readonly image: "image";
|
|
142
|
+
readonly document: "document";
|
|
143
|
+
readonly spreadsheet: "spreadsheet";
|
|
144
|
+
readonly video: "video";
|
|
145
|
+
readonly audio: "audio";
|
|
146
|
+
readonly archive: "archive";
|
|
147
|
+
readonly other: "other";
|
|
148
|
+
}>>, {
|
|
149
|
+
readonly field: "subtype";
|
|
150
|
+
readonly operator: "in";
|
|
151
|
+
readonly value: ("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[];
|
|
152
|
+
} | null>;
|
|
153
|
+
readonly isArchived: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<boolean>, z$1.ZodBoolean, {
|
|
154
|
+
readonly field: "archivedAt";
|
|
155
|
+
readonly operator: "isNull" | "isNotNull";
|
|
156
|
+
}>;
|
|
157
|
+
readonly hidden: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<boolean>, z$1.ZodBoolean, {
|
|
158
|
+
readonly field: "hidden";
|
|
159
|
+
readonly operator: "eq";
|
|
160
|
+
readonly value: boolean;
|
|
161
|
+
}>;
|
|
162
|
+
}>>, {
|
|
163
|
+
readonly search: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string>, z$1.ZodString, {
|
|
164
|
+
readonly field: "name";
|
|
165
|
+
readonly operator: "ilike";
|
|
166
|
+
readonly value: `%${string}%`;
|
|
167
|
+
} | null>;
|
|
168
|
+
readonly types: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<("folder" | "file")[]>, z$1.ZodArray<z$1.ZodEnum<{
|
|
169
|
+
readonly folder: "folder";
|
|
170
|
+
readonly file: "file";
|
|
171
|
+
}>>, {
|
|
172
|
+
readonly field: "type";
|
|
173
|
+
readonly operator: "in";
|
|
174
|
+
readonly value: ("folder" | "file")[];
|
|
175
|
+
} | null>;
|
|
176
|
+
readonly contentTypes: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
177
|
+
readonly field: "contentType";
|
|
178
|
+
readonly operator: "in";
|
|
179
|
+
readonly value: string[];
|
|
180
|
+
} | null>;
|
|
181
|
+
readonly nodeIds: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
182
|
+
readonly field: "id";
|
|
183
|
+
readonly operator: "in";
|
|
184
|
+
readonly value: string[];
|
|
185
|
+
} | null>;
|
|
186
|
+
readonly assetIds: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
187
|
+
readonly field: "assetId";
|
|
188
|
+
readonly operator: "in";
|
|
189
|
+
readonly value: string[];
|
|
190
|
+
} | null>;
|
|
191
|
+
readonly namespace: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string>, z$1.ZodString, {
|
|
192
|
+
readonly field: "namespace";
|
|
193
|
+
readonly operator: "eq";
|
|
194
|
+
readonly value: string;
|
|
195
|
+
} | null>;
|
|
196
|
+
readonly parentId: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string>, z$1.ZodNullable<z$1.ZodString>, {
|
|
197
|
+
readonly field: "parentId";
|
|
198
|
+
readonly operator: "isNull";
|
|
199
|
+
readonly value?: undefined;
|
|
200
|
+
} | {
|
|
201
|
+
readonly field: "parentId";
|
|
202
|
+
readonly operator: "eq";
|
|
203
|
+
readonly value: string;
|
|
204
|
+
} | null>;
|
|
205
|
+
readonly subtypes: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[]>, z$1.ZodArray<z$1.ZodEnum<{
|
|
206
|
+
readonly image: "image";
|
|
207
|
+
readonly document: "document";
|
|
208
|
+
readonly spreadsheet: "spreadsheet";
|
|
209
|
+
readonly video: "video";
|
|
210
|
+
readonly audio: "audio";
|
|
211
|
+
readonly archive: "archive";
|
|
212
|
+
readonly other: "other";
|
|
213
|
+
}>>, {
|
|
214
|
+
readonly field: "subtype";
|
|
215
|
+
readonly operator: "in";
|
|
216
|
+
readonly value: ("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[];
|
|
217
|
+
} | null>;
|
|
218
|
+
readonly isArchived: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<boolean>, z$1.ZodBoolean, {
|
|
219
|
+
readonly field: "archivedAt";
|
|
220
|
+
readonly operator: "isNull" | "isNotNull";
|
|
221
|
+
}>;
|
|
222
|
+
readonly hidden: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<boolean>, z$1.ZodBoolean, {
|
|
223
|
+
readonly field: "hidden";
|
|
224
|
+
readonly operator: "eq";
|
|
225
|
+
readonly value: boolean;
|
|
226
|
+
}>;
|
|
227
|
+
}>;
|
|
228
|
+
/**
|
|
229
|
+
*
|
|
230
|
+
*
|
|
231
|
+
*
|
|
232
|
+
* Variant filters
|
|
233
|
+
*/
|
|
234
|
+
declare const localDriveVariantFilters: {
|
|
235
|
+
readonly ids: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
236
|
+
readonly field: "id";
|
|
237
|
+
readonly operator: "in";
|
|
238
|
+
readonly value: string[];
|
|
239
|
+
} | null>;
|
|
240
|
+
readonly nodeIds: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
241
|
+
readonly field: "nodeId";
|
|
242
|
+
readonly operator: "in";
|
|
243
|
+
readonly value: string[];
|
|
244
|
+
} | null>;
|
|
245
|
+
readonly assetIds: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
246
|
+
readonly field: "assetId";
|
|
247
|
+
readonly operator: "in";
|
|
248
|
+
readonly value: string[];
|
|
249
|
+
} | null>;
|
|
250
|
+
readonly variants: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<("main" | `preview-${number}`)[]>, z$1.ZodArray<z$1.ZodEnum<{
|
|
251
|
+
readonly [x: `preview-${number}`]: `preview-${number}`;
|
|
252
|
+
readonly main: "main";
|
|
253
|
+
}>>, {
|
|
254
|
+
readonly field: "variant";
|
|
255
|
+
readonly operator: "in";
|
|
256
|
+
readonly value: ("main" | `preview-${number}`)[];
|
|
257
|
+
} | null>;
|
|
258
|
+
};
|
|
259
|
+
declare const localDriveVariantFiltersSchema: z$1.ZodObject<{
|
|
260
|
+
ids: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
261
|
+
nodeIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
262
|
+
assetIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
263
|
+
variants: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
264
|
+
readonly [x: `preview-${number}`]: `preview-${number}`;
|
|
265
|
+
readonly main: "main";
|
|
266
|
+
}>>>;
|
|
267
|
+
}, z$1.core.$strip>;
|
|
268
|
+
type LocalDriveVariantFiltersInput = z$1.input<typeof localDriveVariantFiltersSchema>;
|
|
269
|
+
type LocalDriveVariantFiltersSchema = z$1.infer<typeof localDriveVariantFiltersSchema>;
|
|
270
|
+
declare const localDriveVariantFiltersParser: import("@tulip-systems/query").FilteringParser<Partial<import("@tulip-systems/query").ResolvedFilters<{
|
|
271
|
+
readonly ids: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
272
|
+
readonly field: "id";
|
|
273
|
+
readonly operator: "in";
|
|
274
|
+
readonly value: string[];
|
|
275
|
+
} | null>;
|
|
276
|
+
readonly nodeIds: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
277
|
+
readonly field: "nodeId";
|
|
278
|
+
readonly operator: "in";
|
|
279
|
+
readonly value: string[];
|
|
280
|
+
} | null>;
|
|
281
|
+
readonly assetIds: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
282
|
+
readonly field: "assetId";
|
|
283
|
+
readonly operator: "in";
|
|
284
|
+
readonly value: string[];
|
|
285
|
+
} | null>;
|
|
286
|
+
readonly variants: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<("main" | `preview-${number}`)[]>, z$1.ZodArray<z$1.ZodEnum<{
|
|
287
|
+
readonly [x: `preview-${number}`]: `preview-${number}`;
|
|
288
|
+
readonly main: "main";
|
|
289
|
+
}>>, {
|
|
290
|
+
readonly field: "variant";
|
|
291
|
+
readonly operator: "in";
|
|
292
|
+
readonly value: ("main" | `preview-${number}`)[];
|
|
293
|
+
} | null>;
|
|
294
|
+
}>>, {
|
|
295
|
+
readonly ids: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
296
|
+
readonly field: "id";
|
|
297
|
+
readonly operator: "in";
|
|
298
|
+
readonly value: string[];
|
|
299
|
+
} | null>;
|
|
300
|
+
readonly nodeIds: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
301
|
+
readonly field: "nodeId";
|
|
302
|
+
readonly operator: "in";
|
|
303
|
+
readonly value: string[];
|
|
304
|
+
} | null>;
|
|
305
|
+
readonly assetIds: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string[]>, z$1.ZodArray<z$1.ZodString>, {
|
|
306
|
+
readonly field: "assetId";
|
|
307
|
+
readonly operator: "in";
|
|
308
|
+
readonly value: string[];
|
|
309
|
+
} | null>;
|
|
310
|
+
readonly variants: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<("main" | `preview-${number}`)[]>, z$1.ZodArray<z$1.ZodEnum<{
|
|
311
|
+
readonly [x: `preview-${number}`]: `preview-${number}`;
|
|
312
|
+
readonly main: "main";
|
|
313
|
+
}>>, {
|
|
314
|
+
readonly field: "variant";
|
|
315
|
+
readonly operator: "in";
|
|
316
|
+
readonly value: ("main" | `preview-${number}`)[];
|
|
317
|
+
} | null>;
|
|
318
|
+
}>;
|
|
319
|
+
/**
|
|
320
|
+
* Presigned URL filters
|
|
321
|
+
*/
|
|
322
|
+
declare const localDrivePresignedUrlFilters: {
|
|
323
|
+
readonly nodeId: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string>, z$1.ZodString, {
|
|
324
|
+
readonly field: "nodeId";
|
|
325
|
+
readonly operator: "eq";
|
|
326
|
+
readonly value: string;
|
|
327
|
+
} | null>;
|
|
328
|
+
readonly variant: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<"main" | `preview-${number}`>, z$1.ZodEnum<{
|
|
329
|
+
readonly [x: `preview-${number}`]: `preview-${number}`;
|
|
330
|
+
readonly main: "main";
|
|
331
|
+
}>, {
|
|
332
|
+
readonly field: "variant";
|
|
333
|
+
readonly operator: "eq";
|
|
334
|
+
readonly value: "main" | `preview-${number}`;
|
|
335
|
+
} | null>;
|
|
336
|
+
readonly disposition: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<"inline" | "attachment">, z$1.ZodEnum<{
|
|
337
|
+
readonly inline: "inline";
|
|
338
|
+
readonly attachment: "attachment";
|
|
339
|
+
}>, {
|
|
340
|
+
readonly field: "disposition";
|
|
341
|
+
readonly operator: "eq";
|
|
342
|
+
readonly value: "inline" | "attachment";
|
|
343
|
+
} | null>;
|
|
344
|
+
};
|
|
345
|
+
declare const localDrivePresignedUrlFiltersSchema: z$1.ZodObject<{
|
|
346
|
+
nodeId: z$1.ZodOptional<z$1.ZodString>;
|
|
347
|
+
variant: z$1.ZodOptional<z$1.ZodEnum<{
|
|
348
|
+
readonly [x: `preview-${number}`]: `preview-${number}`;
|
|
349
|
+
readonly main: "main";
|
|
350
|
+
}>>;
|
|
351
|
+
disposition: z$1.ZodOptional<z$1.ZodEnum<{
|
|
352
|
+
readonly inline: "inline";
|
|
353
|
+
readonly attachment: "attachment";
|
|
354
|
+
}>>;
|
|
355
|
+
}, z$1.core.$strip>;
|
|
356
|
+
type LocalDrivePresignedUrlFiltersInput = z$1.input<typeof localDrivePresignedUrlFiltersSchema>;
|
|
357
|
+
type LocalDrivePresignedUrlFiltersSchema = z$1.infer<typeof localDrivePresignedUrlFiltersSchema>;
|
|
358
|
+
declare const localDrivePresignedUrlFiltersParser: import("@tulip-systems/query").FilteringParser<Partial<import("@tulip-systems/query").ResolvedFilters<{
|
|
359
|
+
readonly nodeId: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string>, z$1.ZodString, {
|
|
360
|
+
readonly field: "nodeId";
|
|
361
|
+
readonly operator: "eq";
|
|
362
|
+
readonly value: string;
|
|
363
|
+
} | null>;
|
|
364
|
+
readonly variant: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<"main" | `preview-${number}`>, z$1.ZodEnum<{
|
|
365
|
+
readonly [x: `preview-${number}`]: `preview-${number}`;
|
|
366
|
+
readonly main: "main";
|
|
367
|
+
}>, {
|
|
368
|
+
readonly field: "variant";
|
|
369
|
+
readonly operator: "eq";
|
|
370
|
+
readonly value: "main" | `preview-${number}`;
|
|
371
|
+
} | null>;
|
|
372
|
+
readonly disposition: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<"inline" | "attachment">, z$1.ZodEnum<{
|
|
373
|
+
readonly inline: "inline";
|
|
374
|
+
readonly attachment: "attachment";
|
|
375
|
+
}>, {
|
|
376
|
+
readonly field: "disposition";
|
|
377
|
+
readonly operator: "eq";
|
|
378
|
+
readonly value: "inline" | "attachment";
|
|
379
|
+
} | null>;
|
|
380
|
+
}>>, {
|
|
381
|
+
readonly nodeId: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<string>, z$1.ZodString, {
|
|
382
|
+
readonly field: "nodeId";
|
|
383
|
+
readonly operator: "eq";
|
|
384
|
+
readonly value: string;
|
|
385
|
+
} | null>;
|
|
386
|
+
readonly variant: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<"main" | `preview-${number}`>, z$1.ZodEnum<{
|
|
387
|
+
readonly [x: `preview-${number}`]: `preview-${number}`;
|
|
388
|
+
readonly main: "main";
|
|
389
|
+
}>, {
|
|
390
|
+
readonly field: "variant";
|
|
391
|
+
readonly operator: "eq";
|
|
392
|
+
readonly value: "main" | `preview-${number}`;
|
|
393
|
+
} | null>;
|
|
394
|
+
readonly disposition: import("@tulip-systems/query").Filter<import("nuqs/server").SingleParserBuilder<"inline" | "attachment">, z$1.ZodEnum<{
|
|
395
|
+
readonly inline: "inline";
|
|
396
|
+
readonly attachment: "attachment";
|
|
397
|
+
}>, {
|
|
398
|
+
readonly field: "disposition";
|
|
399
|
+
readonly operator: "eq";
|
|
400
|
+
readonly value: "inline" | "attachment";
|
|
401
|
+
} | null>;
|
|
402
|
+
}>;
|
|
403
|
+
//#endregion
|
|
404
|
+
export { LocalDriveFiltersInput, LocalDriveFiltersSchema, LocalDrivePresignedUrlFiltersInput, LocalDrivePresignedUrlFiltersSchema, LocalDriveVariantFiltersInput, LocalDriveVariantFiltersSchema, localDriveFilters, localDriveFiltersParser, localDriveFiltersSchema, localDrivePresignedUrlFilters, localDrivePresignedUrlFiltersParser, localDrivePresignedUrlFiltersSchema, localDriveVariantFilters, localDriveVariantFiltersParser, localDriveVariantFiltersSchema };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { imageVariants, nodeSubtypes } from "../lib/constants.mjs";
|
|
2
|
+
import { DRIVE_NODE_TYPES } from "@tulip-systems/drive";
|
|
3
|
+
import { arrayFilter, booleanFilter, createFilteringParser, defineFilters, enumFilter, resolveFiltersSchema, stringFilter } from "@tulip-systems/query";
|
|
4
|
+
import { imageDispositions } from "@tulip-systems/storage";
|
|
5
|
+
import { z as z$1 } from "zod";
|
|
6
|
+
//#region src/root/config/filters.ts
|
|
7
|
+
/**
|
|
8
|
+
* Node filters
|
|
9
|
+
*/
|
|
10
|
+
const localDriveFilters = defineFilters({
|
|
11
|
+
search: stringFilter.build((value) => value ? {
|
|
12
|
+
field: "name",
|
|
13
|
+
operator: "ilike",
|
|
14
|
+
value: `%${value}%`
|
|
15
|
+
} : null),
|
|
16
|
+
types: arrayFilter(enumFilter(DRIVE_NODE_TYPES)).build((value) => value?.length ? {
|
|
17
|
+
field: "type",
|
|
18
|
+
operator: "in",
|
|
19
|
+
value
|
|
20
|
+
} : null),
|
|
21
|
+
contentTypes: arrayFilter(stringFilter).build((value) => value?.length ? {
|
|
22
|
+
field: "contentType",
|
|
23
|
+
operator: "in",
|
|
24
|
+
value
|
|
25
|
+
} : null),
|
|
26
|
+
nodeIds: arrayFilter(stringFilter).build((value) => value === void 0 ? null : {
|
|
27
|
+
field: "id",
|
|
28
|
+
operator: "in",
|
|
29
|
+
value
|
|
30
|
+
}),
|
|
31
|
+
assetIds: arrayFilter(stringFilter).build((value) => value === void 0 ? null : {
|
|
32
|
+
field: "assetId",
|
|
33
|
+
operator: "in",
|
|
34
|
+
value
|
|
35
|
+
}),
|
|
36
|
+
namespace: stringFilter.build((value) => value ? {
|
|
37
|
+
field: "namespace",
|
|
38
|
+
operator: "eq",
|
|
39
|
+
value
|
|
40
|
+
} : null),
|
|
41
|
+
parentId: stringFilter.options({ schema: z$1.string().nullable() }).build((value) => {
|
|
42
|
+
if (value === void 0) return null;
|
|
43
|
+
return value === null ? {
|
|
44
|
+
field: "parentId",
|
|
45
|
+
operator: "isNull"
|
|
46
|
+
} : {
|
|
47
|
+
field: "parentId",
|
|
48
|
+
operator: "eq",
|
|
49
|
+
value
|
|
50
|
+
};
|
|
51
|
+
}),
|
|
52
|
+
subtypes: arrayFilter(enumFilter(nodeSubtypes)).build((value) => value?.length ? {
|
|
53
|
+
field: "subtype",
|
|
54
|
+
operator: "in",
|
|
55
|
+
value
|
|
56
|
+
} : null),
|
|
57
|
+
isArchived: booleanFilter.build((value) => ({
|
|
58
|
+
field: "archivedAt",
|
|
59
|
+
operator: value ? "isNotNull" : "isNull"
|
|
60
|
+
})),
|
|
61
|
+
hidden: booleanFilter.build((value) => ({
|
|
62
|
+
field: "hidden",
|
|
63
|
+
operator: "eq",
|
|
64
|
+
value: value ?? false
|
|
65
|
+
}))
|
|
66
|
+
});
|
|
67
|
+
const localDriveFiltersSchema = resolveFiltersSchema(localDriveFilters);
|
|
68
|
+
const localDriveFiltersParser = createFilteringParser(localDriveFilters);
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
*
|
|
72
|
+
*
|
|
73
|
+
* Variant filters
|
|
74
|
+
*/
|
|
75
|
+
const localDriveVariantFilters = defineFilters({
|
|
76
|
+
ids: arrayFilter(stringFilter).build((value) => value === void 0 ? null : {
|
|
77
|
+
field: "id",
|
|
78
|
+
operator: "in",
|
|
79
|
+
value
|
|
80
|
+
}),
|
|
81
|
+
nodeIds: arrayFilter(stringFilter).build((value) => value === void 0 ? null : {
|
|
82
|
+
field: "nodeId",
|
|
83
|
+
operator: "in",
|
|
84
|
+
value
|
|
85
|
+
}),
|
|
86
|
+
assetIds: arrayFilter(stringFilter).build((value) => value === void 0 ? null : {
|
|
87
|
+
field: "assetId",
|
|
88
|
+
operator: "in",
|
|
89
|
+
value
|
|
90
|
+
}),
|
|
91
|
+
variants: arrayFilter(enumFilter(imageVariants)).build((value) => value?.length ? {
|
|
92
|
+
field: "variant",
|
|
93
|
+
operator: "in",
|
|
94
|
+
value
|
|
95
|
+
} : null)
|
|
96
|
+
});
|
|
97
|
+
const localDriveVariantFiltersSchema = resolveFiltersSchema(localDriveVariantFilters);
|
|
98
|
+
const localDriveVariantFiltersParser = createFilteringParser(localDriveVariantFilters);
|
|
99
|
+
/**
|
|
100
|
+
* Presigned URL filters
|
|
101
|
+
*/
|
|
102
|
+
const localDrivePresignedUrlFilters = defineFilters({
|
|
103
|
+
nodeId: stringFilter.build((value) => value ? {
|
|
104
|
+
field: "nodeId",
|
|
105
|
+
operator: "eq",
|
|
106
|
+
value
|
|
107
|
+
} : null),
|
|
108
|
+
variant: enumFilter(imageVariants).build((value) => value ? {
|
|
109
|
+
field: "variant",
|
|
110
|
+
operator: "eq",
|
|
111
|
+
value
|
|
112
|
+
} : null),
|
|
113
|
+
disposition: enumFilter(imageDispositions).build((value) => value ? {
|
|
114
|
+
field: "disposition",
|
|
115
|
+
operator: "eq",
|
|
116
|
+
value
|
|
117
|
+
} : null)
|
|
118
|
+
});
|
|
119
|
+
const localDrivePresignedUrlFiltersSchema = resolveFiltersSchema(localDrivePresignedUrlFilters);
|
|
120
|
+
const localDrivePresignedUrlFiltersParser = createFilteringParser(localDrivePresignedUrlFilters);
|
|
121
|
+
//#endregion
|
|
122
|
+
export { localDriveFilters, localDriveFiltersParser, localDriveFiltersSchema, localDrivePresignedUrlFilters, localDrivePresignedUrlFiltersParser, localDrivePresignedUrlFiltersSchema, localDriveVariantFilters, localDriveVariantFiltersParser, localDriveVariantFiltersSchema };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z as z$1 } from "zod";
|
|
2
|
+
//#region src/root/config/sorting.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Local Drive sorting
|
|
5
|
+
*/
|
|
6
|
+
declare const localDriveTableSorts: {
|
|
7
|
+
readonly name: import("@tulip-systems/query").Sort<{
|
|
8
|
+
readonly field: "name";
|
|
9
|
+
readonly direction: "asc" | "desc";
|
|
10
|
+
}>;
|
|
11
|
+
readonly createdAt: import("@tulip-systems/query").Sort<{
|
|
12
|
+
readonly field: "createdAt";
|
|
13
|
+
readonly direction: "asc" | "desc";
|
|
14
|
+
}>;
|
|
15
|
+
readonly updatedAt: import("@tulip-systems/query").Sort<{
|
|
16
|
+
readonly field: "updatedAt";
|
|
17
|
+
readonly direction: "asc" | "desc";
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
declare const localDriveTableSortsSchema: z$1.ZodType<import("@tulip-systems/query").SortInput<"name" | "createdAt" | "updatedAt">[], unknown, z$1.core.$ZodTypeInternals<import("@tulip-systems/query").SortInput<"name" | "createdAt" | "updatedAt">[], unknown>>;
|
|
21
|
+
type LocalDriveTableSortsInput = z$1.input<typeof localDriveTableSortsSchema>;
|
|
22
|
+
type LocalDriveTableSortsSchema = z$1.infer<typeof localDriveTableSortsSchema>;
|
|
23
|
+
declare const localDriveTableSortsParser: import("@tulip-systems/query").SortingParser<"name" | "createdAt" | "updatedAt", import("@tulip-systems/query").SortingFieldUnion<{
|
|
24
|
+
readonly name: import("@tulip-systems/query").Sort<{
|
|
25
|
+
readonly field: "name";
|
|
26
|
+
readonly direction: "asc" | "desc";
|
|
27
|
+
}>;
|
|
28
|
+
readonly createdAt: import("@tulip-systems/query").Sort<{
|
|
29
|
+
readonly field: "createdAt";
|
|
30
|
+
readonly direction: "asc" | "desc";
|
|
31
|
+
}>;
|
|
32
|
+
readonly updatedAt: import("@tulip-systems/query").Sort<{
|
|
33
|
+
readonly field: "updatedAt";
|
|
34
|
+
readonly direction: "asc" | "desc";
|
|
35
|
+
}>;
|
|
36
|
+
}>>;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { LocalDriveTableSortsInput, LocalDriveTableSortsSchema, localDriveTableSorts, localDriveTableSortsParser, localDriveTableSortsSchema };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createSortingParser, defineSorting, resolveSortingSchema, sortOption } from "@tulip-systems/query";
|
|
2
|
+
//#region src/root/config/sorting.ts
|
|
3
|
+
/**
|
|
4
|
+
* Local Drive sorting
|
|
5
|
+
*/
|
|
6
|
+
const localDriveTableSorts = defineSorting({
|
|
7
|
+
name: sortOption((direction) => ({
|
|
8
|
+
field: "name",
|
|
9
|
+
direction
|
|
10
|
+
})),
|
|
11
|
+
createdAt: sortOption((direction) => ({
|
|
12
|
+
field: "createdAt",
|
|
13
|
+
direction
|
|
14
|
+
})),
|
|
15
|
+
updatedAt: sortOption((direction) => ({
|
|
16
|
+
field: "updatedAt",
|
|
17
|
+
direction
|
|
18
|
+
}))
|
|
19
|
+
});
|
|
20
|
+
const localDriveTableSortsSchema = resolveSortingSchema(localDriveTableSorts);
|
|
21
|
+
const localDriveTableSortsParser = createSortingParser(localDriveTableSorts, { fallback: [{
|
|
22
|
+
key: "createdAt",
|
|
23
|
+
direction: "asc"
|
|
24
|
+
}] });
|
|
25
|
+
//#endregion
|
|
26
|
+
export { localDriveTableSorts, localDriveTableSortsParser, localDriveTableSortsSchema };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/root/lib/constants.d.ts
|
|
2
|
+
declare const deviceSizes: number[];
|
|
3
|
+
declare const imageSizes: number[];
|
|
4
|
+
declare const imageVariants: readonly ["main", ...`preview-${number}`[]];
|
|
5
|
+
type ImageVariant = (typeof imageVariants)[number];
|
|
6
|
+
/**
|
|
7
|
+
* Node subtype
|
|
8
|
+
*/
|
|
9
|
+
declare const nodeSubtypes: readonly ["image", "document", "spreadsheet", "video", "audio", "archive", "other"];
|
|
10
|
+
type LocalDriveNodeSubtype = (typeof nodeSubtypes)[number];
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ImageVariant, LocalDriveNodeSubtype, deviceSizes, imageSizes, imageVariants, nodeSubtypes };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/root/lib/constants.ts
|
|
2
|
+
const deviceSizes = [
|
|
3
|
+
640,
|
|
4
|
+
750,
|
|
5
|
+
828,
|
|
6
|
+
1080,
|
|
7
|
+
1200,
|
|
8
|
+
1920,
|
|
9
|
+
2048,
|
|
10
|
+
3840
|
|
11
|
+
];
|
|
12
|
+
const imageSizes = deviceSizes;
|
|
13
|
+
const imageVariants = ["main", ...deviceSizes.map((size) => `preview-${size}`)];
|
|
14
|
+
/**
|
|
15
|
+
* Node subtype
|
|
16
|
+
*/
|
|
17
|
+
const nodeSubtypes = [
|
|
18
|
+
"image",
|
|
19
|
+
"document",
|
|
20
|
+
"spreadsheet",
|
|
21
|
+
"video",
|
|
22
|
+
"audio",
|
|
23
|
+
"archive",
|
|
24
|
+
"other"
|
|
25
|
+
];
|
|
26
|
+
//#endregion
|
|
27
|
+
export { deviceSizes, imageSizes, imageVariants, nodeSubtypes };
|