Remove deprecated image url function

This commit is contained in:
Bill Thornton 2024-07-01 13:54:25 -04:00
parent 9f9ab70444
commit cb5ec89d9a
2 changed files with 0 additions and 35 deletions

View File

@ -9,7 +9,6 @@ import { vi, describe, expect, it, afterEach } from 'vitest';
import { Api, AUTHORIZATION_HEADER } from '..';
import { SERVER_URL, TEST_CLIENT, TEST_DEVICE } from '../__helpers__/common';
import { ImageType } from '../generated-client/models';
import { getAuthorizationHeader } from '../utils';
vi.mock('axios', async () => {
@ -80,11 +79,4 @@ describe('Api', () => {
const api = new Api(SERVER_URL, TEST_CLIENT, TEST_DEVICE);
expect(api.basePath).toBe(SERVER_URL);
});
it('should return an item image url', () => {
const api = new Api(SERVER_URL, TEST_CLIENT, TEST_DEVICE);
expect(api.getItemImageUrl('TEST')).toBe('https://example.com/Items/TEST/Images/Primary');
expect(api.getItemImageUrl('TEST', ImageType.Backdrop, { fillWidth: 100, fillHeight: 100 }))
.toBe('https://example.com/Items/TEST/Images/Backdrop?fillWidth=100&fillHeight=100');
});
});

View File

@ -8,14 +8,8 @@ import globalInstance from 'axios';
import { Configuration } from './generated-client/configuration';
import type { AuthenticationResult } from './generated-client/models/authentication-result';
import { ImageType } from './generated-client/models/image-type';
import type { ClientInfo, DeviceInfo } from './models';
import type { ImageRequestParameters } from './models/api/image-request-parameters';
import { getAuthorizationHeader } from './utils';
import { getImageApi } from './utils/api/image-api';
// NOTE: This import is used for TSDoc
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type { ImageUrlsApi } from './utils/api/image-urls-api';
import { getSessionApi } from './utils/api/session-api';
import { getUserApi } from './utils/api/user-api';
@ -80,27 +74,6 @@ export class Api {
});
}
/**
* Get an item image URL.
* @deprecated Use {@link ImageUrlsApi.getItemImageUrlById} instead.
* @param itemId The Item ID.
* @param imageType An optional Image Type (Primary by default).
* @param params Additional request parameters.
* @returns The image URL.
*/
getItemImageUrl(
itemId: string,
imageType: ImageType = ImageType.Primary,
params: ImageRequestParameters = {}
): string | undefined {
return getImageApi(this)
.getItemImageUrlById(
itemId,
imageType,
params
);
}
get authorizationHeader(): string {
return getAuthorizationHeader(this.clientInfo, this.deviceInfo, this.accessToken);
}