@humaan/payload-storage-imagekit 2.9.0 → 3.0.0-canary.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 +60 -7
- package/dist/clientUploads.d.ts +4 -41
- package/dist/clientUploads.js +1 -8
- package/dist/clientUploads.js.map +1 -1
- package/dist/components/BeforeDashboardServer.d.ts +1 -1
- package/dist/components/BeforeDashboardServer.js +6 -1
- package/dist/components/BeforeDashboardServer.js.map +1 -1
- package/dist/components/ImageKitUploadHandler.d.ts +3 -4
- package/dist/components/ImageKitUploadHandler.js +42 -80
- package/dist/components/ImageKitUploadHandler.js.map +1 -1
- package/dist/endpoints/createImageKitUploadInstructions.d.ts +14 -0
- package/dist/endpoints/createImageKitUploadInstructions.js +116 -0
- package/dist/endpoints/createImageKitUploadInstructions.js.map +1 -0
- package/dist/index.d.ts +6 -28
- package/dist/index.js +456 -638
- package/dist/index.js.map +1 -1
- package/dist/migrate.js +37 -14
- package/dist/migrate.js.map +1 -1
- package/package.json +13 -13
- package/dist/clientUploadVerification.d.ts +0 -30
- package/dist/clientUploadVerification.js +0 -106
- package/dist/clientUploadVerification.js.map +0 -1
- package/dist/endpoints/createImageKitUploadAuthHandler.d.ts +0 -26
- package/dist/endpoints/createImageKitUploadAuthHandler.js +0 -215
- package/dist/endpoints/createImageKitUploadAuthHandler.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,47 +1,25 @@
|
|
|
1
1
|
import type { ClientUploadsConfig } from '@payloadcms/plugin-cloud-storage/types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { StorageAdapter, UploadCollectionSlug } from 'payload';
|
|
3
3
|
export type ImageKitCollectionOptions = {
|
|
4
|
-
/**
|
|
5
|
-
* Override Payload's native focal-point picker (`upload.focalPoint`) for this
|
|
6
|
-
* collection.
|
|
7
|
-
*/
|
|
8
4
|
focalPoint?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Upload files in this collection as ImageKit private files (`isPrivateFile: true`)
|
|
11
|
-
* and deliver them only through short-lived signed URLs, behind Payload access control.
|
|
12
|
-
*/
|
|
13
5
|
private?: boolean;
|
|
14
6
|
};
|
|
15
|
-
type ImageKitCollectionConfig = ImageKitCollectionOptions | true;
|
|
16
|
-
type ImageKitCollectionMap = Partial<Record<UploadCollectionSlug, ImageKitCollectionConfig>>;
|
|
17
7
|
export type PayloadStorageImageKitConfig = {
|
|
18
|
-
alwaysInsertFields?: boolean;
|
|
19
8
|
clientUploads?: ClientUploadsConfig;
|
|
20
|
-
collections:
|
|
9
|
+
collections: Partial<Record<UploadCollectionSlug, ImageKitCollectionOptions | true>>;
|
|
21
10
|
disablePayloadAccessControl?: true;
|
|
22
11
|
enabled?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Broad default for Payload's native focal-point picker (`upload.focalPoint`)
|
|
25
|
-
* on every configured collection. Focal points are disabled by default for
|
|
26
|
-
* configured collections, so prefer collection-level `focalPoint: true` for
|
|
27
|
-
* image collections. A collection's own `upload.focalPoint` still takes
|
|
28
|
-
* precedence.
|
|
29
|
-
*/
|
|
30
12
|
focalPoint?: boolean;
|
|
31
13
|
folder: string;
|
|
32
14
|
privateKey: string;
|
|
33
15
|
publicKey: string;
|
|
34
|
-
/**
|
|
35
|
-
* Expiry (in seconds) applied to signed URLs generated for private collections.
|
|
36
|
-
* Defaults to 900 (15 minutes). URLs are signed fresh on every request, so a short
|
|
37
|
-
* window is safe.
|
|
38
|
-
*/
|
|
39
16
|
signedUrlExpiresIn?: number;
|
|
40
17
|
urlEndpoint: string;
|
|
41
18
|
};
|
|
42
|
-
|
|
19
|
+
/** Payload 4 storage capability. Register under config.storage, not config.plugins. */
|
|
20
|
+
export declare const imagekitStorage: (options: PayloadStorageImageKitConfig) => StorageAdapter;
|
|
43
21
|
export { migrateFolder } from './migrate.js';
|
|
44
22
|
export type { MigrateFolderOptions, MigrationJobResult, MigrationLocation } from './migrate.js';
|
|
45
|
-
export declare const payloadStorageImagekit: (
|
|
46
|
-
export declare const payloadStorageImageKit: (
|
|
23
|
+
export declare const payloadStorageImagekit: (options: PayloadStorageImageKitConfig) => StorageAdapter;
|
|
24
|
+
export declare const payloadStorageImageKit: (options: PayloadStorageImageKitConfig) => StorageAdapter;
|
|
47
25
|
export type PayloadStorageImagekitConfig = PayloadStorageImageKitConfig;
|