@jellyfin/sdk 0.0.0-unstable.202512090502 → 0.0.0-unstable.202512091852
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -1
- package/lib/api.d.ts +2 -0
- package/lib/api.js +3 -1
- package/lib/index.js +1 -1
- package/lib/utils/api/library-api.d.ts +15 -3
- package/lib/utils/api/library-api.js +17 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
* `getLibraryApi` now returns an augmented class with a `getDownloadUrl` method ([#967](https://github.com/jellyfin/jellyfin-sdk-typescript/pull/967)).
|
|
13
|
+
|
|
10
14
|
## [0.13.0] - 2025-10-28
|
|
11
15
|
|
|
12
16
|
### Changed
|
|
@@ -15,7 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
15
19
|
|
|
16
20
|
### Deprecated
|
|
17
21
|
|
|
18
|
-
* Deprecate authentication helper methods in `Api` class ([#949](https://github.com/jellyfin/jellyfin-sdk-typescript/pull/
|
|
22
|
+
* Deprecate authentication helper methods in `Api` class ([#949](https://github.com/jellyfin/jellyfin-sdk-typescript/pull/949)).
|
|
19
23
|
Updating the `accessToken` is now handled transparently in `getUserApi` and `getSessionApi`. If you need to handle
|
|
20
24
|
authentication manually, then you should manually create `UserApi` and `SessionApi` instances.
|
|
21
25
|
|
package/lib/api.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ import type { AuthenticationResult } from './generated-client/models/authenticat
|
|
|
9
9
|
import type { ClientInfo, DeviceInfo } from './models';
|
|
10
10
|
/** The authorization header field name. */
|
|
11
11
|
export declare const AUTHORIZATION_HEADER = "Authorization";
|
|
12
|
+
/** The authorization query parameter name. */
|
|
13
|
+
export declare const AUTHORIZATION_PARAMETER = "ApiKey";
|
|
12
14
|
/** Class representing the Jellyfin API. */
|
|
13
15
|
export declare class Api {
|
|
14
16
|
basePath: string;
|
package/lib/api.js
CHANGED
|
@@ -6,6 +6,8 @@ import { getUserApi } from './utils/api/user-api.js';
|
|
|
6
6
|
|
|
7
7
|
/** The authorization header field name. */
|
|
8
8
|
const AUTHORIZATION_HEADER = 'Authorization';
|
|
9
|
+
/** The authorization query parameter name. */
|
|
10
|
+
const AUTHORIZATION_PARAMETER = 'ApiKey';
|
|
9
11
|
/** Class representing the Jellyfin API. */
|
|
10
12
|
class Api {
|
|
11
13
|
constructor(basePath, clientInfo, deviceInfo, accessToken = '', axiosInstance = globalAxios) {
|
|
@@ -62,4 +64,4 @@ class Api {
|
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
export { AUTHORIZATION_HEADER, Api };
|
|
67
|
+
export { AUTHORIZATION_HEADER, AUTHORIZATION_PARAMETER, Api };
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as discovery_index from './discovery/index.js';
|
|
|
2
2
|
export { discovery_index as discovery };
|
|
3
3
|
import * as utils_index from './utils/index.js';
|
|
4
4
|
export { utils_index as utils };
|
|
5
|
-
export { AUTHORIZATION_HEADER, Api } from './api.js';
|
|
5
|
+
export { AUTHORIZATION_HEADER, AUTHORIZATION_PARAMETER, Api } from './api.js';
|
|
6
6
|
export { Jellyfin } from './jellyfin.js';
|
|
7
7
|
export { RecommendedServerInfoScore } from './models/recommended-server-info.js';
|
|
8
8
|
export { ProductNameIssue, RecommendedServerIssue, SlowResponseIssue, SystemInfoIssue, VersionMissingIssue, VersionOutdatedIssue, VersionUnsupportedIssue } from './models/recommended-server-issue.js';
|
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
4
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
5
5
|
*/
|
|
6
|
-
import type
|
|
7
|
-
import { LibraryApi } from '../../generated-client/api/library-api';
|
|
8
|
-
|
|
6
|
+
import { type Api } from '../../api';
|
|
7
|
+
import { LibraryApi, type LibraryApiGetDownloadRequest } from '../../generated-client/api/library-api';
|
|
8
|
+
/** An augmented LibraryApi with URL helpers. */
|
|
9
|
+
declare class AugmentedLibraryApi extends LibraryApi {
|
|
10
|
+
api: Api;
|
|
11
|
+
constructor(api: Api);
|
|
12
|
+
/**
|
|
13
|
+
* Get an Item download URL.
|
|
14
|
+
* @param requestParameters The download request parameters.
|
|
15
|
+
* @returns The Item download URL.
|
|
16
|
+
*/
|
|
17
|
+
getDownloadUrl(requestParameters: LibraryApiGetDownloadRequest): string;
|
|
18
|
+
}
|
|
19
|
+
export declare function getLibraryApi(api: Api): AugmentedLibraryApi;
|
|
20
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AUTHORIZATION_PARAMETER } from '../../api.js';
|
|
1
2
|
import { LibraryApi } from '../../generated-client/api/library-api.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -5,8 +6,23 @@ import { LibraryApi } from '../../generated-client/api/library-api.js';
|
|
|
5
6
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
7
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
7
8
|
*/
|
|
9
|
+
/** An augmented LibraryApi with URL helpers. */
|
|
10
|
+
class AugmentedLibraryApi extends LibraryApi {
|
|
11
|
+
constructor(api) {
|
|
12
|
+
super(api.configuration, undefined, api.axiosInstance);
|
|
13
|
+
this.api = api;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get an Item download URL.
|
|
17
|
+
* @param requestParameters The download request parameters.
|
|
18
|
+
* @returns The Item download URL.
|
|
19
|
+
*/
|
|
20
|
+
getDownloadUrl(requestParameters) {
|
|
21
|
+
return this.api.getUri(`/Items/${requestParameters.itemId}/Download`, { [AUTHORIZATION_PARAMETER]: this.api.accessToken });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
8
24
|
function getLibraryApi(api) {
|
|
9
|
-
return new
|
|
25
|
+
return new AugmentedLibraryApi(api);
|
|
10
26
|
}
|
|
11
27
|
|
|
12
28
|
export { getLibraryApi };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jellyfin/sdk",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.202512091852+commit.b1c8b8d74a21b64230f76e1db7b7120704869e3f",
|
|
4
4
|
"description": "A TypeScript SDK for Jellyfin.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jellyfin"
|