@tulip-systems/drive 0.10.1 → 0.10.3
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/dist/google/server.d.mts +2 -2
- package/dist/google/server.mjs +2 -2
- package/dist/google.d.mts +2 -2
- package/dist/google.mjs +2 -2
- package/dist/lib/dto.d.mts +2 -2
- package/dist/lib/validators.d.mts +9 -9
- package/dist/local/server.d.mts +2 -2
- package/dist/local/server.mjs +2 -2
- package/dist/local.d.mts +2 -2
- package/dist/local.mjs +2 -2
- package/dist/providers/google/config/filters.d.mts +1 -1
- package/dist/providers/google/lib/router.server.d.mts +121 -161
- package/dist/providers/google/lib/router.server.mjs +27 -33
- package/dist/providers/google/lib/search-params.d.mts +1 -1
- package/dist/providers/google/lib/service.server.d.mts +1 -1
- package/dist/providers/google/lib/validators.d.mts +88 -13
- package/dist/providers/google/lib/validators.mjs +22 -1
- package/dist/providers/local/config/filters.d.mts +1 -1
- package/dist/providers/local/lib/route-handler.server.d.mts +5 -3
- package/dist/providers/local/lib/route-handler.server.mjs +1 -1
- package/dist/providers/local/lib/router.server.d.mts +1248 -41272
- package/dist/providers/local/lib/router.server.mjs +35 -42
- package/dist/providers/local/lib/schema.d.mts +2 -2
- package/dist/providers/local/lib/schema.mjs +1 -1
- package/dist/providers/local/lib/search-params.d.mts +1 -1
- package/dist/providers/local/lib/service.server.d.mts +39 -16
- package/dist/providers/local/lib/upload.client.d.mts +4 -4
- package/dist/providers/local/lib/upload.client.mjs +1 -1
- package/dist/providers/local/lib/validators.d.mts +1403 -27
- package/dist/providers/local/lib/validators.mjs +38 -3
- package/package.json +3 -3
- package/src/providers/google/lib/router.server.ts +55 -51
- package/src/providers/google/lib/service.server.ts +1 -1
- package/src/providers/google/lib/validators.ts +23 -0
- package/src/providers/local/lib/route-handler.server.ts +12 -10
- package/src/providers/local/lib/router.server.ts +211 -117
- package/src/providers/local/lib/schema.ts +1 -1
- package/src/providers/local/lib/service.server.ts +1 -1
- package/src/providers/local/lib/upload.client.ts +6 -6
- package/src/providers/local/lib/validators.ts +58 -5
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { GoogleDrive } from "./service.server.mjs";
|
|
2
1
|
import { z } from "zod";
|
|
3
|
-
import { TDatabaseSchema } from "@tulip-systems/core/config";
|
|
4
|
-
import * as _tulip_systems_core_router_server0 from "@tulip-systems/core/router/server";
|
|
5
|
-
import * as _tulip_systems_core_data_tables_server0 from "@tulip-systems/core/data-tables/server";
|
|
6
|
-
import * as _orpc_server0 from "@orpc/server";
|
|
7
2
|
import * as _orpc_contract0 from "@orpc/contract";
|
|
8
3
|
|
|
9
4
|
//#region src/providers/google/lib/router.server.d.ts
|
|
10
|
-
declare
|
|
11
|
-
|
|
5
|
+
declare const googleDriveRouterContract: {
|
|
6
|
+
/**
|
|
7
|
+
* Get node with children
|
|
8
|
+
*/
|
|
9
|
+
getNodeWithChildren: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
12
10
|
id: z.ZodString;
|
|
13
11
|
namespace: z.ZodString;
|
|
14
12
|
}, z.core.$strip>, z.ZodNullable<z.ZodObject<{
|
|
@@ -18,8 +16,8 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
18
16
|
name: z.ZodString;
|
|
19
17
|
namespace: z.ZodString;
|
|
20
18
|
type: z.ZodEnum<{
|
|
21
|
-
file: "file";
|
|
22
19
|
folder: "folder";
|
|
20
|
+
file: "file";
|
|
23
21
|
}>;
|
|
24
22
|
subtype: z.ZodEnum<{
|
|
25
23
|
image: "image";
|
|
@@ -64,8 +62,8 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
64
62
|
name: z.ZodString;
|
|
65
63
|
namespace: z.ZodString;
|
|
66
64
|
type: z.ZodEnum<{
|
|
67
|
-
file: "file";
|
|
68
65
|
folder: "folder";
|
|
66
|
+
file: "file";
|
|
69
67
|
}>;
|
|
70
68
|
subtype: z.ZodEnum<{
|
|
71
69
|
image: "image";
|
|
@@ -105,7 +103,10 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
105
103
|
canEdit: z.ZodNullable<z.ZodBoolean>;
|
|
106
104
|
}, z.core.$strip>>;
|
|
107
105
|
}, z.core.$strip>>, Record<never, never>, Record<never, never>>;
|
|
108
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Get folders by parent id
|
|
108
|
+
*/
|
|
109
|
+
getNodesByParentId: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
109
110
|
sort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
110
111
|
search: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
111
112
|
order: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
@@ -114,8 +115,8 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
114
115
|
}>>>;
|
|
115
116
|
filters: z.ZodPipe<z.ZodObject<{
|
|
116
117
|
types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
117
|
-
file: "file";
|
|
118
118
|
folder: "folder";
|
|
119
|
+
file: "file";
|
|
119
120
|
}>>>>;
|
|
120
121
|
contentTypes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
121
122
|
nodeIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
@@ -126,13 +127,13 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
126
127
|
isArchived: boolean;
|
|
127
128
|
namespace: string;
|
|
128
129
|
parentId: string | null;
|
|
129
|
-
types?: ("
|
|
130
|
+
types?: ("folder" | "file")[] | null | undefined;
|
|
130
131
|
contentTypes?: string[] | null | undefined;
|
|
131
132
|
nodeIds?: string[] | null | undefined;
|
|
132
133
|
}, {
|
|
133
134
|
namespace: string;
|
|
134
135
|
parentId: string | null;
|
|
135
|
-
types?: ("
|
|
136
|
+
types?: ("folder" | "file")[] | null | undefined;
|
|
136
137
|
contentTypes?: string[] | null | undefined;
|
|
137
138
|
nodeIds?: string[] | null | undefined;
|
|
138
139
|
isArchived?: boolean | null | undefined;
|
|
@@ -144,8 +145,8 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
144
145
|
name: z.ZodString;
|
|
145
146
|
namespace: z.ZodString;
|
|
146
147
|
type: z.ZodEnum<{
|
|
147
|
-
file: "file";
|
|
148
148
|
folder: "folder";
|
|
149
|
+
file: "file";
|
|
149
150
|
}>;
|
|
150
151
|
subtype: z.ZodEnum<{
|
|
151
152
|
image: "image";
|
|
@@ -184,7 +185,10 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
184
185
|
googleParents: z.ZodArray<z.ZodString>;
|
|
185
186
|
canEdit: z.ZodNullable<z.ZodBoolean>;
|
|
186
187
|
}, z.core.$strip>>, Record<never, never>, Record<never, never>>;
|
|
187
|
-
|
|
188
|
+
/**
|
|
189
|
+
* List tree nodes with pagination and search.
|
|
190
|
+
*/
|
|
191
|
+
listTree: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
188
192
|
cursor: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>, z.ZodTransform<number, number>>;
|
|
189
193
|
limit: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>, z.ZodTransform<number, number>>;
|
|
190
194
|
sort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -195,8 +199,8 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
195
199
|
search: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
196
200
|
filters: z.ZodPipe<z.ZodObject<{
|
|
197
201
|
types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
198
|
-
file: "file";
|
|
199
202
|
folder: "folder";
|
|
203
|
+
file: "file";
|
|
200
204
|
}>>>>;
|
|
201
205
|
contentTypes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
202
206
|
nodeIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
@@ -207,151 +211,92 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
207
211
|
isArchived: boolean;
|
|
208
212
|
namespace: string;
|
|
209
213
|
parentId: string | null;
|
|
210
|
-
types?: ("
|
|
214
|
+
types?: ("folder" | "file")[] | null | undefined;
|
|
211
215
|
contentTypes?: string[] | null | undefined;
|
|
212
216
|
nodeIds?: string[] | null | undefined;
|
|
213
217
|
}, {
|
|
214
218
|
namespace: string;
|
|
215
219
|
parentId: string | null;
|
|
216
|
-
types?: ("
|
|
220
|
+
types?: ("folder" | "file")[] | null | undefined;
|
|
217
221
|
contentTypes?: string[] | null | undefined;
|
|
218
222
|
nodeIds?: string[] | null | undefined;
|
|
219
223
|
isArchived?: boolean | null | undefined;
|
|
220
224
|
}>>;
|
|
221
|
-
}, z.core.$strip>,
|
|
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
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
getFolderParents: _orpc_server0.DecoratedProcedure<_orpc_server0.MergedInitialContext<_tulip_systems_core_router_server0.RPCContext<TSchema> & Record<never, never>, _tulip_systems_core_router_server0.RPCContext<TSchema> & Record<never, never>, _tulip_systems_core_router_server0.RPCContext<TSchema>>, _orpc_server0.MergedCurrentContext<_tulip_systems_core_router_server0.RPCContext<TSchema>, _tulip_systems_core_router_server0.ProtectedRPCContext<TSchema>>, z.ZodObject<{
|
|
225
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
226
|
+
data: z.ZodArray<z.ZodObject<{
|
|
227
|
+
id: z.ZodString;
|
|
228
|
+
createdAt: z.ZodDate;
|
|
229
|
+
updatedAt: z.ZodDate;
|
|
230
|
+
name: z.ZodString;
|
|
231
|
+
namespace: z.ZodString;
|
|
232
|
+
type: z.ZodEnum<{
|
|
233
|
+
folder: "folder";
|
|
234
|
+
file: "file";
|
|
235
|
+
}>;
|
|
236
|
+
subtype: z.ZodEnum<{
|
|
237
|
+
image: "image";
|
|
238
|
+
document: "document";
|
|
239
|
+
spreadsheet: "spreadsheet";
|
|
240
|
+
video: "video";
|
|
241
|
+
audio: "audio";
|
|
242
|
+
archive: "archive";
|
|
243
|
+
other: "other";
|
|
244
|
+
}>;
|
|
245
|
+
size: z.ZodNullable<z.ZodNumber>;
|
|
246
|
+
contentType: z.ZodNullable<z.ZodString>;
|
|
247
|
+
readonly: z.ZodBoolean;
|
|
248
|
+
hidden: z.ZodBoolean;
|
|
249
|
+
archivedAt: z.ZodNullable<z.ZodDate>;
|
|
250
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
251
|
+
links: z.ZodObject<{
|
|
252
|
+
view: z.ZodNullable<z.ZodString>;
|
|
253
|
+
download: z.ZodNullable<z.ZodString>;
|
|
254
|
+
preview: z.ZodNullable<z.ZodString>;
|
|
255
|
+
thumbnail: z.ZodNullable<z.ZodString>;
|
|
256
|
+
}, z.core.$strip>;
|
|
257
|
+
availability: z.ZodEnum<{
|
|
258
|
+
ready: "ready";
|
|
259
|
+
pending: "pending";
|
|
260
|
+
failed: "failed";
|
|
261
|
+
}>;
|
|
262
|
+
provider: z.ZodLiteral<"google">;
|
|
263
|
+
googleDriveId: z.ZodNullable<z.ZodString>;
|
|
264
|
+
mimeType: z.ZodNullable<z.ZodString>;
|
|
265
|
+
webViewLink: z.ZodNullable<z.ZodString>;
|
|
266
|
+
webContentLink: z.ZodNullable<z.ZodString>;
|
|
267
|
+
thumbnailLink: z.ZodNullable<z.ZodString>;
|
|
268
|
+
trashed: z.ZodBoolean;
|
|
269
|
+
trashedAt: z.ZodNullable<z.ZodDate>;
|
|
270
|
+
googleParents: z.ZodArray<z.ZodString>;
|
|
271
|
+
canEdit: z.ZodNullable<z.ZodBoolean>;
|
|
272
|
+
}, z.core.$strip>>;
|
|
273
|
+
pagination: z.ZodObject<{
|
|
274
|
+
total: z.ZodNumber;
|
|
275
|
+
totalPages: z.ZodNumber;
|
|
276
|
+
limit: z.ZodNumber;
|
|
277
|
+
hasNextPage: z.ZodBoolean;
|
|
278
|
+
hasPreviousPage: z.ZodBoolean;
|
|
279
|
+
cursor: z.ZodNumber;
|
|
280
|
+
nextCursor: z.ZodNullable<z.ZodNumber>;
|
|
281
|
+
previousCursor: z.ZodNullable<z.ZodNumber>;
|
|
282
|
+
}, z.core.$strip>;
|
|
283
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
284
|
+
/**
|
|
285
|
+
* Get parents of a folder
|
|
286
|
+
*/
|
|
287
|
+
getFolderParents: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
285
288
|
id: z.ZodNullable<z.ZodString>;
|
|
286
289
|
namespace: z.ZodString;
|
|
287
|
-
}, z.core.$strip>,
|
|
288
|
-
id:
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
readonly: boolean;
|
|
298
|
-
hidden: boolean;
|
|
299
|
-
archivedAt: Date | null;
|
|
300
|
-
parentId: string | null;
|
|
301
|
-
links: {
|
|
302
|
-
view: string | null;
|
|
303
|
-
download: string | null;
|
|
304
|
-
preview: string | null;
|
|
305
|
-
thumbnail: string | null;
|
|
306
|
-
};
|
|
307
|
-
availability: "ready" | "pending" | "failed";
|
|
308
|
-
provider: "google";
|
|
309
|
-
googleDriveId: string | null;
|
|
310
|
-
mimeType: string | null;
|
|
311
|
-
webViewLink: string | null;
|
|
312
|
-
webContentLink: string | null;
|
|
313
|
-
thumbnailLink: string | null;
|
|
314
|
-
trashed: boolean;
|
|
315
|
-
trashedAt: Date | null;
|
|
316
|
-
googleParents: string[];
|
|
317
|
-
canEdit: boolean | null;
|
|
318
|
-
}, "name" | "parentId" | "id"> & {
|
|
319
|
-
depth: number;
|
|
320
|
-
})[], (Pick<{
|
|
321
|
-
id: string;
|
|
322
|
-
createdAt: Date;
|
|
323
|
-
updatedAt: Date;
|
|
324
|
-
name: string;
|
|
325
|
-
namespace: string;
|
|
326
|
-
type: "file" | "folder";
|
|
327
|
-
subtype: "image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other";
|
|
328
|
-
size: number | null;
|
|
329
|
-
contentType: string | null;
|
|
330
|
-
readonly: boolean;
|
|
331
|
-
hidden: boolean;
|
|
332
|
-
archivedAt: Date | null;
|
|
333
|
-
parentId: string | null;
|
|
334
|
-
links: {
|
|
335
|
-
view: string | null;
|
|
336
|
-
download: string | null;
|
|
337
|
-
preview: string | null;
|
|
338
|
-
thumbnail: string | null;
|
|
339
|
-
};
|
|
340
|
-
availability: "ready" | "pending" | "failed";
|
|
341
|
-
provider: "google";
|
|
342
|
-
googleDriveId: string | null;
|
|
343
|
-
mimeType: string | null;
|
|
344
|
-
webViewLink: string | null;
|
|
345
|
-
webContentLink: string | null;
|
|
346
|
-
thumbnailLink: string | null;
|
|
347
|
-
trashed: boolean;
|
|
348
|
-
trashedAt: Date | null;
|
|
349
|
-
googleParents: string[];
|
|
350
|
-
canEdit: boolean | null;
|
|
351
|
-
}, "name" | "parentId" | "id"> & {
|
|
352
|
-
depth: number;
|
|
353
|
-
})[]>, Record<never, never>, Record<never, never>>;
|
|
354
|
-
createFolder: _orpc_server0.DecoratedProcedure<_orpc_server0.MergedInitialContext<_tulip_systems_core_router_server0.RPCContext<TSchema> & Record<never, never>, _tulip_systems_core_router_server0.RPCContext<TSchema> & Record<never, never>, _tulip_systems_core_router_server0.RPCContext<TSchema>>, _orpc_server0.MergedCurrentContext<_tulip_systems_core_router_server0.RPCContext<TSchema>, _tulip_systems_core_router_server0.ProtectedRPCContext<TSchema>>, z.ZodObject<{
|
|
290
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
291
|
+
id: z.ZodString;
|
|
292
|
+
name: z.ZodString;
|
|
293
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
294
|
+
depth: z.ZodNumber;
|
|
295
|
+
}, z.core.$strip>>, Record<never, never>, Record<never, never>>;
|
|
296
|
+
/**
|
|
297
|
+
* Create a folder
|
|
298
|
+
*/
|
|
299
|
+
createFolder: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
355
300
|
name: z.ZodString;
|
|
356
301
|
namespace: z.ZodString;
|
|
357
302
|
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -362,8 +307,8 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
362
307
|
name: z.ZodString;
|
|
363
308
|
namespace: z.ZodString;
|
|
364
309
|
type: z.ZodEnum<{
|
|
365
|
-
file: "file";
|
|
366
310
|
folder: "folder";
|
|
311
|
+
file: "file";
|
|
367
312
|
}>;
|
|
368
313
|
subtype: z.ZodEnum<{
|
|
369
314
|
image: "image";
|
|
@@ -402,7 +347,10 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
402
347
|
googleParents: z.ZodArray<z.ZodString>;
|
|
403
348
|
canEdit: z.ZodNullable<z.ZodBoolean>;
|
|
404
349
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
405
|
-
|
|
350
|
+
/**
|
|
351
|
+
* Update node
|
|
352
|
+
*/
|
|
353
|
+
updateNode: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
406
354
|
id: z.ZodString;
|
|
407
355
|
data: z.ZodObject<{
|
|
408
356
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -415,8 +363,8 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
415
363
|
name: z.ZodString;
|
|
416
364
|
namespace: z.ZodString;
|
|
417
365
|
type: z.ZodEnum<{
|
|
418
|
-
file: "file";
|
|
419
366
|
folder: "folder";
|
|
367
|
+
file: "file";
|
|
420
368
|
}>;
|
|
421
369
|
subtype: z.ZodEnum<{
|
|
422
370
|
image: "image";
|
|
@@ -455,7 +403,10 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
455
403
|
googleParents: z.ZodArray<z.ZodString>;
|
|
456
404
|
canEdit: z.ZodNullable<z.ZodBoolean>;
|
|
457
405
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
458
|
-
|
|
406
|
+
/**
|
|
407
|
+
* Move node
|
|
408
|
+
*/
|
|
409
|
+
moveNode: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
459
410
|
id: z.ZodString;
|
|
460
411
|
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
461
412
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -465,8 +416,8 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
465
416
|
name: z.ZodString;
|
|
466
417
|
namespace: z.ZodString;
|
|
467
418
|
type: z.ZodEnum<{
|
|
468
|
-
file: "file";
|
|
469
419
|
folder: "folder";
|
|
420
|
+
file: "file";
|
|
470
421
|
}>;
|
|
471
422
|
subtype: z.ZodEnum<{
|
|
472
423
|
image: "image";
|
|
@@ -505,7 +456,10 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
505
456
|
googleParents: z.ZodArray<z.ZodString>;
|
|
506
457
|
canEdit: z.ZodNullable<z.ZodBoolean>;
|
|
507
458
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
508
|
-
|
|
459
|
+
/**
|
|
460
|
+
* Archive nodes
|
|
461
|
+
*/
|
|
462
|
+
archiveNodes: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
509
463
|
ids: z.ZodArray<z.ZodString>;
|
|
510
464
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
511
465
|
id: z.ZodString;
|
|
@@ -514,8 +468,8 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
514
468
|
name: z.ZodString;
|
|
515
469
|
namespace: z.ZodString;
|
|
516
470
|
type: z.ZodEnum<{
|
|
517
|
-
file: "file";
|
|
518
471
|
folder: "folder";
|
|
472
|
+
file: "file";
|
|
519
473
|
}>;
|
|
520
474
|
subtype: z.ZodEnum<{
|
|
521
475
|
image: "image";
|
|
@@ -554,7 +508,10 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
554
508
|
googleParents: z.ZodArray<z.ZodString>;
|
|
555
509
|
canEdit: z.ZodNullable<z.ZodBoolean>;
|
|
556
510
|
}, z.core.$strip>>, Record<never, never>, Record<never, never>>;
|
|
557
|
-
|
|
511
|
+
/**
|
|
512
|
+
* Restore nodes
|
|
513
|
+
*/
|
|
514
|
+
restoreNodes: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
558
515
|
ids: z.ZodArray<z.ZodString>;
|
|
559
516
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
560
517
|
id: z.ZodString;
|
|
@@ -563,8 +520,8 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
563
520
|
name: z.ZodString;
|
|
564
521
|
namespace: z.ZodString;
|
|
565
522
|
type: z.ZodEnum<{
|
|
566
|
-
file: "file";
|
|
567
523
|
folder: "folder";
|
|
524
|
+
file: "file";
|
|
568
525
|
}>;
|
|
569
526
|
subtype: z.ZodEnum<{
|
|
570
527
|
image: "image";
|
|
@@ -603,9 +560,12 @@ declare function createGoogleDriveProcedures<TSchema extends TDatabaseSchema>(dr
|
|
|
603
560
|
googleParents: z.ZodArray<z.ZodString>;
|
|
604
561
|
canEdit: z.ZodNullable<z.ZodBoolean>;
|
|
605
562
|
}, z.core.$strip>>, Record<never, never>, Record<never, never>>;
|
|
606
|
-
|
|
563
|
+
/**
|
|
564
|
+
* Delete nodes
|
|
565
|
+
*/
|
|
566
|
+
deleteNodes: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
607
567
|
ids: z.ZodArray<z.ZodString>;
|
|
608
568
|
}, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
|
|
609
569
|
};
|
|
610
570
|
//#endregion
|
|
611
|
-
export {
|
|
571
|
+
export { googleDriveRouterContract };
|
|
@@ -1,39 +1,33 @@
|
|
|
1
|
-
import { createGoogleDriveFolderInputSchema, getGoogleDriveNodesByParentIdInputSchema, googleDriveNodeSchema, googleDriveNodeWithChildrenSchema, listGoogleDriveTreeInputSchema, updateGoogleDriveNodeInputSchema } from "./validators.mjs";
|
|
1
|
+
import { createGoogleDriveFolderInputSchema, getGoogleDriveNodesByParentIdInputSchema, googleDriveNodeParentSchema, googleDriveNodeSchema, googleDriveNodeWithChildrenSchema, googleDriveTreeResponseSchema, listGoogleDriveTreeInputSchema, updateGoogleDriveNodeInputSchema } from "./validators.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import {
|
|
3
|
+
import { oc } from "@orpc/contract";
|
|
4
4
|
import { bulkActionSchema } from "@tulip-systems/core/router";
|
|
5
5
|
|
|
6
6
|
//#region src/providers/google/lib/router.server.ts
|
|
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
|
-
archiveNodes: protectedProcedure.input(bulkActionSchema).output(z.array(googleDriveNodeSchema)).handler(async ({ input }) => drive.archiveNodes(input.ids)),
|
|
33
|
-
restoreNodes: protectedProcedure.input(bulkActionSchema).output(z.array(googleDriveNodeSchema)).handler(async ({ input }) => drive.restoreNodes(input.ids)),
|
|
34
|
-
deleteNodes: protectedProcedure.input(bulkActionSchema).output(z.void()).handler(async ({ input }) => drive.deleteNodes(input.ids))
|
|
35
|
-
};
|
|
36
|
-
}
|
|
7
|
+
const googleDriveRouterContract = {
|
|
8
|
+
getNodeWithChildren: oc.input(z.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
namespace: z.string()
|
|
11
|
+
})).output(googleDriveNodeWithChildrenSchema.nullable()),
|
|
12
|
+
getNodesByParentId: oc.input(getGoogleDriveNodesByParentIdInputSchema).output(z.array(googleDriveNodeSchema)),
|
|
13
|
+
listTree: oc.input(listGoogleDriveTreeInputSchema).output(googleDriveTreeResponseSchema),
|
|
14
|
+
getFolderParents: oc.input(z.object({
|
|
15
|
+
id: z.string().nullable(),
|
|
16
|
+
namespace: z.string()
|
|
17
|
+
})).output(z.array(googleDriveNodeParentSchema)),
|
|
18
|
+
createFolder: oc.input(createGoogleDriveFolderInputSchema).output(googleDriveNodeSchema),
|
|
19
|
+
updateNode: oc.input(z.object({
|
|
20
|
+
id: z.string(),
|
|
21
|
+
data: updateGoogleDriveNodeInputSchema
|
|
22
|
+
})).output(googleDriveNodeSchema),
|
|
23
|
+
moveNode: oc.input(z.object({
|
|
24
|
+
id: z.string(),
|
|
25
|
+
parentId: z.string().nullish()
|
|
26
|
+
})).output(googleDriveNodeSchema),
|
|
27
|
+
archiveNodes: oc.input(bulkActionSchema).output(z.array(googleDriveNodeSchema)),
|
|
28
|
+
restoreNodes: oc.input(bulkActionSchema).output(z.array(googleDriveNodeSchema)),
|
|
29
|
+
deleteNodes: oc.input(bulkActionSchema).output(z.void())
|
|
30
|
+
};
|
|
37
31
|
|
|
38
32
|
//#endregion
|
|
39
|
-
export {
|
|
33
|
+
export { googleDriveRouterContract };
|
|
@@ -5,7 +5,7 @@ import * as nuqs_server0 from "nuqs/server";
|
|
|
5
5
|
* Filters
|
|
6
6
|
*/
|
|
7
7
|
declare const googleDriveTreeFilterSearchParams: {
|
|
8
|
-
readonly types: nuqs_server0.SingleParserBuilder<("
|
|
8
|
+
readonly types: nuqs_server0.SingleParserBuilder<("folder" | "file")[] | null>;
|
|
9
9
|
readonly contentTypes: nuqs_server0.SingleParserBuilder<string[] | null>;
|
|
10
10
|
readonly nodeIds: nuqs_server0.SingleParserBuilder<string[] | null>;
|
|
11
11
|
readonly isArchived: nuqs_server0.SingleParserBuilder<boolean | null>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DriveArchive, DriveDirectUpload, DriveNodeMutations, DriveReader } from "../../../lib/contracts.mjs";
|
|
2
2
|
import { CreateGoogleDriveFolderInput, GetGoogleDriveNodesByParentIdSchema, GoogleDriveNode, GoogleDriveNodeChild, GoogleDriveNodeWithChildren, ListGoogleDriveTreeSchema, UpdateGoogleDriveNodeInput, UploadGoogleDriveFileInput } from "./validators.mjs";
|
|
3
|
-
import { TDatabaseSchema } from "@tulip-systems/core/
|
|
3
|
+
import { TDatabaseSchema } from "@tulip-systems/core/database";
|
|
4
4
|
import { ObjectBodyInput } from "@tulip-systems/core/storage";
|
|
5
5
|
import { TableQueryResponse } from "@tulip-systems/core/data-tables/server";
|
|
6
6
|
import { drive_v3 } from "googleapis";
|