Features: - Server: Get identity, info, preferences, sessions, butler tasks - Library: Get all, get contents, recently added, on deck, refresh, analyze - Media: Get, update, delete, refresh, mark watched/unwatched - Playlist: CRUD operations, add/remove items - Collection: CRUD operations, add/remove items - Search: Global and library-specific search - Session: Get active sessions, history, terminate Includes CI/CD pipeline for automatic npm publishing on release. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
import {
|
||||
IAuthenticateGeneric,
|
||||
ICredentialTestRequest,
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class PlexApi implements ICredentialType {
|
||||
name = 'plexApi';
|
||||
displayName = 'Plex API';
|
||||
documentationUrl = 'https://developer.plex.tv/pms/';
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Server URL',
|
||||
name: 'serverUrl',
|
||||
type: 'string',
|
||||
default: 'http://localhost:32400',
|
||||
placeholder: 'http://localhost:32400',
|
||||
description: 'The URL of your Plex Media Server',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'X-Plex-Token',
|
||||
name: 'plexToken',
|
||||
type: 'string',
|
||||
typeOptions: {
|
||||
password: true,
|
||||
},
|
||||
default: '',
|
||||
description: 'Your Plex authentication token. Find it in Plex settings or browser developer tools.',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'X-Plex-Client-Identifier',
|
||||
name: 'clientIdentifier',
|
||||
type: 'string',
|
||||
default: 'n8n-plex-node',
|
||||
description: 'A unique identifier for this client',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'X-Plex-Product',
|
||||
name: 'product',
|
||||
type: 'string',
|
||||
default: 'n8n',
|
||||
description: 'The name of your application',
|
||||
},
|
||||
{
|
||||
displayName: 'X-Plex-Version',
|
||||
name: 'version',
|
||||
type: 'string',
|
||||
default: '1.0.0',
|
||||
description: 'The version of your application',
|
||||
},
|
||||
{
|
||||
displayName: 'X-Plex-Platform',
|
||||
name: 'platform',
|
||||
type: 'string',
|
||||
default: 'Node.js',
|
||||
description: 'The platform running your application',
|
||||
},
|
||||
];
|
||||
|
||||
authenticate: IAuthenticateGeneric = {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
headers: {
|
||||
'X-Plex-Token': '={{$credentials.plexToken}}',
|
||||
'X-Plex-Client-Identifier': '={{$credentials.clientIdentifier}}',
|
||||
'X-Plex-Product': '={{$credentials.product}}',
|
||||
'X-Plex-Version': '={{$credentials.version}}',
|
||||
'X-Plex-Platform': '={{$credentials.platform}}',
|
||||
Accept: 'application/json',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
baseURL: '={{$credentials.serverUrl}}',
|
||||
url: '/identity',
|
||||
method: 'GET',
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user