@muhgholy/next-drive 0.1.2 → 1.0.2
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/README.md +27 -7
- package/dist/client/index.d.ts +4 -7
- package/dist/client/index.js +417 -571
- package/dist/client/index.js.map +1 -1
- package/dist/{index-DE7-rwJm.d.ts → index-CIbbTroj.d.ts} +33 -1
- package/dist/server/index.d.ts +35 -3
- package/dist/server/index.js +1 -0
- package/dist/server/index.js.map +1 -1
- package/package.json +4 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
1
3
|
type TDatabaseDriveStatus = "READY" | "PROCESSING" | "UPLOADING" | "FAILED";
|
|
2
4
|
type TDatabaseDriveMetadataFile = {
|
|
3
5
|
type: "FILE";
|
|
@@ -63,6 +65,36 @@ type TDriveFile = {
|
|
|
63
65
|
size: number;
|
|
64
66
|
};
|
|
65
67
|
};
|
|
68
|
+
declare const driveFileSchemaZod: z.ZodObject<{
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
file: z.ZodObject<{
|
|
71
|
+
name: z.ZodString;
|
|
72
|
+
mime: z.ZodString;
|
|
73
|
+
size: z.ZodNumber;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
name: string;
|
|
76
|
+
mime: string;
|
|
77
|
+
size: number;
|
|
78
|
+
}, {
|
|
79
|
+
name: string;
|
|
80
|
+
mime: string;
|
|
81
|
+
size: number;
|
|
82
|
+
}>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
id: string;
|
|
85
|
+
file: {
|
|
86
|
+
name: string;
|
|
87
|
+
mime: string;
|
|
88
|
+
size: number;
|
|
89
|
+
};
|
|
90
|
+
}, {
|
|
91
|
+
id: string;
|
|
92
|
+
file: {
|
|
93
|
+
name: string;
|
|
94
|
+
mime: string;
|
|
95
|
+
size: number;
|
|
96
|
+
};
|
|
97
|
+
}>;
|
|
66
98
|
type TDrivePathItem = {
|
|
67
99
|
id: string | null;
|
|
68
100
|
name: string;
|
|
@@ -84,4 +116,4 @@ type TDriveUploadState = {
|
|
|
84
116
|
error?: string;
|
|
85
117
|
};
|
|
86
118
|
|
|
87
|
-
export type
|
|
119
|
+
export { type TDatabaseDriveProvider as T, type TDatabaseDriveMetadata as a, type TDatabaseDriveInformation as b, type TDatabaseDriveStatus as c, type TDatabaseDrive as d, type TDriveFile as e, type TDatabaseDriveMetadataFile as f, type TDatabaseDriveMetadataFolder as g, type TDriveAction as h, type TDriveAPIResponse as i, type TDriveThumbnailSize as j, type TDriveImageQuality as k, type TDrivePathItem as l, type TDriveQuota as m, type TDriveUploadState as n, driveFileSchemaZod as o };
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { NextApiRequest, NextApiResponse } from 'next';
|
|
2
2
|
import { Readable } from 'stream';
|
|
3
|
-
import { T as TDatabaseDriveProvider, a as TDatabaseDriveMetadata, b as TDatabaseDriveInformation, c as TDatabaseDriveStatus, d as TDatabaseDrive } from '../index-
|
|
4
|
-
export { f as TDatabaseDriveMetadataFile, g as TDatabaseDriveMetadataFolder, i as TDriveAPIResponse, h as TDriveAction, e as TDriveFile, k as TDriveImageQuality, j as TDriveThumbnailSize } from '../index-
|
|
3
|
+
import { T as TDatabaseDriveProvider, a as TDatabaseDriveMetadata, b as TDatabaseDriveInformation, c as TDatabaseDriveStatus, d as TDatabaseDrive } from '../index-CIbbTroj.js';
|
|
4
|
+
export { f as TDatabaseDriveMetadataFile, g as TDatabaseDriveMetadataFolder, i as TDriveAPIResponse, h as TDriveAction, e as TDriveFile, k as TDriveImageQuality, j as TDriveThumbnailSize } from '../index-CIbbTroj.js';
|
|
5
5
|
import { Document, Types } from 'mongoose';
|
|
6
|
+
import { z } from 'zod';
|
|
6
7
|
|
|
7
8
|
type TDriveDatabase = "MONGOOSE";
|
|
8
9
|
type TDriveConfigInformation = {
|
|
@@ -110,6 +111,37 @@ declare const driveFilePath: (file: string | IDatabaseDriveDocument | TDatabaseD
|
|
|
110
111
|
provider: string;
|
|
111
112
|
}>>;
|
|
112
113
|
|
|
114
|
+
declare const driveFileSchemaZod: z.ZodObject<{
|
|
115
|
+
id: z.ZodString;
|
|
116
|
+
file: z.ZodObject<{
|
|
117
|
+
name: z.ZodString;
|
|
118
|
+
mime: z.ZodString;
|
|
119
|
+
size: z.ZodNumber;
|
|
120
|
+
}, "strip", z.ZodTypeAny, {
|
|
121
|
+
name: string;
|
|
122
|
+
mime: string;
|
|
123
|
+
size: number;
|
|
124
|
+
}, {
|
|
125
|
+
name: string;
|
|
126
|
+
mime: string;
|
|
127
|
+
size: number;
|
|
128
|
+
}>;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
id: string;
|
|
131
|
+
file: {
|
|
132
|
+
name: string;
|
|
133
|
+
mime: string;
|
|
134
|
+
size: number;
|
|
135
|
+
};
|
|
136
|
+
}, {
|
|
137
|
+
id: string;
|
|
138
|
+
file: {
|
|
139
|
+
name: string;
|
|
140
|
+
mime: string;
|
|
141
|
+
size: number;
|
|
142
|
+
};
|
|
143
|
+
}>;
|
|
144
|
+
|
|
113
145
|
declare const driveAPIHandler: (req: NextApiRequest, res: NextApiResponse) => Promise<void>;
|
|
114
146
|
|
|
115
|
-
export { TDatabaseDrive, TDatabaseDriveInformation, TDatabaseDriveMetadata, TDatabaseDriveProvider, TDatabaseDriveStatus, type TDriveConfigInformation, type TDriveConfiguration, type TDriveDatabase, type TDriveImageConfig, type TDriveSecurityConfig, type TDriveStorageConfig, driveAPIHandler, driveConfiguration, driveFilePath, driveGetUrl, driveReadFile, getDriveConfig, getDriveInformation };
|
|
147
|
+
export { TDatabaseDrive, TDatabaseDriveInformation, TDatabaseDriveMetadata, TDatabaseDriveProvider, TDatabaseDriveStatus, type TDriveConfigInformation, type TDriveConfiguration, type TDriveDatabase, type TDriveImageConfig, type TDriveSecurityConfig, type TDriveStorageConfig, driveAPIHandler, driveConfiguration, driveFilePath, driveFileSchemaZod, driveGetUrl, driveReadFile, getDriveConfig, getDriveInformation };
|