gantri-components 2.179.0 → 2.180.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/dist/helpers/get-folder-structure/helpers/get-organizations-path/get-organizations-path.types.d.ts +2 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-cloudinary-file-uploader/index.d.ts +2 -0
- package/dist/hooks/use-cloudinary-file-uploader/use-cloudinary-file-uploader.d.ts +3 -0
- package/dist/hooks/use-cloudinary-file-uploader/use-cloudinary-file-uploader.types.d.ts +84 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type OrganizationsFileType = 'msa' | 'contract';
|
|
1
|
+
export type OrganizationsFileType = 'msa' | 'contract' | 'logo';
|
|
2
2
|
interface OrganizationsRootLevel {
|
|
3
3
|
organizationId: number;
|
|
4
4
|
}
|
|
@@ -7,5 +7,5 @@ interface OrganizationsArgs<FileType extends OrganizationsFileType, Identifiers
|
|
|
7
7
|
fileType: FileType;
|
|
8
8
|
identifiers: Identifiers;
|
|
9
9
|
}
|
|
10
|
-
export type GetOrganizationsArgs<FileType extends OrganizationsFileType> = FileType extends 'msa' | 'contract' ? OrganizationsArgs<FileType, OrganizationsRootLevel> : never;
|
|
10
|
+
export type GetOrganizationsArgs<FileType extends OrganizationsFileType> = FileType extends 'msa' | 'contract' | 'logo' ? OrganizationsArgs<FileType, OrganizationsRootLevel> : never;
|
|
11
11
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-cloudinary-file-uploader';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DirectoryName } from '../../helpers/get-folder-structure';
|
|
2
|
+
import { UseCloudinaryFileUploaderArgs, UseCloudinaryFileUploaderReturn } from './use-cloudinary-file-uploader.types';
|
|
3
|
+
export declare const useCloudinaryFileUploader: <Directory extends DirectoryName>(props: UseCloudinaryFileUploaderArgs<Directory>) => UseCloudinaryFileUploaderReturn;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { DirectoryName } from '../../helpers/get-folder-structure';
|
|
2
|
+
import { HandleDeleteFile, HandleFileSelected, HandleUploadsComplete, HandleUploadFile, TransformFileName, ValidateFile } from '../../components/file-uploader/file-uploader.types';
|
|
3
|
+
import { GetFolderStructureArgs } from '../../helpers/get-folder-structure/get-folder-structure.types';
|
|
4
|
+
export interface UploadSignatureResponse {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
uploadSignature: string;
|
|
7
|
+
uploadSignatureTimestamp: number;
|
|
8
|
+
}
|
|
9
|
+
export interface CloudinaryUploadArgs {
|
|
10
|
+
file: Blob;
|
|
11
|
+
folder: string;
|
|
12
|
+
publicId: string;
|
|
13
|
+
resourceType?: 'auto' | 'image' | 'video' | 'raw';
|
|
14
|
+
uploadPreset?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface CloudinaryDeleteArgs {
|
|
17
|
+
fileUrl: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CloudinaryRenameArgs {
|
|
20
|
+
fromPublicId: string;
|
|
21
|
+
resourceType: 'image' | 'video' | 'raw';
|
|
22
|
+
toPublicId: string;
|
|
23
|
+
}
|
|
24
|
+
export type UseCloudinaryFileUploaderArgs<Directory extends DirectoryName> = GetFolderStructureArgs<Directory> & {
|
|
25
|
+
base64Url?: string;
|
|
26
|
+
fileName?: string;
|
|
27
|
+
handleUploadsComplete?: HandleUploadsComplete;
|
|
28
|
+
isDisabled?: boolean;
|
|
29
|
+
isRawFile?: boolean;
|
|
30
|
+
isVideoFile?: boolean;
|
|
31
|
+
onDeleteFile?: (args: CloudinaryDeleteArgs) => Promise<void>;
|
|
32
|
+
onError?: (error: {
|
|
33
|
+
error: unknown;
|
|
34
|
+
fallbackMessage: string;
|
|
35
|
+
}) => void;
|
|
36
|
+
onFileDelete?: HandleDeleteFile;
|
|
37
|
+
onFileRecovered?: (updatedFileName: string) => Promise<void> | void;
|
|
38
|
+
onFileSelected?: HandleFileSelected;
|
|
39
|
+
onGetUploadSignature?: (args: {
|
|
40
|
+
folder: string;
|
|
41
|
+
publicId: string;
|
|
42
|
+
uploadPreset: string;
|
|
43
|
+
}) => Promise<UploadSignatureResponse>;
|
|
44
|
+
onRenameFile?: (args: CloudinaryRenameArgs) => Promise<{
|
|
45
|
+
public_id: string;
|
|
46
|
+
}>;
|
|
47
|
+
onUploadFile?: (args: CloudinaryUploadArgs) => Promise<{
|
|
48
|
+
fileName: string;
|
|
49
|
+
fileUrl: string;
|
|
50
|
+
}>;
|
|
51
|
+
showLoading?: boolean;
|
|
52
|
+
transformFileName?: TransformFileName;
|
|
53
|
+
validateFile?: ValidateFile;
|
|
54
|
+
};
|
|
55
|
+
export interface UseCloudinaryFileUploaderReturn {
|
|
56
|
+
fileUploaderProps: {
|
|
57
|
+
disabledDescription?: string;
|
|
58
|
+
enableCopyUrl?: boolean;
|
|
59
|
+
fileName: string;
|
|
60
|
+
fileUrl: string;
|
|
61
|
+
handleDeleteFile: HandleDeleteFile;
|
|
62
|
+
handleFileSelected?: HandleFileSelected;
|
|
63
|
+
handleRecoverFile?: (fileUrl: string) => Promise<void>;
|
|
64
|
+
handleUploadFile?: HandleUploadFile;
|
|
65
|
+
handleUploadsComplete?: HandleUploadsComplete;
|
|
66
|
+
isDisabled?: boolean;
|
|
67
|
+
maxFileSizeMB: number;
|
|
68
|
+
onError: (args: {
|
|
69
|
+
error: unknown;
|
|
70
|
+
fallbackMessage: string;
|
|
71
|
+
}) => void;
|
|
72
|
+
processing: boolean;
|
|
73
|
+
purifyFileName: boolean;
|
|
74
|
+
transformFileName?: TransformFileName;
|
|
75
|
+
transformThumbnailSrc?: (props: {
|
|
76
|
+
size: number;
|
|
77
|
+
src: string;
|
|
78
|
+
}) => string;
|
|
79
|
+
validateFile?: ValidateFile;
|
|
80
|
+
};
|
|
81
|
+
handleDeleteFileOnly: () => Promise<void>;
|
|
82
|
+
handleUploadFile: HandleUploadFile;
|
|
83
|
+
processing: boolean;
|
|
84
|
+
}
|