node-alarm-dot-com 2.2.0 → 2.3.0-beta.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 (43) hide show
  1. package/dist/_models/AuthOpts.js +1 -0
  2. package/dist/_models/AuthOpts.js.map +1 -0
  3. package/dist/_models/DeviceStates.d.ts +1 -1
  4. package/dist/_models/DeviceStates.js +1 -0
  5. package/dist/_models/DeviceStates.js.map +1 -0
  6. package/dist/_models/IdentityResponse.js +1 -0
  7. package/dist/_models/IdentityResponse.js.map +1 -0
  8. package/dist/_models/PartitionActionOptions.js +1 -0
  9. package/dist/_models/PartitionActionOptions.js.map +1 -0
  10. package/dist/_models/RequestOptions.d.ts +2 -3
  11. package/dist/_models/RequestOptions.js +1 -0
  12. package/dist/_models/RequestOptions.js.map +1 -0
  13. package/dist/_models/SensorType.js +1 -1
  14. package/dist/_models/SensorType.js.map +1 -0
  15. package/dist/_models/States.js +1 -1
  16. package/dist/_models/States.js.map +1 -0
  17. package/dist/_models/SystemState.js +1 -0
  18. package/dist/_models/SystemState.js.map +1 -0
  19. package/dist/_utils.d.ts +34 -0
  20. package/dist/_utils.js +147 -0
  21. package/dist/_utils.js.map +1 -0
  22. package/dist/core.d.ts +29 -0
  23. package/dist/core.js +163 -0
  24. package/dist/core.js.map +1 -0
  25. package/dist/garages.d.ts +17 -0
  26. package/dist/garages.js +38 -0
  27. package/dist/garages.js.map +1 -0
  28. package/dist/index.d.ts +8 -171
  29. package/dist/index.js +13 -629
  30. package/dist/index.js.map +1 -0
  31. package/dist/lights.d.ts +23 -0
  32. package/dist/lights.js +76 -0
  33. package/dist/lights.js.map +1 -0
  34. package/dist/locks.d.ts +19 -0
  35. package/dist/locks.js +44 -0
  36. package/dist/locks.js.map +1 -0
  37. package/dist/partitions.d.ts +40 -0
  38. package/dist/partitions.js +83 -0
  39. package/dist/partitions.js.map +1 -0
  40. package/dist/thermostats.d.ts +29 -0
  41. package/dist/thermostats.js +61 -0
  42. package/dist/thermostats.js.map +1 -0
  43. package/package.json +11 -6
package/dist/index.d.ts CHANGED
@@ -1,180 +1,17 @@
1
1
  /**
2
2
  * @module node-alarm-dot-com
3
3
  */
4
- import { AuthOpts } from './_models/AuthOpts';
5
- import { ApiDeviceState } from './_models/DeviceStates';
6
- import { IdentityResponse } from './_models/IdentityResponse';
7
- import { PartitionActionOptions } from './_models/PartitionActionOptions';
8
- import { FlattenedSystemState } from './_models/SystemState';
9
- import { THERMOSTAT_STATES } from './_models/States';
10
4
  export * from './_models/AuthOpts';
11
5
  export * from './_models/DeviceStates';
12
6
  export * from './_models/IdentityResponse';
13
7
  export * from './_models/PartitionActionOptions';
14
8
  export * from './_models/RequestOptions';
15
- export * from './_models/SystemState';
16
9
  export * from './_models/SensorType';
