mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-10-31 16:56:52 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			621 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			621 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { FileObject } from '@/api/server/files/loadDirectory';
 | |
| import http from '@/api/http';
 | |
| import { rawDataToFileObject } from '@/api/transformers';
 | |
| 
 | |
| export default async (uuid: string, directory: string, files: string[]): Promise<FileObject> => {
 | |
|     const { data } = await http.post(
 | |
|         `/api/client/servers/${uuid}/files/compress`,
 | |
|         { root: directory, files },
 | |
|         {
 | |
|             timeout: 60000,
 | |
|             timeoutErrorMessage:
 | |
|                 'It looks like this archive is taking a long time to generate. It will appear once completed.',
 | |
|         }
 | |
|     );
 | |
| 
 | |
|     return rawDataToFileObject(data);
 | |
| };
 | 
