refactor(server): deprecate PUT routes in favor of PATCH (#28859)

* add patch routes and deprecate put

* gen client
This commit is contained in:
Timon
2026-06-07 15:40:01 +02:00
committed by GitHub
parent 8860817c76
commit 9e453440e6
15 changed files with 1215 additions and 65 deletions
+14
View File
@@ -148,6 +148,20 @@ Class | Method | HTTP request | Description
*DeprecatedApi* | [**createPartnerDeprecated**](doc//DeprecatedApi.md#createpartnerdeprecated) | **POST** /partners/{id} | Create a partner
*DeprecatedApi* | [**getQueuesLegacy**](doc//DeprecatedApi.md#getqueueslegacy) | **GET** /jobs | Retrieve queue counts and status
*DeprecatedApi* | [**runQueueCommandLegacy**](doc//DeprecatedApi.md#runqueuecommandlegacy) | **PUT** /jobs/{name} | Run jobs
*DeprecatedApi* | [**updateApiKey**](doc//DeprecatedApi.md#updateapikey) | **PUT** /api-keys/{id} | Update an API key
*DeprecatedApi* | [**updateAsset**](doc//DeprecatedApi.md#updateasset) | **PUT** /assets/{id} | Update an asset
*DeprecatedApi* | [**updateAssets**](doc//DeprecatedApi.md#updateassets) | **PUT** /assets | Update assets
*DeprecatedApi* | [**updateLibrary**](doc//DeprecatedApi.md#updatelibrary) | **PUT** /libraries/{id} | Update a library
*DeprecatedApi* | [**updateMemory**](doc//DeprecatedApi.md#updatememory) | **PUT** /memories/{id} | Update a memory
*DeprecatedApi* | [**updateMyPreferences**](doc//DeprecatedApi.md#updatemypreferences) | **PUT** /users/me/preferences | Update my preferences
*DeprecatedApi* | [**updateMyUser**](doc//DeprecatedApi.md#updatemyuser) | **PUT** /users/me | Update current user
*DeprecatedApi* | [**updatePerson**](doc//DeprecatedApi.md#updateperson) | **PUT** /people/{id} | Update person
*DeprecatedApi* | [**updateSession**](doc//DeprecatedApi.md#updatesession) | **PUT** /sessions/{id} | Update a session
*DeprecatedApi* | [**updateStack**](doc//DeprecatedApi.md#updatestack) | **PUT** /stacks/{id} | Update a stack
*DeprecatedApi* | [**updateTag**](doc//DeprecatedApi.md#updatetag) | **PUT** /tags/{id} | Update a tag
*DeprecatedApi* | [**updateUserAdmin**](doc//DeprecatedApi.md#updateuseradmin) | **PUT** /admin/users/{id} | Update a user
*DeprecatedApi* | [**updateUserPreferencesAdmin**](doc//DeprecatedApi.md#updateuserpreferencesadmin) | **PUT** /admin/users/{id}/preferences | Update user preferences
*DeprecatedApi* | [**updateWorkflow**](doc//DeprecatedApi.md#updateworkflow) | **PUT** /workflows/{id} | Update a workflow
*DownloadApi* | [**downloadArchive**](doc//DownloadApi.md#downloadarchive) | **POST** /download/archive | Download asset archive
*DownloadApi* | [**getDownloadInfo**](doc//DownloadApi.md#getdownloadinfo) | **POST** /download/info | Retrieve download information
*DuplicatesApi* | [**deleteDuplicate**](doc//DuplicatesApi.md#deleteduplicate) | **DELETE** /duplicates/{id} | Dismiss a duplicate group
+845
View File
@@ -184,4 +184,849 @@ class DeprecatedApi {
}
return null;
}
/// Update an API key
///
/// Updates the name and permissions of an API key by its ID. The current user must own this API key.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [ApiKeyUpdateDto] apiKeyUpdateDto (required):
Future<Response> updateApiKeyWithHttpInfo(String id, ApiKeyUpdateDto apiKeyUpdateDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/api-keys/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = apiKeyUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update an API key
///
/// Updates the name and permissions of an API key by its ID. The current user must own this API key.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [ApiKeyUpdateDto] apiKeyUpdateDto (required):
Future<ApiKeyResponseDto?> updateApiKey(String id, ApiKeyUpdateDto apiKeyUpdateDto, { Future<void>? abortTrigger, }) async {
final response = await updateApiKeyWithHttpInfo(id, apiKeyUpdateDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ApiKeyResponseDto',) as ApiKeyResponseDto;
}
return null;
}
/// Update an asset
///
/// Update information of a specific asset.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateAssetDto] updateAssetDto (required):
Future<Response> updateAssetWithHttpInfo(String id, UpdateAssetDto updateAssetDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = updateAssetDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update an asset
///
/// Update information of a specific asset.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateAssetDto] updateAssetDto (required):
Future<AssetResponseDto?> updateAsset(String id, UpdateAssetDto updateAssetDto, { Future<void>? abortTrigger, }) async {
final response = await updateAssetWithHttpInfo(id, updateAssetDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
}
return null;
}
/// Update assets
///
/// Updates multiple assets at the same time.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
Future<Response> updateAssetsWithHttpInfo(AssetBulkUpdateDto assetBulkUpdateDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets';
// ignore: prefer_final_locals
Object? postBody = assetBulkUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update assets
///
/// Updates multiple assets at the same time.
///
/// Parameters:
///
/// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
Future<void> updateAssets(AssetBulkUpdateDto assetBulkUpdateDto, { Future<void>? abortTrigger, }) async {
final response = await updateAssetsWithHttpInfo(assetBulkUpdateDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Update a library
///
/// Update an existing external library.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateLibraryDto] updateLibraryDto (required):
Future<Response> updateLibraryWithHttpInfo(String id, UpdateLibraryDto updateLibraryDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/libraries/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = updateLibraryDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update a library
///
/// Update an existing external library.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateLibraryDto] updateLibraryDto (required):
Future<LibraryResponseDto?> updateLibrary(String id, UpdateLibraryDto updateLibraryDto, { Future<void>? abortTrigger, }) async {
final response = await updateLibraryWithHttpInfo(id, updateLibraryDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'LibraryResponseDto',) as LibraryResponseDto;
}
return null;
}
/// Update a memory
///
/// Update an existing memory by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [MemoryUpdateDto] memoryUpdateDto (required):
Future<Response> updateMemoryWithHttpInfo(String id, MemoryUpdateDto memoryUpdateDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/memories/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = memoryUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update a memory
///
/// Update an existing memory by its ID.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [MemoryUpdateDto] memoryUpdateDto (required):
Future<MemoryResponseDto?> updateMemory(String id, MemoryUpdateDto memoryUpdateDto, { Future<void>? abortTrigger, }) async {
final response = await updateMemoryWithHttpInfo(id, memoryUpdateDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MemoryResponseDto',) as MemoryResponseDto;
}
return null;
}
/// Update my preferences
///
/// Update the preferences of the current user.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [UserPreferencesUpdateDto] userPreferencesUpdateDto (required):
Future<Response> updateMyPreferencesWithHttpInfo(UserPreferencesUpdateDto userPreferencesUpdateDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/users/me/preferences';
// ignore: prefer_final_locals
Object? postBody = userPreferencesUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update my preferences
///
/// Update the preferences of the current user.
///
/// Parameters:
///
/// * [UserPreferencesUpdateDto] userPreferencesUpdateDto (required):
Future<UserPreferencesResponseDto?> updateMyPreferences(UserPreferencesUpdateDto userPreferencesUpdateDto, { Future<void>? abortTrigger, }) async {
final response = await updateMyPreferencesWithHttpInfo(userPreferencesUpdateDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserPreferencesResponseDto',) as UserPreferencesResponseDto;
}
return null;
}
/// Update current user
///
/// Update the current user making the API request.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [UserUpdateMeDto] userUpdateMeDto (required):
Future<Response> updateMyUserWithHttpInfo(UserUpdateMeDto userUpdateMeDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/users/me';
// ignore: prefer_final_locals
Object? postBody = userUpdateMeDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update current user
///
/// Update the current user making the API request.
///
/// Parameters:
///
/// * [UserUpdateMeDto] userUpdateMeDto (required):
Future<UserAdminResponseDto?> updateMyUser(UserUpdateMeDto userUpdateMeDto, { Future<void>? abortTrigger, }) async {
final response = await updateMyUserWithHttpInfo(userUpdateMeDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserAdminResponseDto',) as UserAdminResponseDto;
}
return null;
}
/// Update person
///
/// Update an individual person.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [PersonUpdateDto] personUpdateDto (required):
Future<Response> updatePersonWithHttpInfo(String id, PersonUpdateDto personUpdateDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/people/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = personUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update person
///
/// Update an individual person.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [PersonUpdateDto] personUpdateDto (required):
Future<PersonResponseDto?> updatePerson(String id, PersonUpdateDto personUpdateDto, { Future<void>? abortTrigger, }) async {
final response = await updatePersonWithHttpInfo(id, personUpdateDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PersonResponseDto',) as PersonResponseDto;
}
return null;
}
/// Update a session
///
/// Update a specific session identified by id.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [SessionUpdateDto] sessionUpdateDto (required):
Future<Response> updateSessionWithHttpInfo(String id, SessionUpdateDto sessionUpdateDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/sessions/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = sessionUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update a session
///
/// Update a specific session identified by id.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [SessionUpdateDto] sessionUpdateDto (required):
Future<SessionResponseDto?> updateSession(String id, SessionUpdateDto sessionUpdateDto, { Future<void>? abortTrigger, }) async {
final response = await updateSessionWithHttpInfo(id, sessionUpdateDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SessionResponseDto',) as SessionResponseDto;
}
return null;
}
/// Update a stack
///
/// Update an existing stack by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [StackUpdateDto] stackUpdateDto (required):
Future<Response> updateStackWithHttpInfo(String id, StackUpdateDto stackUpdateDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/stacks/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = stackUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update a stack
///
/// Update an existing stack by its ID.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [StackUpdateDto] stackUpdateDto (required):
Future<StackResponseDto?> updateStack(String id, StackUpdateDto stackUpdateDto, { Future<void>? abortTrigger, }) async {
final response = await updateStackWithHttpInfo(id, stackUpdateDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'StackResponseDto',) as StackResponseDto;
}
return null;
}
/// Update a tag
///
/// Update an existing tag identified by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [TagUpdateDto] tagUpdateDto (required):
Future<Response> updateTagWithHttpInfo(String id, TagUpdateDto tagUpdateDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/tags/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = tagUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update a tag
///
/// Update an existing tag identified by its ID.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [TagUpdateDto] tagUpdateDto (required):
Future<TagResponseDto?> updateTag(String id, TagUpdateDto tagUpdateDto, { Future<void>? abortTrigger, }) async {
final response = await updateTagWithHttpInfo(id, tagUpdateDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TagResponseDto',) as TagResponseDto;
}
return null;
}
/// Update a user
///
/// Update an existing user.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UserAdminUpdateDto] userAdminUpdateDto (required):
Future<Response> updateUserAdminWithHttpInfo(String id, UserAdminUpdateDto userAdminUpdateDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/users/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = userAdminUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update a user
///
/// Update an existing user.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UserAdminUpdateDto] userAdminUpdateDto (required):
Future<UserAdminResponseDto?> updateUserAdmin(String id, UserAdminUpdateDto userAdminUpdateDto, { Future<void>? abortTrigger, }) async {
final response = await updateUserAdminWithHttpInfo(id, userAdminUpdateDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserAdminResponseDto',) as UserAdminResponseDto;
}
return null;
}
/// Update user preferences
///
/// Update the preferences of a specific user.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UserPreferencesUpdateDto] userPreferencesUpdateDto (required):
Future<Response> updateUserPreferencesAdminWithHttpInfo(String id, UserPreferencesUpdateDto userPreferencesUpdateDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/users/{id}/preferences'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = userPreferencesUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update user preferences
///
/// Update the preferences of a specific user.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UserPreferencesUpdateDto] userPreferencesUpdateDto (required):
Future<UserPreferencesResponseDto?> updateUserPreferencesAdmin(String id, UserPreferencesUpdateDto userPreferencesUpdateDto, { Future<void>? abortTrigger, }) async {
final response = await updateUserPreferencesAdminWithHttpInfo(id, userPreferencesUpdateDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserPreferencesResponseDto',) as UserPreferencesResponseDto;
}
return null;
}
/// Update a workflow
///
/// Update the information of a specific workflow by its ID. This endpoint can be used to update the workflow name, description, trigger type, filters and actions order, etc.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [WorkflowUpdateDto] workflowUpdateDto (required):
Future<Response> updateWorkflowWithHttpInfo(String id, WorkflowUpdateDto workflowUpdateDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = workflowUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update a workflow
///
/// Update the information of a specific workflow by its ID. This endpoint can be used to update the workflow name, description, trigger type, filters and actions order, etc.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [WorkflowUpdateDto] workflowUpdateDto (required):
Future<WorkflowResponseDto?> updateWorkflow(String id, WorkflowUpdateDto workflowUpdateDto, { Future<void>? abortTrigger, }) async {
final response = await updateWorkflowWithHttpInfo(id, workflowUpdateDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'WorkflowResponseDto',) as WorkflowResponseDto;
}
return null;
}
}
+127 -28
View File
@@ -1194,6 +1194,7 @@
"x-immich-state": "Stable"
},
"put": {
"deprecated": true,
"description": "Update an existing user.",
"operationId": "updateUserAdmin",
"parameters": [
@@ -1243,7 +1244,8 @@
],
"summary": "Update a user",
"tags": [
"Users (admin)"
"Users (admin)",
"Deprecated"
],
"x-immich-admin-only": true,
"x-immich-history": [
@@ -1258,10 +1260,15 @@
{
"version": "v2",
"state": "Stable"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updateUserAdmin"
}
],
"x-immich-permission": "adminUser.update",
"x-immich-state": "Stable"
"x-immich-state": "Deprecated"
}
},
"/admin/users/{id}/calendar-heatmap": {
@@ -1416,6 +1423,7 @@
"x-immich-state": "Stable"
},
"put": {
"deprecated": true,
"description": "Update the preferences of a specific user.",
"operationId": "updateUserPreferencesAdmin",
"parameters": [
@@ -1465,7 +1473,8 @@
],
"summary": "Update user preferences",
"tags": [
"Users (admin)"
"Users (admin)",
"Deprecated"
],
"x-immich-admin-only": true,
"x-immich-history": [
@@ -1480,10 +1489,15 @@
{
"version": "v2",
"state": "Stable"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updateUserPreferencesAdmin"
}
],
"x-immich-permission": "adminUser.update",
"x-immich-state": "Stable"
"x-immich-state": "Deprecated"
}
},
"/admin/users/{id}/restore": {
@@ -2863,6 +2877,7 @@
"x-immich-state": "Stable"
},
"put": {
"deprecated": true,
"description": "Updates the name and permissions of an API key by its ID. The current user must own this API key.",
"operationId": "updateApiKey",
"parameters": [
@@ -2912,7 +2927,8 @@
],
"summary": "Update an API key",
"tags": [
"API keys"
"API keys",
"Deprecated"
],
"x-immich-history": [
{
@@ -2926,10 +2942,15 @@
{
"version": "v2",
"state": "Stable"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updateApiKey"
}
],
"x-immich-permission": "apiKey.update",
"x-immich-state": "Stable"
"x-immich-state": "Deprecated"
}
},
"/assets": {
@@ -3080,6 +3101,7 @@
"x-immich-state": "Stable"
},
"put": {
"deprecated": true,
"description": "Updates multiple assets at the same time.",
"operationId": "updateAssets",
"parameters": [],
@@ -3111,7 +3133,8 @@
],
"summary": "Update assets",
"tags": [
"Assets"
"Assets",
"Deprecated"
],
"x-immich-history": [
{
@@ -3125,10 +3148,15 @@
{
"version": "v2",
"state": "Stable"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updateAssets"
}
],
"x-immich-permission": "asset.update",
"x-immich-state": "Stable"
"x-immich-state": "Deprecated"
}
},
"/assets/bulk-upload-check": {
@@ -3557,6 +3585,7 @@
"x-immich-state": "Stable"
},
"put": {
"deprecated": true,
"description": "Update information of a specific asset.",
"operationId": "updateAsset",
"parameters": [
@@ -3606,7 +3635,8 @@
],
"summary": "Update an asset",
"tags": [
"Assets"
"Assets",
"Deprecated"
],
"x-immich-history": [
{
@@ -3620,10 +3650,15 @@
{
"version": "v2",
"state": "Stable"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updateAsset"
}
],
"x-immich-permission": "asset.update",
"x-immich-state": "Stable"
"x-immich-state": "Deprecated"
}
},
"/assets/{id}/edits": {
@@ -6329,6 +6364,7 @@
"x-immich-state": "Stable"
},
"put": {
"deprecated": true,
"description": "Update an existing external library.",
"operationId": "updateLibrary",
"parameters": [
@@ -6378,7 +6414,8 @@
],
"summary": "Update a library",
"tags": [
"Libraries"
"Libraries",
"Deprecated"
],
"x-immich-admin-only": true,
"x-immich-history": [
@@ -6393,10 +6430,15 @@
{
"version": "v2",
"state": "Stable"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updateLibrary"
}
],
"x-immich-permission": "library.update",
"x-immich-state": "Stable"
"x-immich-state": "Deprecated"
}
},
"/libraries/{id}/scan": {
@@ -7165,6 +7207,7 @@
"x-immich-state": "Stable"
},
"put": {
"deprecated": true,
"description": "Update an existing memory by its ID.",
"operationId": "updateMemory",
"parameters": [
@@ -7214,7 +7257,8 @@
],
"summary": "Update a memory",
"tags": [
"Memories"
"Memories",
"Deprecated"
],
"x-immich-history": [
{
@@ -7228,10 +7272,15 @@
{
"version": "v2",
"state": "Stable"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updateMemory"
}
],
"x-immich-permission": "memory.update",
"x-immich-state": "Stable"
"x-immich-state": "Deprecated"
}
},
"/memories/{id}/assets": {
@@ -8711,6 +8760,7 @@
"x-immich-state": "Stable"
},
"put": {
"deprecated": true,
"description": "Update an individual person.",
"operationId": "updatePerson",
"parameters": [
@@ -8760,7 +8810,8 @@
],
"summary": "Update person",
"tags": [
"People"
"People",
"Deprecated"
],
"x-immich-history": [
{
@@ -8774,10 +8825,15 @@
{
"version": "v2",
"state": "Stable"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updatePerson"
}
],
"x-immich-permission": "person.update",
"x-immich-state": "Stable"
"x-immich-state": "Deprecated"
}
},
"/people/{id}/merge": {
@@ -11529,6 +11585,7 @@
"x-immich-state": "Stable"
},
"put": {
"deprecated": true,
"description": "Update a specific session identified by id.",
"operationId": "updateSession",
"parameters": [
@@ -11578,7 +11635,8 @@
],
"summary": "Update a session",
"tags": [
"Sessions"
"Sessions",
"Deprecated"
],
"x-immich-history": [
{
@@ -11592,10 +11650,15 @@
{
"version": "v2",
"state": "Stable"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updateSession"
}
],
"x-immich-permission": "session.update",
"x-immich-state": "Stable"
"x-immich-state": "Deprecated"
}
},
"/sessions/{id}/lock": {
@@ -12545,6 +12608,7 @@
"x-immich-state": "Stable"
},
"put": {
"deprecated": true,
"description": "Update an existing stack by its ID.",
"operationId": "updateStack",
"parameters": [
@@ -12594,7 +12658,8 @@
],
"summary": "Update a stack",
"tags": [
"Stacks"
"Stacks",
"Deprecated"
],
"x-immich-history": [
{
@@ -12608,10 +12673,15 @@
{
"version": "v2",
"state": "Stable"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updateStack"
}
],
"x-immich-permission": "stack.update",
"x-immich-state": "Stable"
"x-immich-state": "Deprecated"
}
},
"/stacks/{id}/assets/{assetId}": {
@@ -13648,6 +13718,7 @@
"x-immich-state": "Stable"
},
"put": {
"deprecated": true,
"description": "Update an existing tag identified by its ID.",
"operationId": "updateTag",
"parameters": [
@@ -13697,7 +13768,8 @@
],
"summary": "Update a tag",
"tags": [
"Tags"
"Tags",
"Deprecated"
],
"x-immich-history": [
{
@@ -13711,10 +13783,15 @@
{
"version": "v2",
"state": "Stable"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updateTag"
}
],
"x-immich-permission": "tag.update",
"x-immich-state": "Stable"
"x-immich-state": "Deprecated"
}
},
"/tags/{id}/assets": {
@@ -14517,6 +14594,7 @@
"x-immich-state": "Stable"
},
"put": {
"deprecated": true,
"description": "Update the current user making the API request.",
"operationId": "updateMyUser",
"parameters": [],
@@ -14555,7 +14633,8 @@
],
"summary": "Update current user",
"tags": [
"Users"
"Users",
"Deprecated"
],
"x-immich-history": [
{
@@ -14569,10 +14648,15 @@
{
"version": "v2",
"state": "Stable"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updateMyUser"
}
],
"x-immich-permission": "user.update",
"x-immich-state": "Stable"
"x-immich-state": "Deprecated"
}
},
"/users/me/calendar-heatmap": {
@@ -15003,6 +15087,7 @@
"x-immich-state": "Stable"
},
"put": {
"deprecated": true,
"description": "Update the preferences of the current user.",
"operationId": "updateMyPreferences",
"parameters": [],
@@ -15041,7 +15126,8 @@
],
"summary": "Update my preferences",
"tags": [
"Users"
"Users",
"Deprecated"
],
"x-immich-history": [
{
@@ -15055,10 +15141,15 @@
{
"version": "v2",
"state": "Stable"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updateMyPreferences"
}
],
"x-immich-permission": "userPreference.update",
"x-immich-state": "Stable"
"x-immich-state": "Deprecated"
}
},
"/users/profile-image": {
@@ -15680,6 +15771,7 @@
"x-immich-permission": "workflow.read"
},
"put": {
"deprecated": true,
"description": "Update the information of a specific workflow by its ID. This endpoint can be used to update the workflow name, description, trigger type, filters and actions order, etc.",
"operationId": "updateWorkflow",
"parameters": [
@@ -15729,15 +15821,22 @@
],
"summary": "Update a workflow",
"tags": [
"Workflows"
"Workflows",
"Deprecated"
],
"x-immich-history": [
{
"version": "v3.0.0",
"state": "Added"
},
{
"version": "v3",
"state": "Deprecated",
"replacementId": "updateWorkflow"
}
],
"x-immich-permission": "workflow.update"
"x-immich-permission": "workflow.update",
"x-immich-state": "Deprecated"
}
},
"/workflows/{id}/share": {
+18 -3
View File
@@ -1,5 +1,5 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Patch, Post, Put } from '@nestjs/common';
import { ApiExcludeEndpoint, ApiTags } from '@nestjs/swagger';
import { Endpoint, HistoryBuilder } from 'src/decorators';
import { ApiKeyCreateDto, ApiKeyCreateResponseDto, ApiKeyResponseDto, ApiKeyUpdateDto } from 'src/dtos/api-key.dto';
import { AuthDto } from 'src/dtos/auth.dto';
@@ -62,7 +62,11 @@ export class ApiKeyController {
@Endpoint({
summary: 'Update an API key',
description: 'Updates the name and permissions of an API key by its ID. The current user must own this API key.',
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
history: new HistoryBuilder()
.added('v1')
.beta('v1')
.stable('v2')
.deprecated('v3', { replacementId: 'updateApiKey' }),
})
updateApiKey(
@Auth() auth: AuthDto,
@@ -72,6 +76,17 @@ export class ApiKeyController {
return this.service.update(auth, id, dto);
}
@Patch(':id')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.ApiKeyUpdate })
updateApiKeyV3(
@Auth() auth: AuthDto,
@Param() { id }: UUIDParamDto,
@Body() dto: ApiKeyUpdateDto,
): Promise<ApiKeyResponseDto> {
return this.service.update(auth, id, dto);
}
@Delete(':id')
@Authenticated({ permission: Permission.ApiKeyDelete })
@HttpCode(HttpStatus.NO_CONTENT)
+31 -4
View File
@@ -1,5 +1,5 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Patch, Post, Put, Query } from '@nestjs/common';
import { ApiExcludeEndpoint, ApiTags } from '@nestjs/swagger';
import { Endpoint, HistoryBuilder } from 'src/decorators';
import { AssetResponseDto } from 'src/dtos/asset-response.dto';
import {
@@ -59,12 +59,24 @@ export class AssetController {
@Endpoint({
summary: 'Update assets',
description: 'Updates multiple assets at the same time.',
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
history: new HistoryBuilder()
.added('v1')
.beta('v1')
.stable('v2')
.deprecated('v3', { replacementId: 'updateAssets' }),
})
updateAssets(@Auth() auth: AuthDto, @Body() dto: AssetBulkUpdateDto): Promise<void> {
return this.service.updateAll(auth, dto);
}
@Patch()
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.AssetUpdate })
@HttpCode(HttpStatus.NO_CONTENT)
updateAssetsV3(@Auth() auth: AuthDto, @Body() dto: AssetBulkUpdateDto): Promise<void> {
return this.service.updateAll(auth, dto);
}
@Delete()
@Authenticated({ permission: Permission.AssetDelete })
@HttpCode(HttpStatus.NO_CONTENT)
@@ -131,7 +143,11 @@ export class AssetController {
@Endpoint({
summary: 'Update an asset',
description: 'Update information of a specific asset.',
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
history: new HistoryBuilder()
.added('v1')
.beta('v1')
.stable('v2')
.deprecated('v3', { replacementId: 'updateAsset' }),
})
updateAsset(
@Auth() auth: AuthDto,
@@ -141,6 +157,17 @@ export class AssetController {
return this.service.update(auth, id, dto);
}
@Patch(':id')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.AssetUpdate })
updateAssetV3(
@Auth() auth: AuthDto,
@Param() { id }: UUIDParamDto,
@Body() dto: UpdateAssetDto,
): Promise<AssetResponseDto> {
return this.service.update(auth, id, dto);
}
@Get(':id/metadata')
@Authenticated({ permission: Permission.AssetRead })
@Endpoint({
+14 -3
View File
@@ -1,5 +1,5 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Patch, Post, Put } from '@nestjs/common';
import { ApiExcludeEndpoint, ApiTags } from '@nestjs/swagger';
import { Endpoint, HistoryBuilder } from 'src/decorators';
import {
CreateLibraryDto,
@@ -57,12 +57,23 @@ export class LibraryController {
@Endpoint({
summary: 'Update a library',
description: 'Update an existing external library.',
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
history: new HistoryBuilder()
.added('v1')
.beta('v1')
.stable('v2')
.deprecated('v3', { replacementId: 'updateLibrary' }),
})
updateLibrary(@Param() { id }: UUIDParamDto, @Body() dto: UpdateLibraryDto): Promise<LibraryResponseDto> {
return this.service.update(id, dto);
}
@Patch(':id')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.LibraryUpdate, admin: true })
updateLibraryV3(@Param() { id }: UUIDParamDto, @Body() dto: UpdateLibraryDto): Promise<LibraryResponseDto> {
return this.service.update(id, dto);
}
@Delete(':id')
@Authenticated({ permission: Permission.LibraryDelete, admin: true })
@HttpCode(HttpStatus.NO_CONTENT)
+18 -3
View File
@@ -1,5 +1,5 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Patch, Post, Put, Query } from '@nestjs/common';
import { ApiExcludeEndpoint, ApiTags } from '@nestjs/swagger';
import { Endpoint, HistoryBuilder } from 'src/decorators';
import { BulkIdResponseDto, BulkIdsDto } from 'src/dtos/asset-ids.response.dto';
import { AuthDto } from 'src/dtos/auth.dto';
@@ -71,7 +71,11 @@ export class MemoryController {
@Endpoint({
summary: 'Update a memory',
description: 'Update an existing memory by its ID.',
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
history: new HistoryBuilder()
.added('v1')
.beta('v1')
.stable('v2')
.deprecated('v3', { replacementId: 'updateMemory' }),
})
updateMemory(
@Auth() auth: AuthDto,
@@ -81,6 +85,17 @@ export class MemoryController {
return this.service.update(auth, id, dto);
}
@Patch(':id')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.MemoryUpdate })
updateMemoryV3(
@Auth() auth: AuthDto,
@Param() { id }: UUIDParamDto,
@Body() dto: MemoryUpdateDto,
): Promise<MemoryResponseDto> {
return this.service.update(auth, id, dto);
}
@Delete(':id')
@Authenticated({ permission: Permission.MemoryDelete })
@HttpCode(HttpStatus.NO_CONTENT)
+18 -2
View File
@@ -7,12 +7,13 @@ import {
HttpStatus,
Next,
Param,
Patch,
Post,
Put,
Query,
Res,
} from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { ApiExcludeEndpoint, ApiTags } from '@nestjs/swagger';
import { NextFunction, Response } from 'express';
import { Endpoint, HistoryBuilder } from 'src/decorators';
import { BulkIdResponseDto, BulkIdsDto } from 'src/dtos/asset-ids.response.dto';
@@ -106,7 +107,11 @@ export class PersonController {
@Endpoint({
summary: 'Update person',
description: 'Update an individual person.',
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
history: new HistoryBuilder()
.added('v1')
.beta('v1')
.stable('v2')
.deprecated('v3', { replacementId: 'updatePerson' }),
})
updatePerson(
@Auth() auth: AuthDto,
@@ -116,6 +121,17 @@ export class PersonController {
return this.service.update(auth, id, dto);
}
@Patch(':id')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.PersonUpdate })
updatePersonV3(
@Auth() auth: AuthDto,
@Param() { id }: UUIDParamDto,
@Body() dto: PersonUpdateDto,
): Promise<PersonResponseDto> {
return this.service.update(auth, id, dto);
}
@Delete(':id')
@Authenticated({ permission: Permission.PersonDelete })
@HttpCode(HttpStatus.NO_CONTENT)
+18 -3
View File
@@ -1,5 +1,5 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Patch, Post, Put } from '@nestjs/common';
import { ApiExcludeEndpoint, ApiTags } from '@nestjs/swagger';
import { Endpoint, HistoryBuilder } from 'src/decorators';
import { AuthDto } from 'src/dtos/auth.dto';
import { SessionCreateDto, SessionCreateResponseDto, SessionResponseDto, SessionUpdateDto } from 'src/dtos/session.dto';
@@ -52,7 +52,11 @@ export class SessionController {
@Endpoint({
summary: 'Update a session',
description: 'Update a specific session identified by id.',
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
history: new HistoryBuilder()
.added('v1')
.beta('v1')
.stable('v2')
.deprecated('v3', { replacementId: 'updateSession' }),
})
updateSession(
@Auth() auth: AuthDto,
@@ -62,6 +66,17 @@ export class SessionController {
return this.service.update(auth, id, dto);
}
@Patch(':id')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.SessionUpdate })
updateSessionV3(
@Auth() auth: AuthDto,
@Param() { id }: UUIDParamDto,
@Body() dto: SessionUpdateDto,
): Promise<SessionResponseDto> {
return this.service.update(auth, id, dto);
}
@Delete(':id')
@Authenticated({ permission: Permission.SessionDelete })
@HttpCode(HttpStatus.NO_CONTENT)
+18 -3
View File
@@ -1,5 +1,5 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Patch, Post, Put, Query } from '@nestjs/common';
import { ApiExcludeEndpoint, ApiTags } from '@nestjs/swagger';
import { Endpoint, HistoryBuilder } from 'src/decorators';
import { BulkIdsDto } from 'src/dtos/asset-ids.response.dto';
import { AuthDto } from 'src/dtos/auth.dto';
@@ -65,7 +65,11 @@ export class StackController {
@Endpoint({
summary: 'Update a stack',
description: 'Update an existing stack by its ID.',
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
history: new HistoryBuilder()
.added('v1')
.beta('v1')
.stable('v2')
.deprecated('v3', { replacementId: 'updateStack' }),
})
updateStack(
@Auth() auth: AuthDto,
@@ -75,6 +79,17 @@ export class StackController {
return this.service.update(auth, id, dto);
}
@Patch(':id')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.StackUpdate })
updateStackV3(
@Auth() auth: AuthDto,
@Param() { id }: UUIDParamDto,
@Body() dto: StackUpdateDto,
): Promise<StackResponseDto> {
return this.service.update(auth, id, dto);
}
@Delete(':id')
@Authenticated({ permission: Permission.StackDelete })
@HttpCode(HttpStatus.NO_CONTENT)
+14 -3
View File
@@ -1,5 +1,5 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Patch, Post, Put } from '@nestjs/common';
import { ApiExcludeEndpoint, ApiTags } from '@nestjs/swagger';
import { Endpoint, HistoryBuilder } from 'src/decorators';
import { BulkIdResponseDto, BulkIdsDto } from 'src/dtos/asset-ids.response.dto';
import { AuthDto } from 'src/dtos/auth.dto';
@@ -81,12 +81,23 @@ export class TagController {
@Endpoint({
summary: 'Update a tag',
description: 'Update an existing tag identified by its ID.',
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
history: new HistoryBuilder().added('v1').beta('v1').stable('v2').deprecated('v3', { replacementId: 'updateTag' }),
})
updateTag(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto, @Body() dto: TagUpdateDto): Promise<TagResponseDto> {
return this.service.update(auth, id, dto);
}
@Patch(':id')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.TagUpdate })
updateTagV3(
@Auth() auth: AuthDto,
@Param() { id }: UUIDParamDto,
@Body() dto: TagUpdateDto,
): Promise<TagResponseDto> {
return this.service.update(auth, id, dto);
}
@Delete(':id')
@Authenticated({ permission: Permission.TagDelete })
@HttpCode(HttpStatus.NO_CONTENT)
@@ -1,5 +1,5 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Patch, Post, Put, Query } from '@nestjs/common';
import { ApiExcludeEndpoint, ApiTags } from '@nestjs/swagger';
import { Endpoint, HistoryBuilder } from 'src/decorators';
import { AssetStatsDto, AssetStatsResponseDto } from 'src/dtos/asset.dto';
import { AuthDto } from 'src/dtos/auth.dto';
@@ -61,7 +61,11 @@ export class UserAdminController {
@Endpoint({
summary: 'Update a user',
description: 'Update an existing user.',
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
history: new HistoryBuilder()
.added('v1')
.beta('v1')
.stable('v2')
.deprecated('v3', { replacementId: 'updateUserAdmin' }),
})
updateUserAdmin(
@Auth() auth: AuthDto,
@@ -71,6 +75,17 @@ export class UserAdminController {
return this.service.update(auth, id, dto);
}
@Patch(':id')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.AdminUserUpdate, admin: true })
updateUserAdminV3(
@Auth() auth: AuthDto,
@Param() { id }: UUIDParamDto,
@Body() dto: UserAdminUpdateDto,
): Promise<UserAdminResponseDto> {
return this.service.update(auth, id, dto);
}
@Delete(':id')
@Authenticated({ permission: Permission.AdminUserDelete, admin: true })
@Endpoint({
@@ -143,7 +158,11 @@ export class UserAdminController {
@Endpoint({
summary: 'Update user preferences',
description: 'Update the preferences of a specific user.',
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
history: new HistoryBuilder()
.added('v1')
.beta('v1')
.stable('v2')
.deprecated('v3', { replacementId: 'updateUserPreferencesAdmin' }),
})
updateUserPreferencesAdmin(
@Auth() auth: AuthDto,
@@ -153,6 +172,17 @@ export class UserAdminController {
return this.service.updatePreferences(auth, id, dto);
}
@Patch(':id/preferences')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.AdminUserUpdate, admin: true })
updateUserPreferencesAdminV3(
@Auth() auth: AuthDto,
@Param() { id }: UUIDParamDto,
@Body() dto: UserPreferencesUpdateDto,
): Promise<UserPreferencesResponseDto> {
return this.service.updatePreferences(auth, id, dto);
}
@Post(':id/restore')
@Authenticated({ permission: Permission.AdminUserDelete, admin: true })
@HttpCode(HttpStatus.OK)
+29 -3
View File
@@ -7,6 +7,7 @@ import {
HttpStatus,
Next,
Param,
Patch,
Post,
Put,
Query,
@@ -14,7 +15,7 @@ import {
UploadedFile,
UseInterceptors,
} from '@nestjs/common';
import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger';
import { ApiBody, ApiConsumes, ApiExcludeEndpoint, ApiTags } from '@nestjs/swagger';
import { NextFunction, Response } from 'express';
import { Endpoint, HistoryBuilder } from 'src/decorators';
import { AuthDto } from 'src/dtos/auth.dto';
@@ -78,12 +79,23 @@ export class UserController {
@Endpoint({
summary: 'Update current user',
description: 'Update the current user making the API request.',
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
history: new HistoryBuilder()
.added('v1')
.beta('v1')
.stable('v2')
.deprecated('v3', { replacementId: 'updateMyUser' }),
})
updateMyUser(@Auth() auth: AuthDto, @Body() dto: UserUpdateMeDto): Promise<UserAdminResponseDto> {
return this.service.updateMe(auth, dto);
}
@Patch('me')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.UserUpdate })
updateMyUserV3(@Auth() auth: AuthDto, @Body() dto: UserUpdateMeDto): Promise<UserAdminResponseDto> {
return this.service.updateMe(auth, dto);
}
@Get('me/preferences')
@Authenticated({ permission: Permission.UserPreferenceRead })
@Endpoint({
@@ -100,7 +112,11 @@ export class UserController {
@Endpoint({
summary: 'Update my preferences',
description: 'Update the preferences of the current user.',
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
history: new HistoryBuilder()
.added('v1')
.beta('v1')
.stable('v2')
.deprecated('v3', { replacementId: 'updateMyPreferences' }),
})
updateMyPreferences(
@Auth() auth: AuthDto,
@@ -109,6 +125,16 @@ export class UserController {
return this.service.updateMyPreferences(auth, dto);
}
@Patch('me/preferences')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.UserPreferenceUpdate })
updateMyPreferencesV3(
@Auth() auth: AuthDto,
@Body() dto: UserPreferencesUpdateDto,
): Promise<UserPreferencesResponseDto> {
return this.service.updateMyPreferences(auth, dto);
}
@Get('me/license')
@Authenticated({ permission: Permission.UserLicenseRead })
@Endpoint({
@@ -95,15 +95,15 @@ describe(WorkflowController.name, () => {
});
});
describe('PUT /workflows/:id', () => {
describe('PATCH /workflows/:id', () => {
it('should be an authenticated route', async () => {
await request(ctx.getHttpServer()).put(`/workflows/${factory.uuid()}`).send({});
await request(ctx.getHttpServer()).patch(`/workflows/${factory.uuid()}`).send({});
expect(ctx.authenticate).toHaveBeenCalled();
});
it(`should require id to be a uuid`, async () => {
const { status, body } = await request(ctx.getHttpServer())
.put(`/workflows/invalid`)
.patch(`/workflows/invalid`)
.set('Authorization', `Bearer token`)
.send({});
expect(status).toBe(400);
+14 -3
View File
@@ -1,5 +1,5 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Patch, Post, Put, Query } from '@nestjs/common';
import { ApiExcludeEndpoint, ApiTags } from '@nestjs/swagger';
import { Endpoint, HistoryBuilder } from 'src/decorators';
import { AuthDto } from 'src/dtos/auth.dto';
import {
@@ -81,7 +81,7 @@ export class WorkflowController {
summary: 'Update a workflow',
description:
'Update the information of a specific workflow by its ID. This endpoint can be used to update the workflow name, description, trigger type, filters and actions order, etc.',
history: HistoryBuilder.v3(),
history: new HistoryBuilder().added('v3.0.0').deprecated('v3', { replacementId: 'updateWorkflow' }),
})
updateWorkflow(
@Auth() auth: AuthDto,
@@ -91,6 +91,17 @@ export class WorkflowController {
return this.service.update(auth, id, dto);
}
@Patch(':id')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.WorkflowUpdate })
updateWorkflowV3(
@Auth() auth: AuthDto,
@Param() { id }: UUIDParamDto,
@Body() dto: WorkflowUpdateDto,
): Promise<WorkflowResponseDto> {
return this.service.update(auth, id, dto);
}
@Delete(':id')
@Authenticated({ permission: Permission.WorkflowDelete })
@HttpCode(HttpStatus.NO_CONTENT)