@redseat/api 0.2.6 → 0.2.8
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/{agents.md → AGENTS.md} +275 -275
- package/CLAUDE.md +2 -0
- package/README.md +132 -132
- package/client.md +614 -318
- package/dist/client.d.ts +71 -0
- package/dist/client.js +285 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/interfaces.d.ts +9 -31
- package/dist/library.d.ts +34 -9
- package/dist/library.js +30 -10
- package/dist/sse-types.d.ts +121 -0
- package/dist/sse-types.js +1 -0
- package/encryption.md +533 -533
- package/firebase.md +602 -602
- package/libraries.md +250 -0
- package/package.json +49 -49
- package/server.md +196 -196
- package/test.md +291 -291
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { ILibrary, IFile, IEpisode, ISerie, IMovie, IPerson, ITag, IBackup } from './interfaces.js';
|
|
2
|
+
export type ElementAction = 'Added' | 'Updated' | 'Deleted';
|
|
3
|
+
export type SSEConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting' | 'error';
|
|
4
|
+
export interface SSEConnectionOptions {
|
|
5
|
+
/** Filter to specific library IDs */
|
|
6
|
+
libraries?: string[];
|
|
7
|
+
/** Enable auto-reconnect on disconnect (default: true) */
|
|
8
|
+
autoReconnect?: boolean;
|
|
9
|
+
/** Maximum reconnect attempts (default: unlimited) */
|
|
10
|
+
maxReconnectAttempts?: number;
|
|
11
|
+
/** Initial reconnect delay in ms (default: 1000) */
|
|
12
|
+
initialReconnectDelay?: number;
|
|
13
|
+
/** Maximum reconnect delay in ms (default: 30000) */
|
|
14
|
+
maxReconnectDelay?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface SSEConnectionError {
|
|
17
|
+
type: 'network' | 'auth' | 'server' | 'parse';
|
|
18
|
+
message: string;
|
|
19
|
+
originalError?: Error;
|
|
20
|
+
timestamp: number;
|
|
21
|
+
}
|
|
22
|
+
export interface SSELibraryEvent {
|
|
23
|
+
action: ElementAction;
|
|
24
|
+
library: ILibrary;
|
|
25
|
+
}
|
|
26
|
+
export interface SSELibraryStatusEvent {
|
|
27
|
+
message: string;
|
|
28
|
+
library: string;
|
|
29
|
+
progress?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface SSEMediasEvent {
|
|
32
|
+
library: string;
|
|
33
|
+
medias: {
|
|
34
|
+
action: ElementAction;
|
|
35
|
+
media: IFile;
|
|
36
|
+
}[];
|
|
37
|
+
}
|
|
38
|
+
export interface SSEMediasProgressEvent {
|
|
39
|
+
library: string;
|
|
40
|
+
mediaId: string;
|
|
41
|
+
progress: number;
|
|
42
|
+
status?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface SSEConvertProgressEvent {
|
|
45
|
+
library: string;
|
|
46
|
+
mediaId: string;
|
|
47
|
+
progress: number;
|
|
48
|
+
status: string;
|
|
49
|
+
message?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface SSEEpisodesEvent {
|
|
52
|
+
library: string;
|
|
53
|
+
episodes: {
|
|
54
|
+
action: ElementAction;
|
|
55
|
+
episode: IEpisode;
|
|
56
|
+
}[];
|
|
57
|
+
}
|
|
58
|
+
export interface SSESeriesEvent {
|
|
59
|
+
library: string;
|
|
60
|
+
series: {
|
|
61
|
+
action: ElementAction;
|
|
62
|
+
serie: ISerie;
|
|
63
|
+
}[];
|
|
64
|
+
}
|
|
65
|
+
export interface SSEMoviesEvent {
|
|
66
|
+
library: string;
|
|
67
|
+
movies: {
|
|
68
|
+
action: ElementAction;
|
|
69
|
+
movie: IMovie;
|
|
70
|
+
}[];
|
|
71
|
+
}
|
|
72
|
+
export interface SSEPeopleEvent {
|
|
73
|
+
library: string;
|
|
74
|
+
people: {
|
|
75
|
+
action: ElementAction;
|
|
76
|
+
person: IPerson;
|
|
77
|
+
}[];
|
|
78
|
+
}
|
|
79
|
+
export interface SSETagsEvent {
|
|
80
|
+
library: string;
|
|
81
|
+
tags: {
|
|
82
|
+
action: ElementAction;
|
|
83
|
+
tag: ITag;
|
|
84
|
+
}[];
|
|
85
|
+
}
|
|
86
|
+
export interface IBackupWithStatus extends IBackup {
|
|
87
|
+
status?: 'running' | 'completed' | 'failed';
|
|
88
|
+
progress?: number;
|
|
89
|
+
message?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface SSEBackupsEvent {
|
|
92
|
+
backup: IBackupWithStatus;
|
|
93
|
+
}
|
|
94
|
+
export interface SSEBackupFilesEvent {
|
|
95
|
+
library?: string;
|
|
96
|
+
file: string;
|
|
97
|
+
progress: number;
|
|
98
|
+
status?: string;
|
|
99
|
+
message?: string;
|
|
100
|
+
}
|
|
101
|
+
export interface SSEEventMap {
|
|
102
|
+
'library': SSELibraryEvent;
|
|
103
|
+
'library-status': SSELibraryStatusEvent;
|
|
104
|
+
'medias': SSEMediasEvent;
|
|
105
|
+
'medias_progress': SSEMediasProgressEvent;
|
|
106
|
+
'convert_progress': SSEConvertProgressEvent;
|
|
107
|
+
'episodes': SSEEpisodesEvent;
|
|
108
|
+
'series': SSESeriesEvent;
|
|
109
|
+
'movies': SSEMoviesEvent;
|
|
110
|
+
'people': SSEPeopleEvent;
|
|
111
|
+
'tags': SSETagsEvent;
|
|
112
|
+
'backups': SSEBackupsEvent;
|
|
113
|
+
'backups-files': SSEBackupFilesEvent;
|
|
114
|
+
}
|
|
115
|
+
export type SSEEventName = keyof SSEEventMap;
|
|
116
|
+
export interface SSEEvent<T extends SSEEventName = SSEEventName> {
|
|
117
|
+
id?: string;
|
|
118
|
+
event: T;
|
|
119
|
+
data: SSEEventMap[T];
|
|
120
|
+
retry?: number;
|
|
121
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|