# FilesApi

All URIs are relative to *http://localhost*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**fetchFileApiFetchFileFilePathGet**](#fetchfileapifetchfilefilepathget) | **GET** /api/fetch_file/{file_path} | Fetch File|
|[**getHdf5MetadataApiHdf5MetadataFilePathGet**](#gethdf5metadataapihdf5metadatafilepathget) | **GET** /api/hdf5_metadata/{file_path} | Get Hdf5 Metadata|
|[**getHdf5PreviewApiHdf5PreviewPost**](#gethdf5previewapihdf5previewpost) | **POST** /api/hdf5_preview | Get Hdf5 Preview|
|[**uploadFileApiFileuploadPost**](#uploadfileapifileuploadpost) | **POST** /api/fileupload | Upload File|

# **fetchFileApiFetchFileFilePathGet**
> any fetchFileApiFetchFileFilePathGet()

Fetch file content from server based on data_path.  This endpoint handles both relative paths (using VIPR\'s resolve_file_path) and absolute paths (like /tmp files) to provide file access for the frontend.  Args:     file_path: The path to the file to fetch  Returns:     FileResponse: The file content with appropriate headers  Raises:     HTTPException: If file is not found, access denied, or other errors

### Example

```typescript
import {
    FilesApi,
    Configuration
} from '@vipr/api';

const configuration = new Configuration();
const apiInstance = new FilesApi(configuration);

let filePath: string; // (default to undefined)

const { status, data } = await apiInstance.fetchFileApiFetchFileFilePathGet(
    filePath
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **filePath** | [**string**] |  | defaults to undefined|


### Return type

**any**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful Response |  -  |
|**422** | Validation Error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getHdf5MetadataApiHdf5MetadataFilePathGet**
> HDF5Metadata getHdf5MetadataApiHdf5MetadataFilePathGet()

Get metadata from HDF5 file including available datasets and spectrum counts.  This endpoint uses the SpectraReader from the HDF5SpectraReaderDataLoader to extract metadata from HDF5 files.  Args:     file_path: The path to the HDF5 file  Returns:     HDF5Metadata: Metadata containing datasets, spectrum counts, and file info  Raises:     HTTPException: If file is not found, not HDF5, or metadata extraction fails

### Example

```typescript
import {
    FilesApi,
    Configuration
} from '@vipr/api';

const configuration = new Configuration();
const apiInstance = new FilesApi(configuration);

let filePath: string; // (default to undefined)

const { status, data } = await apiInstance.getHdf5MetadataApiHdf5MetadataFilePathGet(
    filePath
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **filePath** | [**string**] |  | defaults to undefined|


### Return type

**HDF5Metadata**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful Response |  -  |
|**422** | Validation Error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getHdf5PreviewApiHdf5PreviewPost**
> HDF5PreviewData getHdf5PreviewApiHdf5PreviewPost(requestBody)

Get preview data for a specific dataset/spectrum combination from HDF5 file.  Args:     request: Dictionary containing:         - filePath: Path to HDF5 file         - datasetName: Name of dataset to preview         - spectrumIndex: Index of spectrum (optional, for single spectrum preview)         - batchProcessing: Whether to preview batch data (optional)  Returns:     HDF5PreviewData: Preview data with Q/intensity ranges and metadata  Raises:     HTTPException: If file access fails or preview extraction fails

### Example

```typescript
import {
    FilesApi,
    Configuration
} from '@vipr/api';

const configuration = new Configuration();
const apiInstance = new FilesApi(configuration);

let requestBody: { [key: string]: any; }; //

const { status, data } = await apiInstance.getHdf5PreviewApiHdf5PreviewPost(
    requestBody
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **requestBody** | **{ [key: string]: any; }**|  | |


### Return type

**HDF5PreviewData**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful Response |  -  |
|**422** | Validation Error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **uploadFileApiFileuploadPost**
> FileValidationResponse uploadFileApiFileuploadPost()

Validates and saves an uploaded file. Supports both text-based files (CSV, TXT, etc.) and HDF5 files with appropriate validation for each type.  Args:     file: The uploaded file (UTF-8 text format for CSV/TXT or binary for HDF5)  Returns:     FileValidationResponse: Validation result with file path on success  Raises:     HTTPException: With appropriate status code and detail message on failure

### Example

```typescript
import {
    FilesApi,
    Configuration
} from '@vipr/api';

const configuration = new Configuration();
const apiInstance = new FilesApi(configuration);

let file: File; // (default to undefined)

const { status, data } = await apiInstance.uploadFileApiFileuploadPost(
    file
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **file** | [**File**] |  | defaults to undefined|


### Return type

**FileValidationResponse**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: multipart/form-data
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful Response |  -  |
|**422** | Validation Error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