17
- /**
18
- * Authenticate with alarm.com.
19
- * Returns an authentication object that can be passed to other methods.
20
- *
21
- * @param {string} username Alarm.com username.
22
- * @param {string} password Alarm.com password.
23
- * @param {string} existingMfaToken MFA token from browser used to bypass MFA.
24
- * @returns {Promise}
25
- */
26
- export declare function login(username: string, password: string, existingMfaToken?: string): Promise<AuthOpts>;
27
- /**
28
- * This function returns the alarm.com system identity for the currently logged in system.
29
- * The information returned is useful for finding current systems and global config.
30
- */
31
- export declare function getIdentitiesState(loginCookies: string, ajaxKey: string): Promise<IdentityResponse>;
32
- /**
33
- * Retrieve information about the current state of a security system including
34
- * attributes, partitions, accessory components and relationships.
35
- *
36
- * @param {string} systemID ID of the system to query. The Authentication
37
- * object returned from the `login` method contains a `systems` property which
38
- * is an array of system IDs.
39
- * @param {Object} authOpts Authentication object returned from the login.
40
- * @returns {Promise}
41
- */
42
- export declare function getCurrentState(systemID: string, authOpts: AuthOpts): Promise<FlattenedSystemState>;
43
- /**
44
- * Get information about groups of components e.g., sensors, lights, locks, garages, etc.
45
- *
46
- * @param {string} url Base request url.
47
- * @param {string} componentIDs Array of ID to retrieve.
48
- * @param {Object} authOpts Authentication object returned from the login.
49
- * @returns {Promise}
50
- */
51
- export declare function getComponents(url: string, componentIDs: string[], authOpts: AuthOpts): Promise<ApiDeviceState>;
52
- /**
53
- * Convenience Method:
54
- * Arm a security system panel in "stay" mode. NOTE: This call generally takes
55
- * 20-30 seconds to complete.
56
- *
57
- * @param {string} partitionID Partition ID to arm.
58
- * @param {Object} authOpts Authentication object returned from the login.
59
- * @param {Object} opts Optional arguments for arming the system.
60
- * @param {boolean} opts.noEntryDelay Disable the 30-second entry delay.
61
- * @param {boolean} opts.silentArming Disable audible beeps and double the exit
62
- * delay.
63
- * @returns {Promise}
64
- */
65
- export declare function armStay(partitionID: string, authOpts: AuthOpts, opts: PartitionActionOptions): Promise<any>;
66
- /**
67
- * Convenience Method:
68
- * Arm a security system panel in "away" mode. NOTE: This call generally takes
69
- * 20-30 seconds to complete.
70
- *
71
- * @param {string} partitionID Partition ID to arm.
72
- * @param {Object} authOpts Authentication object returned from the login.
73
- * @param {Object} opts Optional arguments for arming the system.
74
- * @param {boolean} opts.noEntryDelay Disable the 30-second entry delay.
75
- * @param {boolean} opts.silentArming Disable audible beeps and double the exit
76
- * delay.
77
- * @returns {Promise}
78
- */
79
- export declare function armAway(partitionID: string, authOpts: AuthOpts, opts: PartitionActionOptions): Promise<any>;
80
- /**
81
- * Convenience Method:
82
- * Disarm a security system panel. NOTE: This call generally takes 20-30 seconds
83
- * to complete.
84
- *
85
- * @param {string} partitionID Partition ID to disarm.
86
- * @param {Object} authOpts Authentication object returned from the login.
87
- * @returns {Promise}
88
- */
89
- export declare function disarm(partitionID: string, authOpts: AuthOpts): Promise<any>;
90
- /**
91
- * Convenience Method:
92
- * Sets a light to ON and adjusts brightness level (1-100) of dimmable lights.
93
- *
94
- * @param {string} lightID Light ID string.
95
- * @param {number} brightness An integer, 1-100, indicating brightness.
96
- * @param {Object} authOpts Authentication object returned from the login.
97
- * @param {boolean} isDimmer Indicates whether or not light is dimmable.
98
- * @returns {Promise}
99
- */
100
- export declare function setLightOn(lightID: string, authOpts: AuthOpts, brightness: number, isDimmer: boolean): Promise<any>;
101
- /**
102
- * Convenience Method:
103
- * Sets a light to OFF. The brightness level is ignored.
104
- *
105
- * @param {string} lightID Light ID string.
106
- * @param {number} brightness An integer, 1-100, indicating brightness. Ignored.
107
- * @param {Object} authOpts Authentication object returned from the login.
108
- * @param {boolean} isDimmer Indicates whether or not light is dimmable.
109
- * @returns {Promise}
110
- */
111
- export declare function setLightOff(lightID: string, authOpts: AuthOpts, brightness: number, isDimmer: boolean): Promise<any>;
112
- /**
113
- * Convenience Method:
114
- * Sets a lock to "locked" (SECURED).
115
- *
116
- * @param {string} lockID Lock ID string.
117
- * @param {Object} authOpts Authentication object returned from the login.
118
- * @returns {Promise}
119
- */
120
- export declare function setLockSecure(lockID: string, authOpts: AuthOpts): Promise<any>;
121
- /**
122
- * Convenience Method:
123
- * Sets a lock to "unlocked" (UNSECURED).
124
- *
125
- * @param {string} lockID Lock ID string.
126
- * @param {Object} authOpts Authentication object returned from the login.
127
- * @returns {Promise}
128
- */
129
- export declare function setLockUnsecure(lockID: string, authOpts: AuthOpts): Promise<any>;
130
- /**
131
- * Sets a garage to CLOSED.
132
- *
133
- *
134
- * @param {string} garageID Lock ID string.
135
- * @param {Object} authOpts Authentication object returned from the `login`
136
- * method.
137
- * @returns {Promise}
138
- */
139
- export declare function closeGarage(garageID: string, authOpts: AuthOpts): Promise<any>;
140
- /**
141
- * Sets a garage to OPEN.
142
- *
143
- * @param {string} garageID Lock ID string.
144
- * @param {Object} authOpts Authentication object returned from the `login`
145
- * method.
146
- * @returns {Promise}
147
- */
148
- export declare function openGarage(garageID: string, authOpts: AuthOpts): Promise<any>;
149
- /**
150
- * Update thermostat state
151
- *
152
- * @param {string} thermostatID Thermostat ID string.
153
- * @param {Object} newState New desired state
154
- * @param {Object} authOpts Authentication object returned from the `login`
155
- * method.
156
- * @returns {Promise}
157
- */
158
- export declare function setThermostatState(thermostatID: string, newState: THERMOSTAT_STATES, authOpts: AuthOpts): Promise<any>;
159
- /**
160
- * Sets a thermostat target heat temperature.
161
- *
162
- * @param {string} thermostatID ThermostatID ID string.
163
- * @param {number} newTemp New target temperature
164
- * @param {Object} authOpts Authentication object returned from the `login`
165
- * method.
166
- * @returns {Promise}
167
- */
168
- export declare function setThermostatTargetHeatTemperature(thermostatID: string, newTemp: number, authOpts: AuthOpts): Promise<any>;
169
- /**
170
- * Sets a thermostat target cool temperature.
171
- *
172
- * @param {string} thermostatID ThermostatID ID string.
173
- * @param {number} newTemp New target temperature
174
- * @param {Object} authOpts Authentication object returned from the `login`
175
- * method.
176
- * @returns {Promise}
177
- */
178
- export declare function setThermostatTargetCoolTemperature(thermostatID: string, newTemp: number, authOpts: AuthOpts): Promise<any>;
179
- export declare function authenticatedGet(url: string, opts: any): Promise<any>;
180
- export declare function authenticatedPost(url: string, opts: any): Promise<any>;
10
+ export * from './_models/SystemState';
11
+ export { authenticatedGet, authenticatedPost, getComponents } from './_utils';
12
+ export * from './core';
13
+ export * from './partitions';
14
+ export * from './lights';
15
+ export * from './locks';
16
+ export * from './garages';
17
+ export * from './thermostats';