node-alarm-dot-com 2.5.0 → 2.5.1-beta.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/README.md +2 -2
- package/dist/_models/AuthOpts.d.ts +1 -1
- package/dist/_models/AuthOpts.js +1 -2
- package/dist/_models/DeviceStates.d.ts +6 -6
- package/dist/_models/DeviceStates.js +3 -2
- package/dist/_models/DeviceStates.js.map +1 -1
- package/dist/_models/IdentityResponse.d.ts +1 -1
- package/dist/_models/IdentityResponse.js +1 -2
- package/dist/_models/PartitionActionOptions.js +1 -2
- package/dist/_models/RequestOptions.js +1 -2
- package/dist/_models/SensorType.js +2 -5
- package/dist/_models/SensorType.js.map +1 -1
- package/dist/_models/States.js +16 -19
- package/dist/_models/States.js.map +1 -1
- package/dist/_models/SystemState.d.ts +2 -2
- package/dist/_models/SystemState.js +4 -7
- package/dist/_models/SystemState.js.map +1 -1
- package/dist/_models/WebSockets.d.ts +10 -1
- package/dist/_models/WebSockets.js +9 -12
- package/dist/_models/WebSockets.js.map +1 -1
- package/dist/_utils.d.ts +7 -8
- package/dist/_utils.js +29 -41
- package/dist/_utils.js.map +1 -1
- package/dist/cameras.d.ts +1 -1
- package/dist/cameras.js +3 -6
- package/dist/cameras.js.map +1 -1
- package/dist/core.d.ts +4 -4
- package/dist/core.js +31 -38
- package/dist/core.js.map +1 -1
- package/dist/garages.d.ts +4 -4
- package/dist/garages.js +9 -14
- package/dist/garages.js.map +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.js +17 -37
- package/dist/index.js.map +1 -1
- package/dist/lights.d.ts +4 -4
- package/dist/lights.js +9 -14
- package/dist/lights.js.map +1 -1
- package/dist/locks.d.ts +4 -4
- package/dist/locks.js +7 -12
- package/dist/locks.js.map +1 -1
- package/dist/partitions.d.ts +6 -6
- package/dist/partitions.js +8 -14
- package/dist/partitions.js.map +1 -1
- package/dist/sensors.d.ts +2 -2
- package/dist/sensors.js +3 -6
- package/dist/sensors.js.map +1 -1
- package/dist/thermostats.d.ts +6 -6
- package/dist/thermostats.js +13 -18
- package/dist/thermostats.js.map +1 -1
- package/package.json +10 -17
package/dist/partitions.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AuthOpts } from './_models/AuthOpts';
|
|
2
|
-
import { PartitionState } from './_models/DeviceStates';
|
|
3
|
-
import { PartitionActionOptions } from './_models/PartitionActionOptions';
|
|
1
|
+
import type { AuthOpts } from './_models/AuthOpts.js';
|
|
2
|
+
import type { PartitionState } from './_models/DeviceStates.js';
|
|
3
|
+
import type { PartitionActionOptions } from './_models/PartitionActionOptions.js';
|
|
4
4
|
/**
|
|
5
5
|
* Convenience Method:
|
|
6
6
|
* Arm a security system panel in "stay" mode. NOTE: This call generally takes
|
|
@@ -14,7 +14,7 @@ import { PartitionActionOptions } from './_models/PartitionActionOptions';
|
|
|
14
14
|
* delay.
|
|
15
15
|
* @returns {Promise}
|
|
16
16
|
*/
|
|
17
|
-
export declare function armStay(partitionID: string, authOpts: AuthOpts, opts: PartitionActionOptions): Promise<
|
|
17
|
+
export declare function armStay(partitionID: string, authOpts: AuthOpts, opts: PartitionActionOptions): Promise<unknown>;
|
|
18
18
|
/**
|
|
19
19
|
* Convenience Method:
|
|
20
20
|
* Arm a security system panel in "away" mode. NOTE: This call generally takes
|
|
@@ -28,7 +28,7 @@ export declare function armStay(partitionID: string, authOpts: AuthOpts, opts: P
|
|
|
28
28
|
* delay.
|
|
29
29
|
* @returns {Promise}
|
|
30
30
|
*/
|
|
31
|
-
export declare function armAway(partitionID: string, authOpts: AuthOpts, opts: PartitionActionOptions): Promise<
|
|
31
|
+
export declare function armAway(partitionID: string, authOpts: AuthOpts, opts: PartitionActionOptions): Promise<unknown>;
|
|
32
32
|
/**
|
|
33
33
|
* Convenience Method:
|
|
34
34
|
* Disarm a security system panel. NOTE: This call generally takes 20-30 seconds
|
|
@@ -38,5 +38,5 @@ export declare function armAway(partitionID: string, authOpts: AuthOpts, opts: P
|
|
|
38
38
|
* @param {Object} authOpts Authentication object returned from the login.
|
|
39
39
|
* @returns {Promise}
|
|
40
40
|
*/
|
|
41
|
-
export declare function disarm(partitionID: string, authOpts: AuthOpts): Promise<
|
|
41
|
+
export declare function disarm(partitionID: string, authOpts: AuthOpts): Promise<unknown>;
|
|
42
42
|
export declare function getPartitions(partitionIDs: string[], authOpts: AuthOpts): Promise<PartitionState[]>;
|
package/dist/partitions.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.armStay = armStay;
|
|
4
|
-
exports.armAway = armAway;
|
|
5
|
-
exports.disarm = disarm;
|
|
6
|
-
exports.getPartitions = getPartitions;
|
|
7
|
-
const _utils_1 = require("./_utils");
|
|
1
|
+
import { PARTITIONS_URL, authenticatedGet, authenticatedPost } from './_utils.js';
|
|
8
2
|
/**
|
|
9
3
|
* Perform partition actions, e.g., armAway, armStay, disarm.
|
|
10
4
|
*
|
|
@@ -20,7 +14,7 @@ function partitionAction(partitionID, action, authOpts, opts) {
|
|
|
20
14
|
nightArming: false,
|
|
21
15
|
forceBypass: false
|
|
22
16
|
};
|
|
23
|
-
const url = `${
|
|
17
|
+
const url = `${PARTITIONS_URL}${encodeURIComponent(partitionID)}/${action}`;
|
|
24
18
|
const body = {
|
|
25
19
|
noEntryDelay: action === 'disarm' ? undefined : Boolean(opts.noEntryDelay),
|
|
26
20
|
silentArming: action === 'disarm' ? undefined : Boolean(opts.silentArming),
|
|
@@ -35,7 +29,7 @@ function partitionAction(partitionID, action, authOpts, opts) {
|
|
|
35
29
|
body['forceBypass'] = true;
|
|
36
30
|
}
|
|
37
31
|
const postOpts = Object.assign({}, authOpts, { body });
|
|
38
|
-
return
|
|
32
|
+
return authenticatedPost(url, postOpts);
|
|
39
33
|
}
|
|
40
34
|
/**
|
|
41
35
|
* Convenience Method:
|
|
@@ -50,7 +44,7 @@ function partitionAction(partitionID, action, authOpts, opts) {
|
|
|
50
44
|
* delay.
|
|
51
45
|
* @returns {Promise}
|
|
52
46
|
*/
|
|
53
|
-
function armStay(partitionID, authOpts, opts) {
|
|
47
|
+
export function armStay(partitionID, authOpts, opts) {
|
|
54
48
|
return partitionAction(partitionID, 'armStay', authOpts, opts);
|
|
55
49
|
}
|
|
56
50
|
/**
|
|
@@ -66,7 +60,7 @@ function armStay(partitionID, authOpts, opts) {
|
|
|
66
60
|
* delay.
|
|
67
61
|
* @returns {Promise}
|
|
68
62
|
*/
|
|
69
|
-
function armAway(partitionID, authOpts, opts) {
|
|
63
|
+
export function armAway(partitionID, authOpts, opts) {
|
|
70
64
|
return partitionAction(partitionID, 'armAway', authOpts, opts);
|
|
71
65
|
}
|
|
72
66
|
/**
|
|
@@ -78,14 +72,14 @@ function armAway(partitionID, authOpts, opts) {
|
|
|
78
72
|
* @param {Object} authOpts Authentication object returned from the login.
|
|
79
73
|
* @returns {Promise}
|
|
80
74
|
*/
|
|
81
|
-
function disarm(partitionID, authOpts) {
|
|
75
|
+
export function disarm(partitionID, authOpts) {
|
|
82
76
|
return partitionAction(partitionID, 'disarm', authOpts);
|
|
83
77
|
}
|
|
84
78
|
async function getPartition(partitionID, authOpts) {
|
|
85
|
-
const res = await
|
|
79
|
+
const res = await authenticatedGet(`${PARTITIONS_URL}${encodeURIComponent(partitionID)}`, authOpts);
|
|
86
80
|
return res.data;
|
|
87
81
|
}
|
|
88
|
-
async function getPartitions(partitionIDs, authOpts) {
|
|
82
|
+
export async function getPartitions(partitionIDs, authOpts) {
|
|
89
83
|
const results = await Promise.all(partitionIDs.map((id) => getPartition(id, authOpts)));
|
|
90
84
|
return results.filter((p) => p !== undefined);
|
|
91
85
|
}
|
package/dist/partitions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partitions.js","sourceRoot":"","sources":["../src/partitions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"partitions.js","sourceRoot":"","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E,IAA4B;IAC3F,OAAO,eAAe,CAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;AACjE,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,OAAO,CAAC,WAAmB,EAAE,QAAkB,EAAE,IAA4B;IAC3F,OAAO,eAAe,CAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;AACjE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,MAAM,CAAC,WAAmB,EAAE,QAAkB;IAC5D,OAAO,eAAe,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,WAAmB,EAAE,QAAkB;IACjE,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAiB,GAAG,cAAc,GAAG,kBAAkB,CAAC,WAAW,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IACpH,OAAO,GAAG,CAAC,IAAsB,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,YAAsB,EAAE,QAAkB;IAC5E,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACxF,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAuB,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;AACrE,CAAC"}
|
package/dist/sensors.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AuthOpts } from './_models/AuthOpts';
|
|
2
|
-
import { SensorState } from './_models/DeviceStates';
|
|
1
|
+
import type { AuthOpts } from './_models/AuthOpts.js';
|
|
2
|
+
import type { SensorState } from './_models/DeviceStates.js';
|
|
3
3
|
export declare function getSensors(sensorIDs: string[], authOpts: AuthOpts): Promise<SensorState[]>;
|
package/dist/sensors.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSensors = getSensors;
|
|
4
|
-
const _utils_1 = require("./_utils");
|
|
1
|
+
import { SENSORS_URL, authenticatedGet } from './_utils.js';
|
|
5
2
|
async function getSensor(sensorID, authOpts) {
|
|
6
|
-
const res = await
|
|
3
|
+
const res = await authenticatedGet(`${SENSORS_URL}/${sensorID}`, authOpts);
|
|
7
4
|
return res.data;
|
|
8
5
|
}
|
|
9
|
-
async function getSensors(sensorIDs, authOpts) {
|
|
6
|
+
export async function getSensors(sensorIDs, authOpts) {
|
|
10
7
|
const results = await Promise.all(sensorIDs.map((id) => getSensor(id, authOpts)));
|
|
11
8
|
return results.filter((s) => s !== undefined);
|
|
12
9
|
}
|
package/dist/sensors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sensors.js","sourceRoot":"","sources":["../src/sensors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sensors.js","sourceRoot":"","sources":["../src/sensors.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE5D,KAAK,UAAU,SAAS,CAAC,QAAgB,EAAE,QAAkB;IAC3D,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAiB,GAAG,WAAW,IAAI,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC3F,OAAO,GAAG,CAAC,IAAmB,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,SAAmB,EAAE,QAAkB;IACtE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAClF,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAoB,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;AAClE,CAAC"}
|
package/dist/thermostats.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AuthOpts } from './_models/AuthOpts';
|
|
2
|
-
import { ThermostatState } from './_models/DeviceStates';
|
|
3
|
-
import { THERMOSTAT_STATES } from './_models/States';
|
|
1
|
+
import type { AuthOpts } from './_models/AuthOpts.js';
|
|
2
|
+
import type { ThermostatState } from './_models/DeviceStates.js';
|
|
3
|
+
import { THERMOSTAT_STATES } from './_models/States.js';
|
|
4
4
|
/**
|
|
5
5
|
* Update thermostat state
|
|
6
6
|
*
|
|
@@ -9,7 +9,7 @@ import { THERMOSTAT_STATES } from './_models/States';
|
|
|
9
9
|
* @param {Object} authOpts Authentication object returned from the `login` method.
|
|
10
10
|
* @returns {Promise}
|
|
11
11
|
*/
|
|
12
|
-
export declare function setThermostatState(thermostatID: string, newState: THERMOSTAT_STATES, authOpts: AuthOpts): Promise<
|
|
12
|
+
export declare function setThermostatState(thermostatID: string, newState: THERMOSTAT_STATES, authOpts: AuthOpts): Promise<unknown>;
|
|
13
13
|
/**
|
|
14
14
|
* Sets a thermostat target heat temperature.
|
|
15
15
|
*
|
|
@@ -18,7 +18,7 @@ export declare function setThermostatState(thermostatID: string, newState: THERM
|
|
|
18
18
|
* @param {Object} authOpts Authentication object returned from the `login` method.
|
|
19
19
|
* @returns {Promise}
|
|
20
20
|
*/
|
|
21
|
-
export declare function setThermostatTargetHeatTemperature(thermostatID: string, newTemp: number, authOpts: AuthOpts): Promise<
|
|
21
|
+
export declare function setThermostatTargetHeatTemperature(thermostatID: string, newTemp: number, authOpts: AuthOpts): Promise<unknown>;
|
|
22
22
|
/**
|
|
23
23
|
* Sets a thermostat target cool temperature.
|
|
24
24
|
*
|
|
@@ -27,5 +27,5 @@ export declare function setThermostatTargetHeatTemperature(thermostatID: string,
|
|
|
27
27
|
* @param {Object} authOpts Authentication object returned from the `login` method.
|
|
28
28
|
* @returns {Promise}
|
|
29
29
|
*/
|
|
30
|
-
export declare function setThermostatTargetCoolTemperature(thermostatID: string, newTemp: number, authOpts: AuthOpts): Promise<
|
|
30
|
+
export declare function setThermostatTargetCoolTemperature(thermostatID: string, newTemp: number, authOpts: AuthOpts): Promise<unknown>;
|
|
31
31
|
export declare function getThermostats(thermostatIDs: string[], authOpts: AuthOpts): Promise<ThermostatState[]>;
|
package/dist/thermostats.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.setThermostatState = setThermostatState;
|
|
4
|
-
exports.setThermostatTargetHeatTemperature = setThermostatTargetHeatTemperature;
|
|
5
|
-
exports.setThermostatTargetCoolTemperature = setThermostatTargetCoolTemperature;
|
|
6
|
-
exports.getThermostats = getThermostats;
|
|
7
|
-
const _utils_1 = require("./_utils");
|
|
1
|
+
import { THERMOSTAT_STATES } from './_models/States.js';
|
|
2
|
+
import { THERMOSTAT_URL, authenticatedGet, authenticatedPost } from './_utils.js';
|
|
8
3
|
/**
|
|
9
4
|
* Update thermostat state
|
|
10
5
|
*
|
|
@@ -13,15 +8,15 @@ const _utils_1 = require("./_utils");
|
|
|
13
8
|
* @param {Object} authOpts Authentication object returned from the `login` method.
|
|
14
9
|
* @returns {Promise}
|
|
15
10
|
*/
|
|
16
|
-
function setThermostatState(thermostatID, newState, authOpts) {
|
|
17
|
-
const url = `${
|
|
11
|
+
export function setThermostatState(thermostatID, newState, authOpts) {
|
|
12
|
+
const url = `${THERMOSTAT_URL}${encodeURIComponent(thermostatID)}/setState`;
|
|
18
13
|
const postOpts = Object.assign({}, authOpts, {
|
|
19
14
|
body: {
|
|
20
15
|
desiredState: newState,
|
|
21
16
|
statePollOnly: false
|
|
22
17
|
}
|
|
23
18
|
});
|
|
24
|
-
return
|
|
19
|
+
return authenticatedPost(url, postOpts);
|
|
25
20
|
}
|
|
26
21
|
/**
|
|
27
22
|
* Sets a thermostat target heat temperature.
|
|
@@ -31,15 +26,15 @@ function setThermostatState(thermostatID, newState, authOpts) {
|
|
|
31
26
|
* @param {Object} authOpts Authentication object returned from the `login` method.
|
|
32
27
|
* @returns {Promise}
|
|
33
28
|
*/
|
|
34
|
-
function setThermostatTargetHeatTemperature(thermostatID, newTemp, authOpts) {
|
|
35
|
-
const url = `${
|
|
29
|
+
export function setThermostatTargetHeatTemperature(thermostatID, newTemp, authOpts) {
|
|
30
|
+
const url = `${THERMOSTAT_URL}${encodeURIComponent(thermostatID)}/setState`;
|
|
36
31
|
const postOpts = Object.assign({}, authOpts, {
|
|
37
32
|
body: {
|
|
38
33
|
desiredHeatSetpoint: newTemp,
|
|
39
34
|
statePollOnly: false
|
|
40
35
|
}
|
|
41
36
|
});
|
|
42
|
-
return
|
|
37
|
+
return authenticatedPost(url, postOpts);
|
|
43
38
|
}
|
|
44
39
|
/**
|
|
45
40
|
* Sets a thermostat target cool temperature.
|
|
@@ -49,21 +44,21 @@ function setThermostatTargetHeatTemperature(thermostatID, newTemp, authOpts) {
|
|
|
49
44
|
* @param {Object} authOpts Authentication object returned from the `login` method.
|
|
50
45
|
* @returns {Promise}
|
|
51
46
|
*/
|
|
52
|
-
function setThermostatTargetCoolTemperature(thermostatID, newTemp, authOpts) {
|
|
53
|
-
const url = `${
|
|
47
|
+
export function setThermostatTargetCoolTemperature(thermostatID, newTemp, authOpts) {
|
|
48
|
+
const url = `${THERMOSTAT_URL}${encodeURIComponent(thermostatID)}/setState`;
|
|
54
49
|
const postOpts = Object.assign({}, authOpts, {
|
|
55
50
|
body: {
|
|
56
51
|
desiredCoolSetpoint: newTemp,
|
|
57
52
|
statePollOnly: false
|
|
58
53
|
}
|
|
59
54
|
});
|
|
60
|
-
return
|
|
55
|
+
return authenticatedPost(url, postOpts);
|
|
61
56
|
}
|
|
62
57
|
async function getThermostat(thermostatID, authOpts) {
|
|
63
|
-
const res = await
|
|
58
|
+
const res = await authenticatedGet(`${THERMOSTAT_URL}${encodeURIComponent(thermostatID)}`, authOpts);
|
|
64
59
|
return res.data;
|
|
65
60
|
}
|
|
66
|
-
async function getThermostats(thermostatIDs, authOpts) {
|
|
61
|
+
export async function getThermostats(thermostatIDs, authOpts) {
|
|
67
62
|
const results = await Promise.all(thermostatIDs.map((id) => getThermostat(id, authOpts)));
|
|
68
63
|
return results.filter((t) => t !== undefined);
|
|
69
64
|
}
|
package/dist/thermostats.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thermostats.js","sourceRoot":"","sources":["../src/thermostats.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"thermostats.js","sourceRoot":"","sources":["../src/thermostats.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAElF;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,YAAoB,EAAE,QAA2B,EAAE,QAAkB;IACtG,MAAM,GAAG,GAAG,GAAG,cAAc,GAAG,kBAAkB,CAAC,YAAY,CAAC,WAAW,CAAC;IAC5E,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE;QAC3C,IAAI,EAAE;YACJ,YAAY,EAAE,QAAQ;YACtB,aAAa,EAAE,KAAK;SACrB;KACF,CAAC,CAAC;IACH,OAAO,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kCAAkC,CAAC,YAAoB,EAAE,OAAe,EAAE,QAAkB;IAC1G,MAAM,GAAG,GAAG,GAAG,cAAc,GAAG,kBAAkB,CAAC,YAAY,CAAC,WAAW,CAAC;IAC5E,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,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ot-com",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1-beta.1",
|
|
4
4
|
"description": "An interface module written in node.js to arm and disarm Alarm.com security systems.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Chase Christiansen",
|
|
7
7
|
"url": "https://github.com/chase9"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
|
+
"type": "module",
|
|
10
11
|
"keywords": [
|
|
11
12
|
"node-only",
|
|
12
13
|
"security",
|
|
@@ -32,38 +33,30 @@
|
|
|
32
33
|
"files": [
|
|
33
34
|
"dist"
|
|
34
35
|
],
|
|
35
|
-
"bin": {
|
|
36
|
-
"nodeADC": "dist/index.js"
|
|
37
|
-
},
|
|
38
36
|
"scripts": {
|
|
39
37
|
"clean": "rimraf ./dist",
|
|
40
|
-
"lint": "eslint src
|
|
38
|
+
"lint": "eslint src/**/*.ts test/**/*.ts",
|
|
41
39
|
"build": "rimraf ./dist && tsc",
|
|
42
40
|
"prepublishOnly": "npm run lint && npm run build",
|
|
43
41
|
"postpublish": "npm run clean",
|
|
44
42
|
"start": "ts-node src/index.ts",
|
|
45
|
-
"test": "
|
|
43
|
+
"test": "vitest run",
|
|
44
|
+
"typecheck:test": "tsc -p tsconfig.test.json"
|
|
46
45
|
},
|
|
47
46
|
"engines": {
|
|
48
47
|
"node": ">=22.0.0"
|
|
49
48
|
},
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"node-fetch": "^2.7.0",
|
|
52
|
-
"semver": "^7.8.4"
|
|
53
|
-
},
|
|
54
49
|
"devDependencies": {
|
|
55
|
-
"@eslint/eslintrc": "^3.3.5",
|
|
56
50
|
"@eslint/js": "^10.0.1",
|
|
57
|
-
"@types/node": "^
|
|
58
|
-
"
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "^8.61.1",
|
|
60
|
-
"@typescript-eslint/parser": "^8.61.1",
|
|
61
|
-
"eslint": "^10.5.0",
|
|
51
|
+
"@types/node": "^26.2.0",
|
|
52
|
+
"eslint": "^10.8.1",
|
|
62
53
|
"eslint-config-prettier": "^10.1.8",
|
|
63
54
|
"eslint-plugin-prettier": "^5.5.6",
|
|
55
|
+
"nock": "^14.0.17",
|
|
64
56
|
"rimraf": "^6.1.3",
|
|
65
57
|
"ts-node": "^10.9.2",
|
|
66
58
|
"typescript": "^6.0.3",
|
|
67
|
-
"
|
|
59
|
+
"typescript-eslint": "^8.67.0",
|
|
60
|
+
"vitest": "^4.1.10"
|
|
68
61
|
}
|
|
69
62
|
}
|