@camstack/addon-provider-frigate 0.1.7 → 0.1.10
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/dist/addon.d.mts +14 -0
- package/dist/addon.d.ts +14 -0
- package/dist/index.d.mts +250 -0
- package/dist/index.d.ts +250 -0
- package/package.json +3 -3
package/dist/addon.d.mts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
|
|
2
|
+
|
|
3
|
+
declare class FrigateProviderAddon implements ICamstackAddon, IConfigurable {
|
|
4
|
+
readonly manifest: AddonManifest;
|
|
5
|
+
private provider;
|
|
6
|
+
initialize(context: AddonContext): Promise<void>;
|
|
7
|
+
shutdown(): Promise<void>;
|
|
8
|
+
getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
|
|
9
|
+
getConfigSchema(): ConfigUISchema;
|
|
10
|
+
getConfig(): Record<string, unknown>;
|
|
11
|
+
onConfigChange(_config: Record<string, unknown>): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { FrigateProviderAddon };
|
package/dist/addon.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
|
|
2
|
+
|
|
3
|
+
declare class FrigateProviderAddon implements ICamstackAddon, IConfigurable {
|
|
4
|
+
readonly manifest: AddonManifest;
|
|
5
|
+
private provider;
|
|
6
|
+
initialize(context: AddonContext): Promise<void>;
|
|
7
|
+
shutdown(): Promise<void>;
|
|
8
|
+
getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
|
|
9
|
+
getConfigSchema(): ConfigUISchema;
|
|
10
|
+
getConfig(): Record<string, unknown>;
|
|
11
|
+
onConfigChange(_config: Record<string, unknown>): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { FrigateProviderAddon };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
export { FrigateProviderAddon } from './addon.mjs';
|
|
2
|
+
import { IDeviceProvider, CamstackContext, ProviderStatus, DiscoveredDevice, IDevice, LiveEvent, DeviceType, DeviceCapabilityName, StreamOption, IDeviceCapability, DeviceState, DeviceMetadata } from '@camstack/types';
|
|
3
|
+
|
|
4
|
+
interface FrigateProviderConfig {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly url: string;
|
|
8
|
+
readonly username?: string;
|
|
9
|
+
readonly password?: string;
|
|
10
|
+
readonly mqtt?: {
|
|
11
|
+
readonly brokerUrl: string;
|
|
12
|
+
readonly username?: string;
|
|
13
|
+
readonly password?: string;
|
|
14
|
+
readonly topicPrefix?: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
declare class FrigateProvider implements IDeviceProvider {
|
|
18
|
+
private readonly config;
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly type = "frigate";
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly discoveryMode: 'auto';
|
|
23
|
+
readonly ctx: CamstackContext;
|
|
24
|
+
private readonly api;
|
|
25
|
+
private mqtt;
|
|
26
|
+
private devices;
|
|
27
|
+
private readonly liveEventListeners;
|
|
28
|
+
private mqttUnsubscribe?;
|
|
29
|
+
/** Cached Frigate config, refreshed on start() and discoverDevices() */
|
|
30
|
+
private frigateConfig;
|
|
31
|
+
private go2rtcStreams;
|
|
32
|
+
private frigateHost;
|
|
33
|
+
constructor(config: FrigateProviderConfig, ctx: CamstackContext);
|
|
34
|
+
start(): Promise<void>;
|
|
35
|
+
stop(): Promise<void>;
|
|
36
|
+
getStatus(): ProviderStatus;
|
|
37
|
+
discoverDevices(): Promise<DiscoveredDevice[]>;
|
|
38
|
+
adoptDevice(externalId: string, _config?: Record<string, unknown>): Promise<IDevice>;
|
|
39
|
+
getDevices(): IDevice[];
|
|
40
|
+
subscribeLiveEvents(callback: (event: LiveEvent) => void): () => void;
|
|
41
|
+
private createDeviceFromCamera;
|
|
42
|
+
private getAdoptedDeviceIds;
|
|
43
|
+
private persistAdoptedDeviceId;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface FrigateConfig {
|
|
47
|
+
cameras: Record<string, FrigateCameraConfig>;
|
|
48
|
+
version?: string;
|
|
49
|
+
mqtt?: {
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
host?: string;
|
|
52
|
+
port?: number;
|
|
53
|
+
topic_prefix?: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
interface FrigateCameraConfig {
|
|
57
|
+
enabled?: boolean;
|
|
58
|
+
detect?: {
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
fps?: number;
|
|
62
|
+
enabled?: boolean;
|
|
63
|
+
};
|
|
64
|
+
record?: {
|
|
65
|
+
enabled?: boolean;
|
|
66
|
+
};
|
|
67
|
+
snapshots?: {
|
|
68
|
+
enabled?: boolean;
|
|
69
|
+
};
|
|
70
|
+
audio?: {
|
|
71
|
+
enabled?: boolean;
|
|
72
|
+
};
|
|
73
|
+
live?: {
|
|
74
|
+
stream_name?: string;
|
|
75
|
+
};
|
|
76
|
+
onvif?: {
|
|
77
|
+
host?: string;
|
|
78
|
+
};
|
|
79
|
+
ffmpeg?: {
|
|
80
|
+
inputs?: Array<{
|
|
81
|
+
path: string;
|
|
82
|
+
roles: string[];
|
|
83
|
+
}>;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
interface FrigateRawEvent {
|
|
87
|
+
id: string;
|
|
88
|
+
camera: string;
|
|
89
|
+
label: string;
|
|
90
|
+
sub_label?: string;
|
|
91
|
+
top_score: number;
|
|
92
|
+
start_time: number;
|
|
93
|
+
end_time: number | null;
|
|
94
|
+
has_snapshot: boolean;
|
|
95
|
+
has_clip: boolean;
|
|
96
|
+
data?: {
|
|
97
|
+
box?: [number, number, number, number];
|
|
98
|
+
region?: [number, number, number, number];
|
|
99
|
+
type?: 'new' | 'update' | 'end';
|
|
100
|
+
};
|
|
101
|
+
thumbnail?: string;
|
|
102
|
+
}
|
|
103
|
+
interface FrigateReviewItem {
|
|
104
|
+
id: string;
|
|
105
|
+
camera: string;
|
|
106
|
+
start_time: number;
|
|
107
|
+
end_time: number | null;
|
|
108
|
+
severity: 'alert' | 'detection';
|
|
109
|
+
data?: {
|
|
110
|
+
objects?: string[];
|
|
111
|
+
zones?: string[];
|
|
112
|
+
sub_labels?: string[];
|
|
113
|
+
};
|
|
114
|
+
thumb_path?: string;
|
|
115
|
+
}
|
|
116
|
+
interface FrigateRawRecording {
|
|
117
|
+
id?: string;
|
|
118
|
+
start_time: number;
|
|
119
|
+
end_time: number;
|
|
120
|
+
duration: number;
|
|
121
|
+
motion?: number;
|
|
122
|
+
objects?: number;
|
|
123
|
+
}
|
|
124
|
+
interface FrigateMotionData {
|
|
125
|
+
camera: string;
|
|
126
|
+
start_time: number;
|
|
127
|
+
end_time: number;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
interface FrigateApiConfig {
|
|
131
|
+
baseUrl: string;
|
|
132
|
+
username?: string;
|
|
133
|
+
password?: string;
|
|
134
|
+
}
|
|
135
|
+
interface EventsQuery {
|
|
136
|
+
after?: number;
|
|
137
|
+
before?: number;
|
|
138
|
+
cameras?: string;
|
|
139
|
+
limit?: number;
|
|
140
|
+
labels?: string;
|
|
141
|
+
}
|
|
142
|
+
interface ReviewQuery {
|
|
143
|
+
after?: number;
|
|
144
|
+
before?: number;
|
|
145
|
+
cameras?: string;
|
|
146
|
+
limit?: number;
|
|
147
|
+
}
|
|
148
|
+
interface MotionQuery {
|
|
149
|
+
after: number;
|
|
150
|
+
before: number;
|
|
151
|
+
cameras?: string;
|
|
152
|
+
}
|
|
153
|
+
interface TestConnectionResult {
|
|
154
|
+
success: boolean;
|
|
155
|
+
version?: string;
|
|
156
|
+
cameraCount?: number;
|
|
157
|
+
error?: string;
|
|
158
|
+
}
|
|
159
|
+
declare class FrigateApiClient {
|
|
160
|
+
private readonly config;
|
|
161
|
+
private readonly baseUrl;
|
|
162
|
+
private authToken;
|
|
163
|
+
private authHeader;
|
|
164
|
+
constructor(config: FrigateApiConfig);
|
|
165
|
+
private authenticate;
|
|
166
|
+
private buildHeaders;
|
|
167
|
+
private request;
|
|
168
|
+
private requestBuffer;
|
|
169
|
+
private requestText;
|
|
170
|
+
getConfig(): Promise<FrigateConfig>;
|
|
171
|
+
getGo2rtcStreams(): Promise<Record<string, unknown>>;
|
|
172
|
+
getEvents(params: EventsQuery): Promise<FrigateRawEvent[]>;
|
|
173
|
+
getReviewItems(params: ReviewQuery): Promise<FrigateReviewItem[]>;
|
|
174
|
+
getRecordings(camera: string, after: number, before: number): Promise<FrigateRawRecording[]>;
|
|
175
|
+
getMotionActivity(params: MotionQuery): Promise<FrigateMotionData[]>;
|
|
176
|
+
getLatestSnapshot(camera: string): Promise<Buffer>;
|
|
177
|
+
getEventThumbnail(eventId: string): Promise<Buffer>;
|
|
178
|
+
getEventSnapshot(eventId: string): Promise<Buffer>;
|
|
179
|
+
getEventClip(eventId: string): Promise<Buffer>;
|
|
180
|
+
getRecordingThumbnail(camera: string, timestampSec: number): Promise<Buffer>;
|
|
181
|
+
proxyWhepSdp(streamName: string, sdpOffer: string): Promise<string>;
|
|
182
|
+
getPtzInfo(camera: string): Promise<{
|
|
183
|
+
features?: string[];
|
|
184
|
+
presets?: string[];
|
|
185
|
+
} | null>;
|
|
186
|
+
ptzCommand(camera: string, command: string, params?: Record<string, unknown>): Promise<void>;
|
|
187
|
+
testConnection(): Promise<TestConnectionResult>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
interface FrigateMqttConfig {
|
|
191
|
+
brokerUrl: string;
|
|
192
|
+
username?: string;
|
|
193
|
+
password?: string;
|
|
194
|
+
topicPrefix: string;
|
|
195
|
+
}
|
|
196
|
+
interface MqttStatus {
|
|
197
|
+
connected: boolean;
|
|
198
|
+
eventCount: number;
|
|
199
|
+
}
|
|
200
|
+
declare class FrigateMqttClient {
|
|
201
|
+
private readonly config;
|
|
202
|
+
private readonly cameraResolutions;
|
|
203
|
+
private client;
|
|
204
|
+
private readonly listeners;
|
|
205
|
+
private eventCount;
|
|
206
|
+
constructor(config: FrigateMqttConfig, cameraResolutions: Map<string, {
|
|
207
|
+
width: number;
|
|
208
|
+
height: number;
|
|
209
|
+
}>);
|
|
210
|
+
connect(): Promise<void>;
|
|
211
|
+
disconnect(): Promise<void>;
|
|
212
|
+
subscribe(callback: (event: LiveEvent) => void): () => void;
|
|
213
|
+
get status(): MqttStatus;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
interface FrigateDeviceConfig {
|
|
217
|
+
readonly cameraName: string;
|
|
218
|
+
readonly providerId: string;
|
|
219
|
+
readonly detectWidth: number;
|
|
220
|
+
readonly detectHeight: number;
|
|
221
|
+
readonly audioEnabled: boolean;
|
|
222
|
+
readonly recordEnabled: boolean;
|
|
223
|
+
readonly ptzEnabled: boolean;
|
|
224
|
+
readonly streams: StreamOption[];
|
|
225
|
+
readonly frigateHost: string;
|
|
226
|
+
}
|
|
227
|
+
declare class FrigateDevice implements IDevice {
|
|
228
|
+
private readonly config;
|
|
229
|
+
private readonly api;
|
|
230
|
+
readonly id: string;
|
|
231
|
+
readonly name: string;
|
|
232
|
+
readonly providerId: string;
|
|
233
|
+
readonly type: DeviceType;
|
|
234
|
+
readonly capabilities: DeviceCapabilityName[];
|
|
235
|
+
private readonly capabilityMap;
|
|
236
|
+
readonly ctx: CamstackContext;
|
|
237
|
+
constructor(config: FrigateDeviceConfig, api: FrigateApiClient, ctx: CamstackContext);
|
|
238
|
+
getCapability<T extends IDeviceCapability>(cap: DeviceCapabilityName): T | null;
|
|
239
|
+
hasCapability(cap: DeviceCapabilityName): boolean;
|
|
240
|
+
getState(): DeviceState;
|
|
241
|
+
getMetadata(): DeviceMetadata;
|
|
242
|
+
private createCamera;
|
|
243
|
+
private createMotionSensor;
|
|
244
|
+
private createObjectDetector;
|
|
245
|
+
private createEvents;
|
|
246
|
+
private createRecording;
|
|
247
|
+
private createAudioDetector;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export { type EventsQuery, FrigateApiClient, type FrigateApiConfig, type FrigateCameraConfig, type FrigateConfig, FrigateDevice, type FrigateDeviceConfig, type FrigateMotionData, FrigateMqttClient, type FrigateMqttConfig, FrigateProvider, type FrigateProviderConfig, type FrigateRawEvent, type FrigateRawRecording, type FrigateReviewItem, type MotionQuery, type MqttStatus, type ReviewQuery, type TestConnectionResult };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
export { FrigateProviderAddon } from './addon.js';
|
|
2
|
+
import { IDeviceProvider, CamstackContext, ProviderStatus, DiscoveredDevice, IDevice, LiveEvent, DeviceType, DeviceCapabilityName, StreamOption, IDeviceCapability, DeviceState, DeviceMetadata } from '@camstack/types';
|
|
3
|
+
|
|
4
|
+
interface FrigateProviderConfig {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly url: string;
|
|
8
|
+
readonly username?: string;
|
|
9
|
+
readonly password?: string;
|
|
10
|
+
readonly mqtt?: {
|
|
11
|
+
readonly brokerUrl: string;
|
|
12
|
+
readonly username?: string;
|
|
13
|
+
readonly password?: string;
|
|
14
|
+
readonly topicPrefix?: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
declare class FrigateProvider implements IDeviceProvider {
|
|
18
|
+
private readonly config;
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly type = "frigate";
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly discoveryMode: 'auto';
|
|
23
|
+
readonly ctx: CamstackContext;
|
|
24
|
+
private readonly api;
|
|
25
|
+
private mqtt;
|
|
26
|
+
private devices;
|
|
27
|
+
private readonly liveEventListeners;
|
|
28
|
+
private mqttUnsubscribe?;
|
|
29
|
+
/** Cached Frigate config, refreshed on start() and discoverDevices() */
|
|
30
|
+
private frigateConfig;
|
|
31
|
+
private go2rtcStreams;
|
|
32
|
+
private frigateHost;
|
|
33
|
+
constructor(config: FrigateProviderConfig, ctx: CamstackContext);
|
|
34
|
+
start(): Promise<void>;
|
|
35
|
+
stop(): Promise<void>;
|
|
36
|
+
getStatus(): ProviderStatus;
|
|
37
|
+
discoverDevices(): Promise<DiscoveredDevice[]>;
|
|
38
|
+
adoptDevice(externalId: string, _config?: Record<string, unknown>): Promise<IDevice>;
|
|
39
|
+
getDevices(): IDevice[];
|
|
40
|
+
subscribeLiveEvents(callback: (event: LiveEvent) => void): () => void;
|
|
41
|
+
private createDeviceFromCamera;
|
|
42
|
+
private getAdoptedDeviceIds;
|
|
43
|
+
private persistAdoptedDeviceId;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface FrigateConfig {
|
|
47
|
+
cameras: Record<string, FrigateCameraConfig>;
|
|
48
|
+
version?: string;
|
|
49
|
+
mqtt?: {
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
host?: string;
|
|
52
|
+
port?: number;
|
|
53
|
+
topic_prefix?: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
interface FrigateCameraConfig {
|
|
57
|
+
enabled?: boolean;
|
|
58
|
+
detect?: {
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
fps?: number;
|
|
62
|
+
enabled?: boolean;
|
|
63
|
+
};
|
|
64
|
+
record?: {
|
|
65
|
+
enabled?: boolean;
|
|
66
|
+
};
|
|
67
|
+
snapshots?: {
|
|
68
|
+
enabled?: boolean;
|
|
69
|
+
};
|
|
70
|
+
audio?: {
|
|
71
|
+
enabled?: boolean;
|
|
72
|
+
};
|
|
73
|
+
live?: {
|
|
74
|
+
stream_name?: string;
|
|
75
|
+
};
|
|
76
|
+
onvif?: {
|
|
77
|
+
host?: string;
|
|
78
|
+
};
|
|
79
|
+
ffmpeg?: {
|
|
80
|
+
inputs?: Array<{
|
|
81
|
+
path: string;
|
|
82
|
+
roles: string[];
|
|
83
|
+
}>;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
interface FrigateRawEvent {
|
|
87
|
+
id: string;
|
|
88
|
+
camera: string;
|
|
89
|
+
label: string;
|
|
90
|
+
sub_label?: string;
|
|
91
|
+
top_score: number;
|
|
92
|
+
start_time: number;
|
|
93
|
+
end_time: number | null;
|
|
94
|
+
has_snapshot: boolean;
|
|
95
|
+
has_clip: boolean;
|
|
96
|
+
data?: {
|
|
97
|
+
box?: [number, number, number, number];
|
|
98
|
+
region?: [number, number, number, number];
|
|
99
|
+
type?: 'new' | 'update' | 'end';
|
|
100
|
+
};
|
|
101
|
+
thumbnail?: string;
|
|
102
|
+
}
|
|
103
|
+
interface FrigateReviewItem {
|
|
104
|
+
id: string;
|
|
105
|
+
camera: string;
|
|
106
|
+
start_time: number;
|
|
107
|
+
end_time: number | null;
|
|
108
|
+
severity: 'alert' | 'detection';
|
|
109
|
+
data?: {
|
|
110
|
+
objects?: string[];
|
|
111
|
+
zones?: string[];
|
|
112
|
+
sub_labels?: string[];
|
|
113
|
+
};
|
|
114
|
+
thumb_path?: string;
|
|
115
|
+
}
|
|
116
|
+
interface FrigateRawRecording {
|
|
117
|
+
id?: string;
|
|
118
|
+
start_time: number;
|
|
119
|
+
end_time: number;
|
|
120
|
+
duration: number;
|
|
121
|
+
motion?: number;
|
|
122
|
+
objects?: number;
|
|
123
|
+
}
|
|
124
|
+
interface FrigateMotionData {
|
|
125
|
+
camera: string;
|
|
126
|
+
start_time: number;
|
|
127
|
+
end_time: number;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
interface FrigateApiConfig {
|
|
131
|
+
baseUrl: string;
|
|
132
|
+
username?: string;
|
|
133
|
+
password?: string;
|
|
134
|
+
}
|
|
135
|
+
interface EventsQuery {
|
|
136
|
+
after?: number;
|
|
137
|
+
before?: number;
|
|
138
|
+
cameras?: string;
|
|
139
|
+
limit?: number;
|
|
140
|
+
labels?: string;
|
|
141
|
+
}
|
|
142
|
+
interface ReviewQuery {
|
|
143
|
+
after?: number;
|
|
144
|
+
before?: number;
|
|
145
|
+
cameras?: string;
|
|
146
|
+
limit?: number;
|
|
147
|
+
}
|
|
148
|
+
interface MotionQuery {
|
|
149
|
+
after: number;
|
|
150
|
+
before: number;
|
|
151
|
+
cameras?: string;
|
|
152
|
+
}
|
|
153
|
+
interface TestConnectionResult {
|
|
154
|
+
success: boolean;
|
|
155
|
+
version?: string;
|
|
156
|
+
cameraCount?: number;
|
|
157
|
+
error?: string;
|
|
158
|
+
}
|
|
159
|
+
declare class FrigateApiClient {
|
|
160
|
+
private readonly config;
|
|
161
|
+
private readonly baseUrl;
|
|
162
|
+
private authToken;
|
|
163
|
+
private authHeader;
|
|
164
|
+
constructor(config: FrigateApiConfig);
|
|
165
|
+
private authenticate;
|
|
166
|
+
private buildHeaders;
|
|
167
|
+
private request;
|
|
168
|
+
private requestBuffer;
|
|
169
|
+
private requestText;
|
|
170
|
+
getConfig(): Promise<FrigateConfig>;
|
|
171
|
+
getGo2rtcStreams(): Promise<Record<string, unknown>>;
|
|
172
|
+
getEvents(params: EventsQuery): Promise<FrigateRawEvent[]>;
|
|
173
|
+
getReviewItems(params: ReviewQuery): Promise<FrigateReviewItem[]>;
|
|
174
|
+
getRecordings(camera: string, after: number, before: number): Promise<FrigateRawRecording[]>;
|
|
175
|
+
getMotionActivity(params: MotionQuery): Promise<FrigateMotionData[]>;
|
|
176
|
+
getLatestSnapshot(camera: string): Promise<Buffer>;
|
|
177
|
+
getEventThumbnail(eventId: string): Promise<Buffer>;
|
|
178
|
+
getEventSnapshot(eventId: string): Promise<Buffer>;
|
|
179
|
+
getEventClip(eventId: string): Promise<Buffer>;
|
|
180
|
+
getRecordingThumbnail(camera: string, timestampSec: number): Promise<Buffer>;
|
|
181
|
+
proxyWhepSdp(streamName: string, sdpOffer: string): Promise<string>;
|
|
182
|
+
getPtzInfo(camera: string): Promise<{
|
|
183
|
+
features?: string[];
|
|
184
|
+
presets?: string[];
|
|
185
|
+
} | null>;
|
|
186
|
+
ptzCommand(camera: string, command: string, params?: Record<string, unknown>): Promise<void>;
|
|
187
|
+
testConnection(): Promise<TestConnectionResult>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
interface FrigateMqttConfig {
|
|
191
|
+
brokerUrl: string;
|
|
192
|
+
username?: string;
|
|
193
|
+
password?: string;
|
|
194
|
+
topicPrefix: string;
|
|
195
|
+
}
|
|
196
|
+
interface MqttStatus {
|
|
197
|
+
connected: boolean;
|
|
198
|
+
eventCount: number;
|
|
199
|
+
}
|
|
200
|
+
declare class FrigateMqttClient {
|
|
201
|
+
private readonly config;
|
|
202
|
+
private readonly cameraResolutions;
|
|
203
|
+
private client;
|
|
204
|
+
private readonly listeners;
|
|
205
|
+
private eventCount;
|
|
206
|
+
constructor(config: FrigateMqttConfig, cameraResolutions: Map<string, {
|
|
207
|
+
width: number;
|
|
208
|
+
height: number;
|
|
209
|
+
}>);
|
|
210
|
+
connect(): Promise<void>;
|
|
211
|
+
disconnect(): Promise<void>;
|
|
212
|
+
subscribe(callback: (event: LiveEvent) => void): () => void;
|
|
213
|
+
get status(): MqttStatus;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
interface FrigateDeviceConfig {
|
|
217
|
+
readonly cameraName: string;
|
|
218
|
+
readonly providerId: string;
|
|
219
|
+
readonly detectWidth: number;
|
|
220
|
+
readonly detectHeight: number;
|
|
221
|
+
readonly audioEnabled: boolean;
|
|
222
|
+
readonly recordEnabled: boolean;
|
|
223
|
+
readonly ptzEnabled: boolean;
|
|
224
|
+
readonly streams: StreamOption[];
|
|
225
|
+
readonly frigateHost: string;
|
|
226
|
+
}
|
|
227
|
+
declare class FrigateDevice implements IDevice {
|
|
228
|
+
private readonly config;
|
|
229
|
+
private readonly api;
|
|
230
|
+
readonly id: string;
|
|
231
|
+
readonly name: string;
|
|
232
|
+
readonly providerId: string;
|
|
233
|
+
readonly type: DeviceType;
|
|
234
|
+
readonly capabilities: DeviceCapabilityName[];
|
|
235
|
+
private readonly capabilityMap;
|
|
236
|
+
readonly ctx: CamstackContext;
|
|
237
|
+
constructor(config: FrigateDeviceConfig, api: FrigateApiClient, ctx: CamstackContext);
|
|
238
|
+
getCapability<T extends IDeviceCapability>(cap: DeviceCapabilityName): T | null;
|
|
239
|
+
hasCapability(cap: DeviceCapabilityName): boolean;
|
|
240
|
+
getState(): DeviceState;
|
|
241
|
+
getMetadata(): DeviceMetadata;
|
|
242
|
+
private createCamera;
|
|
243
|
+
private createMotionSensor;
|
|
244
|
+
private createObjectDetector;
|
|
245
|
+
private createEvents;
|
|
246
|
+
private createRecording;
|
|
247
|
+
private createAudioDetector;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export { type EventsQuery, FrigateApiClient, type FrigateApiConfig, type FrigateCameraConfig, type FrigateConfig, FrigateDevice, type FrigateDeviceConfig, type FrigateMotionData, FrigateMqttClient, type FrigateMqttConfig, FrigateProvider, type FrigateProviderConfig, type FrigateRawEvent, type FrigateRawRecording, type FrigateReviewItem, type MotionQuery, type MqttStatus, type ReviewQuery, type TestConnectionResult };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-frigate",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Frigate NVR device provider addon for CamStack",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
24
25
|
"import": "./dist/index.mjs",
|
|
25
|
-
"require": "./dist/index.js"
|
|
26
|
-
"types": "./dist/index.d.ts"
|
|
26
|
+
"require": "./dist/index.js"
|
|
27
27
|
},
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|