Skip to content

Commit

Permalink
Merge pull request #731 from thornbill/remove-deprecated-image-url
Browse files Browse the repository at this point in the history
Remove deprecated image url function
  • Loading branch information
thornbill authored Jul 1, 2024
2 parents 921293f + cb5ec89 commit e44fa0c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
8 changes: 0 additions & 8 deletions src/__tests__/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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');
});
});
27 changes: 0 additions & 27 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit e44fa0c

Please sign in to comment.