mirror of
https://github.com/jellyfin/jellyfin-sdk-typescript.git
synced 2024-11-23 05:59:44 +00:00
Restructure project root
This commit is contained in:
parent
22b9bf97f7
commit
350a9a589f
@ -1,5 +1,4 @@
|
||||
import { Jellyfin } from '..';
|
||||
import { Configuration } from '../generated-client';
|
||||
import { Configuration, Jellyfin } from '..';
|
||||
|
||||
// FIXME: These tests should be mocked and not calling an actual server
|
||||
const SERVER_URL = 'https://demo.jellyfin.org/stable';
|
||||
|
30
src/index.ts
30
src/index.ts
@ -3,30 +3,10 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
import globalInstance from 'axios';
|
||||
|
||||
import { Api } from './api';
|
||||
|
||||
import { Configuration } from './generated-client';
|
||||
import { ClientInfo } from './models/client-info';
|
||||
import { DeviceInfo } from './models/device-info';
|
||||
|
||||
export * from './api';
|
||||
// Should the full generated client be exported?
|
||||
export * from './generated-client/configuration';
|
||||
export * from './jellyfin';
|
||||
export * from './models';
|
||||
export * from './utils';
|
||||
|
||||
export class Jellyfin {
|
||||
clientInfo;
|
||||
deviceInfo;
|
||||
|
||||
constructor(
|
||||
clientInfo: ClientInfo = { Name: 'jellyfin-sdk-typescript', Version: 'v0.1.0' },
|
||||
// FIXME: The device info should always be required.
|
||||
deviceInfo: DeviceInfo = { Name: 'device-name', Id: 'device-id' }
|
||||
) {
|
||||
this.clientInfo = clientInfo;
|
||||
this.deviceInfo = deviceInfo;
|
||||
}
|
||||
|
||||
createApi(configuration: Configuration, axiosInstance = globalInstance): Api {
|
||||
return new Api(this.clientInfo, this.deviceInfo, configuration, axiosInstance);
|
||||
}
|
||||
}
|
||||
|
28
src/jellyfin.ts
Normal file
28
src/jellyfin.ts
Normal file
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
import globalInstance from 'axios';
|
||||
|
||||
import { Api } from './api';
|
||||
import { Configuration } from './generated-client';
|
||||
import { ClientInfo, DeviceInfo } from './models';
|
||||
|
||||
export class Jellyfin {
|
||||
clientInfo;
|
||||
deviceInfo;
|
||||
|
||||
constructor(
|
||||
clientInfo: ClientInfo = { Name: 'jellyfin-sdk-typescript', Version: 'v0.1.0' },
|
||||
// FIXME: The device info should always be required.
|
||||
deviceInfo: DeviceInfo = { Name: 'device-name', Id: 'device-id' }
|
||||
) {
|
||||
this.clientInfo = clientInfo;
|
||||
this.deviceInfo = deviceInfo;
|
||||
}
|
||||
|
||||
createApi(configuration: Configuration, axiosInstance = globalInstance): Api {
|
||||
return new Api(this.clientInfo, this.deviceInfo, configuration, axiosInstance);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user