@muhgholy/next-drive 1.2.0 → 1.3.0
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 +13 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/{index-C4pw1JjP.d.ts → index-CUS76o75.d.ts} +2 -33
- package/dist/schemas.d.ts +35 -0
- package/dist/schemas.js +14 -0
- package/dist/schemas.js.map +1 -0
- package/dist/server/index.d.ts +2 -2
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -187,7 +187,19 @@ You can use the exported `driveFileSchemaZod` to validate file data in your form
|
|
|
187
187
|
|
|
188
188
|
```typescript
|
|
189
189
|
import { z } from "zod";
|
|
190
|
-
import { driveFileSchemaZod } from "@muhgholy/next-drive/
|
|
190
|
+
import { driveFileSchemaZod } from "@muhgholy/next-drive/schemas";
|
|
191
|
+
|
|
192
|
+
// Use in your form schema (works in both client and server)
|
|
193
|
+
const myFormSchema = z.object({
|
|
194
|
+
asset: driveFileSchemaZod,
|
|
195
|
+
title: z.string(),
|
|
196
|
+
description: z.string().optional(),
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
type MyFormData = z.infer<typeof myFormSchema>;
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
> **Note**: The schema is also available from `/client` and `/server` exports for convenience, but `/schemas` is the recommended universal import.
|
|
191
203
|
|
|
192
204
|
// Use in your form schema
|
|
193
205
|
const myFormSchema = z.object({
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { n as TDrivePathItem, d as TDatabaseDrive, o as TDriveQuota, e as TDriveFile, f as TImageQuality, g as TImageFormat, k as TDriveAPIResponse, p as TDriveUploadState } from '../index-
|
|
3
|
-
export {
|
|
2
|
+
import { n as TDrivePathItem, d as TDatabaseDrive, o as TDriveQuota, e as TDriveFile, f as TImageQuality, g as TImageFormat, k as TDriveAPIResponse, p as TDriveUploadState } from '../index-CUS76o75.js';
|
|
3
|
+
export { driveFileSchemaZod } from '../schemas.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
type TDriveContext = {
|
package/dist/client/index.js
CHANGED