@homebridge-eufy-security/eufy-security-client 3.7.2-dev.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.
Files changed (129) hide show
  1. package/.prettierignore/342/200/216 +8 -0
  2. package/.prettierrc +11 -0
  3. package/LICENSE +21 -0
  4. package/README.md +970 -0
  5. package/build/error.d.ts +138 -0
  6. package/build/error.js +190 -0
  7. package/build/error.js.map +1 -0
  8. package/build/eufysecurity.d.ts +180 -0
  9. package/build/eufysecurity.js +3148 -0
  10. package/build/eufysecurity.js.map +1 -0
  11. package/build/http/api.d.ts +119 -0
  12. package/build/http/api.js +1877 -0
  13. package/build/http/api.js.map +1 -0
  14. package/build/http/cache.d.ts +8 -0
  15. package/build/http/cache.js +34 -0
  16. package/build/http/cache.js.map +1 -0
  17. package/build/http/const.d.ts +8 -0
  18. package/build/http/const.js +3054 -0
  19. package/build/http/const.js.map +1 -0
  20. package/build/http/device.d.ts +490 -0
  21. package/build/http/device.js +5256 -0
  22. package/build/http/device.js.map +1 -0
  23. package/build/http/error.d.ts +73 -0
  24. package/build/http/error.js +101 -0
  25. package/build/http/error.js.map +1 -0
  26. package/build/http/index.d.ts +10 -0
  27. package/build/http/index.js +30 -0
  28. package/build/http/index.js.map +1 -0
  29. package/build/http/interfaces.d.ts +248 -0
  30. package/build/http/interfaces.js +3 -0
  31. package/build/http/interfaces.js.map +1 -0
  32. package/build/http/models.d.ts +608 -0
  33. package/build/http/models.js +3 -0
  34. package/build/http/models.js.map +1 -0
  35. package/build/http/parameter.d.ts +7 -0
  36. package/build/http/parameter.js +119 -0
  37. package/build/http/parameter.js.map +1 -0
  38. package/build/http/station.d.ts +382 -0
  39. package/build/http/station.js +15735 -0
  40. package/build/http/station.js.map +1 -0
  41. package/build/http/types.d.ts +1358 -0
  42. package/build/http/types.js +10333 -0
  43. package/build/http/types.js.map +1 -0
  44. package/build/http/utils.d.ts +89 -0
  45. package/build/http/utils.js +916 -0
  46. package/build/http/utils.js.map +1 -0
  47. package/build/index.d.ts +8 -0
  48. package/build/index.js +29 -0
  49. package/build/index.js.map +1 -0
  50. package/build/interfaces.d.ts +147 -0
  51. package/build/interfaces.js +7 -0
  52. package/build/interfaces.js.map +1 -0
  53. package/build/logging.d.ts +36 -0
  54. package/build/logging.js +119 -0
  55. package/build/logging.js.map +1 -0
  56. package/build/mqtt/interface.d.ts +6 -0
  57. package/build/mqtt/interface.js +3 -0
  58. package/build/mqtt/interface.js.map +1 -0
  59. package/build/mqtt/model.d.ts +24 -0
  60. package/build/mqtt/model.js +3 -0
  61. package/build/mqtt/model.js.map +1 -0
  62. package/build/mqtt/mqtt-eufy.crt +79 -0
  63. package/build/mqtt/proto/lock.proto +33 -0
  64. package/build/mqtt/service.d.ts +28 -0
  65. package/build/mqtt/service.js +196 -0
  66. package/build/mqtt/service.js.map +1 -0
  67. package/build/p2p/ble.d.ts +59 -0
  68. package/build/p2p/ble.js +281 -0
  69. package/build/p2p/ble.js.map +1 -0
  70. package/build/p2p/error.d.ts +49 -0
  71. package/build/p2p/error.js +69 -0
  72. package/build/p2p/error.js.map +1 -0
  73. package/build/p2p/index.d.ts +8 -0
  74. package/build/p2p/index.js +28 -0
  75. package/build/p2p/index.js.map +1 -0
  76. package/build/p2p/interfaces.d.ts +423 -0
  77. package/build/p2p/interfaces.js +3 -0
  78. package/build/p2p/interfaces.js.map +1 -0
  79. package/build/p2p/models.d.ts +295 -0
  80. package/build/p2p/models.js +3 -0
  81. package/build/p2p/models.js.map +1 -0
  82. package/build/p2p/session.d.ts +186 -0
  83. package/build/p2p/session.js +3737 -0
  84. package/build/p2p/session.js.map +1 -0
  85. package/build/p2p/talkback.d.ts +8 -0
  86. package/build/p2p/talkback.js +23 -0
  87. package/build/p2p/talkback.js.map +1 -0
  88. package/build/p2p/types.d.ts +1164 -0
  89. package/build/p2p/types.js +1219 -0
  90. package/build/p2p/types.js.map +1 -0
  91. package/build/p2p/utils.d.ts +72 -0
  92. package/build/p2p/utils.js +865 -0
  93. package/build/p2p/utils.js.map +1 -0
  94. package/build/push/client.d.ts +49 -0
  95. package/build/push/client.js +344 -0
  96. package/build/push/client.js.map +1 -0
  97. package/build/push/error.d.ts +73 -0
  98. package/build/push/error.js +101 -0
  99. package/build/push/error.js.map +1 -0
  100. package/build/push/index.d.ts +6 -0
  101. package/build/push/index.js +26 -0
  102. package/build/push/index.js.map +1 -0
  103. package/build/push/interfaces.d.ts +19 -0
  104. package/build/push/interfaces.js +3 -0
  105. package/build/push/interfaces.js.map +1 -0
  106. package/build/push/models.d.ts +328 -0
  107. package/build/push/models.js +38 -0
  108. package/build/push/models.js.map +1 -0
  109. package/build/push/parser.d.ts +25 -0
  110. package/build/push/parser.js +231 -0
  111. package/build/push/parser.js.map +1 -0
  112. package/build/push/proto/checkin.proto +266 -0
  113. package/build/push/proto/mcs.proto +328 -0
  114. package/build/push/service.d.ts +46 -0
  115. package/build/push/service.js +965 -0
  116. package/build/push/service.js.map +1 -0
  117. package/build/push/types.d.ts +220 -0
  118. package/build/push/types.js +244 -0
  119. package/build/push/types.js.map +1 -0
  120. package/build/push/utils.d.ts +7 -0
  121. package/build/push/utils.js +116 -0
  122. package/build/push/utils.js.map +1 -0
  123. package/build/utils.d.ts +115 -0
  124. package/build/utils.js +438 -0
  125. package/build/utils.js.map +1 -0
  126. package/eslint.config.mts +68 -0
  127. package/jest.config.js +14 -0
  128. package/package.json +85 -0
  129. package/scripts/cut_release.sh +31 -0
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImageSeedError = exports.ImageBaseCodeError = exports.ApiRequestError = exports.ApiBaseLoadError = exports.ApiGenericError = exports.ApiHTTPResponseCodeError = exports.ApiInvalidResponseError = exports.ApiResponseCodeError = exports.PropertyNotSupportedError = exports.LivestreamNotRunningError = exports.LivestreamAlreadyRunningError = exports.InvalidPropertyError = void 0;
4
+ const error_1 = require("../error");
5
+ class InvalidPropertyError extends error_1.BaseError {
6
+ constructor(message, options = {}) {
7
+ super(message, options);
8
+ Object.setPrototypeOf(this, new.target.prototype);
9
+ this.name = InvalidPropertyError.name;
10
+ }
11
+ }
12
+ exports.InvalidPropertyError = InvalidPropertyError;
13
+ class LivestreamAlreadyRunningError extends error_1.BaseError {
14
+ constructor(message, options = {}) {
15
+ super(message, options);
16
+ Object.setPrototypeOf(this, new.target.prototype);
17
+ this.name = LivestreamAlreadyRunningError.name;
18
+ }
19
+ }
20
+ exports.LivestreamAlreadyRunningError = LivestreamAlreadyRunningError;
21
+ class LivestreamNotRunningError extends error_1.BaseError {
22
+ constructor(message, options = {}) {
23
+ super(message, options);
24
+ Object.setPrototypeOf(this, new.target.prototype);
25
+ this.name = LivestreamNotRunningError.name;
26
+ }
27
+ }
28
+ exports.LivestreamNotRunningError = LivestreamNotRunningError;
29
+ class PropertyNotSupportedError extends error_1.BaseError {
30
+ constructor(message, options = {}) {
31
+ super(message, options);
32
+ Object.setPrototypeOf(this, new.target.prototype);
33
+ this.name = PropertyNotSupportedError.name;
34
+ }
35
+ }
36
+ exports.PropertyNotSupportedError = PropertyNotSupportedError;
37
+ class ApiResponseCodeError extends error_1.BaseError {
38
+ constructor(message, options = {}) {
39
+ super(message, options);
40
+ Object.setPrototypeOf(this, new.target.prototype);
41
+ this.name = ApiResponseCodeError.name;
42
+ }
43
+ }
44
+ exports.ApiResponseCodeError = ApiResponseCodeError;
45
+ class ApiInvalidResponseError extends error_1.BaseError {
46
+ constructor(message, options = {}) {
47
+ super(message, options);
48
+ Object.setPrototypeOf(this, new.target.prototype);
49
+ this.name = ApiInvalidResponseError.name;
50
+ }
51
+ }
52
+ exports.ApiInvalidResponseError = ApiInvalidResponseError;
53
+ class ApiHTTPResponseCodeError extends error_1.BaseError {
54
+ constructor(message, options = {}) {
55
+ super(message, options);
56
+ Object.setPrototypeOf(this, new.target.prototype);
57
+ this.name = ApiHTTPResponseCodeError.name;
58
+ }
59
+ }
60
+ exports.ApiHTTPResponseCodeError = ApiHTTPResponseCodeError;
61
+ class ApiGenericError extends error_1.BaseError {
62
+ constructor(message, options = {}) {
63
+ super(message, options);
64
+ Object.setPrototypeOf(this, new.target.prototype);
65
+ this.name = ApiGenericError.name;
66
+ }
67
+ }
68
+ exports.ApiGenericError = ApiGenericError;
69
+ class ApiBaseLoadError extends error_1.BaseError {
70
+ constructor(message, options = {}) {
71
+ super(message, options);
72
+ Object.setPrototypeOf(this, new.target.prototype);
73
+ this.name = ApiBaseLoadError.name;
74
+ }
75
+ }
76
+ exports.ApiBaseLoadError = ApiBaseLoadError;
77
+ class ApiRequestError extends error_1.BaseError {
78
+ constructor(message, options = {}) {
79
+ super(message, options);
80
+ Object.setPrototypeOf(this, new.target.prototype);
81
+ this.name = ApiRequestError.name;
82
+ }
83
+ }
84
+ exports.ApiRequestError = ApiRequestError;
85
+ class ImageBaseCodeError extends error_1.BaseError {
86
+ constructor(message, options = {}) {
87
+ super(message, options);
88
+ Object.setPrototypeOf(this, new.target.prototype);
89
+ this.name = ImageBaseCodeError.name;
90
+ }
91
+ }
92
+ exports.ImageBaseCodeError = ImageBaseCodeError;
93
+ class ImageSeedError extends error_1.BaseError {
94
+ constructor(message, options = {}) {
95
+ super(message, options);
96
+ Object.setPrototypeOf(this, new.target.prototype);
97
+ this.name = ImageSeedError.name;
98
+ }
99
+ }
100
+ exports.ImageSeedError = ImageSeedError;
101
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/http/error.ts"],"names":[],"mappings":";;;AAAA,oCAA+C;AAE/C,MAAa,oBAAqB,SAAQ,iBAAS;IACjD,YAAY,OAAe,EAAE,UAAiD,EAAE;QAC9E,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC,I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E,OAAO,CAAC,CAAC;QACxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;IACnC,CAAC;CACF;AAND,0CAMC;AAED,MAAa,kBAAmB,SAAQ,iBAAS;IAC/C,YAAY,OAAe,EAAE,UAAiD,EAAE;QAC9E,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC;IACtC,CAAC;CACF;AAND,gDAMC;AAED,MAAa,cAAe,SAAQ,iBAAS;IAC3C,YAAY,OAAe,EAAE,UAAiD,EAAE;QAC9E,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;IAClC,CAAC;CACF;AAND,wCAMC"}
@@ -0,0 +1,10 @@
1
+ export * from "./api";
2
+ export * from "./cache";
3
+ export * from "./device";
4
+ export * from "./interfaces";
5
+ export * from "./models";
6
+ export * from "./parameter";
7
+ export * from "./station";
8
+ export * from "./types";
9
+ export * from "./error";
10
+ export { isGreaterEqualMinVersion, getAbsoluteFilePath } from "./utils";
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.getAbsoluteFilePath = exports.isGreaterEqualMinVersion = void 0;
18
+ __exportStar(require("./api"), exports);
19
+ __exportStar(require("./cache"), exports);
20
+ __exportStar(require("./device"), exports);
21
+ __exportStar(require("./interfaces"), exports);
22
+ __exportStar(require("./models"), exports);
23
+ __exportStar(require("./parameter"), exports);
24
+ __exportStar(require("./station"), exports);
25
+ __exportStar(require("./types"), exports);
26
+ __exportStar(require("./error"), exports);
27
+ var utils_1 = require("./utils");
28
+ Object.defineProperty(exports, "isGreaterEqualMinVersion", { enumerable: true, get: function () { return utils_1.isGreaterEqualMinVersion; } });
29
+ Object.defineProperty(exports, "getAbsoluteFilePath", { enumerable: true, get: function () { return utils_1.getAbsoluteFilePath; } });
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,0CAAwB;AACxB,2CAAyB;AACzB,+CAA6B;AAC7B,2CAAyB;AACzB,8CAA4B;AAC5B,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB;AACxB,iCAAwE;AAA/D,iHAAA,wBAAwB,OAAA;AAAE,4GAAA,mBAAmB,OAAA"}
@@ -0,0 +1,248 @@
1
+ import { Readable } from "stream";
2
+ import type { Method } from "got" with {
3
+ "resolution-mode": "import"
4
+ };
5
+ import type { ImageFileExtension } from "image-type" with {
6
+ "resolution-mode": "import"
7
+ };
8
+ import { DatabaseCountByDate, DatabaseQueryByDate, DatabaseQueryLatestInfo, DatabaseQueryLocal, StreamMetadata } from "../p2p/interfaces";
9
+ import { CommandResult, StorageInfoBodyHB3 } from "../p2p/models";
10
+ import { AlarmEvent, DatabaseReturnCode, SmartSafeAlarm911Event, SmartSafeShakeAlarmEvent, TFCardStatus } from "../p2p/types";
11
+ import { Camera, Device } from "./device";
12
+ import { Cipher, Voice, Invite, DeviceListResponse, StationListResponse, HouseListResponse } from "./models";
13
+ import { Station } from "./station";
14
+ import { CommandName, PropertyName, SourceType } from "./types";
15
+ import { TalkbackStream } from "../p2p/talkback";
16
+ export type PropertyValue = number | boolean | string | object | undefined;
17
+ export interface PropertyValues {
18
+ [index: string]: PropertyValue;
19
+ }
20
+ export interface DeviceConfig {
21
+ simultaneousDetections?: boolean;
22
+ }
23
+ export interface RawValue {
24
+ value: string;
25
+ source: SourceType;
26
+ }
27
+ export interface RawValues {
28
+ [index: number]: RawValue;
29
+ }
30
+ export interface Devices {
31
+ [index: string]: Device;
32
+ }
33
+ export interface Cameras {
34
+ [index: string]: Camera;
35
+ }
36
+ export interface Stations {
37
+ [index: string]: Station;
38
+ }
39
+ export interface Houses {
40
+ [index: string]: HouseListResponse;
41
+ }
42
+ export interface Hubs {
43
+ [index: string]: StationListResponse;
44
+ }
45
+ export interface FullDevices {
46
+ [index: string]: DeviceListResponse;
47
+ }
48
+ export interface Ciphers {
49
+ [index: number]: Cipher;
50
+ }
51
+ export interface Voices {
52
+ [index: number]: Voice;
53
+ }
54
+ export interface Invites {
55
+ [index: number]: Invite;
56
+ }
57
+ export interface HTTPApiRequest {
58
+ method: Method;
59
+ endpoint: string | URL;
60
+ responseType?: "text" | "json" | "buffer";
61
+ data?: any;
62
+ }
63
+ export type PropertyMetadataType = "number" | "boolean" | "string" | "object";
64
+ export interface PropertyMetadataAny {
65
+ key: number | string;
66
+ name: PropertyName;
67
+ type: PropertyMetadataType;
68
+ default?: any;
69
+ readable: boolean;
70
+ writeable: boolean;
71
+ description?: string;
72
+ label?: string;
73
+ commandId?: number;
74
+ }
75
+ export interface PropertyMetadataNumeric extends PropertyMetadataAny {
76
+ type: "number";
77
+ min?: number;
78
+ max?: number;
79
+ steps?: number;
80
+ default?: number;
81
+ states?: Record<number, string>;
82
+ unit?: string;
83
+ }
84
+ export interface PropertyMetadataBoolean extends PropertyMetadataAny {
85
+ type: "boolean";
86
+ default?: boolean;
87
+ }
88
+ export interface PropertyMetadataString extends PropertyMetadataAny {
89
+ type: "string";
90
+ minLength?: number;
91
+ maxLength?: number;
92
+ default?: string;
93
+ format?: RegExp;
94
+ }
95
+ export interface PropertyMetadataObject extends PropertyMetadataAny {
96
+ type: "object";
97
+ isValidObject?: (obj: any) => boolean;
98
+ default?: any;
99
+ }
100
+ export interface IndexedProperty {
101
+ [index: string]: PropertyMetadataAny;
102
+ }
103
+ export interface Properties {
104
+ [index: number]: IndexedProperty;
105
+ }
106
+ export interface Commands {
107
+ [index: number]: Array<CommandName>;
108
+ }
109
+ export interface HTTPApiPersistentData {
110
+ user_id: string;
111
+ email: string;
112
+ nick_name: string;
113
+ device_public_keys: {
114
+ [index: string]: string;
115
+ };
116
+ clientPrivateKey: string;
117
+ serverPublicKey: string;
118
+ }
119
+ export interface CaptchaOptions {
120
+ captchaCode: string;
121
+ captchaId: string;
122
+ }
123
+ export interface LoginOptions {
124
+ verifyCode?: string;
125
+ captcha?: CaptchaOptions;
126
+ force: boolean;
127
+ }
128
+ export interface Schedule {
129
+ startDateTime?: Date;
130
+ endDateTime?: Date;
131
+ week?: {
132
+ monday: boolean;
133
+ tuesday: boolean;
134
+ wednesday: boolean;
135
+ thursday: boolean;
136
+ friday: boolean;
137
+ saturday: boolean;
138
+ sunday: boolean;
139
+ };
140
+ }
141
+ export interface ImageType {
142
+ ext: ImageFileExtension | "unknown";
143
+ mime: string;
144
+ }
145
+ export interface Picture {
146
+ data: Buffer;
147
+ type: ImageType;
148
+ }
149
+ export interface HTTPApiEvents {
150
+ devices: (devices: FullDevices) => void;
151
+ hubs: (hubs: Hubs) => void;
152
+ houses: (houses: Houses) => void;
153
+ connect: () => void;
154
+ close: () => void;
155
+ "connection error": (error: Error) => void;
156
+ "tfa request": () => void;
157
+ "captcha request": (id: string, captcha: string) => void;
158
+ "auth token invalidated": () => void;
159
+ }
160
+ export interface StationEvents {
161
+ connect: (station: Station) => void;
162
+ close: (station: Station) => void;
163
+ "connection error": (station: Station, error: Error) => void;
164
+ "raw device property changed": (deviceSN: string, params: RawValues) => void;
165
+ "property changed": (station: Station, name: string, value: PropertyValue, ready: boolean) => void;
166
+ "raw property changed": (station: Station, type: number, value: string) => void;
167
+ "command result": (station: Station, result: CommandResult) => void;
168
+ "download start": (station: Station, channel: number, metadata: StreamMetadata, videostream: Readable, audiostream: Readable) => void;
169
+ "download finish": (station: Station, channel: number) => void;
170
+ "livestream start": (station: Station, channel: number, metadata: StreamMetadata, videostream: Readable, audiostream: Readable) => void;
171
+ "livestream stop": (station: Station, channel: number) => void;
172
+ "livestream error": (station: Station, channel: number, error: Error) => void;
173
+ "rtsp livestream start": (station: Station, channel: number) => void;
174
+ "rtsp livestream stop": (station: Station, channel: number) => void;
175
+ "rtsp url": (station: Station, channel: number, value: string) => void;
176
+ "guard mode": (station: Station, guardMode: number) => void;
177
+ "current mode": (station: Station, currentMode: number) => void;
178
+ "alarm event": (station: Station, alarmEvent: AlarmEvent) => void;
179
+ ready: (station: Station) => void;
180
+ "runtime state": (station: Station, channel: number, batteryLevel: number, temperature: number) => void;
181
+ "charging state": (station: Station, channel: number, chargeType: number, batteryLevel: number) => void;
182
+ "wifi rssi": (station: Station, channel: number, rssi: number) => void;
183
+ "floodlight manual switch": (station: Station, channel: number, enabled: boolean) => void;
184
+ "alarm delay event": (station: Station, alarmDelayEvent: AlarmEvent, alarmDelay: number) => void;
185
+ "alarm arm delay event": (station: Station, armDelay: number) => void;
186
+ "alarm armed event": (station: Station) => void;
187
+ "talkback started": (station: Station, channel: number, talkbackStream: TalkbackStream) => void;
188
+ "talkback stopped": (station: Station, channel: number) => void;
189
+ "talkback error": (station: Station, channel: number, error: Error) => void;
190
+ "secondary command result": (station: Station, result: CommandResult) => void;
191
+ "device shake alarm": (deviceSN: string, event: SmartSafeShakeAlarmEvent) => void;
192
+ "device 911 alarm": (deviceSN: string, event: SmartSafeAlarm911Event) => void;
193
+ "device jammed": (deviceSN: string) => void;
194
+ "device low battery": (deviceSN: string) => void;
195
+ "device wrong try-protect alarm": (deviceSN: string) => void;
196
+ "device pin verified": (deviceSN: string, successfull: boolean) => void;
197
+ "sd info ex": (station: Station, sdStatus: TFCardStatus, sdCapacity: number, sdCapacityAvailable: number) => void;
198
+ "image download": (station: Station, file: string, image: Buffer) => void;
199
+ "database query latest": (station: Station, returnCode: DatabaseReturnCode, data: Array<DatabaseQueryLatestInfo>) => void;
200
+ "database query local": (station: Station, returnCode: DatabaseReturnCode, data: Array<DatabaseQueryLocal>) => void;
201
+ "database query by date": (station: Station, returnCode: DatabaseReturnCode, data: Array<DatabaseQueryByDate>) => void;
202
+ "database count by date": (station: Station, returnCode: DatabaseReturnCode, data: Array<DatabaseCountByDate>) => void;
203
+ "database delete": (station: Station, returnCode: DatabaseReturnCode, failedIds: Array<unknown>) => void;
204
+ "sensor status": (station: Station, channel: number, status: number) => void;
205
+ "garage door status": (station: Station, channel: number, doorId: number, status: number) => void;
206
+ "storage info hb3": (station: Station, channel: number, storageInfo: StorageInfoBodyHB3) => void;
207
+ }
208
+ export interface DeviceEvents {
209
+ "property changed": (device: Device, name: string, value: PropertyValue, ready: boolean) => void;
210
+ "raw property changed": (device: Device, type: number, value: string) => void;
211
+ "motion detected": (device: Device, state: boolean) => void;
212
+ "person detected": (device: Device, state: boolean, person: string) => void;
213
+ "pet detected": (device: Device, state: boolean) => void;
214
+ "sound detected": (device: Device, state: boolean) => void;
215
+ "crying detected": (device: Device, state: boolean) => void;
216
+ "vehicle detected": (device: Device, state: boolean) => void;
217
+ "dog detected": (device: Device, state: boolean) => void;
218
+ "dog lick detected": (device: Device, state: boolean) => void;
219
+ "dog poop detected": (device: Device, state: boolean) => void;
220
+ "stranger person detected": (device: Device, state: boolean) => void;
221
+ rings: (device: Device, state: boolean) => void;
222
+ locked: (device: Device, state: boolean) => void;
223
+ open: (device: Device, state: boolean) => void;
224
+ ready: (device: Device) => void;
225
+ "package delivered": (device: Device, state: boolean) => void;
226
+ "package stranded": (device: Device, state: boolean) => void;
227
+ "package taken": (device: Device, state: boolean) => void;
228
+ "someone loitering": (device: Device, state: boolean) => void;
229
+ "radar motion detected": (device: Device, state: boolean) => void;
230
+ "911 alarm": (device: Device, state: boolean, detail: SmartSafeAlarm911Event) => void;
231
+ "shake alarm": (device: Device, state: boolean, detail: SmartSafeShakeAlarmEvent) => void;
232
+ "wrong try-protect alarm": (device: Device, state: boolean) => void;
233
+ "long time not close": (device: Device, state: boolean) => void;
234
+ "low battery": (device: Device, state: boolean) => void;
235
+ jammed: (device: Device, state: boolean) => void;
236
+ tampering: (device: Device, state: boolean) => void;
237
+ "low temperature": (device: Device, state: boolean) => void;
238
+ "high temperature": (device: Device, state: boolean) => void;
239
+ "pin incorrect": (device: Device, state: boolean) => void;
240
+ "lid stuck": (device: Device, state: boolean) => void;
241
+ "battery fully charged": (device: Device, state: boolean) => void;
242
+ }
243
+ export interface BrandData {
244
+ first?: string[];
245
+ second?: string[];
246
+ numbers?: number;
247
+ letters?: string[];
248
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/http/interfaces.ts"],"names":[],"mappings":""}