@camera.ui/browser 0.0.1
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 +8 -0
- package/LICENSE.md +22 -0
- package/README.md +1 -0
- package/dist/bundle.browser.js +1 -0
- package/dist/client/node/src/api.d.ts +5 -0
- package/dist/client/node/src/api.js +27 -0
- package/dist/client/node/src/api.js.map +1 -0
- package/dist/client/node/src/client.d.ts +20 -0
- package/dist/client/node/src/client.js +106 -0
- package/dist/client/node/src/client.js.map +1 -0
- package/dist/client/node/src/index.d.ts +2 -0
- package/dist/client/node/src/index.js +19 -0
- package/dist/client/node/src/index.js.map +1 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.browser.d.ts +48 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.browser.js +176 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.browser.js.map +1 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.mock.d.ts +1 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.mock.js +3 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.mock.js.map +1 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.node.d.ts +11 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.node.js +51 -0
- package/dist/client/node/src/proxy/cameraDevice/cameraDevice.node.js.map +1 -0
- package/dist/client/node/src/proxy/cameraDevice/index.d.ts +6 -0
- package/dist/client/node/src/proxy/cameraDevice/index.js +11 -0
- package/dist/client/node/src/proxy/cameraDevice/index.js.map +1 -0
- package/dist/client/node/src/proxy/deviceManager.d.ts +15 -0
- package/dist/client/node/src/proxy/deviceManager.js +67 -0
- package/dist/client/node/src/proxy/deviceManager.js.map +1 -0
- package/dist/client/node/src/proxy/index.d.ts +4 -0
- package/dist/client/node/src/proxy/index.js +21 -0
- package/dist/client/node/src/proxy/index.js.map +1 -0
- package/dist/client/node/src/proxy/pluginsManager.d.ts +9 -0
- package/dist/client/node/src/proxy/pluginsManager.js +25 -0
- package/dist/client/node/src/proxy/pluginsManager.js.map +1 -0
- package/dist/client/node/src/proxy/systemManager.d.ts +9 -0
- package/dist/client/node/src/proxy/systemManager.js +25 -0
- package/dist/client/node/src/proxy/systemManager.js.map +1 -0
- package/dist/client/node/src/socket.d.ts +9 -0
- package/dist/client/node/src/socket.js +45 -0
- package/dist/client/node/src/socket.js.map +1 -0
- package/dist/client/node/src/types.d.ts +22 -0
- package/dist/client/node/src/types.js +3 -0
- package/dist/client/node/src/types.js.map +1 -0
- package/dist/package.json +149 -0
- package/dist/shared/common/utils.d.ts +6 -0
- package/dist/shared/common/utils.js +66 -0
- package/dist/shared/common/utils.js.map +1 -0
- package/dist/shared/types/index.d.ts +8 -0
- package/dist/shared/types/index.js +23 -0
- package/dist/shared/types/index.js.map +1 -0
- package/dist/src/api/database/index.d.ts +25 -0
- package/dist/src/api/database/index.js +203 -0
- package/dist/src/api/database/index.js.map +1 -0
- package/dist/src/api/database/types.d.ts +153 -0
- package/dist/src/api/database/types.js +3 -0
- package/dist/src/api/database/types.js.map +1 -0
- package/dist/src/api/go2rtc/api/application.d.ts +8 -0
- package/dist/src/api/go2rtc/api/application.js +32 -0
- package/dist/src/api/go2rtc/api/application.js.map +1 -0
- package/dist/src/api/go2rtc/api/index.d.ts +3 -0
- package/dist/src/api/go2rtc/api/index.js +33 -0
- package/dist/src/api/go2rtc/api/index.js.map +1 -0
- package/dist/src/api/go2rtc/api/snapshot.d.ts +6 -0
- package/dist/src/api/go2rtc/api/snapshot.js +22 -0
- package/dist/src/api/go2rtc/api/snapshot.js.map +1 -0
- package/dist/src/api/go2rtc/api/streams.d.ts +10 -0
- package/dist/src/api/go2rtc/api/streams.js +32 -0
- package/dist/src/api/go2rtc/api/streams.js.map +1 -0
- package/dist/src/api/go2rtc/index.d.ts +3 -0
- package/dist/src/api/go2rtc/index.js +13 -0
- package/dist/src/api/go2rtc/index.js.map +1 -0
- package/dist/src/api/go2rtc/types.d.ts +43 -0
- package/dist/src/api/go2rtc/types.js +3 -0
- package/dist/src/api/go2rtc/types.js.map +1 -0
- package/dist/src/api/middlewares/socketAuth.middleware.d.ts +41 -0
- package/dist/src/api/middlewares/socketAuth.middleware.js +90 -0
- package/dist/src/api/middlewares/socketAuth.middleware.js.map +1 -0
- package/dist/src/api/schemas/backup.schema.d.ts +220 -0
- package/dist/src/api/schemas/backup.schema.js +94 -0
- package/dist/src/api/schemas/backup.schema.js.map +1 -0
- package/dist/src/api/schemas/cameras.schema.d.ts +316 -0
- package/dist/src/api/schemas/cameras.schema.js +124 -0
- package/dist/src/api/schemas/cameras.schema.js.map +1 -0
- package/dist/src/api/schemas/config.schema.d.ts +202 -0
- package/dist/src/api/schemas/config.schema.js +94 -0
- package/dist/src/api/schemas/config.schema.js.map +1 -0
- package/dist/src/api/schemas/go2rtc.schema.d.ts +604 -0
- package/dist/src/api/schemas/go2rtc.schema.js +204 -0
- package/dist/src/api/schemas/go2rtc.schema.js.map +1 -0
- package/dist/src/api/schemas/users.schema.d.ts +515 -0
- package/dist/src/api/schemas/users.schema.js +131 -0
- package/dist/src/api/schemas/users.schema.js.map +1 -0
- package/dist/src/api/services/auth.service.d.ts +20 -0
- package/dist/src/api/services/auth.service.js +104 -0
- package/dist/src/api/services/auth.service.js.map +1 -0
- package/dist/src/api/services/cameras.service.d.ts +40 -0
- package/dist/src/api/services/cameras.service.js +535 -0
- package/dist/src/api/services/cameras.service.js.map +1 -0
- package/dist/src/api/services/plugins.service.d.ts +23 -0
- package/dist/src/api/services/plugins.service.js +115 -0
- package/dist/src/api/services/plugins.service.js.map +1 -0
- package/dist/src/api/services/users.service.d.ts +13 -0
- package/dist/src/api/services/users.service.js +54 -0
- package/dist/src/api/services/users.service.js.map +1 -0
- package/dist/src/api/types/index.d.ts +522 -0
- package/dist/src/api/types/index.js +12 -0
- package/dist/src/api/types/index.js.map +1 -0
- package/dist/src/api/utils/cert.d.ts +17 -0
- package/dist/src/api/utils/cert.js +437 -0
- package/dist/src/api/utils/cert.js.map +1 -0
- package/dist/src/api/ws/index.d.ts +15 -0
- package/dist/src/api/ws/index.js +89 -0
- package/dist/src/api/ws/index.js.map +1 -0
- package/dist/src/api/ws/nsp/logs.d.ts +11 -0
- package/dist/src/api/ws/nsp/logs.js +121 -0
- package/dist/src/api/ws/nsp/logs.js.map +1 -0
- package/dist/src/api/ws/nsp/main.d.ts +9 -0
- package/dist/src/api/ws/nsp/main.js +49 -0
- package/dist/src/api/ws/nsp/main.js.map +1 -0
- package/dist/src/api/ws/nsp/metrics.d.ts +33 -0
- package/dist/src/api/ws/nsp/metrics.js +225 -0
- package/dist/src/api/ws/nsp/metrics.js.map +1 -0
- package/dist/src/api/ws/nsp/notifications.d.ts +11 -0
- package/dist/src/api/ws/nsp/notifications.js +39 -0
- package/dist/src/api/ws/nsp/notifications.js.map +1 -0
- package/dist/src/api/ws/nsp/plugins.d.ts +13 -0
- package/dist/src/api/ws/nsp/plugins.js +33 -0
- package/dist/src/api/ws/nsp/plugins.js.map +1 -0
- package/dist/src/api/ws/nsp/status.d.ts +12 -0
- package/dist/src/api/ws/nsp/status.js +41 -0
- package/dist/src/api/ws/nsp/status.js.map +1 -0
- package/dist/src/api/ws/nsp/streams.d.ts +30 -0
- package/dist/src/api/ws/nsp/streams.js +140 -0
- package/dist/src/api/ws/nsp/streams.js.map +1 -0
- package/dist/src/api/ws/types.d.ts +82 -0
- package/dist/src/api/ws/types.js +3 -0
- package/dist/src/api/ws/types.js.map +1 -0
- package/dist/src/api.d.ts +60 -0
- package/dist/src/api.js +66 -0
- package/dist/src/api.js.map +1 -0
- package/dist/src/camera/index.d.ts +54 -0
- package/dist/src/camera/index.js +210 -0
- package/dist/src/camera/index.js.map +1 -0
- package/dist/src/camera/streaming/peer-connection.d.ts +31 -0
- package/dist/src/camera/streaming/peer-connection.js +157 -0
- package/dist/src/camera/streaming/peer-connection.js.map +1 -0
- package/dist/src/camera/streaming/streaming-session.d.ts +32 -0
- package/dist/src/camera/streaming/streaming-session.js +172 -0
- package/dist/src/camera/streaming/streaming-session.js.map +1 -0
- package/dist/src/camera/streaming/webrtc-connection.d.ts +33 -0
- package/dist/src/camera/streaming/webrtc-connection.js +156 -0
- package/dist/src/camera/streaming/webrtc-connection.js.map +1 -0
- package/dist/src/camera/subscribed.d.ts +6 -0
- package/dist/src/camera/subscribed.js +14 -0
- package/dist/src/camera/subscribed.js.map +1 -0
- package/dist/src/camera/types.d.ts +130 -0
- package/dist/src/camera/types.js +3 -0
- package/dist/src/camera/types.js.map +1 -0
- package/dist/src/go2rtc/index.d.ts +24 -0
- package/dist/src/go2rtc/index.js +220 -0
- package/dist/src/go2rtc/index.js.map +1 -0
- package/dist/src/go2rtc/types.d.ts +14 -0
- package/dist/src/go2rtc/types.js +76 -0
- package/dist/src/go2rtc/types.js.map +1 -0
- package/dist/src/plugins/base.d.ts +19 -0
- package/dist/src/plugins/base.js +26 -0
- package/dist/src/plugins/base.js.map +1 -0
- package/dist/src/plugins/cameraStorage.d.ts +97 -0
- package/dist/src/plugins/cameraStorage.js +290 -0
- package/dist/src/plugins/cameraStorage.js.map +1 -0
- package/dist/src/plugins/child.d.ts +18 -0
- package/dist/src/plugins/child.js +140 -0
- package/dist/src/plugins/child.js.map +1 -0
- package/dist/src/plugins/config.d.ts +113 -0
- package/dist/src/plugins/config.js +234 -0
- package/dist/src/plugins/config.js.map +1 -0
- package/dist/src/plugins/index.d.ts +36 -0
- package/dist/src/plugins/index.js +328 -0
- package/dist/src/plugins/index.js.map +1 -0
- package/dist/src/plugins/plugin.d.ts +47 -0
- package/dist/src/plugins/plugin.js +215 -0
- package/dist/src/plugins/plugin.js.map +1 -0
- package/dist/src/plugins/schema.d.ts +268 -0
- package/dist/src/plugins/schema.js +717 -0
- package/dist/src/plugins/schema.js.map +1 -0
- package/dist/src/plugins/storage.d.ts +28 -0
- package/dist/src/plugins/storage.js +45 -0
- package/dist/src/plugins/storage.js.map +1 -0
- package/dist/src/plugins/types.d.ts +162 -0
- package/dist/src/plugins/types.js +21 -0
- package/dist/src/plugins/types.js.map +1 -0
- package/dist/src/plugins/worker.d.ts +27 -0
- package/dist/src/plugins/worker.js +236 -0
- package/dist/src/plugins/worker.js.map +1 -0
- package/dist/src/proxy/client/cameraDevice.d.ts +29 -0
- package/dist/src/proxy/client/cameraDevice.js +171 -0
- package/dist/src/proxy/client/cameraDevice.js.map +1 -0
- package/dist/src/proxy/client/deviceManager.d.ts +40 -0
- package/dist/src/proxy/client/deviceManager.js +239 -0
- package/dist/src/proxy/client/deviceManager.js.map +1 -0
- package/dist/src/proxy/client/index.d.ts +4 -0
- package/dist/src/proxy/client/index.js +21 -0
- package/dist/src/proxy/client/index.js.map +1 -0
- package/dist/src/proxy/client/pluginsManager.d.ts +35 -0
- package/dist/src/proxy/client/pluginsManager.js +237 -0
- package/dist/src/proxy/client/pluginsManager.js.map +1 -0
- package/dist/src/proxy/client/systemManager.d.ts +29 -0
- package/dist/src/proxy/client/systemManager.js +163 -0
- package/dist/src/proxy/client/systemManager.js.map +1 -0
- package/dist/src/proxy/index.d.ts +20 -0
- package/dist/src/proxy/index.js +98 -0
- package/dist/src/proxy/index.js.map +1 -0
- package/dist/src/proxy/proxies/camera.d.ts +26 -0
- package/dist/src/proxy/proxies/camera.js +72 -0
- package/dist/src/proxy/proxies/camera.js.map +1 -0
- package/dist/src/proxy/proxies/plugin.d.ts +30 -0
- package/dist/src/proxy/proxies/plugin.js +110 -0
- package/dist/src/proxy/proxies/plugin.js.map +1 -0
- package/dist/src/proxy/proxies/server.d.ts +34 -0
- package/dist/src/proxy/proxies/server.js +92 -0
- package/dist/src/proxy/proxies/server.js.map +1 -0
- package/dist/src/proxy/types.d.ts +189 -0
- package/dist/src/proxy/types.js +3 -0
- package/dist/src/proxy/types.js.map +1 -0
- package/dist/src/proxy/utils/generateKeys.d.ts +5 -0
- package/dist/src/proxy/utils/generateKeys.js +13 -0
- package/dist/src/proxy/utils/generateKeys.js.map +1 -0
- package/dist/src/proxy/ws/index.d.ts +21 -0
- package/dist/src/proxy/ws/index.js +75 -0
- package/dist/src/proxy/ws/index.js.map +1 -0
- package/dist/src/services/config/index.d.ts +60 -0
- package/dist/src/services/config/index.js +319 -0
- package/dist/src/services/config/index.js.map +1 -0
- package/dist/src/services/config/types.d.ts +153 -0
- package/dist/src/services/config/types.js +13 -0
- package/dist/src/services/config/types.js.map +1 -0
- package/dist/src/services/logger/index.d.ts +37 -0
- package/dist/src/services/logger/index.js +181 -0
- package/dist/src/services/logger/index.js.map +1 -0
- package/package.json +46 -0
- package/webpack.config.js +29 -0
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="pouchdb-core" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
import type { Readable } from 'stream';
|
|
5
|
+
import type { CreateUserInput, LoginUserInput, PatchUserInput } from '../schemas/users.schema';
|
|
6
|
+
import type { CreateCameraInput, PreviewCameraInput, PatchCameraInput } from '../schemas/cameras.schema';
|
|
7
|
+
import type { PatchConfigInput } from '../schemas/config.schema';
|
|
8
|
+
import type { RestoreBackupInput } from '../schemas/backup.schema';
|
|
9
|
+
import type { PatchGo2RtcConfigInput } from '../schemas/go2rtc.schema';
|
|
10
|
+
import type { LoggingLevel } from '../../services/config/types';
|
|
11
|
+
import type { ApplicationResponse } from '../go2rtc/types';
|
|
12
|
+
import type { DBRoles, DBCamera, DBUser, DBCamviewLayout, CameraExtensions } from '../database/types';
|
|
13
|
+
import type { CameraExtension, PluginContract, PluginRootSchema } from '../../plugins/types';
|
|
14
|
+
export interface BusboyFileStream extends Readable {
|
|
15
|
+
truncated: boolean;
|
|
16
|
+
bytesRead: number;
|
|
17
|
+
}
|
|
18
|
+
export interface UiNotification {
|
|
19
|
+
_id: string;
|
|
20
|
+
title: string;
|
|
21
|
+
text: string;
|
|
22
|
+
timestamp: number;
|
|
23
|
+
type: LoggingLevel;
|
|
24
|
+
link?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface JwtTokenEncoded {
|
|
27
|
+
_id: string;
|
|
28
|
+
access_token: string;
|
|
29
|
+
refresh_token: string;
|
|
30
|
+
token_type: string;
|
|
31
|
+
expires_in: number;
|
|
32
|
+
expires_at: Date;
|
|
33
|
+
}
|
|
34
|
+
export interface JwtPayload {
|
|
35
|
+
_id: string;
|
|
36
|
+
avatar: string;
|
|
37
|
+
username: string;
|
|
38
|
+
role: DBRoles;
|
|
39
|
+
oneLogin: boolean;
|
|
40
|
+
rememberMe: boolean;
|
|
41
|
+
firstLogin: boolean;
|
|
42
|
+
sessionTimer: number;
|
|
43
|
+
}
|
|
44
|
+
export interface JwtRefreshPayload {
|
|
45
|
+
_id: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ClientData {
|
|
48
|
+
_id: string;
|
|
49
|
+
access_token: string;
|
|
50
|
+
address?: string;
|
|
51
|
+
device?: string;
|
|
52
|
+
}
|
|
53
|
+
export declare enum REFRESH_TOKEN {
|
|
54
|
+
EXPIRES_IN = "7d"
|
|
55
|
+
}
|
|
56
|
+
export declare const PAGINATION_DEFAULTS: PaginationQuery;
|
|
57
|
+
export interface CameraCamviewSettings {
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
mode: InterfaceStreamMode;
|
|
60
|
+
imageRefreshTimer: number;
|
|
61
|
+
}
|
|
62
|
+
export type InterfaceStreamMode = 'live' | 'snapshot';
|
|
63
|
+
export interface JwtTokenDecoded {
|
|
64
|
+
_id: string;
|
|
65
|
+
username: string;
|
|
66
|
+
avatar: string;
|
|
67
|
+
role: DBRoles;
|
|
68
|
+
oneLogin: boolean;
|
|
69
|
+
firstLogin: boolean;
|
|
70
|
+
rememberMe: boolean;
|
|
71
|
+
sessionTimer: number;
|
|
72
|
+
exp: Readonly<number>;
|
|
73
|
+
iat: Readonly<number>;
|
|
74
|
+
}
|
|
75
|
+
export interface JwtRefreshTokenDecoded {
|
|
76
|
+
_id: string;
|
|
77
|
+
expires_in: number;
|
|
78
|
+
expires_at: Date;
|
|
79
|
+
exp: Readonly<number>;
|
|
80
|
+
iat: Readonly<number>;
|
|
81
|
+
}
|
|
82
|
+
export interface JwtTokenResponse {
|
|
83
|
+
access_token: string;
|
|
84
|
+
refresh_token: string;
|
|
85
|
+
}
|
|
86
|
+
export interface JwtTokenClientData {
|
|
87
|
+
token: JwtTokenEncoded;
|
|
88
|
+
clientData?: ClientData;
|
|
89
|
+
}
|
|
90
|
+
export type LogoutResponse = 'OK';
|
|
91
|
+
export interface SessionResponse {
|
|
92
|
+
status: 'OK';
|
|
93
|
+
statusCode: undefined;
|
|
94
|
+
message: undefined;
|
|
95
|
+
}
|
|
96
|
+
export interface SessionExpiredResponse {
|
|
97
|
+
status: undefined;
|
|
98
|
+
statusCode: number;
|
|
99
|
+
message: string;
|
|
100
|
+
}
|
|
101
|
+
export type SessionStatus = SessionResponse | SessionExpiredResponse;
|
|
102
|
+
export interface Pagination {
|
|
103
|
+
pageSize: number;
|
|
104
|
+
startIndex: number;
|
|
105
|
+
endIndex: number;
|
|
106
|
+
totalItems: number;
|
|
107
|
+
currentPage?: number;
|
|
108
|
+
totalPages?: number;
|
|
109
|
+
nextPageQuery?: string | null;
|
|
110
|
+
prevPageQuery?: string | null;
|
|
111
|
+
}
|
|
112
|
+
export interface PaginationResponse {
|
|
113
|
+
pagination: Pagination;
|
|
114
|
+
result: any[];
|
|
115
|
+
}
|
|
116
|
+
export interface UsersResponse {
|
|
117
|
+
pagination: Pagination;
|
|
118
|
+
result: DBUser[];
|
|
119
|
+
}
|
|
120
|
+
export interface CamerasResponse {
|
|
121
|
+
pagination: Pagination;
|
|
122
|
+
result: DBCamera[];
|
|
123
|
+
}
|
|
124
|
+
export interface PluginExtension {
|
|
125
|
+
pluginName: string;
|
|
126
|
+
displayName: string;
|
|
127
|
+
type: CameraExtension;
|
|
128
|
+
builtIn?: boolean;
|
|
129
|
+
}
|
|
130
|
+
export interface PluginExtensionConfig extends PluginExtension {
|
|
131
|
+
rootSchema?: PluginRootSchema;
|
|
132
|
+
config?: Record<string, any>;
|
|
133
|
+
}
|
|
134
|
+
export interface ExtensionsResponse {
|
|
135
|
+
pagination: Pagination;
|
|
136
|
+
result: PluginExtension[];
|
|
137
|
+
}
|
|
138
|
+
export interface PluginsResponse {
|
|
139
|
+
pagination: Pagination;
|
|
140
|
+
result: CameraUiPlugin[];
|
|
141
|
+
}
|
|
142
|
+
export interface PluginContractCamera {
|
|
143
|
+
name: string;
|
|
144
|
+
extensions: CameraExtensions;
|
|
145
|
+
}
|
|
146
|
+
export interface PluginContractResponse {
|
|
147
|
+
contract: PluginContract;
|
|
148
|
+
cameras: PluginContractCamera[];
|
|
149
|
+
}
|
|
150
|
+
export interface Go2RtcInfoAuth {
|
|
151
|
+
username: string;
|
|
152
|
+
password: string;
|
|
153
|
+
}
|
|
154
|
+
export interface Go2RtcInfo {
|
|
155
|
+
url: string;
|
|
156
|
+
wsURL: string;
|
|
157
|
+
port: number;
|
|
158
|
+
info: ApplicationResponse;
|
|
159
|
+
auth: Go2RtcInfoAuth;
|
|
160
|
+
}
|
|
161
|
+
export interface TokenClientDataResponse {
|
|
162
|
+
pagination: Pagination;
|
|
163
|
+
result: JwtTokenClientData[];
|
|
164
|
+
}
|
|
165
|
+
export interface PaginationQuery {
|
|
166
|
+
start?: number;
|
|
167
|
+
page?: number;
|
|
168
|
+
pageSize?: number;
|
|
169
|
+
}
|
|
170
|
+
export type Multipart = MultipartFile | MultipartValue;
|
|
171
|
+
export interface MultipartFile {
|
|
172
|
+
type: 'file';
|
|
173
|
+
toBuffer: () => Promise<Buffer>;
|
|
174
|
+
file: BusboyFileStream;
|
|
175
|
+
fieldname: string;
|
|
176
|
+
filename: string;
|
|
177
|
+
encoding: string;
|
|
178
|
+
mimetype: string;
|
|
179
|
+
fields: MultipartFields;
|
|
180
|
+
_buf?: Buffer;
|
|
181
|
+
value: Buffer;
|
|
182
|
+
}
|
|
183
|
+
export interface MultipartValue<T = unknown> {
|
|
184
|
+
type: 'field';
|
|
185
|
+
value: T;
|
|
186
|
+
fieldname: string;
|
|
187
|
+
mimetype: string;
|
|
188
|
+
encoding: string;
|
|
189
|
+
fieldnameTruncated: boolean;
|
|
190
|
+
valueTruncated: boolean;
|
|
191
|
+
fields: MultipartFields;
|
|
192
|
+
}
|
|
193
|
+
export interface MultipartFields {
|
|
194
|
+
[fieldname: string]: Multipart | Multipart[] | undefined;
|
|
195
|
+
}
|
|
196
|
+
export type PaginationRequest = {
|
|
197
|
+
Querystring: PaginationQuery;
|
|
198
|
+
};
|
|
199
|
+
export type DownloadLogRequest = {
|
|
200
|
+
Querystring: {
|
|
201
|
+
filter?: string;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
export type AuthParamsRequest = {
|
|
205
|
+
Params: {
|
|
206
|
+
id: string;
|
|
207
|
+
username?: string;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
export type AuthLoginRequest = {
|
|
211
|
+
Querystring: {
|
|
212
|
+
username?: string;
|
|
213
|
+
password?: string;
|
|
214
|
+
token?: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
export type AuthNewLoginRequest = {
|
|
218
|
+
Body: LoginUserInput;
|
|
219
|
+
};
|
|
220
|
+
export type AuthRefreshRequest = {
|
|
221
|
+
Body: {
|
|
222
|
+
refresh_token: string;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
export type AuthTokensRequest = {
|
|
226
|
+
Querystring: {
|
|
227
|
+
clientData?: boolean;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
export type CamerasParamsRequest = {
|
|
231
|
+
Params: {
|
|
232
|
+
cameraname: string;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
export type CamerasExtensionsParamsRequest = {
|
|
236
|
+
Params: {
|
|
237
|
+
cameraname: string;
|
|
238
|
+
pluginname: string;
|
|
239
|
+
scope?: string;
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
export type CamerasExtensionsRequest = {
|
|
243
|
+
Querystring: {
|
|
244
|
+
type?: CameraExtension;
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
export type CamerasInsertRequest = {
|
|
248
|
+
Body: CreateCameraInput;
|
|
249
|
+
};
|
|
250
|
+
export type CamerasPreviewRequest = {
|
|
251
|
+
Body: PreviewCameraInput;
|
|
252
|
+
};
|
|
253
|
+
export type CamerasPatchRequest = {
|
|
254
|
+
Body: PatchCameraInput;
|
|
255
|
+
};
|
|
256
|
+
export type ExtensionsPatchRequest = {
|
|
257
|
+
Body: Record<string, any>;
|
|
258
|
+
};
|
|
259
|
+
export type ConfigRequest = {
|
|
260
|
+
Querystring: {
|
|
261
|
+
json?: boolean;
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
export type ConfigPatchRequest = {
|
|
265
|
+
Body: PatchConfigInput;
|
|
266
|
+
};
|
|
267
|
+
export type Go2RtcConfigPatchRequest = {
|
|
268
|
+
Body: PatchGo2RtcConfigInput;
|
|
269
|
+
};
|
|
270
|
+
export type FilesParamsRequest = {
|
|
271
|
+
Params: {
|
|
272
|
+
file: string;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
export type PluginsParamsIdRequest = {
|
|
276
|
+
Params: {
|
|
277
|
+
pluginid: string;
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
export type PluginsParamsNameRequest = {
|
|
281
|
+
Params: {
|
|
282
|
+
scope?: string;
|
|
283
|
+
pluginname: string;
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
export type PluginsParamsRemoveRequest = {
|
|
287
|
+
Querystring: {
|
|
288
|
+
removeStorage?: boolean;
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
export interface PluginsQuery {
|
|
292
|
+
pluginname?: string;
|
|
293
|
+
pluginversion?: string;
|
|
294
|
+
}
|
|
295
|
+
export type PluginsQueryRequest = {
|
|
296
|
+
Querystring: PluginsQuery;
|
|
297
|
+
};
|
|
298
|
+
export type PluginsInsertRequest = {
|
|
299
|
+
Body: {
|
|
300
|
+
pluginname: string;
|
|
301
|
+
pluginversion?: string;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
export type PluginsConfigPatchRequest = {
|
|
305
|
+
Body: Record<string, any>;
|
|
306
|
+
};
|
|
307
|
+
export type PluginsActionRequest = {
|
|
308
|
+
Body: {
|
|
309
|
+
actionId: string;
|
|
310
|
+
payload: any;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
export type UsersParamsRequest = {
|
|
314
|
+
Params: {
|
|
315
|
+
username: string;
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
export type UsersInsertRequest = {
|
|
319
|
+
Body: CreateUserInput & {
|
|
320
|
+
avatar: string;
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
export type UsersPatchRequest = {
|
|
324
|
+
Body: PatchUserInput & {
|
|
325
|
+
avatar: string;
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
export type BackupCreateRequest = {
|
|
329
|
+
Body: {
|
|
330
|
+
localStorage: Partial<UiLocalStorage>;
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
export interface BackupInfo {
|
|
334
|
+
backupDirectory: string;
|
|
335
|
+
backupFile: string;
|
|
336
|
+
backupFileName: string;
|
|
337
|
+
}
|
|
338
|
+
export type SupportedLanguageAbbreviatons = 'de' | 'en';
|
|
339
|
+
export type SupportedThemes = 'light' | 'dark';
|
|
340
|
+
export interface ThemeLocalStorage {
|
|
341
|
+
theme: SupportedThemes;
|
|
342
|
+
autoMode: boolean;
|
|
343
|
+
}
|
|
344
|
+
export interface CamviewLocalStorage {
|
|
345
|
+
currentLayout: DBCamviewLayout;
|
|
346
|
+
preferences: DBCamviewLayout[];
|
|
347
|
+
}
|
|
348
|
+
export interface UiLocalStorage {
|
|
349
|
+
layout: CamviewLocalStorage;
|
|
350
|
+
theme: ThemeLocalStorage;
|
|
351
|
+
locale: SupportedLanguageAbbreviatons;
|
|
352
|
+
}
|
|
353
|
+
export type BackupRestoreRequest = {
|
|
354
|
+
Body: RestoreBackupInput;
|
|
355
|
+
};
|
|
356
|
+
export interface INpmPluginState {
|
|
357
|
+
updateAvailable: boolean;
|
|
358
|
+
betaUpdateAvailable: boolean;
|
|
359
|
+
lastUpdated?: string;
|
|
360
|
+
latestVersion?: string;
|
|
361
|
+
}
|
|
362
|
+
export interface INpmPerson {
|
|
363
|
+
name?: string;
|
|
364
|
+
email?: string;
|
|
365
|
+
homepage?: string;
|
|
366
|
+
username?: string;
|
|
367
|
+
url?: string;
|
|
368
|
+
}
|
|
369
|
+
export interface IPackageJson {
|
|
370
|
+
name: string;
|
|
371
|
+
displayName?: string;
|
|
372
|
+
version?: string;
|
|
373
|
+
description?: string;
|
|
374
|
+
keywords?: string[];
|
|
375
|
+
homepage?: string;
|
|
376
|
+
bugs?: string | {
|
|
377
|
+
email?: string;
|
|
378
|
+
url?: string;
|
|
379
|
+
};
|
|
380
|
+
license?: string;
|
|
381
|
+
author?: string | INpmPerson;
|
|
382
|
+
maintainers?: INpmPerson[];
|
|
383
|
+
contributors?: string[] | INpmPerson[];
|
|
384
|
+
files?: string[];
|
|
385
|
+
main?: string;
|
|
386
|
+
bin?: string | {
|
|
387
|
+
[key: string]: string;
|
|
388
|
+
};
|
|
389
|
+
repository?: string | {
|
|
390
|
+
type: string;
|
|
391
|
+
url: string;
|
|
392
|
+
};
|
|
393
|
+
scripts?: {
|
|
394
|
+
[key: string]: string;
|
|
395
|
+
};
|
|
396
|
+
dependencies?: {
|
|
397
|
+
[key: string]: string;
|
|
398
|
+
};
|
|
399
|
+
devDependencies?: {
|
|
400
|
+
[key: string]: string;
|
|
401
|
+
};
|
|
402
|
+
peerDependencies?: {
|
|
403
|
+
[key: string]: string;
|
|
404
|
+
};
|
|
405
|
+
optionalDependencies?: {
|
|
406
|
+
[key: string]: string;
|
|
407
|
+
};
|
|
408
|
+
bundledDependencies?: string[];
|
|
409
|
+
engines?: {
|
|
410
|
+
[key: string]: string;
|
|
411
|
+
};
|
|
412
|
+
os?: string[];
|
|
413
|
+
cpu?: string[];
|
|
414
|
+
preferGlobal?: boolean;
|
|
415
|
+
private?: boolean;
|
|
416
|
+
publishConfig?: {
|
|
417
|
+
registry?: string;
|
|
418
|
+
};
|
|
419
|
+
exports?: {
|
|
420
|
+
[key: string]: any;
|
|
421
|
+
};
|
|
422
|
+
type?: 'module';
|
|
423
|
+
}
|
|
424
|
+
export interface INpmRegistryModule {
|
|
425
|
+
_id: string;
|
|
426
|
+
_rev: string;
|
|
427
|
+
name: string;
|
|
428
|
+
'dist-tags': {
|
|
429
|
+
latest: string;
|
|
430
|
+
[key: string]: string;
|
|
431
|
+
};
|
|
432
|
+
versions: {
|
|
433
|
+
[key: string]: IPackageJson;
|
|
434
|
+
};
|
|
435
|
+
time: {
|
|
436
|
+
created: string;
|
|
437
|
+
modified: string;
|
|
438
|
+
[key: string]: string;
|
|
439
|
+
};
|
|
440
|
+
maintainers: INpmPerson[];
|
|
441
|
+
description: string;
|
|
442
|
+
homepage: string;
|
|
443
|
+
keywords: string[];
|
|
444
|
+
repository: {
|
|
445
|
+
type: string;
|
|
446
|
+
url: string;
|
|
447
|
+
};
|
|
448
|
+
author: INpmPerson;
|
|
449
|
+
bugs: {
|
|
450
|
+
email?: string;
|
|
451
|
+
url?: string;
|
|
452
|
+
};
|
|
453
|
+
license: string;
|
|
454
|
+
readme: string;
|
|
455
|
+
readmeFilename: string;
|
|
456
|
+
}
|
|
457
|
+
export interface INpmSearchResults {
|
|
458
|
+
objects: INpmSearchResultItem[];
|
|
459
|
+
}
|
|
460
|
+
export interface INpmSearchResultItem {
|
|
461
|
+
package: {
|
|
462
|
+
name: string;
|
|
463
|
+
scoped: string;
|
|
464
|
+
version: string;
|
|
465
|
+
description: string;
|
|
466
|
+
keywords: string[];
|
|
467
|
+
date: string;
|
|
468
|
+
links: {
|
|
469
|
+
npm: string;
|
|
470
|
+
homebridge?: string;
|
|
471
|
+
repository?: string;
|
|
472
|
+
bugs?: string;
|
|
473
|
+
};
|
|
474
|
+
author: INpmPerson;
|
|
475
|
+
publisher: INpmPerson;
|
|
476
|
+
maintainers: INpmPerson[];
|
|
477
|
+
};
|
|
478
|
+
flags: {
|
|
479
|
+
unstable: boolean;
|
|
480
|
+
};
|
|
481
|
+
score: {
|
|
482
|
+
final: number;
|
|
483
|
+
detail: {
|
|
484
|
+
quality: number;
|
|
485
|
+
popularity: number;
|
|
486
|
+
maintenance: number;
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
searchScore: number;
|
|
490
|
+
}
|
|
491
|
+
export interface PluginLinks {
|
|
492
|
+
npm: string;
|
|
493
|
+
homepage: string;
|
|
494
|
+
}
|
|
495
|
+
export interface PluginEngines {
|
|
496
|
+
node: string;
|
|
497
|
+
'camera.ui': string;
|
|
498
|
+
}
|
|
499
|
+
export interface CameraUiPlugin {
|
|
500
|
+
id: string;
|
|
501
|
+
pluginName: string;
|
|
502
|
+
private: boolean;
|
|
503
|
+
displayName: string;
|
|
504
|
+
description?: string;
|
|
505
|
+
publicPackage?: boolean;
|
|
506
|
+
installedVersion?: string;
|
|
507
|
+
latestVersion?: string;
|
|
508
|
+
lastUpdated?: string;
|
|
509
|
+
availableVersions?: string[];
|
|
510
|
+
installPath?: string;
|
|
511
|
+
globalInstall?: boolean;
|
|
512
|
+
disabled?: boolean;
|
|
513
|
+
links?: {
|
|
514
|
+
npm?: string;
|
|
515
|
+
homepage?: string;
|
|
516
|
+
};
|
|
517
|
+
author?: string;
|
|
518
|
+
engines?: {
|
|
519
|
+
'camera.ui'?: string;
|
|
520
|
+
node?: string;
|
|
521
|
+
};
|
|
522
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PAGINATION_DEFAULTS = exports.REFRESH_TOKEN = void 0;
|
|
4
|
+
var REFRESH_TOKEN;
|
|
5
|
+
(function (REFRESH_TOKEN) {
|
|
6
|
+
REFRESH_TOKEN["EXPIRES_IN"] = "7d";
|
|
7
|
+
})(REFRESH_TOKEN || (exports.REFRESH_TOKEN = REFRESH_TOKEN = {}));
|
|
8
|
+
exports.PAGINATION_DEFAULTS = {
|
|
9
|
+
page: 1,
|
|
10
|
+
pageSize: 5,
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/api/types/index.ts"],"names":[],"mappings":";;;AAwDA,IAAY,aAEX;AAFD,WAAY,aAAa;IACvB,kCAAiB,CAAA;AACnB,CAAC,EAFW,aAAa,6BAAb,aAAa,QAExB;AAEY,QAAA,mBAAmB,GAAoB;IAClD,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,CAAC;CACZ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import forge from 'node-forge';
|
|
2
|
+
export interface CertKey {
|
|
3
|
+
cert: string;
|
|
4
|
+
certPath: string;
|
|
5
|
+
key: string;
|
|
6
|
+
keyPath: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const HOST_CERT_FILENAME = "camera.ui.cert.pem";
|
|
9
|
+
export declare const HOST_KEY_FILENAME = "camera.ui.key.pem";
|
|
10
|
+
export declare const ROOT_CERT_FILENAME = "camera.ui.root.cert.pem";
|
|
11
|
+
export declare const ROOT_KEY_FILENAME = "camera.ui.root.key.pem";
|
|
12
|
+
export declare const P12_FILENAME = "camera.ui.p12";
|
|
13
|
+
export declare const P12_PASSWORD = "camera.ui";
|
|
14
|
+
export declare const getCert: () => CertKey;
|
|
15
|
+
export declare const createRootCA: (customAddresses?: string[]) => CertKey;
|
|
16
|
+
export declare const createCSR: (addresses: string[], keys: forge.pki.rsa.KeyPair) => Partial<CertKey>;
|
|
17
|
+
export declare const createCert: (customAddresses?: string[]) => CertKey;
|