|
1 | 1 | import type {
|
2 | 2 | Adapter,
|
3 |
| - ClientUploadsConfig, |
| 3 | + ClientUploadsAccess, |
4 | 4 | PluginOptions as CloudStoragePluginOptions,
|
5 | 5 | CollectionOptions,
|
6 | 6 | GeneratedAdapter,
|
7 | 7 | } from '@payloadcms/plugin-cloud-storage/types'
|
8 | 8 | import type { Config, Field, Plugin, UploadCollectionSlug } from 'payload'
|
| 9 | +import type { createUploadthing } from 'uploadthing/server' |
9 | 10 | import type { UTApiOptions } from 'uploadthing/types'
|
10 | 11 |
|
11 | 12 | import { cloudStoragePlugin } from '@payloadcms/plugin-cloud-storage'
|
12 | 13 | import { initClientUploads } from '@payloadcms/plugin-cloud-storage/utilities'
|
13 |
| -import { createRouteHandler } from 'uploadthing/next' |
14 |
| -import { createUploadthing, UTApi } from 'uploadthing/server' |
| 14 | +import { UTApi } from 'uploadthing/server' |
15 | 15 |
|
16 | 16 | import { generateURL } from './generateURL.js'
|
17 | 17 | import { getClientUploadRoute } from './getClientUploadRoute.js'
|
18 | 18 | import { getHandleDelete } from './handleDelete.js'
|
19 | 19 | import { getHandleUpload } from './handleUpload.js'
|
20 | 20 | import { getHandler } from './staticHandler.js'
|
21 | 21 |
|
| 22 | +export type FileRouterInputConfig = Parameters<ReturnType<typeof createUploadthing>>[0] |
| 23 | + |
22 | 24 | export type UploadthingStorageOptions = {
|
23 | 25 | /**
|
24 | 26 | * Do uploads directly on the client, to bypass limits on Vercel.
|
25 | 27 | */
|
26 |
| - clientUploads?: ClientUploadsConfig |
| 28 | + clientUploads?: |
| 29 | + | { |
| 30 | + access?: ClientUploadsAccess |
| 31 | + routerInputConfig?: FileRouterInputConfig |
| 32 | + } |
| 33 | + | boolean |
27 | 34 |
|
28 | 35 | /**
|
29 | 36 | * Collection options to apply the adapter to.
|
|
0 commit comments