# TusControllerApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**_options**](#_options) | **OPTIONS** /api/v1/tus | TUS capability discovery|
|[**cancelUpload**](#cancelupload) | **DELETE** /api/v1/tus/{uploadId} | Cancel upload|
|[**createUpload**](#createupload) | **POST** /api/v1/tus | Create new TUS upload|
|[**finalizeUpload**](#finalizeupload) | **POST** /api/v1/tus/{uploadId}/finalize | Finalize upload|
|[**getConfig**](#getconfig) | **GET** /api/v1/tus/config | Get TUS configuration|
|[**getUploadInfo**](#getuploadinfo) | **GET** /api/v1/tus/{uploadId}/info | Get upload information|
|[**getUploadOffset**](#getuploadoffset) | **HEAD** /api/v1/tus/{uploadId} | Get upload progress|
|[**isUploadComplete**](#isuploadcomplete) | **GET** /api/v1/tus/{uploadId}/complete | Check upload completion|
|[**uploadChunk**](#uploadchunk) | **PATCH** /api/v1/tus/{uploadId} | Upload chunk|

# **_options**
> _options()

Returns TUS protocol headers indicating supported extensions and version.

### Example

```typescript
import {
    TusControllerApi,
    Configuration
} from '@openfilz-sdk/typescript';

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

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

### Parameters
This endpoint does not have any parameters.


### Return type

void (empty response body)

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | TUS capabilities returned in headers |  * Tus-Resumable - TUS protocol version <br>  * Tus-Version - Supported TUS versions <br>  * Tus-Max-Size - Maximum upload size in bytes <br>  * Tus-Extension - Supported TUS extensions <br>  |

[[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)

# **cancelUpload**
> cancelUpload()

Cancels an in-progress upload and cleans up temporary data.

### Example

```typescript
import {
    TusControllerApi,
    Configuration
} from '@openfilz-sdk/typescript';

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

let uploadId: string; //Upload identifier (default to undefined)

const { status, data } = await apiInstance.cancelUpload(
    uploadId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **uploadId** | [**string**] | Upload identifier | defaults to undefined|


### Return type

void (empty response body)

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | Upload cancelled successfully |  -  |
|**404** | Upload not found |  -  |

[[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)

# **createUpload**
> object createUpload()

Creates a new TUS upload session. Client must provide Upload-Length header. Upload-Metadata header should contain base64-encoded values for: filename (required), parentFolderId (optional), allowDuplicateFileNames (optional, default false).

### Example

```typescript
import {
    TusControllerApi,
    Configuration
} from '@openfilz-sdk/typescript';

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

let uploadLength: number; // (default to undefined)
let uploadMetadata: string; // (optional) (default to undefined)

const { status, data } = await apiInstance.createUpload(
    uploadLength,
    uploadMetadata
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **uploadLength** | [**number**] |  | defaults to undefined|
| **uploadMetadata** | [**string**] |  | (optional) defaults to undefined|


### Return type

**object**

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**201** | Upload created |  * Tus-Resumable - TUS protocol version <br>  * Location - URL to upload chunks to <br>  |
|**413** | Upload size exceeds maximum allowed or file quota exceeded |  -  |
|**507** | User or instance storage quota exceeded (error UserQuotaExceeded / InstanceQuotaExceeded) |  -  |
|**404** | Parent folder not found |  -  |
|**409** | Duplicate filename in target folder |  -  |
|**400** | Missing required headers or filename |  -  |

[[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)

# **finalizeUpload**
> UploadResponse finalizeUpload(tusFinalizeRequest)

Completes the upload by moving the file to permanent storage and creating the Document record. Call this after all chunks have been successfully uploaded.

### Example

```typescript
import {
    TusControllerApi,
    Configuration,
    TusFinalizeRequest
} from '@openfilz-sdk/typescript';

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

let uploadId: string; //Upload identifier (default to undefined)
let tusFinalizeRequest: TusFinalizeRequest; //

const { status, data } = await apiInstance.finalizeUpload(
    uploadId,
    tusFinalizeRequest
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **tusFinalizeRequest** | **TusFinalizeRequest**|  | |
| **uploadId** | [**string**] | Upload identifier | defaults to undefined|


### Return type

**UploadResponse**

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**201** | Document created successfully |  -  |
|**400** | Upload is not complete |  -  |
|**404** | Upload not found |  -  |
|**409** | Duplicate filename in target folder |  -  |
|**413** | File size exceeds quota |  -  |
|**507** | User storage quota exceeded |  -  |

[[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)

# **getConfig**
> TusConfigResponse getConfig()

Returns configuration values for client-side TUS setup.

### Example

```typescript
import {
    TusControllerApi,
    Configuration
} from '@openfilz-sdk/typescript';

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

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

### Parameters
This endpoint does not have any parameters.


### Return type

**TusConfigResponse**

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[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)

# **getUploadInfo**
> TusUploadInfo getUploadInfo()

Returns detailed information about an upload including offset, length, and expiration.

### Example

```typescript
import {
    TusControllerApi,
    Configuration
} from '@openfilz-sdk/typescript';

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

let uploadId: string; //Upload identifier (default to undefined)

const { status, data } = await apiInstance.getUploadInfo(
    uploadId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **uploadId** | [**string**] | Upload identifier | defaults to undefined|


### Return type

**TusUploadInfo**

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Upload information returned |  -  |
|**404** | Upload not found |  -  |

[[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)

# **getUploadOffset**
> getUploadOffset()

Returns the current upload offset (bytes received).

### Example

```typescript
import {
    TusControllerApi,
    Configuration
} from '@openfilz-sdk/typescript';

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

let uploadId: string; //Upload identifier (default to undefined)

const { status, data } = await apiInstance.getUploadOffset(
    uploadId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **uploadId** | [**string**] | Upload identifier | defaults to undefined|


### Return type

void (empty response body)

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Upload info returned |  * Tus-Resumable - TUS protocol version <br>  * Upload-Offset - New offset after this chunk <br>  * Upload-Length - Total file size in bytes <br>  |
|**404** | Upload not found |  -  |
|**410** | Upload expired before it was complete - start it again |  -  |

[[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)

# **isUploadComplete**
> boolean isUploadComplete()

Returns whether the upload has received all bytes.

### Example

```typescript
import {
    TusControllerApi,
    Configuration
} from '@openfilz-sdk/typescript';

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

let uploadId: string; //Upload identifier (default to undefined)

const { status, data } = await apiInstance.isUploadComplete(
    uploadId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **uploadId** | [**string**] | Upload identifier | defaults to undefined|


### Return type

**boolean**

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Completion status returned |  -  |
|**404** | Upload not found |  -  |

[[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)

# **uploadChunk**
> object uploadChunk(requestBody)

Uploads a chunk of data. Client must send Upload-Offset header matching current offset.

### Example

```typescript
import {
    TusControllerApi,
    Configuration
} from '@openfilz-sdk/typescript';

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

let uploadId: string; //Upload identifier (default to undefined)
let uploadOffset: number; // (default to undefined)
let requestBody: Array<any>; //
let contentLength: number; // (optional) (default to undefined)

const { status, data } = await apiInstance.uploadChunk(
    uploadId,
    uploadOffset,
    requestBody,
    contentLength
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **requestBody** | **Array<any>**|  | |
| **uploadId** | [**string**] | Upload identifier | defaults to undefined|
| **uploadOffset** | [**number**] |  | defaults to undefined|
| **contentLength** | [**number**] |  | (optional) defaults to undefined|


### Return type

**object**

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

 - **Content-Type**: application/offset+octet-stream
 - **Accept**: */*


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | Chunk received successfully |  * Tus-Resumable - TUS protocol version <br>  * Upload-Offset - New offset after this chunk <br>  |
|**409** | Offset mismatch - resume from HEAD request |  -  |
|**410** | Upload expired - start it again |  -  |
|**413** | The chunk would go past the declared Upload-Length |  -  |
|**404** | Upload not found |  -  |

[[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)

