@tulip-systems/drive 0.8.1 → 0.8.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/client.d.mts +5 -0
- package/dist/client.mjs +6 -0
- package/dist/components/content.d.mts +13 -0
- package/dist/components/content.mjs +17 -0
- package/dist/components/context.client.d.mts +13 -0
- package/dist/components/dnd.client.d.mts +16 -0
- package/dist/components/dnd.client.mjs +29 -0
- package/dist/components/grid-card.client.d.mts +46 -0
- package/dist/components/grid-card.client.mjs +173 -0
- package/dist/components/grid.client.d.mts +53 -0
- package/dist/components/grid.client.mjs +53 -0
- package/dist/components/navigation/breadcrumbs.client.d.mts +25 -0
- package/dist/components/navigation/breadcrumbs.client.mjs +51 -0
- package/dist/components/navigation/header.client.d.mts +27 -0
- package/dist/components/navigation/header.client.mjs +40 -0
- package/dist/components/navigation/toolbar.client.d.mts +23 -0
- package/dist/components/navigation/toolbar.client.mjs +34 -0
- package/dist/components/navigation/view-switcher.client.d.mts +9 -0
- package/dist/components/navigation/view-switcher.client.mjs +35 -0
- package/dist/components/selection.client.d.mts +27 -0
- package/dist/components/selection.client.mjs +36 -0
- package/dist/components/view.client.d.mts +25 -0
- package/dist/components/view.client.mjs +43 -0
- package/dist/config/filters.mjs +14 -0
- package/dist/config/types.mjs +60 -0
- package/dist/google/client.d.mts +8 -0
- package/dist/google/client.mjs +9 -0
- package/dist/google/server.d.mts +3 -0
- package/dist/google/server.mjs +4 -0
- package/dist/google.d.mts +6 -0
- package/dist/google.mjs +7 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.mjs +7 -0
- package/dist/lib/constants.d.mts +11 -0
- package/dist/lib/constants.mjs +20 -0
- package/dist/lib/contracts.d.mts +100 -0
- package/dist/lib/dto.d.mts +117 -0
- package/dist/lib/dto.mjs +57 -0
- package/dist/lib/helpers.d.mts +17 -0
- package/dist/lib/helpers.mjs +36 -0
- package/dist/lib/helpers.server.d.mts +13 -0
- package/dist/lib/helpers.server.mjs +15 -0
- package/dist/lib/search-params.d.mts +8 -0
- package/dist/lib/search-params.mjs +7 -0
- package/dist/lib/validators.d.mts +157 -0
- package/dist/lib/validators.mjs +65 -0
- package/dist/local/client.d.mts +13 -0
- package/dist/local/client.mjs +13 -0
- package/dist/local/server.d.mts +4 -0
- package/dist/local/server.mjs +5 -0
- package/dist/local.d.mts +8 -0
- package/dist/local.mjs +9 -0
- package/dist/providers/google/components/command-file-update.d.mts +21 -0
- package/dist/providers/google/components/command-file-update.mjs +51 -0
- package/dist/providers/google/components/command-folder-create.d.mts +21 -0
- package/dist/providers/google/components/command-folder-create.mjs +58 -0
- package/dist/providers/google/components/command-folder-update.d.mts +21 -0
- package/dist/providers/google/components/command-folder-update.mjs +51 -0
- package/dist/providers/google/components/content.client.d.mts +9 -0
- package/dist/providers/google/components/content.client.mjs +10 -0
- package/dist/providers/google/components/navigation.client.d.mts +15 -0
- package/dist/providers/google/components/navigation.client.mjs +17 -0
- package/dist/providers/google/components/provider.client.d.mts +32 -0
- package/dist/providers/google/components/provider.client.mjs +42 -0
- package/dist/providers/google/components/view.client.d.mts +40 -0
- package/dist/providers/google/components/view.client.mjs +96 -0
- package/dist/providers/google/config/columns-data.d.mts +7 -0
- package/dist/providers/google/config/columns-data.mjs +69 -0
- package/dist/providers/google/config/filters.d.mts +15 -0
- package/dist/providers/google/config/filters.mjs +7 -0
- package/dist/providers/google/lib/constants.mjs +12 -0
- package/dist/providers/google/lib/dto.d.mts +38 -0
- package/dist/providers/google/lib/dto.mjs +65 -0
- package/dist/providers/google/lib/helpers.mjs +38 -0
- package/dist/providers/google/lib/router.server.d.mts +611 -0
- package/dist/providers/google/lib/router.server.mjs +39 -0
- package/dist/providers/google/lib/search-params.d.mts +14 -0
- package/dist/providers/google/lib/search-params.mjs +11 -0
- package/dist/providers/google/lib/service.server.d.mts +185 -0
- package/dist/providers/google/lib/service.server.mjs +610 -0
- package/dist/providers/google/lib/validators.d.mts +302 -0
- package/dist/providers/google/lib/validators.mjs +58 -0
- package/dist/providers/local/components/command-file-update.d.mts +17 -0
- package/dist/providers/local/components/command-file-update.mjs +47 -0
- package/dist/providers/local/components/command-file-upload.d.mts +10 -0
- package/dist/providers/local/components/command-file-upload.mjs +34 -0
- package/dist/providers/local/components/command-folder-create.d.mts +17 -0
- package/dist/providers/local/components/command-folder-create.mjs +54 -0
- package/dist/providers/local/components/command-folder-update.d.mts +17 -0
- package/dist/providers/local/components/command-folder-update.mjs +47 -0
- package/dist/providers/local/components/content.client.d.mts +6 -0
- package/dist/providers/local/components/content.client.mjs +7 -0
- package/dist/providers/local/components/navigation.client.d.mts +15 -0
- package/dist/providers/local/components/navigation.client.mjs +17 -0
- package/dist/providers/local/components/provider.client.d.mts +39 -0
- package/dist/providers/local/components/provider.client.mjs +60 -0
- package/dist/providers/local/components/upload-zone-context.client.d.mts +37 -0
- package/dist/providers/local/components/upload-zone-context.client.mjs +22 -0
- package/dist/providers/local/components/upload-zone.client.d.mts +29 -0
- package/dist/providers/local/components/upload-zone.client.mjs +146 -0
- package/dist/providers/local/components/view.client.d.mts +31 -0
- package/dist/providers/local/components/view.client.mjs +90 -0
- package/dist/providers/local/config/columns-data.d.mts +7 -0
- package/dist/providers/local/config/columns-data.mjs +69 -0
- package/dist/providers/local/config/filters.d.mts +25 -0
- package/dist/providers/local/config/filters.mjs +14 -0
- package/dist/providers/local/lib/constants.d.mts +11 -0
- package/dist/providers/local/lib/constants.mjs +28 -0
- package/dist/providers/local/lib/helpers.d.mts +44 -0
- package/dist/providers/local/lib/helpers.mjs +109 -0
- package/dist/providers/local/lib/route-handler.server.d.mts +33 -0
- package/dist/providers/local/lib/route-handler.server.mjs +113 -0
- package/dist/providers/local/lib/router.server.d.mts +41647 -0
- package/dist/providers/local/lib/router.server.mjs +51 -0
- package/dist/providers/local/lib/schema.d.mts +1112 -0
- package/dist/providers/local/lib/schema.mjs +70 -0
- package/dist/providers/local/lib/search-params.d.mts +13 -0
- package/dist/providers/local/lib/search-params.mjs +8 -0
- package/dist/providers/local/lib/service.server.d.mts +488 -0
- package/dist/providers/local/lib/service.server.mjs +667 -0
- package/dist/providers/local/lib/upload.client.d.mts +61 -0
- package/dist/providers/local/lib/upload.client.mjs +99 -0
- package/dist/providers/local/lib/validators.d.mts +453 -0
- package/dist/providers/local/lib/validators.mjs +95 -0
- package/dist/server.d.mts +2 -0
- package/dist/server.mjs +3 -0
- package/package.json +45 -46
- package/src/components/grid-card.client.tsx +17 -12
- package/src/components/selection.client.tsx +1 -2
- package/src/config/types.tsx +1 -1
- package/src/providers/google/components/command-file-update.tsx +2 -2
- package/src/providers/google/components/command-folder-create.tsx +2 -2
- package/src/providers/google/components/command-folder-update.tsx +2 -2
- package/src/providers/google/components/view.client.tsx +1 -7
- package/src/providers/google/lib/helpers.ts +0 -9
- package/src/providers/google/lib/service.server.ts +1 -3
- package/src/providers/local/components/command-file-update.tsx +2 -2
- package/src/providers/local/components/command-folder-create.tsx +2 -2
- package/src/providers/local/components/command-folder-update.tsx +2 -2
- package/src/providers/local/components/upload-zone.client.tsx +1 -1
- package/src/providers/local/lib/helpers.ts +0 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { LocalDriveFileNode, LocalDriveNode, PresignLocalDriveFileInput, UpdateLocalDriveNodeInput } from "./validators.mjs";
|
|
2
|
+
import { StorageAsset } from "@tulip-systems/core/storage";
|
|
3
|
+
import { BulkActionSchema } from "@tulip-systems/core/router";
|
|
4
|
+
|
|
5
|
+
//#region src/providers/local/lib/upload.client.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Upload request
|
|
8
|
+
*/
|
|
9
|
+
type PrepareLocalDriveUploadInput = Omit<LocalDriveUploadFileRequest, "name" | "size" | "contentType">;
|
|
10
|
+
type LocalDriveUploadFileRequest = PresignLocalDriveFileInput & {
|
|
11
|
+
file: File;
|
|
12
|
+
};
|
|
13
|
+
type LocalDriveUploadHooks = {
|
|
14
|
+
beforePresign?: (input: LocalDriveUploadFileRequest) => Promise<void> | void;
|
|
15
|
+
afterPresign?: (presignResult: {
|
|
16
|
+
asset: Omit<StorageAsset, "presignedUrl">;
|
|
17
|
+
node: LocalDriveFileNode;
|
|
18
|
+
uploadId: string;
|
|
19
|
+
presignedUrl: string;
|
|
20
|
+
}) => Promise<void> | void;
|
|
21
|
+
beforeConfirm?: (presignResult: {
|
|
22
|
+
asset: Omit<StorageAsset, "presignedUrl">;
|
|
23
|
+
node: LocalDriveFileNode;
|
|
24
|
+
uploadId: string;
|
|
25
|
+
presignedUrl: string;
|
|
26
|
+
}) => Promise<void> | void;
|
|
27
|
+
afterConfirm?: (node: LocalDriveFileNode) => Promise<void> | void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Upload client
|
|
31
|
+
*/
|
|
32
|
+
type LocalDriveUploadClient = {
|
|
33
|
+
prepareUpload: (input: PrepareLocalDriveUploadInput) => LocalDriveUploadFileRequest;
|
|
34
|
+
upload: (input: LocalDriveUploadFileRequest, hooks?: LocalDriveUploadHooks) => Promise<LocalDriveFileNode>;
|
|
35
|
+
deleteFiles: (ids: string[]) => Promise<void>;
|
|
36
|
+
updateNode: (id: string, data: UpdateLocalDriveNodeInput) => Promise<LocalDriveNode>;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Create upload client
|
|
40
|
+
*/
|
|
41
|
+
type CreateLocalDriveUploadClientProps = {
|
|
42
|
+
endpoints: {
|
|
43
|
+
presignUpload: (input: PresignLocalDriveFileInput) => Promise<{
|
|
44
|
+
asset: Omit<StorageAsset, "presignedUrl">;
|
|
45
|
+
node: LocalDriveFileNode;
|
|
46
|
+
uploadId: string;
|
|
47
|
+
presignedUrl: string;
|
|
48
|
+
}>;
|
|
49
|
+
confirmUpload: (input: {
|
|
50
|
+
uploadId: string;
|
|
51
|
+
}) => Promise<LocalDriveFileNode>;
|
|
52
|
+
deleteNodes: (input: BulkActionSchema) => Promise<void>;
|
|
53
|
+
updateNode: (input: {
|
|
54
|
+
id: string;
|
|
55
|
+
data: UpdateLocalDriveNodeInput;
|
|
56
|
+
}) => Promise<LocalDriveNode>;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
declare function createLocalDriveUploadClient(props: CreateLocalDriveUploadClientProps): LocalDriveUploadClient;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { LocalDriveUploadClient, LocalDriveUploadFileRequest, LocalDriveUploadHooks, PrepareLocalDriveUploadInput, createLocalDriveUploadClient };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { generateDefaultUUID } from "@tulip-systems/core/config";
|
|
2
|
+
|
|
3
|
+
//#region src/providers/local/lib/upload.client.ts
|
|
4
|
+
function createLocalDriveUploadClient(props) {
|
|
5
|
+
/**
|
|
6
|
+
* Create input schema for the upload method
|
|
7
|
+
* @param {PrepareLocalDriveUploadInput} input
|
|
8
|
+
* @returns {LocalDriveUploadFileRequest}
|
|
9
|
+
*/
|
|
10
|
+
function prepareUpload(input) {
|
|
11
|
+
return {
|
|
12
|
+
...input,
|
|
13
|
+
uploadId: input.uploadId ?? generateDefaultUUID(),
|
|
14
|
+
name: input.file.name,
|
|
15
|
+
size: input.file.size,
|
|
16
|
+
contentType: input.file.type
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Upload file to the server
|
|
21
|
+
* @param {LocalDriveUploadFileRequest} input
|
|
22
|
+
* @returns {Promise<LocalDriveFileNode>}
|
|
23
|
+
*/
|
|
24
|
+
async function upload(input, hooks) {
|
|
25
|
+
let presignResult = null;
|
|
26
|
+
try {
|
|
27
|
+
/**
|
|
28
|
+
* Presign
|
|
29
|
+
*/
|
|
30
|
+
await hooks?.beforePresign?.(input);
|
|
31
|
+
const { file, ...presignInput } = input;
|
|
32
|
+
presignResult = await props.endpoints.presignUpload(presignInput);
|
|
33
|
+
await hooks?.afterPresign?.(presignResult);
|
|
34
|
+
/**
|
|
35
|
+
* Upload the file
|
|
36
|
+
*/
|
|
37
|
+
const uploadResponse = await fetch(presignResult.presignedUrl, {
|
|
38
|
+
method: "PUT",
|
|
39
|
+
headers: { "Content-Type": input.file.type },
|
|
40
|
+
body: input.file
|
|
41
|
+
});
|
|
42
|
+
if (!uploadResponse.ok) {
|
|
43
|
+
const message = await uploadResponse.text();
|
|
44
|
+
throw new Error(`Upload failed: ${message}`);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Confirm
|
|
48
|
+
*/
|
|
49
|
+
await hooks?.beforeConfirm?.(presignResult);
|
|
50
|
+
const node = await props.endpoints.confirmUpload({ uploadId: presignResult.uploadId });
|
|
51
|
+
await hooks?.afterConfirm?.(node);
|
|
52
|
+
/**
|
|
53
|
+
* Return
|
|
54
|
+
*/
|
|
55
|
+
return node;
|
|
56
|
+
} catch (err) {
|
|
57
|
+
console.error("Upload error: ", err);
|
|
58
|
+
/**
|
|
59
|
+
* Delete if upload failed
|
|
60
|
+
* */
|
|
61
|
+
try {
|
|
62
|
+
if (presignResult?.node.id) await deleteFiles([presignResult.node.id]);
|
|
63
|
+
} catch (cleanupErr) {
|
|
64
|
+
console.error("Cleanup delete failed:", cleanupErr);
|
|
65
|
+
}
|
|
66
|
+
throw err;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Delete files
|
|
71
|
+
* @param {string[]} ids
|
|
72
|
+
*/
|
|
73
|
+
async function deleteFiles(ids) {
|
|
74
|
+
await props.endpoints.deleteNodes({ ids });
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Update node
|
|
78
|
+
* @param {string} id
|
|
79
|
+
* @param {UpdateLocalDriveNodeInput} data
|
|
80
|
+
*/
|
|
81
|
+
async function updateNode(id, data) {
|
|
82
|
+
return props.endpoints.updateNode({
|
|
83
|
+
id,
|
|
84
|
+
data
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Upload client
|
|
89
|
+
*/
|
|
90
|
+
return {
|
|
91
|
+
prepareUpload,
|
|
92
|
+
upload,
|
|
93
|
+
deleteFiles,
|
|
94
|
+
updateNode
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
//#endregion
|
|
99
|
+
export { createLocalDriveUploadClient };
|
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
import { DriveNodeChild } from "../../../lib/dto.mjs";
|
|
2
|
+
import { nodes } from "./schema.mjs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { StorageAsset } from "@tulip-systems/core/storage";
|
|
5
|
+
|
|
6
|
+
//#region src/providers/local/lib/validators.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Nodes
|
|
9
|
+
*/
|
|
10
|
+
type LocalNode = typeof nodes.$inferSelect;
|
|
11
|
+
declare const localDriveNodeSchema: z.ZodObject<{
|
|
12
|
+
id: z.ZodString;
|
|
13
|
+
createdAt: z.ZodDate;
|
|
14
|
+
updatedAt: z.ZodDate;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
namespace: z.ZodString;
|
|
17
|
+
type: z.ZodEnum<{
|
|
18
|
+
file: "file";
|
|
19
|
+
folder: "folder";
|
|
20
|
+
}>;
|
|
21
|
+
subtype: z.ZodEnum<{
|
|
22
|
+
image: "image";
|
|
23
|
+
document: "document";
|
|
24
|
+
spreadsheet: "spreadsheet";
|
|
25
|
+
video: "video";
|
|
26
|
+
audio: "audio";
|
|
27
|
+
archive: "archive";
|
|
28
|
+
other: "other";
|
|
29
|
+
}>;
|
|
30
|
+
size: z.ZodNullable<z.ZodNumber>;
|
|
31
|
+
contentType: z.ZodNullable<z.ZodString>;
|
|
32
|
+
readonly: z.ZodBoolean;
|
|
33
|
+
hidden: z.ZodBoolean;
|
|
34
|
+
archivedAt: z.ZodNullable<z.ZodDate>;
|
|
35
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
36
|
+
links: z.ZodObject<{
|
|
37
|
+
view: z.ZodNullable<z.ZodString>;
|
|
38
|
+
download: z.ZodNullable<z.ZodString>;
|
|
39
|
+
preview: z.ZodNullable<z.ZodString>;
|
|
40
|
+
thumbnail: z.ZodNullable<z.ZodString>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
availability: z.ZodEnum<{
|
|
43
|
+
ready: "ready";
|
|
44
|
+
pending: "pending";
|
|
45
|
+
failed: "failed";
|
|
46
|
+
}>;
|
|
47
|
+
provider: z.ZodLiteral<"local">;
|
|
48
|
+
assetId: z.ZodNullable<z.ZodString>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
type LocalDriveNode = z.infer<typeof localDriveNodeSchema>;
|
|
51
|
+
type LocalDriveFileNode = LocalDriveNode & {
|
|
52
|
+
type: "file";
|
|
53
|
+
};
|
|
54
|
+
type LocalDriveFolderNode = LocalDriveNode & {
|
|
55
|
+
type: "folder";
|
|
56
|
+
};
|
|
57
|
+
type LocalDriveNodeChild = DriveNodeChild<LocalDriveNode>;
|
|
58
|
+
type LocalDriveNodeWithAsset = LocalDriveNode & {
|
|
59
|
+
asset: StorageAsset | null;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Node with children
|
|
63
|
+
*/
|
|
64
|
+
declare const localDriveNodeWithChildrenSchema: z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
createdAt: z.ZodDate;
|
|
67
|
+
updatedAt: z.ZodDate;
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
namespace: z.ZodString;
|
|
70
|
+
type: z.ZodEnum<{
|
|
71
|
+
file: "file";
|
|
72
|
+
folder: "folder";
|
|
73
|
+
}>;
|
|
74
|
+
subtype: z.ZodEnum<{
|
|
75
|
+
image: "image";
|
|
76
|
+
document: "document";
|
|
77
|
+
spreadsheet: "spreadsheet";
|
|
78
|
+
video: "video";
|
|
79
|
+
audio: "audio";
|
|
80
|
+
archive: "archive";
|
|
81
|
+
other: "other";
|
|
82
|
+
}>;
|
|
83
|
+
size: z.ZodNullable<z.ZodNumber>;
|
|
84
|
+
contentType: z.ZodNullable<z.ZodString>;
|
|
85
|
+
readonly: z.ZodBoolean;
|
|
86
|
+
hidden: z.ZodBoolean;
|
|
87
|
+
archivedAt: z.ZodNullable<z.ZodDate>;
|
|
88
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
89
|
+
links: z.ZodObject<{
|
|
90
|
+
view: z.ZodNullable<z.ZodString>;
|
|
91
|
+
download: z.ZodNullable<z.ZodString>;
|
|
92
|
+
preview: z.ZodNullable<z.ZodString>;
|
|
93
|
+
thumbnail: z.ZodNullable<z.ZodString>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
availability: z.ZodEnum<{
|
|
96
|
+
ready: "ready";
|
|
97
|
+
pending: "pending";
|
|
98
|
+
failed: "failed";
|
|
99
|
+
}>;
|
|
100
|
+
provider: z.ZodLiteral<"local">;
|
|
101
|
+
assetId: z.ZodNullable<z.ZodString>;
|
|
102
|
+
children: z.ZodArray<z.ZodObject<{
|
|
103
|
+
id: z.ZodString;
|
|
104
|
+
createdAt: z.ZodDate;
|
|
105
|
+
updatedAt: z.ZodDate;
|
|
106
|
+
name: z.ZodString;
|
|
107
|
+
namespace: z.ZodString;
|
|
108
|
+
type: z.ZodEnum<{
|
|
109
|
+
file: "file";
|
|
110
|
+
folder: "folder";
|
|
111
|
+
}>;
|
|
112
|
+
subtype: z.ZodEnum<{
|
|
113
|
+
image: "image";
|
|
114
|
+
document: "document";
|
|
115
|
+
spreadsheet: "spreadsheet";
|
|
116
|
+
video: "video";
|
|
117
|
+
audio: "audio";
|
|
118
|
+
archive: "archive";
|
|
119
|
+
other: "other";
|
|
120
|
+
}>;
|
|
121
|
+
size: z.ZodNullable<z.ZodNumber>;
|
|
122
|
+
contentType: z.ZodNullable<z.ZodString>;
|
|
123
|
+
readonly: z.ZodBoolean;
|
|
124
|
+
hidden: z.ZodBoolean;
|
|
125
|
+
archivedAt: z.ZodNullable<z.ZodDate>;
|
|
126
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
127
|
+
links: z.ZodObject<{
|
|
128
|
+
view: z.ZodNullable<z.ZodString>;
|
|
129
|
+
download: z.ZodNullable<z.ZodString>;
|
|
130
|
+
preview: z.ZodNullable<z.ZodString>;
|
|
131
|
+
thumbnail: z.ZodNullable<z.ZodString>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
availability: z.ZodEnum<{
|
|
134
|
+
ready: "ready";
|
|
135
|
+
pending: "pending";
|
|
136
|
+
failed: "failed";
|
|
137
|
+
}>;
|
|
138
|
+
provider: z.ZodLiteral<"local">;
|
|
139
|
+
assetId: z.ZodNullable<z.ZodString>;
|
|
140
|
+
}, z.core.$strip>>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
type LocalDriveNodeWithChildren = z.infer<typeof localDriveNodeWithChildrenSchema>;
|
|
143
|
+
/**
|
|
144
|
+
* Create folder
|
|
145
|
+
*/
|
|
146
|
+
declare const createLocalDriveFolderInputSchema: z.ZodObject<{
|
|
147
|
+
name: z.ZodString;
|
|
148
|
+
namespace: z.ZodString;
|
|
149
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
150
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
151
|
+
readonly: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
type CreateLocalDriveFolderInput = z.input<typeof createLocalDriveFolderInputSchema>;
|
|
154
|
+
type CreateLocalDriveFolderSchema = z.infer<typeof createLocalDriveFolderInputSchema>;
|
|
155
|
+
/**
|
|
156
|
+
* Update node
|
|
157
|
+
*/
|
|
158
|
+
declare const updateLocalDriveNodeInputSchema: z.ZodObject<{
|
|
159
|
+
name: z.ZodOptional<z.ZodString>;
|
|
160
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
161
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
162
|
+
readonly: z.ZodOptional<z.ZodBoolean>;
|
|
163
|
+
archivedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
type UpdateLocalDriveNodeInput = z.input<typeof updateLocalDriveNodeInputSchema>;
|
|
166
|
+
/**
|
|
167
|
+
* Upload file
|
|
168
|
+
*/
|
|
169
|
+
declare const uploadLocalDriveFileInputSchema: z.ZodObject<{
|
|
170
|
+
name: z.ZodString;
|
|
171
|
+
namespace: z.ZodString;
|
|
172
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
173
|
+
contentType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
174
|
+
size: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
175
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
readonly: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
type UploadLocalDriveFileSchema = z.infer<typeof uploadLocalDriveFileInputSchema>;
|
|
179
|
+
/**
|
|
180
|
+
* Presign file
|
|
181
|
+
*/
|
|
182
|
+
declare const presignLocalDriveFileInputSchema: z.ZodObject<{
|
|
183
|
+
name: z.ZodString;
|
|
184
|
+
namespace: z.ZodString;
|
|
185
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
186
|
+
contentType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
187
|
+
size: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
188
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
189
|
+
readonly: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
+
uploadId: z.ZodOptional<z.ZodUUID>;
|
|
191
|
+
visibility: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
192
|
+
private: "private";
|
|
193
|
+
public: "public";
|
|
194
|
+
}>>>;
|
|
195
|
+
}, z.core.$strip>;
|
|
196
|
+
type PresignLocalDriveFileInput = z.input<typeof presignLocalDriveFileInputSchema>;
|
|
197
|
+
/**
|
|
198
|
+
* Get file url schema
|
|
199
|
+
*/
|
|
200
|
+
declare const getLocalFileURLSchemaDefaults: {
|
|
201
|
+
readonly variant: "main";
|
|
202
|
+
readonly disposition: "inline";
|
|
203
|
+
};
|
|
204
|
+
declare const getLocalFileURLSchema: z.ZodObject<{
|
|
205
|
+
disposition: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
206
|
+
inline: "inline";
|
|
207
|
+
attachment: "attachment";
|
|
208
|
+
}>>>;
|
|
209
|
+
variant: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
210
|
+
[x: `preview-${number}`]: `preview-${number}`;
|
|
211
|
+
main: "main";
|
|
212
|
+
}>>>;
|
|
213
|
+
}, z.core.$strip>;
|
|
214
|
+
type GetLocalFileURLSchema = z.infer<typeof getLocalFileURLSchema>;
|
|
215
|
+
/**
|
|
216
|
+
* Tree filters
|
|
217
|
+
*/
|
|
218
|
+
declare const localDriveTreeFiltersSchema: z.ZodPipe<z.ZodObject<{
|
|
219
|
+
subtypes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
220
|
+
image: "image";
|
|
221
|
+
document: "document";
|
|
222
|
+
spreadsheet: "spreadsheet";
|
|
223
|
+
video: "video";
|
|
224
|
+
audio: "audio";
|
|
225
|
+
archive: "archive";
|
|
226
|
+
other: "other";
|
|
227
|
+
}>>>>;
|
|
228
|
+
hidden: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
229
|
+
types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
230
|
+
file: "file";
|
|
231
|
+
folder: "folder";
|
|
232
|
+
}>>>>;
|
|
233
|
+
contentTypes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
234
|
+
nodeIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
235
|
+
isArchived: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
236
|
+
namespace: z.ZodString;
|
|
237
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
238
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
239
|
+
hidden: boolean;
|
|
240
|
+
isArchived: boolean;
|
|
241
|
+
namespace: string;
|
|
242
|
+
parentId: string | null;
|
|
243
|
+
subtypes?: ("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[] | null | undefined;
|
|
244
|
+
types?: ("file" | "folder")[] | null | undefined;
|
|
245
|
+
contentTypes?: string[] | null | undefined;
|
|
246
|
+
nodeIds?: string[] | null | undefined;
|
|
247
|
+
}, {
|
|
248
|
+
namespace: string;
|
|
249
|
+
parentId: string | null;
|
|
250
|
+
subtypes?: ("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[] | null | undefined;
|
|
251
|
+
hidden?: boolean | null | undefined;
|
|
252
|
+
types?: ("file" | "folder")[] | null | undefined;
|
|
253
|
+
contentTypes?: string[] | null | undefined;
|
|
254
|
+
nodeIds?: string[] | null | undefined;
|
|
255
|
+
isArchived?: boolean | null | undefined;
|
|
256
|
+
}>>;
|
|
257
|
+
type LocalDriveTableFilters = z.input<typeof localDriveTreeFiltersSchema>;
|
|
258
|
+
/**
|
|
259
|
+
* Flat filters
|
|
260
|
+
*/
|
|
261
|
+
declare const localDriveFlatFiltersSchema: z.ZodPipe<z.ZodObject<{
|
|
262
|
+
subtypes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
263
|
+
image: "image";
|
|
264
|
+
document: "document";
|
|
265
|
+
spreadsheet: "spreadsheet";
|
|
266
|
+
video: "video";
|
|
267
|
+
audio: "audio";
|
|
268
|
+
archive: "archive";
|
|
269
|
+
other: "other";
|
|
270
|
+
}>>>>;
|
|
271
|
+
hidden: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
272
|
+
types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
273
|
+
file: "file";
|
|
274
|
+
folder: "folder";
|
|
275
|
+
}>>>>;
|
|
276
|
+
contentTypes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
277
|
+
nodeIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
278
|
+
isArchived: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
279
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
280
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
281
|
+
hidden: boolean;
|
|
282
|
+
isArchived: boolean;
|
|
283
|
+
subtypes?: ("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[] | null | undefined;
|
|
284
|
+
types?: ("file" | "folder")[] | null | undefined;
|
|
285
|
+
contentTypes?: string[] | null | undefined;
|
|
286
|
+
nodeIds?: string[] | null | undefined;
|
|
287
|
+
namespace?: string | undefined;
|
|
288
|
+
}, {
|
|
289
|
+
subtypes?: ("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[] | null | undefined;
|
|
290
|
+
hidden?: boolean | null | undefined;
|
|
291
|
+
types?: ("file" | "folder")[] | null | undefined;
|
|
292
|
+
contentTypes?: string[] | null | undefined;
|
|
293
|
+
nodeIds?: string[] | null | undefined;
|
|
294
|
+
isArchived?: boolean | null | undefined;
|
|
295
|
+
namespace?: string | undefined;
|
|
296
|
+
}>>;
|
|
297
|
+
/**
|
|
298
|
+
* List tree input schema
|
|
299
|
+
*/
|
|
300
|
+
declare const listLocalDriveTreeInputSchema: z.ZodObject<{
|
|
301
|
+
cursor: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>, z.ZodTransform<number, number>>;
|
|
302
|
+
limit: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>, z.ZodTransform<number, number>>;
|
|
303
|
+
sort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
304
|
+
order: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
305
|
+
asc: "asc";
|
|
306
|
+
desc: "desc";
|
|
307
|
+
}>>>;
|
|
308
|
+
search: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
309
|
+
filters: z.ZodPipe<z.ZodObject<{
|
|
310
|
+
subtypes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
311
|
+
image: "image";
|
|
312
|
+
document: "document";
|
|
313
|
+
spreadsheet: "spreadsheet";
|
|
314
|
+
video: "video";
|
|
315
|
+
audio: "audio";
|
|
316
|
+
archive: "archive";
|
|
317
|
+
other: "other";
|
|
318
|
+
}>>>>;
|
|
319
|
+
hidden: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
320
|
+
types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
321
|
+
file: "file";
|
|
322
|
+
folder: "folder";
|
|
323
|
+
}>>>>;
|
|
324
|
+
contentTypes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
325
|
+
nodeIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
326
|
+
isArchived: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
327
|
+
namespace: z.ZodString;
|
|
328
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
329
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
330
|
+
hidden: boolean;
|
|
331
|
+
isArchived: boolean;
|
|
332
|
+
namespace: string;
|
|
333
|
+
parentId: string | null;
|
|
334
|
+
subtypes?: ("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[] | null | undefined;
|
|
335
|
+
types?: ("file" | "folder")[] | null | undefined;
|
|
336
|
+
contentTypes?: string[] | null | undefined;
|
|
337
|
+
nodeIds?: string[] | null | undefined;
|
|
338
|
+
}, {
|
|
339
|
+
namespace: string;
|
|
340
|
+
parentId: string | null;
|
|
341
|
+
subtypes?: ("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[] | null | undefined;
|
|
342
|
+
hidden?: boolean | null | undefined;
|
|
343
|
+
types?: ("file" | "folder")[] | null | undefined;
|
|
344
|
+
contentTypes?: string[] | null | undefined;
|
|
345
|
+
nodeIds?: string[] | null | undefined;
|
|
346
|
+
isArchived?: boolean | null | undefined;
|
|
347
|
+
}>>;
|
|
348
|
+
}, z.core.$strip>;
|
|
349
|
+
type ListLocalDriveTreeInput = z.input<typeof listLocalDriveTreeInputSchema>;
|
|
350
|
+
type ListLocalDriveTreeSchema = z.infer<typeof listLocalDriveTreeInputSchema>;
|
|
351
|
+
/**
|
|
352
|
+
* List flat input schema
|
|
353
|
+
*/
|
|
354
|
+
declare const listLocalDriveFlatInputSchema: z.ZodObject<{
|
|
355
|
+
cursor: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>, z.ZodTransform<number, number>>;
|
|
356
|
+
limit: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>, z.ZodTransform<number, number>>;
|
|
357
|
+
sort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
358
|
+
order: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
359
|
+
asc: "asc";
|
|
360
|
+
desc: "desc";
|
|
361
|
+
}>>>;
|
|
362
|
+
search: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
363
|
+
filters: z.ZodPipe<z.ZodObject<{
|
|
364
|
+
subtypes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
365
|
+
image: "image";
|
|
366
|
+
document: "document";
|
|
367
|
+
spreadsheet: "spreadsheet";
|
|
368
|
+
video: "video";
|
|
369
|
+
audio: "audio";
|
|
370
|
+
archive: "archive";
|
|
371
|
+
other: "other";
|
|
372
|
+
}>>>>;
|
|
373
|
+
hidden: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
374
|
+
types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
375
|
+
file: "file";
|
|
376
|
+
folder: "folder";
|
|
377
|
+
}>>>>;
|
|
378
|
+
contentTypes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
379
|
+
nodeIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
380
|
+
isArchived: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
381
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
382
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
383
|
+
hidden: boolean;
|
|
384
|
+
isArchived: boolean;
|
|
385
|
+
subtypes?: ("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[] | null | undefined;
|
|
386
|
+
types?: ("file" | "folder")[] | null | undefined;
|
|
387
|
+
contentTypes?: string[] | null | undefined;
|
|
388
|
+
nodeIds?: string[] | null | undefined;
|
|
389
|
+
namespace?: string | undefined;
|
|
390
|
+
}, {
|
|
391
|
+
subtypes?: ("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[] | null | undefined;
|
|
392
|
+
hidden?: boolean | null | undefined;
|
|
393
|
+
types?: ("file" | "folder")[] | null | undefined;
|
|
394
|
+
contentTypes?: string[] | null | undefined;
|
|
395
|
+
nodeIds?: string[] | null | undefined;
|
|
396
|
+
isArchived?: boolean | null | undefined;
|
|
397
|
+
namespace?: string | undefined;
|
|
398
|
+
}>>;
|
|
399
|
+
}, z.core.$strip>;
|
|
400
|
+
type ListLocalDriveFlatSchema = z.infer<typeof listLocalDriveFlatInputSchema>;
|
|
401
|
+
/**
|
|
402
|
+
* Get by parent id input
|
|
403
|
+
*/
|
|
404
|
+
declare const getLocalDriveNodesByParentIdInputSchema: z.ZodObject<{
|
|
405
|
+
sort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
406
|
+
search: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
407
|
+
order: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
408
|
+
asc: "asc";
|
|
409
|
+
desc: "desc";
|
|
410
|
+
}>>>;
|
|
411
|
+
filters: z.ZodPipe<z.ZodObject<{
|
|
412
|
+
subtypes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
413
|
+
image: "image";
|
|
414
|
+
document: "document";
|
|
415
|
+
spreadsheet: "spreadsheet";
|
|
416
|
+
video: "video";
|
|
417
|
+
audio: "audio";
|
|
418
|
+
archive: "archive";
|
|
419
|
+
other: "other";
|
|
420
|
+
}>>>>;
|
|
421
|
+
hidden: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
422
|
+
types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
423
|
+
file: "file";
|
|
424
|
+
folder: "folder";
|
|
425
|
+
}>>>>;
|
|
426
|
+
contentTypes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
427
|
+
nodeIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
428
|
+
isArchived: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
429
|
+
namespace: z.ZodString;
|
|
430
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
431
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
432
|
+
hidden: boolean;
|
|
433
|
+
isArchived: boolean;
|
|
434
|
+
namespace: string;
|
|
435
|
+
parentId: string | null;
|
|
436
|
+
subtypes?: ("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[] | null | undefined;
|
|
437
|
+
types?: ("file" | "folder")[] | null | undefined;
|
|
438
|
+
contentTypes?: string[] | null | undefined;
|
|
439
|
+
nodeIds?: string[] | null | undefined;
|
|
440
|
+
}, {
|
|
441
|
+
namespace: string;
|
|
442
|
+
parentId: string | null;
|
|
443
|
+
subtypes?: ("image" | "document" | "spreadsheet" | "video" | "audio" | "archive" | "other")[] | null | undefined;
|
|
444
|
+
hidden?: boolean | null | undefined;
|
|
445
|
+
types?: ("file" | "folder")[] | null | undefined;
|
|
446
|
+
contentTypes?: string[] | null | undefined;
|
|
447
|
+
nodeIds?: string[] | null | undefined;
|
|
448
|
+
isArchived?: boolean | null | undefined;
|
|
449
|
+
}>>;
|
|
450
|
+
}, z.core.$strip>;
|
|
451
|
+
type GetLocalDriveNodesByParentIdInput = z.input<typeof getLocalDriveNodesByParentIdInputSchema>;
|
|
452
|
+
//#endregion
|
|
453
|
+
export { CreateLocalDriveFolderInput, CreateLocalDriveFolderSchema, GetLocalDriveNodesByParentIdInput, GetLocalFileURLSchema, ListLocalDriveFlatSchema, ListLocalDriveTreeInput, ListLocalDriveTreeSchema, LocalDriveFileNode, LocalDriveFolderNode, LocalDriveNode, LocalDriveNodeChild, LocalDriveNodeWithAsset, LocalDriveNodeWithChildren, LocalDriveTableFilters, LocalNode, PresignLocalDriveFileInput, UpdateLocalDriveNodeInput, UploadLocalDriveFileSchema, createLocalDriveFolderInputSchema, getLocalDriveNodesByParentIdInputSchema, getLocalFileURLSchema, getLocalFileURLSchemaDefaults, listLocalDriveFlatInputSchema, listLocalDriveTreeInputSchema, localDriveFlatFiltersSchema, localDriveNodeSchema, localDriveNodeWithChildrenSchema, localDriveTreeFiltersSchema, presignLocalDriveFileInputSchema, updateLocalDriveNodeInputSchema, uploadLocalDriveFileInputSchema };
|