@ctrl/plex 3.4.0 → 3.5.0
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/README.md +9 -3
- package/dist/src/alert.d.ts +2 -2
- package/dist/src/client.d.ts +1 -1
- package/dist/src/library.d.ts +6 -6
- package/dist/src/library.js +2 -2
- package/dist/src/library.types.d.ts +1 -1
- package/dist/src/media.d.ts +1 -1
- package/dist/src/media.js +0 -4
- package/dist/src/myplex.js +0 -1
- package/dist/src/playlist.d.ts +2 -2
- package/dist/src/search.d.ts +2 -2
- package/dist/src/server.d.ts +1 -1
- package/dist/src/video.d.ts +3 -3
- package/package.json +21 -20
package/README.md
CHANGED
|
@@ -105,7 +105,8 @@ npm run test-cleanup
|
|
|
105
105
|
get a claim token from https://www.plex.tv/claim/
|
|
106
106
|
export PLEX_CLAIM_TOKEN=claim-token
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
start plex container for testing
|
|
109
|
+
```console
|
|
109
110
|
docker run -d \
|
|
110
111
|
--name=plex \
|
|
111
112
|
--net=host \
|
|
@@ -132,7 +133,12 @@ docker run -d \
|
|
|
132
133
|
lscr.io/linuxserver/plex:latest
|
|
133
134
|
```
|
|
134
135
|
|
|
135
|
-
|
|
136
|
+
Pull latest plex container if needed
|
|
137
|
+
```console
|
|
138
|
+
docker pull lscr.io/linuxserver/plex:latest
|
|
136
139
|
```
|
|
137
|
-
|
|
140
|
+
|
|
141
|
+
bootstrap plex server with test media
|
|
142
|
+
```console
|
|
143
|
+
NODE_OPTIONS="--loader ts-node/esm" node scripts/bootstraptest.ts --no-docker --server-name=orbstack --password=$PLEX_PASSWORD --username=$PLEX_USERNAME
|
|
138
144
|
```
|
package/dist/src/alert.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import WebSocket from 'ws';
|
|
2
|
-
import { AlertTypes } from './alert.types.js';
|
|
3
|
-
import { PlexServer } from './server.js';
|
|
2
|
+
import type { AlertTypes } from './alert.types.js';
|
|
3
|
+
import type { PlexServer } from './server.js';
|
|
4
4
|
export declare class AlertListener {
|
|
5
5
|
private readonly server;
|
|
6
6
|
callback: (data: AlertTypes) => void;
|
package/dist/src/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { URL } from 'url';
|
|
2
|
-
import { Player } from './client.types.js';
|
|
2
|
+
import type { Player } from './client.types.js';
|
|
3
3
|
export interface PlexOptions {
|
|
4
4
|
/** (:class:`~plexapi.server.PlexServer`): PlexServer this client is connected to (optional). */
|
|
5
5
|
server?: any;
|
package/dist/src/library.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Class } from 'type-fest';
|
|
1
|
+
import type { Class } from 'type-fest';
|
|
2
2
|
import { PartialPlexObject } from './base/partialPlexObject.js';
|
|
3
3
|
import { PlexObject } from './base/plexObject.js';
|
|
4
|
-
import { CollectionData, LibraryRootResponse, Location, SectionsDirectory } from './library.types.js';
|
|
4
|
+
import type { CollectionData, LibraryRootResponse, Location, SectionsDirectory } from './library.types.js';
|
|
5
5
|
import { Playlist } from './playlist.js';
|
|
6
|
-
import { Agent, SEARCHTYPES } from './search.js';
|
|
7
|
-
import { SearchResult } from './search.types.js';
|
|
6
|
+
import { type Agent, type SEARCHTYPES } from './search.js';
|
|
7
|
+
import type { SearchResult } from './search.types.js';
|
|
8
8
|
import type { PlexServer } from './server.js';
|
|
9
|
-
import { Movie, Show, VideoType } from './video.js';
|
|
9
|
+
import { Movie, Show, type VideoType } from './video.js';
|
|
10
10
|
export type Section = MovieSection | ShowSection;
|
|
11
11
|
export declare class Library {
|
|
12
12
|
private readonly server;
|
|
@@ -364,7 +364,7 @@ export declare abstract class LibrarySection<SectionVideoType = VideoType> exten
|
|
|
364
364
|
folders(): Promise<Folder[]>;
|
|
365
365
|
genres(): Promise<FilterChoice[]>;
|
|
366
366
|
/**
|
|
367
|
-
* Returns a list of available {@link
|
|
367
|
+
* Returns a list of available {@link FilteringField} for a specified libtype.
|
|
368
368
|
* This is the list of options in the custom filter dropdown menu
|
|
369
369
|
*/
|
|
370
370
|
listFields(libtype?: Libtype): Promise<FilteringField[]>;
|
package/dist/src/library.js
CHANGED
|
@@ -483,7 +483,7 @@ export class LibrarySection extends PlexObject {
|
|
|
483
483
|
return fetchItems(this.server, key, undefined, FilterChoice);
|
|
484
484
|
}
|
|
485
485
|
/**
|
|
486
|
-
* Returns a list of available {@link
|
|
486
|
+
* Returns a list of available {@link FilteringField} for a specified libtype.
|
|
487
487
|
* This is the list of options in the custom filter dropdown menu
|
|
488
488
|
*/
|
|
489
489
|
async listFields(libtype = this.type) {
|
|
@@ -494,7 +494,7 @@ export class LibrarySection extends PlexObject {
|
|
|
494
494
|
const filter = filterTypes.find(f => f.type === libtype);
|
|
495
495
|
if (!filter) {
|
|
496
496
|
throw new NotFound(`Unknown libtype "${libtype}" for this library.
|
|
497
|
-
Available libtypes: ${filterTypes.join(', ')}`);
|
|
497
|
+
Available libtypes: ${filterTypes.map(f => f.type).join(', ')}`);
|
|
498
498
|
}
|
|
499
499
|
return filter;
|
|
500
500
|
}
|
package/dist/src/media.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlexObject } from './base/plexObject.js';
|
|
2
|
-
import { ChapterData, MarkerData, MediaData, MediaPartData, MediaPartStreamData } from './video.types.js';
|
|
2
|
+
import type { ChapterData, MarkerData, MediaData, MediaPartData, MediaPartStreamData } from './video.types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Base class for media tags used for filtering and searching your library
|
|
5
5
|
* items or navigating the metadata of media items in your library. Tags are
|
package/dist/src/media.js
CHANGED
|
@@ -186,7 +186,6 @@ class GuidTag extends PlexObject {
|
|
|
186
186
|
this.id = data.id;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
// biome-ignore lint/complexity/noStaticOnlyClass: <explanation>
|
|
190
189
|
export class Guid extends GuidTag {
|
|
191
190
|
static { this.TAG = 'Guid'; }
|
|
192
191
|
}
|
|
@@ -235,21 +234,18 @@ class BaseResource extends PlexObject {
|
|
|
235
234
|
/**
|
|
236
235
|
* Represents a single Art object.
|
|
237
236
|
*/
|
|
238
|
-
// biome-ignore lint/complexity/noStaticOnlyClass: <explanation>
|
|
239
237
|
export class Art extends BaseResource {
|
|
240
238
|
static { this.TAG = 'Art'; }
|
|
241
239
|
}
|
|
242
240
|
/**
|
|
243
241
|
* Represents a single Poster object.
|
|
244
242
|
*/
|
|
245
|
-
// biome-ignore lint/complexity/noStaticOnlyClass: <explanation>
|
|
246
243
|
export class Poster extends BaseResource {
|
|
247
244
|
static { this.TAG = 'Photo'; }
|
|
248
245
|
}
|
|
249
246
|
/**
|
|
250
247
|
* Represents a single Theme object.
|
|
251
248
|
*/
|
|
252
|
-
// biome-ignore lint/complexity/noStaticOnlyClass: <explanation>
|
|
253
249
|
export class Theme extends BaseResource {
|
|
254
250
|
static { this.TAG = 'Theme'; }
|
|
255
251
|
}
|
package/dist/src/myplex.js
CHANGED
package/dist/src/playlist.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Playable } from './base/playable.js';
|
|
2
2
|
import type { Section } from './library.js';
|
|
3
|
-
import { PlaylistResponse } from './playlist.types.js';
|
|
3
|
+
import type { PlaylistResponse } from './playlist.types.js';
|
|
4
4
|
import type { PlexServer } from './server.js';
|
|
5
|
-
import { Episode, Movie, VideoType } from './video.js';
|
|
5
|
+
import { Episode, Movie, type VideoType } from './video.js';
|
|
6
6
|
interface CreateRegularPlaylistOptions {
|
|
7
7
|
/** True to create a smart playlist */
|
|
8
8
|
smart?: false;
|
package/dist/src/search.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ValueOf } from 'type-fest';
|
|
1
|
+
import type { ValueOf } from 'type-fest';
|
|
2
2
|
import { PlexObject } from './base/plexObject.js';
|
|
3
|
-
import { MatchSearchResult } from './search.types.js';
|
|
3
|
+
import type { MatchSearchResult } from './search.types.js';
|
|
4
4
|
export declare class SearchResult extends PlexObject {
|
|
5
5
|
static TAG: string;
|
|
6
6
|
guid: string;
|
package/dist/src/server.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Hub, Library } from './library.js';
|
|
|
4
4
|
import { Optimized } from './media.js';
|
|
5
5
|
import { MyPlexAccount } from './myplex.js';
|
|
6
6
|
import { Agent, SEARCHTYPES } from './search.js';
|
|
7
|
-
import { HistoryMetadatum } from './server.types.js';
|
|
7
|
+
import type { HistoryMetadatum } from './server.types.js';
|
|
8
8
|
import { Settings } from './settings.js';
|
|
9
9
|
/**
|
|
10
10
|
* This is the main entry point to interacting with a Plex server. It allows you to
|
package/dist/src/video.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { URL } from 'url';
|
|
1
|
+
import type { URL } from 'url';
|
|
2
2
|
import { Playable } from './base/playable.js';
|
|
3
|
-
import { ExtrasData, FullShowData, MovieData, ShowData } from './library.types.js';
|
|
3
|
+
import type { ExtrasData, FullShowData, MovieData, ShowData } from './library.types.js';
|
|
4
4
|
import { Chapter, Collection, Country, Director, Genre, Guid, Marker, Media, Poster, Producer, Rating, Role, Similar, Writer } from './media.js';
|
|
5
|
-
import { ChapterSource, EpisodeMetadata, FullMovieResponse } from './video.types.js';
|
|
5
|
+
import type { ChapterSource, EpisodeMetadata, FullMovieResponse } from './video.types.js';
|
|
6
6
|
export type VideoType = Movie | Show;
|
|
7
7
|
declare abstract class Video extends Playable {
|
|
8
8
|
/** Datetime this item was added to the library. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctrl/plex",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "plex api client in typescript",
|
|
5
5
|
"author": "Scott Cooper <scttcper@gmail.com>",
|
|
6
6
|
"publishConfig": {
|
|
@@ -37,32 +37,32 @@
|
|
|
37
37
|
"test-cleanup": "node --loader ts-node/esm scripts/test-cleanup.ts"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@ctrl/mac-address": "^3.0
|
|
41
|
-
"ofetch": "^1.
|
|
40
|
+
"@ctrl/mac-address": "^3.1.0",
|
|
41
|
+
"ofetch": "^1.4.1",
|
|
42
42
|
"p-any": "^4.0.0",
|
|
43
|
-
"type-fest": "^4.
|
|
44
|
-
"ws": "^8.18.
|
|
43
|
+
"type-fest": "^4.40.1",
|
|
44
|
+
"ws": "^8.18.2",
|
|
45
45
|
"xml2js": "^0.6.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@biomejs/biome": "1.
|
|
49
|
-
"@ctrl/eslint-config-biome": "4.
|
|
50
|
-
"@sindresorhus/tsconfig": "
|
|
51
|
-
"@types/node": "22.3
|
|
52
|
-
"@types/ws": "8.
|
|
48
|
+
"@biomejs/biome": "1.9.4",
|
|
49
|
+
"@ctrl/eslint-config-biome": "4.4.0",
|
|
50
|
+
"@sindresorhus/tsconfig": "7.0.0",
|
|
51
|
+
"@types/node": "22.15.3",
|
|
52
|
+
"@types/ws": "8.18.1",
|
|
53
53
|
"@types/xml2js": "0.4.14",
|
|
54
54
|
"@types/yargs": "17.0.33",
|
|
55
|
-
"@vitest/coverage-v8": "
|
|
56
|
-
"eslint": "9.
|
|
57
|
-
"execa": "9.
|
|
58
|
-
"globby": "14.0
|
|
55
|
+
"@vitest/coverage-v8": "3.1.2",
|
|
56
|
+
"eslint": "9.26.0",
|
|
57
|
+
"execa": "9.5.2",
|
|
58
|
+
"globby": "14.1.0",
|
|
59
59
|
"make-dir": "5.0.0",
|
|
60
|
-
"ora": "8.0
|
|
61
|
-
"p-retry": "6.2.
|
|
60
|
+
"ora": "8.2.0",
|
|
61
|
+
"p-retry": "6.2.1",
|
|
62
62
|
"ts-node": "10.9.2",
|
|
63
|
-
"typedoc": "0.
|
|
64
|
-
"typescript": "5.
|
|
65
|
-
"vitest": "
|
|
63
|
+
"typedoc": "0.28.3",
|
|
64
|
+
"typescript": "5.8.3",
|
|
65
|
+
"vitest": "3.1.2",
|
|
66
66
|
"yargs": "17.7.2"
|
|
67
67
|
},
|
|
68
68
|
"release": {
|
|
@@ -72,5 +72,6 @@
|
|
|
72
72
|
},
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=18"
|
|
75
|
-
}
|
|
75
|
+
},
|
|
76
|
+
"packageManager": "pnpm@10.10.0"
|
|
76
77
|
}
|