@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.
@@ -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 { TDatabaseDriveProvider as T, TDatabaseDriveMetadata as a, TDatabaseDriveInformation as b, TDatabaseDriveStatus as c, TDatabaseDrive as d, TDriveFile as e, TDatabaseDriveMetadataFile as f, TDatabaseDriveMetadataFolder as g, TDriveAction as h, TDriveAPIResponse as i, TDriveThumbnailSize as j, TDriveImageQuality as k, TDrivePathItem as l, TDriveQuota as m, TDriveUploadState as n };
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 };
@@ -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-DE7-rwJm.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-DE7-rwJm.js';
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 };
@@ -1405,6 +1405,7 @@ export {
1405
1405
  driveAPIHandler,
1406
1406
  driveConfiguration,
1407
1407
  driveFilePath,
1408
+ driveFileSchemaZod,
1408
1409
  driveGetUrl,
1409
1410
  driveReadFile,
1410
1411
  getDriveConfig,