1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

chore(server): remove deprecated endpoints (#6984)

* chore: remove deprecated endpoints

* chore: open api
This commit is contained in:
Jason Rasmussen 2024-02-08 16:57:54 -05:00 committed by GitHub
parent 198e8517e5
commit 90a7f16817
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 168 additions and 1807 deletions

View File

@ -36,7 +36,7 @@ class AssetDescriptionService {
Future<String> readLatest(String assetRemoteId, int localExifId) async {
final latestAssetFromServer =
await _api.assetApi.getAssetById(assetRemoteId);
await _api.assetApi.getAssetInfo(assetRemoteId);
final localExifInfo = await _db.exifInfos.get(localExifId);
if (latestAssetFromServer != null && localExifInfo != null) {

View File

@ -25,12 +25,12 @@ class ImageViewerService {
// Download LivePhotos image and motion part
if (asset.isImage && asset.livePhotoVideoId != null && Platform.isIOS) {
var imageResponse =
await _apiService.assetApi.downloadFileOldWithHttpInfo(
await _apiService.downloadApi.downloadFileWithHttpInfo(
asset.remoteId!,
);
var motionReponse =
await _apiService.assetApi.downloadFileOldWithHttpInfo(
await _apiService.downloadApi.downloadFileWithHttpInfo(
asset.livePhotoVideoId!,
);
@ -71,8 +71,8 @@ class ImageViewerService {
return entity != null;
} else {
var res = await _apiService.assetApi
.downloadFileOldWithHttpInfo(asset.remoteId!);
var res = await _apiService.downloadApi
.downloadFileWithHttpInfo(asset.remoteId!);
if (res.statusCode != 200) {
_log.severe(

View File

@ -136,7 +136,7 @@ class BackupVerificationService {
ExifInfo? exif = remote.exifInfo;
if (exif != null && exif.lat != null) return false;
if (exif == null || exif.fileSize == null) {
final dto = await apiService.assetApi.getAssetById(remote.remoteId!);
final dto = await apiService.assetApi.getAssetInfo(remote.remoteId!);
if (dto != null && dto.exifInfo != null) {
exif = ExifInfo.fromDto(dto.exifInfo!);
}
@ -165,8 +165,8 @@ class BackupVerificationService {
// (skip first few KBs containing metadata)
final Uint64List localImage =
_fakeDecodeImg(local, await file.readAsBytes());
final res = await apiService.assetApi
.downloadFileOldWithHttpInfo(remote.remoteId!);
final res = await apiService.downloadApi
.downloadFileWithHttpInfo(remote.remoteId!);
final Uint64List remoteImage = _fakeDecodeImg(remote, res.bodyBytes);
final eq = const ListEquality().equals(remoteImage, localImage);

View File

@ -22,7 +22,7 @@ class TrashService {
try {
List<String> remoteIds =
assetList.where((a) => a.isRemote).map((e) => e.remoteId!).toList();
await _apiService.assetApi.restoreAssetsOld(BulkIdsDto(ids: remoteIds));
await _apiService.trashApi.restoreAssets(BulkIdsDto(ids: remoteIds));
return true;
} catch (error, stack) {
_log.severe("Cannot restore assets ${error.toString()}", error, stack);
@ -32,7 +32,7 @@ class TrashService {
Future<void> emptyTrash() async {
try {
await _apiService.assetApi.emptyTrashOld();
await _apiService.trashApi.emptyTrash();
} catch (error, stack) {
_log.severe("Cannot empty trash ${error.toString()}", error, stack);
}
@ -40,7 +40,7 @@ class TrashService {
Future<void> restoreTrash() async {
try {
await _apiService.assetApi.restoreTrashOld();
await _apiService.trashApi.restoreTrash();
} catch (error, stack) {
_log.severe("Cannot restore trash ${error.toString()}", error, stack);
}

View File

@ -24,6 +24,8 @@ class ApiService {
late SharedLinkApi sharedLinkApi;
late SystemConfigApi systemConfigApi;
late ActivityApi activityApi;
late DownloadApi downloadApi;
late TrashApi trashApi;
ApiService() {
final endpoint = Store.tryGet(StoreKey.serverEndpoint);
@ -51,6 +53,8 @@ class ApiService {
sharedLinkApi = SharedLinkApi(_apiClient);
systemConfigApi = SystemConfigApi(_apiClient);
activityApi = ActivityApi(_apiClient);
downloadApi = DownloadApi(_apiClient);
trashApi = TrashApi(_apiClient);
}
Future<String> resolveAndSetEndpoint(String serverUrl) async {

View File

@ -129,7 +129,7 @@ class AssetService {
// fileSize is always filled on the server but not set on client
if (a.exifInfo?.fileSize == null) {
if (a.isRemote) {
final dto = await _apiService.assetApi.getAssetById(a.remoteId!);
final dto = await _apiService.assetApi.getAssetInfo(a.remoteId!);
if (dto != null && dto.exifInfo != null) {
final newExif = Asset.remote(dto).exifInfo!.copyWith(id: a.id);
if (newExif != a.exifInfo) {

View File

@ -31,8 +31,8 @@ class ShareService {
final tempDir = await getTemporaryDirectory();
final fileName = asset.fileName;
final tempFile = await File('${tempDir.path}/$fileName').create();
final res = await _apiService.assetApi
.downloadFileOldWithHttpInfo(asset.remoteId!);
final res = await _apiService.downloadApi
.downloadFileWithHttpInfo(asset.remoteId!);
if (res.statusCode != 200) {
_log.severe(

View File

@ -95,7 +95,6 @@ doc/OAuthApi.md
doc/OAuthAuthorizeResponseDto.md
doc/OAuthCallbackDto.md
doc/OAuthConfigDto.md
doc/OAuthConfigResponseDto.md
doc/PartnerApi.md
doc/PartnerResponseDto.md
doc/PathEntityType.md
@ -292,7 +291,6 @@ lib/model/model_type.dart
lib/model/o_auth_authorize_response_dto.dart
lib/model/o_auth_callback_dto.dart
lib/model/o_auth_config_dto.dart
lib/model/o_auth_config_response_dto.dart
lib/model/partner_response_dto.dart
lib/model/path_entity_type.dart
lib/model/path_type.dart
@ -462,7 +460,6 @@ test/o_auth_api_test.dart
test/o_auth_authorize_response_dto_test.dart
test/o_auth_callback_dto_test.dart
test/o_auth_config_dto_test.dart
test/o_auth_config_response_dto_test.dart
test/partner_api_test.dart
test/partner_response_dto_test.dart
test/path_entity_type_test.dart

BIN
mobile/openapi/README.md generated

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1055,58 +1055,6 @@
]
}
},
"/asset/assetById/{id}": {
"get": {
"deprecated": true,
"description": "Get a single asset's information",
"operationId": "getAssetById",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
},
{
"name": "key",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Asset"
]
}
},
"/asset/bulk-upload-check": {
"post": {
"description": "Checks if assets exist by checksums",
@ -1265,160 +1213,6 @@
]
}
},
"/asset/download/archive": {
"post": {
"operationId": "downloadArchiveOld",
"parameters": [
{
"name": "key",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetIdsDto"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/octet-stream": {
"schema": {
"format": "binary",
"type": "string"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Asset"
]
}
},
"/asset/download/info": {
"post": {
"operationId": "getDownloadInfoOld",
"parameters": [
{
"name": "key",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DownloadInfoDto"
}
}
},
"required": true
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DownloadResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Asset"
]
}
},
"/asset/download/{id}": {
"post": {
"operationId": "downloadFileOld",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
},
{
"name": "key",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/octet-stream": {
"schema": {
"format": "binary",
"type": "string"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Asset"
]
}
},
"/asset/exist": {
"post": {
"description": "Checks if multiple assets exist on the server and returns all existing - used by background backup",
@ -1732,41 +1526,6 @@
]
}
},
"/asset/restore": {
"post": {
"operationId": "restoreAssetsOld",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BulkIdsDto"
}
}
},
"required": true
},
"responses": {
"204": {
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Asset"
]
}
},
"/asset/search-terms": {
"get": {
"operationId": "getAssetSearchTerms",
@ -2217,56 +1976,6 @@
]
}
},
"/asset/trash/empty": {
"post": {
"operationId": "emptyTrashOld",
"parameters": [],
"responses": {
"204": {
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Asset"
]
}
},
"/asset/trash/restore": {
"post": {
"operationId": "restoreTrashOld",
"parameters": [],
"responses": {
"204": {
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Asset"
]
}
},
"/asset/upload": {
"post": {
"operationId": "uploadFile",
@ -3935,39 +3644,6 @@
]
}
},
"/oauth/config": {
"post": {
"deprecated": true,
"description": "@deprecated use feature flags and /oauth/authorize",
"operationId": "generateOAuthConfig",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OAuthConfigDto"
}
}
},
"required": true
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OAuthConfigResponseDto"
}
}
},
"description": ""
}
},
"tags": [
"OAuth"
]
}
},
"/oauth/link": {
"post": {
"operationId": "linkOAuthAccount",
@ -8399,30 +8075,6 @@
],
"type": "object"
},
"OAuthConfigResponseDto": {
"properties": {
"autoLaunch": {
"type": "boolean"
},
"buttonText": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"passwordLoginEnabled": {
"type": "boolean"
},
"url": {
"type": "string"
}
},
"required": [
"enabled",
"passwordLoginEnabled"
],
"type": "object"
},
"PartnerResponseDto": {
"properties": {
"avatarColor": {

View File

@ -2383,43 +2383,6 @@ export interface OAuthConfigDto {
*/
'redirectUri': string;
}
/**
*
* @export
* @interface OAuthConfigResponseDto
*/
export interface OAuthConfigResponseDto {
/**
*
* @type {boolean}
* @memberof OAuthConfigResponseDto
*/
'autoLaunch'?: boolean;
/**
*
* @type {string}
* @memberof OAuthConfigResponseDto
*/
'buttonText'?: string;
/**
*
* @type {boolean}
* @memberof OAuthConfigResponseDto
*/
'enabled': boolean;
/**
*
* @type {boolean}
* @memberof OAuthConfigResponseDto
*/
'passwordLoginEnabled': boolean;
/**
*
* @type {string}
* @memberof OAuthConfigResponseDto
*/
'url'?: string;
}
/**
*
* @export
@ -6981,140 +6944,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration
options: localVarRequestOptions,
};
},
/**
*
* @param {AssetIdsDto} assetIdsDto
* @param {string} [key]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
downloadArchiveOld: async (assetIdsDto: AssetIdsDto, key?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'assetIdsDto' is not null or undefined
assertParamExists('downloadArchiveOld', 'assetIdsDto', assetIdsDto)
const localVarPath = `/asset/download/archive`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (key !== undefined) {
localVarQueryParameter['key'] = key;
}
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(assetIdsDto, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} id
* @param {string} [key]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
downloadFileOld: async (id: string, key?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('downloadFileOld', 'id', id)
const localVarPath = `/asset/download/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (key !== undefined) {
localVarQueryParameter['key'] = key;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
emptyTrashOld: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/asset/trash/empty`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get all AssetEntity belong to the user
* @param {string} [ifNoneMatch] ETag of data already cached on the client
@ -7230,54 +7059,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get a single asset\'s information
* @param {string} id
* @param {string} [key]
* @param {*} [options] Override http request option.
* @deprecated
* @throws {RequiredError}
*/
getAssetById: async (id: string, key?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('getAssetById', 'id', id)
const localVarPath = `/asset/assetById/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (key !== undefined) {
localVarQueryParameter['key'] = key;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@ -7553,55 +7334,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration
options: localVarRequestOptions,
};
},
/**
*
* @param {DownloadInfoDto} downloadInfoDto
* @param {string} [key]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getDownloadInfoOld: async (downloadInfoDto: DownloadInfoDto, key?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'downloadInfoDto' is not null or undefined
assertParamExists('getDownloadInfoOld', 'downloadInfoDto', downloadInfoDto)
const localVarPath = `/asset/download/info`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
if (key !== undefined) {
localVarQueryParameter['key'] = key;
}
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(downloadInfoDto, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} [fileCreatedAfter]
@ -7937,88 +7669,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {BulkIdsDto} bulkIdsDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
restoreAssetsOld: async (bulkIdsDto: BulkIdsDto, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'bulkIdsDto' is not null or undefined
assertParamExists('restoreAssetsOld', 'bulkIdsDto', bulkIdsDto)
const localVarPath = `/asset/restore`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(bulkIdsDto, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
restoreTrashOld: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/asset/trash/restore`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@ -8697,43 +8347,6 @@ export const AssetApiFp = function(configuration?: Configuration) {
const operationBasePath = operationServerMap['AssetApi.deleteAssets']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
*
* @param {AssetIdsDto} assetIdsDto
* @param {string} [key]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async downloadArchiveOld(assetIdsDto: AssetIdsDto, key?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.downloadArchiveOld(assetIdsDto, key, options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['AssetApi.downloadArchiveOld']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
*
* @param {string} id
* @param {string} [key]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async downloadFileOld(id: string, key?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.downloadFileOld(id, key, options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['AssetApi.downloadFileOld']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async emptyTrashOld(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.emptyTrashOld(options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['AssetApi.emptyTrashOld']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
* Get all AssetEntity belong to the user
* @param {string} [ifNoneMatch] ETag of data already cached on the client
@ -8765,20 +8378,6 @@ export const AssetApiFp = function(configuration?: Configuration) {
const operationBasePath = operationServerMap['AssetApi.getAllUserAssetsByDeviceId']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
* Get a single asset\'s information
* @param {string} id
* @param {string} [key]
* @param {*} [options] Override http request option.
* @deprecated
* @throws {RequiredError}
*/
async getAssetById(id: string, key?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AssetResponseDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getAssetById(id, key, options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['AssetApi.getAssetById']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
*
* @param {string} id
@ -8853,19 +8452,6 @@ export const AssetApiFp = function(configuration?: Configuration) {
const operationBasePath = operationServerMap['AssetApi.getCuratedObjects']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
*
* @param {DownloadInfoDto} downloadInfoDto
* @param {string} [key]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getDownloadInfoOld(downloadInfoDto: DownloadInfoDto, key?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DownloadResponseDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getDownloadInfoOld(downloadInfoDto, key, options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['AssetApi.getDownloadInfoOld']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
*
* @param {string} [fileCreatedAfter]
@ -8949,29 +8535,6 @@ export const AssetApiFp = function(configuration?: Configuration) {
const operationBasePath = operationServerMap['AssetApi.getTimeBuckets']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
*
* @param {BulkIdsDto} bulkIdsDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async restoreAssetsOld(bulkIdsDto: BulkIdsDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.restoreAssetsOld(bulkIdsDto, options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['AssetApi.restoreAssetsOld']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async restoreTrashOld(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.restoreTrashOld(options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['AssetApi.restoreTrashOld']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
*
* @param {AssetJobsDto} assetJobsDto
@ -9151,32 +8714,6 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath
deleteAssets(requestParameters: AssetApiDeleteAssetsRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.deleteAssets(requestParameters.assetBulkDeleteDto, options).then((request) => request(axios, basePath));
},
/**
*
* @param {AssetApiDownloadArchiveOldRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
downloadArchiveOld(requestParameters: AssetApiDownloadArchiveOldRequest, options?: RawAxiosRequestConfig): AxiosPromise<File> {
return localVarFp.downloadArchiveOld(requestParameters.assetIdsDto, requestParameters.key, options).then((request) => request(axios, basePath));
},
/**
*
* @param {AssetApiDownloadFileOldRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
downloadFileOld(requestParameters: AssetApiDownloadFileOldRequest, options?: RawAxiosRequestConfig): AxiosPromise<File> {
return localVarFp.downloadFileOld(requestParameters.id, requestParameters.key, options).then((request) => request(axios, basePath));
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
emptyTrashOld(options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.emptyTrashOld(options).then((request) => request(axios, basePath));
},
/**
* Get all AssetEntity belong to the user
* @param {AssetApiGetAllAssetsRequest} requestParameters Request parameters.
@ -9195,16 +8732,6 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath
getAllUserAssetsByDeviceId(requestParameters: AssetApiGetAllUserAssetsByDeviceIdRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<string>> {
return localVarFp.getAllUserAssetsByDeviceId(requestParameters.deviceId, options).then((request) => request(axios, basePath));
},
/**
* Get a single asset\'s information
* @param {AssetApiGetAssetByIdRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @deprecated
* @throws {RequiredError}
*/
getAssetById(requestParameters: AssetApiGetAssetByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise<AssetResponseDto> {
return localVarFp.getAssetById(requestParameters.id, requestParameters.key, options).then((request) => request(axios, basePath));
},
/**
*
* @param {AssetApiGetAssetInfoRequest} requestParameters Request parameters.
@ -9256,15 +8783,6 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath
getCuratedObjects(options?: RawAxiosRequestConfig): AxiosPromise<Array<CuratedObjectsResponseDto>> {
return localVarFp.getCuratedObjects(options).then((request) => request(axios, basePath));
},
/**
*
* @param {AssetApiGetDownloadInfoOldRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getDownloadInfoOld(requestParameters: AssetApiGetDownloadInfoOldRequest, options?: RawAxiosRequestConfig): AxiosPromise<DownloadResponseDto> {
return localVarFp.getDownloadInfoOld(requestParameters.downloadInfoDto, requestParameters.key, options).then((request) => request(axios, basePath));
},
/**
*
* @param {AssetApiGetMapMarkersRequest} requestParameters Request parameters.
@ -9310,23 +8828,6 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath
getTimeBuckets(requestParameters: AssetApiGetTimeBucketsRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<TimeBucketResponseDto>> {
return localVarFp.getTimeBuckets(requestParameters.size, requestParameters.albumId, requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, requestParameters.key, requestParameters.personId, requestParameters.userId, requestParameters.withPartners, requestParameters.withStacked, options).then((request) => request(axios, basePath));
},
/**
*
* @param {AssetApiRestoreAssetsOldRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
restoreAssetsOld(requestParameters: AssetApiRestoreAssetsOldRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.restoreAssetsOld(requestParameters.bulkIdsDto, options).then((request) => request(axios, basePath));
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
restoreTrashOld(options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.restoreTrashOld(options).then((request) => request(axios, basePath));
},
/**
*
* @param {AssetApiRunAssetJobsRequest} requestParameters Request parameters.
@ -9435,48 +8936,6 @@ export interface AssetApiDeleteAssetsRequest {
readonly assetBulkDeleteDto: AssetBulkDeleteDto
}
/**
* Request parameters for downloadArchiveOld operation in AssetApi.
* @export
* @interface AssetApiDownloadArchiveOldRequest
*/
export interface AssetApiDownloadArchiveOldRequest {
/**
*
* @type {AssetIdsDto}
* @memberof AssetApiDownloadArchiveOld
*/
readonly assetIdsDto: AssetIdsDto
/**
*
* @type {string}
* @memberof AssetApiDownloadArchiveOld
*/
readonly key?: string
}
/**
* Request parameters for downloadFileOld operation in AssetApi.
* @export
* @interface AssetApiDownloadFileOldRequest
*/
export interface AssetApiDownloadFileOldRequest {
/**
*
* @type {string}
* @memberof AssetApiDownloadFileOld
*/
readonly id: string
/**
*
* @type {string}
* @memberof AssetApiDownloadFileOld
*/
readonly key?: string
}
/**
* Request parameters for getAllAssets operation in AssetApi.
* @export
@ -9554,27 +9013,6 @@ export interface AssetApiGetAllUserAssetsByDeviceIdRequest {
readonly deviceId: string
}
/**
* Request parameters for getAssetById operation in AssetApi.
* @export
* @interface AssetApiGetAssetByIdRequest
*/
export interface AssetApiGetAssetByIdRequest {
/**
*
* @type {string}
* @memberof AssetApiGetAssetById
*/
readonly id: string
/**
*
* @type {string}
* @memberof AssetApiGetAssetById
*/
readonly key?: string
}
/**
* Request parameters for getAssetInfo operation in AssetApi.
* @export
@ -9652,27 +9090,6 @@ export interface AssetApiGetAssetThumbnailRequest {
readonly key?: string
}
/**
* Request parameters for getDownloadInfoOld operation in AssetApi.
* @export
* @interface AssetApiGetDownloadInfoOldRequest
*/
export interface AssetApiGetDownloadInfoOldRequest {
/**
*
* @type {DownloadInfoDto}
* @memberof AssetApiGetDownloadInfoOld
*/
readonly downloadInfoDto: DownloadInfoDto
/**
*
* @type {string}
* @memberof AssetApiGetDownloadInfoOld
*/
readonly key?: string
}
/**
* Request parameters for getMapMarkers operation in AssetApi.
* @export
@ -9904,20 +9321,6 @@ export interface AssetApiGetTimeBucketsRequest {
readonly withStacked?: boolean
}
/**
* Request parameters for restoreAssetsOld operation in AssetApi.
* @export
* @interface AssetApiRestoreAssetsOldRequest
*/
export interface AssetApiRestoreAssetsOldRequest {
/**
*
* @type {BulkIdsDto}
* @memberof AssetApiRestoreAssetsOld
*/
readonly bulkIdsDto: BulkIdsDto
}
/**
* Request parameters for runAssetJobs operation in AssetApi.
* @export
@ -10462,38 +9865,6 @@ export class AssetApi extends BaseAPI {
return AssetApiFp(this.configuration).deleteAssets(requestParameters.assetBulkDeleteDto, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {AssetApiDownloadArchiveOldRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AssetApi
*/
public downloadArchiveOld(requestParameters: AssetApiDownloadArchiveOldRequest, options?: RawAxiosRequestConfig) {
return AssetApiFp(this.configuration).downloadArchiveOld(requestParameters.assetIdsDto, requestParameters.key, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {AssetApiDownloadFileOldRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AssetApi
*/
public downloadFileOld(requestParameters: AssetApiDownloadFileOldRequest, options?: RawAxiosRequestConfig) {
return AssetApiFp(this.configuration).downloadFileOld(requestParameters.id, requestParameters.key, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AssetApi
*/
public emptyTrashOld(options?: RawAxiosRequestConfig) {
return AssetApiFp(this.configuration).emptyTrashOld(options).then((request) => request(this.axios, this.basePath));
}
/**
* Get all AssetEntity belong to the user
* @param {AssetApiGetAllAssetsRequest} requestParameters Request parameters.
@ -10516,18 +9887,6 @@ export class AssetApi extends BaseAPI {
return AssetApiFp(this.configuration).getAllUserAssetsByDeviceId(requestParameters.deviceId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get a single asset\'s information
* @param {AssetApiGetAssetByIdRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @deprecated
* @throws {RequiredError}
* @memberof AssetApi
*/
public getAssetById(requestParameters: AssetApiGetAssetByIdRequest, options?: RawAxiosRequestConfig) {
return AssetApiFp(this.configuration).getAssetById(requestParameters.id, requestParameters.key, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {AssetApiGetAssetInfoRequest} requestParameters Request parameters.
@ -10591,17 +9950,6 @@ export class AssetApi extends BaseAPI {
return AssetApiFp(this.configuration).getCuratedObjects(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {AssetApiGetDownloadInfoOldRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AssetApi
*/
public getDownloadInfoOld(requestParameters: AssetApiGetDownloadInfoOldRequest, options?: RawAxiosRequestConfig) {
return AssetApiFp(this.configuration).getDownloadInfoOld(requestParameters.downloadInfoDto, requestParameters.key, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {AssetApiGetMapMarkersRequest} requestParameters Request parameters.
@ -10657,27 +10005,6 @@ export class AssetApi extends BaseAPI {
return AssetApiFp(this.configuration).getTimeBuckets(requestParameters.size, requestParameters.albumId, requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, requestParameters.key, requestParameters.personId, requestParameters.userId, requestParameters.withPartners, requestParameters.withStacked, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {AssetApiRestoreAssetsOldRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AssetApi
*/
public restoreAssetsOld(requestParameters: AssetApiRestoreAssetsOldRequest, options?: RawAxiosRequestConfig) {
return AssetApiFp(this.configuration).restoreAssetsOld(requestParameters.bulkIdsDto, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AssetApi
*/
public restoreTrashOld(options?: RawAxiosRequestConfig) {
return AssetApiFp(this.configuration).restoreTrashOld(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {AssetApiRunAssetJobsRequest} requestParameters Request parameters.
@ -13391,42 +12718,6 @@ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration
options: localVarRequestOptions,
};
},
/**
* @deprecated use feature flags and /oauth/authorize
* @param {OAuthConfigDto} oAuthConfigDto
* @param {*} [options] Override http request option.
* @deprecated
* @throws {RequiredError}
*/
generateOAuthConfig: async (oAuthConfigDto: OAuthConfigDto, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'oAuthConfigDto' is not null or undefined
assertParamExists('generateOAuthConfig', 'oAuthConfigDto', oAuthConfigDto)
const localVarPath = `/oauth/config`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(oAuthConfigDto, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {OAuthCallbackDto} oAuthCallbackDto
@ -13595,19 +12886,6 @@ export const OAuthApiFp = function(configuration?: Configuration) {
const operationBasePath = operationServerMap['OAuthApi.finishOAuth']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
* @deprecated use feature flags and /oauth/authorize
* @param {OAuthConfigDto} oAuthConfigDto
* @param {*} [options] Override http request option.
* @deprecated
* @throws {RequiredError}
*/
async generateOAuthConfig(oAuthConfigDto: OAuthConfigDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OAuthConfigResponseDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.generateOAuthConfig(oAuthConfigDto, options);
const index = configuration?.serverIndex ?? 0;
const operationBasePath = operationServerMap['OAuthApi.generateOAuthConfig']?.[index]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
},
/**
*
* @param {OAuthCallbackDto} oAuthCallbackDto
@ -13673,16 +12951,6 @@ export const OAuthApiFactory = function (configuration?: Configuration, basePath
finishOAuth(requestParameters: OAuthApiFinishOAuthRequest, options?: RawAxiosRequestConfig): AxiosPromise<LoginResponseDto> {
return localVarFp.finishOAuth(requestParameters.oAuthCallbackDto, options).then((request) => request(axios, basePath));
},
/**
* @deprecated use feature flags and /oauth/authorize
* @param {OAuthApiGenerateOAuthConfigRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @deprecated
* @throws {RequiredError}
*/
generateOAuthConfig(requestParameters: OAuthApiGenerateOAuthConfigRequest, options?: RawAxiosRequestConfig): AxiosPromise<OAuthConfigResponseDto> {
return localVarFp.generateOAuthConfig(requestParameters.oAuthConfigDto, options).then((request) => request(axios, basePath));
},
/**
*
* @param {OAuthApiLinkOAuthAccountRequest} requestParameters Request parameters.
@ -13734,20 +13002,6 @@ export interface OAuthApiFinishOAuthRequest {
readonly oAuthCallbackDto: OAuthCallbackDto
}
/**
* Request parameters for generateOAuthConfig operation in OAuthApi.
* @export
* @interface OAuthApiGenerateOAuthConfigRequest
*/
export interface OAuthApiGenerateOAuthConfigRequest {
/**
*
* @type {OAuthConfigDto}
* @memberof OAuthApiGenerateOAuthConfig
*/
readonly oAuthConfigDto: OAuthConfigDto
}
/**
* Request parameters for linkOAuthAccount operation in OAuthApi.
* @export
@ -13794,18 +13048,6 @@ export class OAuthApi extends BaseAPI {
return OAuthApiFp(this.configuration).finishOAuth(requestParameters.oAuthCallbackDto, options).then((request) => request(this.axios, this.basePath));
}
/**
* @deprecated use feature flags and /oauth/authorize
* @param {OAuthApiGenerateOAuthConfigRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @deprecated
* @throws {RequiredError}
* @memberof OAuthApi
*/
public generateOAuthConfig(requestParameters: OAuthApiGenerateOAuthConfigRequest, options?: RawAxiosRequestConfig) {
return OAuthApiFp(this.configuration).generateOAuthConfig(requestParameters.oAuthConfigDto, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {OAuthApiLinkOAuthAccountRequest} requestParameters Request parameters.

View File

@ -101,7 +101,6 @@ models/ModelType.ts
models/OAuthAuthorizeResponseDto.ts
models/OAuthCallbackDto.ts
models/OAuthConfigDto.ts
models/OAuthConfigResponseDto.ts
models/PartnerResponseDto.ts
models/PathEntityType.ts
models/PathType.ts

View File

@ -20,19 +20,15 @@ import type {
AssetBulkUploadCheckDto,
AssetBulkUploadCheckResponseDto,
AssetFileUploadResponseDto,
AssetIdsDto,
AssetJobsDto,
AssetOrder,
AssetResponseDto,
AssetStatsResponseDto,
AssetTypeEnum,
BulkIdsDto,
CheckExistingAssetsDto,
CheckExistingAssetsResponseDto,
CuratedLocationsResponseDto,
CuratedObjectsResponseDto,
DownloadInfoDto,
DownloadResponseDto,
MapMarkerResponseDto,
MemoryLaneResponseDto,
ThumbnailFormat,
@ -52,8 +48,6 @@ import {
AssetBulkUploadCheckResponseDtoToJSON,
AssetFileUploadResponseDtoFromJSON,
AssetFileUploadResponseDtoToJSON,
AssetIdsDtoFromJSON,
AssetIdsDtoToJSON,
AssetJobsDtoFromJSON,
AssetJobsDtoToJSON,
AssetOrderFromJSON,
@ -64,8 +58,6 @@ import {
AssetStatsResponseDtoToJSON,
AssetTypeEnumFromJSON,
AssetTypeEnumToJSON,
BulkIdsDtoFromJSON,
BulkIdsDtoToJSON,
CheckExistingAssetsDtoFromJSON,
CheckExistingAssetsDtoToJSON,
CheckExistingAssetsResponseDtoFromJSON,
@ -74,10 +66,6 @@ import {
CuratedLocationsResponseDtoToJSON,
CuratedObjectsResponseDtoFromJSON,
CuratedObjectsResponseDtoToJSON,
DownloadInfoDtoFromJSON,
DownloadInfoDtoToJSON,
DownloadResponseDtoFromJSON,
DownloadResponseDtoToJSON,
MapMarkerResponseDtoFromJSON,
MapMarkerResponseDtoToJSON,
MemoryLaneResponseDtoFromJSON,
@ -106,16 +94,6 @@ export interface DeleteAssetsRequest {
assetBulkDeleteDto: AssetBulkDeleteDto;
}
export interface DownloadArchiveOldRequest {
assetIdsDto: AssetIdsDto;
key?: string;
}
export interface DownloadFileOldRequest {
id: string;
key?: string;
}
export interface GetAllAssetsRequest {
ifNoneMatch?: string;
isArchived?: boolean;
@ -131,11 +109,6 @@ export interface GetAllUserAssetsByDeviceIdRequest {
deviceId: string;
}
export interface GetAssetByIdRequest {
id: string;
key?: string;
}
export interface GetAssetInfoRequest {
id: string;
key?: string;
@ -153,11 +126,6 @@ export interface GetAssetThumbnailRequest {
key?: string;
}
export interface GetDownloadInfoOldRequest {
downloadInfoDto: DownloadInfoDto;
key?: string;
}
export interface GetMapMarkersRequest {
fileCreatedAfter?: Date;
fileCreatedBefore?: Date;
@ -201,10 +169,6 @@ export interface GetTimeBucketsRequest {
withStacked?: boolean;
}
export interface RestoreAssetsOldRequest {
bulkIdsDto: BulkIdsDto;
}
export interface RunAssetJobsRequest {
assetJobsDto: AssetJobsDto;
}
@ -428,132 +392,6 @@ export class AssetApi extends runtime.BaseAPI {
await this.deleteAssetsRaw(requestParameters, initOverrides);
}
/**
*/
async downloadArchiveOldRaw(requestParameters: DownloadArchiveOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {
if (requestParameters.assetIdsDto === null || requestParameters.assetIdsDto === undefined) {
throw new runtime.RequiredError('assetIdsDto','Required parameter requestParameters.assetIdsDto was null or undefined when calling downloadArchiveOld.');
}
const queryParameters: any = {};
if (requestParameters.key !== undefined) {
queryParameters['key'] = requestParameters.key;
}
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("bearer", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/asset/download/archive`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: AssetIdsDtoToJSON(requestParameters.assetIdsDto),
}, initOverrides);
return new runtime.BlobApiResponse(response);
}
/**
*/
async downloadArchiveOld(requestParameters: DownloadArchiveOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {
const response = await this.downloadArchiveOldRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async downloadFileOldRaw(requestParameters: DownloadFileOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {
if (requestParameters.id === null || requestParameters.id === undefined) {
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling downloadFileOld.');
}
const queryParameters: any = {};
if (requestParameters.key !== undefined) {
queryParameters['key'] = requestParameters.key;
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("bearer", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/asset/download/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.BlobApiResponse(response);
}
/**
*/
async downloadFileOld(requestParameters: DownloadFileOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {
const response = await this.downloadFileOldRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async emptyTrashOldRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("bearer", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/asset/trash/empty`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*/
async emptyTrashOld(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.emptyTrashOldRaw(initOverrides);
}
/**
* Get all AssetEntity belong to the user
*/
@ -666,54 +504,6 @@ export class AssetApi extends runtime.BaseAPI {
return await response.value();
}
/**
* Get a single asset\'s information
* @deprecated
*/
async getAssetByIdRaw(requestParameters: GetAssetByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssetResponseDto>> {
if (requestParameters.id === null || requestParameters.id === undefined) {
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getAssetById.');
}
const queryParameters: any = {};
if (requestParameters.key !== undefined) {
queryParameters['key'] = requestParameters.key;
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("bearer", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/asset/assetById/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => AssetResponseDtoFromJSON(jsonValue));
}
/**
* Get a single asset\'s information
* @deprecated
*/
async getAssetById(requestParameters: GetAssetByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssetResponseDto> {
const response = await this.getAssetByIdRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async getAssetInfoRaw(requestParameters: GetAssetInfoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssetResponseDto>> {
@ -962,53 +752,6 @@ export class AssetApi extends runtime.BaseAPI {
return await response.value();
}
/**
*/
async getDownloadInfoOldRaw(requestParameters: GetDownloadInfoOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DownloadResponseDto>> {
if (requestParameters.downloadInfoDto === null || requestParameters.downloadInfoDto === undefined) {
throw new runtime.RequiredError('downloadInfoDto','Required parameter requestParameters.downloadInfoDto was null or undefined when calling getDownloadInfoOld.');
}
const queryParameters: any = {};
if (requestParameters.key !== undefined) {
queryParameters['key'] = requestParameters.key;
}
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("bearer", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/asset/download/info`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: DownloadInfoDtoToJSON(requestParameters.downloadInfoDto),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DownloadResponseDtoFromJSON(jsonValue));
}
/**
*/
async getDownloadInfoOld(requestParameters: GetDownloadInfoOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DownloadResponseDto> {
const response = await this.getDownloadInfoOldRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async getMapMarkersRaw(requestParameters: GetMapMarkersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<MapMarkerResponseDto>>> {
@ -1321,83 +1064,6 @@ export class AssetApi extends runtime.BaseAPI {
return await response.value();
}
/**
*/
async restoreAssetsOldRaw(requestParameters: RestoreAssetsOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters.bulkIdsDto === null || requestParameters.bulkIdsDto === undefined) {
throw new runtime.RequiredError('bulkIdsDto','Required parameter requestParameters.bulkIdsDto was null or undefined when calling restoreAssetsOld.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("bearer", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/asset/restore`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: BulkIdsDtoToJSON(requestParameters.bulkIdsDto),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*/
async restoreAssetsOld(requestParameters: RestoreAssetsOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.restoreAssetsOldRaw(requestParameters, initOverrides);
}
/**
*/
async restoreTrashOldRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("bearer", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/asset/trash/restore`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*/
async restoreTrashOld(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.restoreTrashOldRaw(initOverrides);
}
/**
*/
async runAssetJobsRaw(requestParameters: RunAssetJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {

View File

@ -19,7 +19,6 @@ import type {
OAuthAuthorizeResponseDto,
OAuthCallbackDto,
OAuthConfigDto,
OAuthConfigResponseDto,
UserResponseDto,
} from '../models/index';
import {
@ -31,8 +30,6 @@ import {
OAuthCallbackDtoToJSON,
OAuthConfigDtoFromJSON,
OAuthConfigDtoToJSON,
OAuthConfigResponseDtoFromJSON,
OAuthConfigResponseDtoToJSON,
UserResponseDtoFromJSON,
UserResponseDtoToJSON,
} from '../models/index';
@ -41,10 +38,6 @@ export interface FinishOAuthRequest {
oAuthCallbackDto: OAuthCallbackDto;
}
export interface GenerateOAuthConfigRequest {
oAuthConfigDto: OAuthConfigDto;
}
export interface LinkOAuthAccountRequest {
oAuthCallbackDto: OAuthCallbackDto;
}
@ -89,41 +82,6 @@ export class OAuthApi extends runtime.BaseAPI {
return await response.value();
}
/**
* @deprecated use feature flags and /oauth/authorize
* @deprecated
*/
async generateOAuthConfigRaw(requestParameters: GenerateOAuthConfigRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OAuthConfigResponseDto>> {
if (requestParameters.oAuthConfigDto === null || requestParameters.oAuthConfigDto === undefined) {
throw new runtime.RequiredError('oAuthConfigDto','Required parameter requestParameters.oAuthConfigDto was null or undefined when calling generateOAuthConfig.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/oauth/config`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: OAuthConfigDtoToJSON(requestParameters.oAuthConfigDto),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => OAuthConfigResponseDtoFromJSON(jsonValue));
}
/**
* @deprecated use feature flags and /oauth/authorize
* @deprecated
*/
async generateOAuthConfig(requestParameters: GenerateOAuthConfigRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OAuthConfigResponseDto> {
const response = await this.generateOAuthConfigRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async linkOAuthAccountRaw(requestParameters: LinkOAuthAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserResponseDto>> {

View File

@ -81,7 +81,6 @@ export * from './ModelType';
export * from './OAuthAuthorizeResponseDto';
export * from './OAuthCallbackDto';
export * from './OAuthConfigDto';
export * from './OAuthConfigResponseDto';
export * from './PartnerResponseDto';
export * from './PathEntityType';
export * from './PathType';

View File

@ -14,7 +14,7 @@ import { AssetEntity, AssetStackEntity, AssetType, SharedLinkType } from '@app/i
import { AssetRepository } from '@app/infra/repositories';
import { INestApplication } from '@nestjs/common';
import { errorStub, userDto, uuidStub } from '@test/fixtures';
import { randomBytes } from 'crypto';
import { randomBytes } from 'node:crypto';
import request from 'supertest';
import { api } from '../../client';
import { generateAsset, testApp, today, yesterday } from '../utils';
@ -517,91 +517,6 @@ describe(`${AssetController.name} (e2e)`, () => {
}
});
// TODO remove with deprecated endpoint
describe('GET /asset/assetById/:id', () => {
it('should require authentication', async () => {
const { status, body } = await request(server).get(`/asset/assetById/${uuidStub.notFound}`);
expect(body).toEqual(errorStub.unauthorized);
expect(status).toBe(401);
});
it('should require a valid id', async () => {
const { status, body } = await request(server)
.get(`/asset/assetById/${uuidStub.invalid}`)
.set('Authorization', `Bearer ${user1.accessToken}`);
expect(status).toBe(400);
expect(body).toEqual(errorStub.badRequest(['id must be a UUID']));
});
it('should require access', async () => {
const { status, body } = await request(server)
.get(`/asset/assetById/${asset4.id}`)
.set('Authorization', `Bearer ${user1.accessToken}`);
expect(status).toBe(400);
expect(body).toEqual(errorStub.noPermission);
});
it('should get the asset info', async () => {
const { status, body } = await request(server)
.get(`/asset/assetById/${asset1.id}`)
.set('Authorization', `Bearer ${user1.accessToken}`);
expect(status).toBe(200);
expect(body).toMatchObject({ id: asset1.id });
});
it('should work with a shared link', async () => {
const sharedLink = await api.sharedLinkApi.create(server, user1.accessToken, {
type: SharedLinkType.INDIVIDUAL,
assetIds: [asset1.id],
});
const { status, body } = await request(server).get(`/asset/assetById/${asset1.id}?key=${sharedLink.key}`);
expect(status).toBe(200);
expect(body).toMatchObject({ id: asset1.id });
});
it('should not send people data for shared links for un-authenticated users', async () => {
const personRepository = app.get<IPersonRepository>(IPersonRepository);
const person = await personRepository.create({ ownerId: asset1.ownerId, name: 'Test Person' });
await personRepository.createFaces([
{
assetId: asset1.id,
personId: person.id,
embedding: Array.from({ length: 512 }, Math.random),
},
]);
const { status, body } = await request(server)
.put(`/asset/${asset1.id}`)
.set('Authorization', `Bearer ${user1.accessToken}`)
.send({ isFavorite: true });
expect(status).toEqual(200);
expect(body).toMatchObject({
id: asset1.id,
isFavorite: true,
people: [
{
birthDate: null,
id: expect.any(String),
isHidden: false,
name: 'Test Person',
thumbnailPath: '',
},
],
});
const sharedLink = await api.sharedLinkApi.create(server, user1.accessToken, {
type: SharedLinkType.INDIVIDUAL,
assetIds: [asset1.id],
});
const data = await request(server).get(`/asset/assetById/${asset1.id}?key=${sharedLink.key}`);
expect(data.status).toBe(200);
expect(data.body).toMatchObject({ people: [] });
});
});
describe('GET /asset/:id', () => {
it('should require authentication', async () => {
const { status, body } = await request(server).get(`/asset/${uuidStub.notFound}`);
@ -643,6 +558,47 @@ describe(`${AssetController.name} (e2e)`, () => {
expect(status).toBe(200);
expect(body).toMatchObject({ id: asset1.id });
});
it('should not send people data for shared links for un-authenticated users', async () => {
const personRepository = app.get<IPersonRepository>(IPersonRepository);
const person = await personRepository.create({ ownerId: asset1.ownerId, name: 'Test Person' });
await personRepository.createFaces([
{
assetId: asset1.id,
personId: person.id,
embedding: Array.from({ length: 512 }, Math.random),
},
]);
const { status, body } = await request(server)
.put(`/asset/${asset1.id}`)
.set('Authorization', `Bearer ${user1.accessToken}`)
.send({ isFavorite: true });
expect(status).toEqual(200);
expect(body).toMatchObject({
id: asset1.id,
isFavorite: true,
people: [
{
birthDate: null,
id: expect.any(String),
isHidden: false,
name: 'Test Person',
thumbnailPath: '',
},
],
});
const sharedLink = await api.sharedLinkApi.create(server, user1.accessToken, {
type: SharedLinkType.INDIVIDUAL,
assetIds: [asset1.id],
});
const data = await request(server).get(`/asset/${asset1.id}?key=${sharedLink.key}`);
expect(data.status).toBe(200);
expect(data.body).toMatchObject({ people: [] });
});
});
describe('POST /asset/upload', () => {
@ -920,46 +876,6 @@ describe(`${AssetController.name} (e2e)`, () => {
});
});
describe('POST /asset/download/info', () => {
it('should require authentication', async () => {
const { status, body } = await request(server)
.post(`/asset/download/info`)
.send({ assetIds: [asset1.id] });
expect(status).toBe(401);
expect(body).toEqual(errorStub.unauthorized);
});
it('should download info', async () => {
const { status, body } = await request(server)
.post('/asset/download/info')
.set('Authorization', `Bearer ${user1.accessToken}`)
.send({ assetIds: [asset1.id] });
expect(status).toBe(201);
expect(body).toEqual(expect.objectContaining({ archives: [expect.objectContaining({ assetIds: [asset1.id] })] }));
});
});
describe('POST /asset/download/:id', () => {
it('should require authentication', async () => {
const { status, body } = await request(server).post(`/asset/download/${asset1.id}`);
expect(status).toBe(401);
expect(body).toEqual(errorStub.unauthorized);
});
it('should download file', async () => {
const asset = await api.assetApi.upload(server, user1.accessToken, 'example');
const response = await request(server)
.post(`/asset/download/${asset.id}`)
.set('Authorization', `Bearer ${user1.accessToken}`);
expect(response.status).toBe(200);
expect(response.headers['content-type']).toEqual('image/jpeg');
});
});
describe('GET /asset/statistics', () => {
beforeEach(async () => {
await api.assetApi.upload(server, user1.accessToken, 'favored_asset', { isFavorite: true });
@ -1459,20 +1375,20 @@ describe(`${AssetController.name} (e2e)`, () => {
});
});
const getAssetIdsWithoutFaces = async () => {
const assetPagination = usePagination(10, (pagination) =>
assetRepository.getWithout(pagination, WithoutProperty.FACES),
);
let assets: AssetEntity[] = [];
for await (const assetsPage of assetPagination) {
assets = [...assets, ...assetsPage];
}
return assets.map((a) => a.id);
};
describe(AssetRepository.name, () => {
describe('getWithout', () => {
describe('WithoutProperty.FACES', () => {
const getAssetIdsWithoutFaces = async () => {
const assetPagination = usePagination(10, (pagination) =>
assetRepository.getWithout(pagination, WithoutProperty.FACES),
);
let assets: AssetEntity[] = [];
for await (const assetsPage of assetPagination) {
assets = [...assets, ...assetsPage];
}
return assets.map((a) => a.id);
};
beforeEach(async () => {
await assetRepository.save({ id: asset1.id, resizePath: '/path/to/resize' });
expect(await getAssetIdsWithoutFaces()).toContain(asset1.id);

View File

@ -0,0 +1,89 @@
import { AssetResponseDto, IAssetRepository, LibraryResponseDto, LoginResponseDto, mapAsset } from '@app/domain';
import { AssetController } from '@app/immich';
import { AssetEntity } from '@app/infra/entities';
import { INestApplication } from '@nestjs/common';
import { errorStub, userDto } from '@test/fixtures';
import request from 'supertest';
import { api } from '../../client';
import { generateAsset, testApp } from '../utils';
describe(`${AssetController.name} (e2e)`, () => {
let app: INestApplication;
let server: any;
let assetRepository: IAssetRepository;
let user1: LoginResponseDto;
let libraries: LibraryResponseDto[];
let asset1: AssetResponseDto;
const createAsset = async (
loginResponse: LoginResponseDto,
fileCreatedAt: Date,
other: Partial<AssetEntity> = {},
) => {
const asset = await assetRepository.create(
generateAsset(loginResponse.userId, libraries, { fileCreatedAt, ...other }),
);
return mapAsset(asset);
};
beforeAll(async () => {
app = await testApp.create();
server = app.getHttpServer();
assetRepository = app.get<IAssetRepository>(IAssetRepository);
await testApp.reset();
await api.authApi.adminSignUp(server);
const admin = await api.authApi.adminLogin(server);
await api.userApi.create(server, admin.accessToken, userDto.user1);
user1 = await api.authApi.login(server, userDto.user1);
libraries = await api.libraryApi.getAll(server, user1.accessToken);
asset1 = await createAsset(user1, new Date('1970-01-01'));
});
afterAll(async () => {
await testApp.teardown();
});
describe('POST /download/info', () => {
it('should require authentication', async () => {
const { status, body } = await request(server)
.post(`/download/info`)
.send({ assetIds: [asset1.id] });
expect(status).toBe(401);
expect(body).toEqual(errorStub.unauthorized);
});
it('should download info', async () => {
const { status, body } = await request(server)
.post('/download/info')
.set('Authorization', `Bearer ${user1.accessToken}`)
.send({ assetIds: [asset1.id] });
expect(status).toBe(201);
expect(body).toEqual(expect.objectContaining({ archives: [expect.objectContaining({ assetIds: [asset1.id] })] }));
});
});
describe('POST /download/asset/:id', () => {
it('should require authentication', async () => {
const { status, body } = await request(server).post(`/download/asset/${asset1.id}`);
expect(status).toBe(401);
expect(body).toEqual(errorStub.unauthorized);
});
it('should download file', async () => {
const asset = await api.assetApi.upload(server, user1.accessToken, 'example');
const response = await request(server)
.post(`/download/asset/${asset.id}`)
.set('Authorization', `Bearer ${user1.accessToken}`);
expect(response.status).toBe(200);
expect(response.headers['content-type']).toEqual('image/jpeg');
});
});
});

View File

@ -1,7 +1,7 @@
import { AssetResponseDto } from '@app/domain';
import { CreateAssetDto } from '@app/immich/api-v1/asset/dto/create-asset.dto';
import { AssetFileUploadResponseDto } from '@app/immich/api-v1/asset/response-dto/asset-file-upload-response.dto';
import { randomBytes } from 'crypto';
import { randomBytes } from 'node:crypto';
import request from 'supertest';
type UploadDto = Partial<CreateAssetDto> & { content?: Buffer; filename?: string };
@ -34,9 +34,7 @@ export const assetApi = {
return body as AssetResponseDto;
},
get: async (server: any, accessToken: string, id: string): Promise<AssetResponseDto> => {
const { body, status } = await request(server)
.get(`/asset/assetById/${id}`)
.set('Authorization', `Bearer ${accessToken}`);
const { body, status } = await request(server).get(`/asset/${id}`).set('Authorization', `Bearer ${accessToken}`);
expect(status).toBe(200);
return body as AssetResponseDto;
},

View File

@ -106,15 +106,6 @@ export class OAuthConfigDto {
redirectUri!: string;
}
/** @deprecated use oauth authorize */
export class OAuthConfigResponseDto {
enabled!: boolean;
passwordLoginEnabled!: boolean;
url?: string;
buttonText?: string;
autoLaunch?: boolean;
}
export class OAuthAuthorizeResponseDto {
url!: string;
}

View File

@ -429,27 +429,6 @@ describe('AuthService', () => {
});
});
describe('generateConfig', () => {
it('should work when oauth is not configured', async () => {
configMock.load.mockResolvedValue(systemConfigStub.disabled);
await expect(sut.generateConfig({ redirectUri: 'http://callback' })).resolves.toEqual({
enabled: false,
passwordLoginEnabled: false,
});
});
it('should generate the config', async () => {
configMock.load.mockResolvedValue(systemConfigStub.enabled);
await expect(sut.generateConfig({ redirectUri: 'http://redirect' })).resolves.toEqual({
enabled: true,
buttonText: 'OAuth',
url: 'http://authorization-url',
autoLaunch: false,
passwordLoginEnabled: true,
});
});
});
describe('callback', () => {
it('should throw an error if OAuth is not enabled', async () => {
await expect(sut.callback({ url: '' }, loginDetails)).rejects.toBeInstanceOf(BadRequestException);

View File

@ -42,7 +42,6 @@ import {
OAuthAuthorizeResponseDto,
OAuthCallbackDto,
OAuthConfigDto,
OAuthConfigResponseDto,
SignUpDto,
mapLoginResponse,
mapUserToken,
@ -201,28 +200,6 @@ export class AuthService {
return `${MOBILE_REDIRECT}?${url.split('?')[1] || ''}`;
}
async generateConfig(dto: OAuthConfigDto): Promise<OAuthConfigResponseDto> {
const config = await this.configCore.getConfig();
const response = {
enabled: config.oauth.enabled,
passwordLoginEnabled: config.passwordLogin.enabled,
};
if (!response.enabled) {
return response;
}
const { scope, buttonText, autoLaunch } = config.oauth;
const oauthClient = await this.getOAuthClient(config);
const url = oauthClient.authorizationUrl({
redirect_uri: this.normalize(config, dto.redirectUri),
scope,
state: generators.state(),
});
return { ...response, buttonText, url, autoLaunch };
}
async authorize(dto: OAuthConfigDto): Promise<OAuthAuthorizeResponseDto> {
const config = await this.configCore.getConfig();
if (!config.oauth.enabled) {

View File

@ -230,8 +230,6 @@ export class SystemConfigCore {
[FeatureFlag.SIDECAR]: true,
[FeatureFlag.SEARCH]: true,
[FeatureFlag.TRASH]: config.trash.enabled,
// TODO: use these instead of `POST oauth/config`
[FeatureFlag.OAUTH]: config.oauth.enabled,
[FeatureFlag.OAUTH_AUTO_LAUNCH]: config.oauth.autoLaunch,
[FeatureFlag.PASSWORD_LOGIN]: config.passwordLogin.enabled,

View File

@ -1,4 +1,4 @@
import { AssetResponseDto, AssetService, AuthDto } from '@app/domain';
import { AssetResponseDto, AuthDto } from '@app/domain';
import {
Body,
Controller,
@ -18,7 +18,7 @@ import {
import { ApiBody, ApiConsumes, ApiHeader, ApiTags } from '@nestjs/swagger';
import { NextFunction, Response } from 'express';
import { Auth, Authenticated, FileResponse, SharedLinkRoute } from '../../app.guard';
import { UseValidation, sendFile } from '../../app.utils';
import { sendFile } from '../../app.utils';
import { UUIDParamDto } from '../../controllers/dto/uuid-param.dto';
import { FileUploadInterceptor, ImmichFile, Route, mapToUploadFile } from '../../interceptors';
import FileNotEmptyValidator from '../validation/file-not-empty-validator';
@ -45,10 +45,7 @@ interface UploadFiles {
@Controller(Route.ASSET)
@Authenticated()
export class AssetController {
constructor(
private serviceV1: AssetServiceV1,
private service: AssetService,
) {}
constructor(private serviceV1: AssetServiceV1) {}
@SharedLinkRoute()
@Post('upload')
@ -143,17 +140,6 @@ export class AssetController {
return this.serviceV1.getAllAssets(auth, dto);
}
/**
* Get a single asset's information
* @deprecated Use `/asset/:id`
*/
@SharedLinkRoute()
@UseValidation()
@Get('/assetById/:id')
getAssetById(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto): Promise<AssetResponseDto> {
return this.service.get(auth, id) as Promise<AssetResponseDto>;
}
/**
* Checks if multiple assets exist on the server and returns all existing - used by background backup
*/

View File

@ -1,7 +1,6 @@
import {
AssetBulkDeleteDto,
AssetBulkUpdateDto,
AssetIdsDto,
AssetJobsDto,
AssetResponseDto,
AssetSearchDto,
@ -9,10 +8,7 @@ import {
AssetStatsDto,
AssetStatsResponseDto,
AuthDto,
BulkIdsDto,
DeviceIdDto,
DownloadInfoDto,
DownloadResponseDto,
DownloadService,
MapMarkerDto,
MapMarkerResponseDto,
@ -26,25 +22,10 @@ import {
UpdateAssetDto as UpdateDto,
UpdateStackParentDto,
} from '@app/domain';
import {
Body,
Controller,
Delete,
Get,
HttpCode,
HttpStatus,
Next,
Param,
Post,
Put,
Query,
Res,
StreamableFile,
} from '@nestjs/common';
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { NextFunction, Response } from 'express';
import { Auth, Authenticated, FileResponse, SharedLinkRoute } from '../app.guard';
import { UseValidation, asStreamableFile, sendFile } from '../app.utils';
import { Auth, Authenticated, SharedLinkRoute } from '../app.guard';
import { UseValidation } from '../app.utils';
import { Route } from '../interceptors';
import { UUIDParamDto } from './dto/uuid-param.dto';
@ -87,42 +68,6 @@ export class AssetController {
return this.service.getRandom(auth, dto.count ?? 1);
}
/**
* @deprecated use `/download/info`
*/
@SharedLinkRoute()
@Post('download/info')
getDownloadInfoOld(@Auth() auth: AuthDto, @Body() dto: DownloadInfoDto): Promise<DownloadResponseDto> {
return this.downloadService.getDownloadInfo(auth, dto);
}
/**
* @deprecated use `/download/archive`
*/
@SharedLinkRoute()
@Post('download/archive')
@HttpCode(HttpStatus.OK)
@FileResponse()
downloadArchiveOld(@Auth() auth: AuthDto, @Body() dto: AssetIdsDto): Promise<StreamableFile> {
return this.downloadService.downloadArchive(auth, dto).then(asStreamableFile);
}
/**
* @deprecated use `/download/:id`
*/
@SharedLinkRoute()
@Post('download/:id')
@HttpCode(HttpStatus.OK)
@FileResponse()
async downloadFileOld(
@Res() res: Response,
@Next() next: NextFunction,
@Auth() auth: AuthDto,
@Param() { id }: UUIDParamDto,
) {
await sendFile(res, next, () => this.downloadService.downloadFile(auth, id));
}
/**
* Get all asset of a device that are in the database, ID only.
*/
@ -166,33 +111,6 @@ export class AssetController {
return this.service.deleteAll(auth, dto);
}
/**
* @deprecated use `POST /trash/restore/assets`
*/
@Post('restore')
@HttpCode(HttpStatus.NO_CONTENT)
restoreAssetsOld(@Auth() auth: AuthDto, @Body() dto: BulkIdsDto): Promise<void> {
return this.trashService.restoreAssets(auth, dto);
}
/**
* @deprecated use `POST /trash/empty`
*/
@Post('trash/empty')
@HttpCode(HttpStatus.NO_CONTENT)
emptyTrashOld(@Auth() auth: AuthDto): Promise<void> {
return this.trashService.empty(auth);
}
/**
* @deprecated use `POST /trash/restore`
*/
@Post('trash/restore')
@HttpCode(HttpStatus.NO_CONTENT)
restoreTrashOld(@Auth() auth: AuthDto): Promise<void> {
return this.trashService.restore(auth);
}
@Put('stack/parent')
@HttpCode(HttpStatus.OK)
updateStackParent(@Auth() auth: AuthDto, @Body() dto: UpdateStackParentDto): Promise<void> {

View File

@ -6,7 +6,6 @@ import {
OAuthAuthorizeResponseDto,
OAuthCallbackDto,
OAuthConfigDto,
OAuthConfigResponseDto,
UserResponseDto,
} from '@app/domain';
import { Body, Controller, Get, HttpStatus, Post, Redirect, Req, Res } from '@nestjs/common';
@ -32,13 +31,6 @@ export class OAuthController {
};
}
/** @deprecated use feature flags and /oauth/authorize */
@PublicRoute()
@Post('config')
generateOAuthConfig(@Body() dto: OAuthConfigDto): Promise<OAuthConfigResponseDto> {
return this.service.generateConfig(dto);
}
@PublicRoute()
@Post('authorize')
startOAuth(@Body() dto: OAuthConfigDto): Promise<OAuthAuthorizeResponseDto> {