@seamapi/http 0.24.0 → 0.25.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 +15 -0
- package/dist/connect.cjs +771 -732
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +153 -127
- package/lib/seam/connect/index.d.ts +1 -0
- package/lib/seam/connect/index.js +1 -0
- package/lib/seam/connect/index.js.map +1 -1
- package/lib/seam/connect/routes/access-codes-unmanaged.d.ts +6 -5
- package/lib/seam/connect/routes/access-codes-unmanaged.js +26 -22
- package/lib/seam/connect/routes/access-codes-unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/access-codes.d.ts +9 -8
- package/lib/seam/connect/routes/access-codes.js +41 -38
- package/lib/seam/connect/routes/access-codes.js.map +1 -1
- package/lib/seam/connect/routes/acs-access-groups.d.ts +6 -5
- package/lib/seam/connect/routes/acs-access-groups.js +26 -23
- package/lib/seam/connect/routes/acs-access-groups.js.map +1 -1
- package/lib/seam/connect/routes/acs-credential-pools.d.ts +2 -1
- package/lib/seam/connect/routes/acs-credential-pools.js +6 -5
- package/lib/seam/connect/routes/acs-credential-pools.js.map +1 -1
- package/lib/seam/connect/routes/acs-credential-provisioning-automations.d.ts +2 -1
- package/lib/seam/connect/routes/acs-credential-provisioning-automations.js +6 -5
- package/lib/seam/connect/routes/acs-credential-provisioning-automations.js.map +1 -1
- package/lib/seam/connect/routes/acs-credentials.d.ts +8 -7
- package/lib/seam/connect/routes/acs-credentials.js +36 -34
- package/lib/seam/connect/routes/acs-credentials.js.map +1 -1
- package/lib/seam/connect/routes/acs-entrances.d.ts +5 -4
- package/lib/seam/connect/routes/acs-entrances.js +21 -19
- package/lib/seam/connect/routes/acs-entrances.js.map +1 -1
- package/lib/seam/connect/routes/acs-systems.d.ts +3 -2
- package/lib/seam/connect/routes/acs-systems.js +11 -10
- package/lib/seam/connect/routes/acs-systems.js.map +1 -1
- package/lib/seam/connect/routes/acs-users.d.ts +12 -11
- package/lib/seam/connect/routes/acs-users.js +56 -48
- package/lib/seam/connect/routes/acs-users.js.map +1 -1
- package/lib/seam/connect/routes/action-attempts.d.ts +3 -2
- package/lib/seam/connect/routes/action-attempts.js +12 -18
- package/lib/seam/connect/routes/action-attempts.js.map +1 -1
- package/lib/seam/connect/routes/client-sessions.d.ts +8 -7
- package/lib/seam/connect/routes/client-sessions.js +36 -33
- package/lib/seam/connect/routes/client-sessions.js.map +1 -1
- package/lib/seam/connect/routes/connect-webviews.d.ts +6 -5
- package/lib/seam/connect/routes/connect-webviews.js +25 -22
- package/lib/seam/connect/routes/connect-webviews.js.map +1 -1
- package/lib/seam/connect/routes/connected-accounts.d.ts +5 -4
- package/lib/seam/connect/routes/connected-accounts.js +21 -19
- package/lib/seam/connect/routes/connected-accounts.js.map +1 -1
- package/lib/seam/connect/routes/devices-simulate.d.ts +2 -1
- package/lib/seam/connect/routes/devices-simulate.js +6 -4
- package/lib/seam/connect/routes/devices-simulate.js.map +1 -1
- package/lib/seam/connect/routes/devices-unmanaged.d.ts +4 -3
- package/lib/seam/connect/routes/devices-unmanaged.js +16 -14
- package/lib/seam/connect/routes/devices-unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/devices.d.ts +6 -5
- package/lib/seam/connect/routes/devices.js +26 -23
- package/lib/seam/connect/routes/devices.js.map +1 -1
- package/lib/seam/connect/routes/events.d.ts +3 -2
- package/lib/seam/connect/routes/events.js +11 -10
- package/lib/seam/connect/routes/events.js.map +1 -1
- package/lib/seam/connect/routes/locks.d.ts +5 -4
- package/lib/seam/connect/routes/locks.js +23 -36
- package/lib/seam/connect/routes/locks.js.map +1 -1
- package/lib/seam/connect/routes/networks.d.ts +3 -2
- package/lib/seam/connect/routes/networks.js +11 -10
- package/lib/seam/connect/routes/networks.js.map +1 -1
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.d.ts +6 -5
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js +26 -23
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js.map +1 -1
- package/lib/seam/connect/routes/phones-simulate.d.ts +2 -1
- package/lib/seam/connect/routes/phones-simulate.js +6 -5
- package/lib/seam/connect/routes/phones-simulate.js.map +1 -1
- package/lib/seam/connect/routes/phones.d.ts +3 -2
- package/lib/seam/connect/routes/phones.js +11 -9
- package/lib/seam/connect/routes/phones.js.map +1 -1
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.d.ts +6 -5
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js +26 -23
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js.map +1 -1
- package/lib/seam/connect/routes/thermostats.d.ts +9 -8
- package/lib/seam/connect/routes/thermostats.js +46 -76
- package/lib/seam/connect/routes/thermostats.js.map +1 -1
- package/lib/seam/connect/routes/user-identities-enrollment-automations.d.ts +5 -4
- package/lib/seam/connect/routes/user-identities-enrollment-automations.js +21 -19
- package/lib/seam/connect/routes/user-identities-enrollment-automations.js.map +1 -1
- package/lib/seam/connect/routes/user-identities.d.ts +13 -12
- package/lib/seam/connect/routes/user-identities.js +61 -54
- package/lib/seam/connect/routes/user-identities.js.map +1 -1
- package/lib/seam/connect/routes/webhooks.d.ts +6 -5
- package/lib/seam/connect/routes/webhooks.js +26 -23
- package/lib/seam/connect/routes/webhooks.js.map +1 -1
- package/lib/seam/connect/routes/workspaces.d.ts +5 -4
- package/lib/seam/connect/routes/workspaces.js +21 -19
- package/lib/seam/connect/routes/workspaces.js.map +1 -1
- package/lib/seam/connect/seam-http-request.d.ts +29 -0
- package/lib/seam/connect/seam-http-request.js +94 -0
- package/lib/seam/connect/seam-http-request.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
- package/src/lib/seam/connect/index.ts +1 -0
- package/src/lib/seam/connect/routes/access-codes-unmanaged.ts +37 -34
- package/src/lib/seam/connect/routes/access-codes.ts +56 -60
- package/src/lib/seam/connect/routes/acs-access-groups.ts +33 -32
- package/src/lib/seam/connect/routes/acs-credential-pools.ts +7 -7
- package/src/lib/seam/connect/routes/acs-credential-provisioning-automations.ts +11 -13
- package/src/lib/seam/connect/routes/acs-credentials.ts +42 -46
- package/src/lib/seam/connect/routes/acs-entrances.ts +31 -28
- package/src/lib/seam/connect/routes/acs-systems.ts +13 -14
- package/src/lib/seam/connect/routes/acs-users.ts +66 -61
- package/src/lib/seam/connect/routes/action-attempts.ts +14 -26
- package/src/lib/seam/connect/routes/client-sessions.ts +45 -49
- package/src/lib/seam/connect/routes/connect-webviews.ts +28 -28
- package/src/lib/seam/connect/routes/connected-accounts.ts +26 -29
- package/src/lib/seam/connect/routes/devices-simulate.ts +6 -4
- package/src/lib/seam/connect/routes/devices-unmanaged.ts +18 -18
- package/src/lib/seam/connect/routes/devices.ts +30 -31
- package/src/lib/seam/connect/routes/events.ts +11 -12
- package/src/lib/seam/connect/routes/locks.ts +25 -50
- package/src/lib/seam/connect/routes/networks.ts +14 -13
- package/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +48 -38
- package/src/lib/seam/connect/routes/phones-simulate.ts +9 -10
- package/src/lib/seam/connect/routes/phones.ts +11 -10
- package/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts +47 -55
- package/src/lib/seam/connect/routes/thermostats.ts +53 -110
- package/src/lib/seam/connect/routes/user-identities-enrollment-automations.ts +39 -48
- package/src/lib/seam/connect/routes/user-identities.ts +81 -78
- package/src/lib/seam/connect/routes/webhooks.ts +30 -28
- package/src/lib/seam/connect/routes/workspaces.ts +26 -25
- package/src/lib/seam/connect/seam-http-request.ts +168 -0
- package/src/lib/version.ts +1 -1
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
limitToSeamHttpRequestOptions,
|
|
36
36
|
parseOptions,
|
|
37
37
|
} from 'lib/seam/connect/parse-options.js'
|
|
38
|
+
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
38
39
|
|
|
39
40
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
40
41
|
|
|
@@ -157,55 +158,54 @@ export class SeamHttpConnectWebviews {
|
|
|
157
158
|
await clientSessions.get()
|
|
158
159
|
}
|
|
159
160
|
|
|
160
|
-
|
|
161
|
+
create(
|
|
161
162
|
body?: ConnectWebviewsCreateBody,
|
|
162
|
-
):
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
): SeamHttpRequest<ConnectWebviewsCreateResponse, 'connect_webview'> {
|
|
164
|
+
return new SeamHttpRequest(this, {
|
|
165
|
+
path: '/connect_webviews/create',
|
|
165
166
|
method: 'post',
|
|
166
|
-
|
|
167
|
+
body,
|
|
168
|
+
responseKey: 'connect_webview',
|
|
167
169
|
})
|
|
168
|
-
|
|
169
|
-
return data.connect_webview
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
delete(body?: ConnectWebviewsDeleteBody): SeamHttpRequest<void, undefined> {
|
|
173
|
+
return new SeamHttpRequest(this, {
|
|
174
|
+
path: '/connect_webviews/delete',
|
|
175
175
|
method: 'post',
|
|
176
|
-
|
|
176
|
+
body,
|
|
177
|
+
responseKey: undefined,
|
|
177
178
|
})
|
|
178
179
|
}
|
|
179
180
|
|
|
180
|
-
|
|
181
|
+
get(
|
|
181
182
|
body?: ConnectWebviewsGetParams,
|
|
182
|
-
):
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
): SeamHttpRequest<ConnectWebviewsGetResponse, 'connect_webview'> {
|
|
184
|
+
return new SeamHttpRequest(this, {
|
|
185
|
+
path: '/connect_webviews/get',
|
|
185
186
|
method: 'post',
|
|
186
|
-
|
|
187
|
+
body,
|
|
188
|
+
responseKey: 'connect_webview',
|
|
187
189
|
})
|
|
188
|
-
|
|
189
|
-
return data.connect_webview
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
|
|
192
|
+
list(
|
|
193
193
|
body?: ConnectWebviewsListParams,
|
|
194
|
-
):
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
): SeamHttpRequest<ConnectWebviewsListResponse, 'connect_webviews'> {
|
|
195
|
+
return new SeamHttpRequest(this, {
|
|
196
|
+
path: '/connect_webviews/list',
|
|
197
197
|
method: 'post',
|
|
198
|
-
|
|
198
|
+
body,
|
|
199
|
+
responseKey: 'connect_webviews',
|
|
199
200
|
})
|
|
200
|
-
|
|
201
|
-
return data.connect_webviews
|
|
202
201
|
}
|
|
203
202
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
view(params?: ConnectWebviewsViewParams): SeamHttpRequest<void, undefined> {
|
|
204
|
+
return new SeamHttpRequest(this, {
|
|
205
|
+
path: '/connect_webviews/view',
|
|
207
206
|
method: 'get',
|
|
208
207
|
params,
|
|
208
|
+
responseKey: undefined,
|
|
209
209
|
})
|
|
210
210
|
}
|
|
211
211
|
}
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
limitToSeamHttpRequestOptions,
|
|
32
32
|
parseOptions,
|
|
33
33
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
|
+
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
35
|
|
|
35
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
36
37
|
|
|
@@ -153,50 +154,46 @@ export class SeamHttpConnectedAccounts {
|
|
|
153
154
|
await clientSessions.get()
|
|
154
155
|
}
|
|
155
156
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
delete(body?: ConnectedAccountsDeleteBody): SeamHttpRequest<void, undefined> {
|
|
158
|
+
return new SeamHttpRequest(this, {
|
|
159
|
+
path: '/connected_accounts/delete',
|
|
159
160
|
method: 'post',
|
|
160
|
-
|
|
161
|
+
body,
|
|
162
|
+
responseKey: undefined,
|
|
161
163
|
})
|
|
162
164
|
}
|
|
163
165
|
|
|
164
|
-
|
|
166
|
+
get(
|
|
165
167
|
body?: ConnectedAccountsGetParams,
|
|
166
|
-
):
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
): SeamHttpRequest<ConnectedAccountsGetResponse, 'connected_account'> {
|
|
169
|
+
return new SeamHttpRequest(this, {
|
|
170
|
+
path: '/connected_accounts/get',
|
|
169
171
|
method: 'post',
|
|
170
|
-
|
|
172
|
+
body,
|
|
173
|
+
responseKey: 'connected_account',
|
|
171
174
|
})
|
|
172
|
-
|
|
173
|
-
return data.connected_account
|
|
174
175
|
}
|
|
175
176
|
|
|
176
|
-
|
|
177
|
+
list(
|
|
177
178
|
body?: ConnectedAccountsListParams,
|
|
178
|
-
):
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
): SeamHttpRequest<ConnectedAccountsListResponse, 'connected_accounts'> {
|
|
180
|
+
return new SeamHttpRequest(this, {
|
|
181
|
+
path: '/connected_accounts/list',
|
|
181
182
|
method: 'post',
|
|
182
|
-
|
|
183
|
+
body,
|
|
184
|
+
responseKey: 'connected_accounts',
|
|
183
185
|
})
|
|
184
|
-
|
|
185
|
-
return data.connected_accounts
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
update(
|
|
189
189
|
body?: ConnectedAccountsUpdateBody,
|
|
190
|
-
):
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
return data.connected_account
|
|
190
|
+
): SeamHttpRequest<ConnectedAccountsUpdateResponse, 'connected_account'> {
|
|
191
|
+
return new SeamHttpRequest(this, {
|
|
192
|
+
path: '/connected_accounts/update',
|
|
193
|
+
method: 'post',
|
|
194
|
+
body,
|
|
195
|
+
responseKey: 'connected_account',
|
|
196
|
+
})
|
|
200
197
|
}
|
|
201
198
|
}
|
|
202
199
|
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
limitToSeamHttpRequestOptions,
|
|
32
32
|
parseOptions,
|
|
33
33
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
|
+
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
35
|
|
|
35
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
36
37
|
|
|
@@ -153,11 +154,12 @@ export class SeamHttpDevicesSimulate {
|
|
|
153
154
|
await clientSessions.get()
|
|
154
155
|
}
|
|
155
156
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
remove(body?: DevicesSimulateRemoveBody): SeamHttpRequest<void, undefined> {
|
|
158
|
+
return new SeamHttpRequest(this, {
|
|
159
|
+
path: '/devices/simulate/remove',
|
|
159
160
|
method: 'post',
|
|
160
|
-
|
|
161
|
+
body,
|
|
162
|
+
responseKey: undefined,
|
|
161
163
|
})
|
|
162
164
|
}
|
|
163
165
|
}
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
limitToSeamHttpRequestOptions,
|
|
32
32
|
parseOptions,
|
|
33
33
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
|
+
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
35
|
|
|
35
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
36
37
|
|
|
@@ -153,35 +154,34 @@ export class SeamHttpDevicesUnmanaged {
|
|
|
153
154
|
await clientSessions.get()
|
|
154
155
|
}
|
|
155
156
|
|
|
156
|
-
|
|
157
|
+
get(
|
|
157
158
|
body?: DevicesUnmanagedGetParams,
|
|
158
|
-
):
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
): SeamHttpRequest<DevicesUnmanagedGetResponse, 'device'> {
|
|
160
|
+
return new SeamHttpRequest(this, {
|
|
161
|
+
path: '/devices/unmanaged/get',
|
|
161
162
|
method: 'post',
|
|
162
|
-
|
|
163
|
+
body,
|
|
164
|
+
responseKey: 'device',
|
|
163
165
|
})
|
|
164
|
-
|
|
165
|
-
return data.device
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
list(
|
|
169
169
|
body?: DevicesUnmanagedListParams,
|
|
170
|
-
):
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
): SeamHttpRequest<DevicesUnmanagedListResponse, 'devices'> {
|
|
171
|
+
return new SeamHttpRequest(this, {
|
|
172
|
+
path: '/devices/unmanaged/list',
|
|
173
173
|
method: 'post',
|
|
174
|
-
|
|
174
|
+
body,
|
|
175
|
+
responseKey: 'devices',
|
|
175
176
|
})
|
|
176
|
-
|
|
177
|
-
return data.devices
|
|
178
177
|
}
|
|
179
178
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
update(body?: DevicesUnmanagedUpdateBody): SeamHttpRequest<void, undefined> {
|
|
180
|
+
return new SeamHttpRequest(this, {
|
|
181
|
+
path: '/devices/unmanaged/update',
|
|
183
182
|
method: 'post',
|
|
184
|
-
|
|
183
|
+
body,
|
|
184
|
+
responseKey: undefined,
|
|
185
185
|
})
|
|
186
186
|
}
|
|
187
187
|
}
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
limitToSeamHttpRequestOptions,
|
|
32
32
|
parseOptions,
|
|
33
33
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
|
+
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
35
|
|
|
35
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
36
37
|
import { SeamHttpDevicesSimulate } from './devices-simulate.js'
|
|
@@ -163,54 +164,52 @@ export class SeamHttpDevices {
|
|
|
163
164
|
return SeamHttpDevicesSimulate.fromClient(this.client, this.defaults)
|
|
164
165
|
}
|
|
165
166
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
delete(body?: DevicesDeleteBody): SeamHttpRequest<void, undefined> {
|
|
168
|
+
return new SeamHttpRequest(this, {
|
|
169
|
+
path: '/devices/delete',
|
|
169
170
|
method: 'post',
|
|
170
|
-
|
|
171
|
+
body,
|
|
172
|
+
responseKey: undefined,
|
|
171
173
|
})
|
|
172
174
|
}
|
|
173
175
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
get(body?: DevicesGetParams): SeamHttpRequest<DevicesGetResponse, 'device'> {
|
|
177
|
+
return new SeamHttpRequest(this, {
|
|
178
|
+
path: '/devices/get',
|
|
177
179
|
method: 'post',
|
|
178
|
-
|
|
180
|
+
body,
|
|
181
|
+
responseKey: 'device',
|
|
179
182
|
})
|
|
180
|
-
|
|
181
|
-
return data.device
|
|
182
183
|
}
|
|
183
184
|
|
|
184
|
-
|
|
185
|
+
list(
|
|
185
186
|
body?: DevicesListParams,
|
|
186
|
-
):
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
): SeamHttpRequest<DevicesListResponse, 'devices'> {
|
|
188
|
+
return new SeamHttpRequest(this, {
|
|
189
|
+
path: '/devices/list',
|
|
189
190
|
method: 'post',
|
|
190
|
-
|
|
191
|
+
body,
|
|
192
|
+
responseKey: 'devices',
|
|
191
193
|
})
|
|
192
|
-
|
|
193
|
-
return data.devices
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
listDeviceProviders(
|
|
197
197
|
body?: DevicesListDeviceProvidersParams,
|
|
198
|
-
):
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
return data.device_providers
|
|
198
|
+
): SeamHttpRequest<DevicesListDeviceProvidersResponse, 'device_providers'> {
|
|
199
|
+
return new SeamHttpRequest(this, {
|
|
200
|
+
path: '/devices/list_device_providers',
|
|
201
|
+
method: 'post',
|
|
202
|
+
body,
|
|
203
|
+
responseKey: 'device_providers',
|
|
204
|
+
})
|
|
207
205
|
}
|
|
208
206
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
207
|
+
update(body?: DevicesUpdateBody): SeamHttpRequest<void, undefined> {
|
|
208
|
+
return new SeamHttpRequest(this, {
|
|
209
|
+
path: '/devices/update',
|
|
212
210
|
method: 'post',
|
|
213
|
-
|
|
211
|
+
body,
|
|
212
|
+
responseKey: undefined,
|
|
214
213
|
})
|
|
215
214
|
}
|
|
216
215
|
}
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
limitToSeamHttpRequestOptions,
|
|
32
32
|
parseOptions,
|
|
33
33
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
|
+
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
35
|
|
|
35
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
36
37
|
|
|
@@ -153,24 +154,22 @@ export class SeamHttpEvents {
|
|
|
153
154
|
await clientSessions.get()
|
|
154
155
|
}
|
|
155
156
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
get(body?: EventsGetParams): SeamHttpRequest<EventsGetResponse, 'event'> {
|
|
158
|
+
return new SeamHttpRequest(this, {
|
|
159
|
+
path: '/events/get',
|
|
159
160
|
method: 'post',
|
|
160
|
-
|
|
161
|
+
body,
|
|
162
|
+
responseKey: 'event',
|
|
161
163
|
})
|
|
162
|
-
|
|
163
|
-
return data.event
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
list(body?: EventsListParams): SeamHttpRequest<EventsListResponse, 'events'> {
|
|
167
|
+
return new SeamHttpRequest(this, {
|
|
168
|
+
path: '/events/list',
|
|
169
169
|
method: 'post',
|
|
170
|
-
|
|
170
|
+
body,
|
|
171
|
+
responseKey: 'events',
|
|
171
172
|
})
|
|
172
|
-
|
|
173
|
-
return data.events
|
|
174
173
|
}
|
|
175
174
|
}
|
|
176
175
|
|
|
@@ -31,9 +31,8 @@ import {
|
|
|
31
31
|
limitToSeamHttpRequestOptions,
|
|
32
32
|
parseOptions,
|
|
33
33
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
|
-
import {
|
|
34
|
+
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
35
35
|
|
|
36
|
-
import { SeamHttpActionAttempts } from './action-attempts.js'
|
|
37
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
38
37
|
|
|
39
38
|
export class SeamHttpLocks {
|
|
@@ -155,72 +154,48 @@ export class SeamHttpLocks {
|
|
|
155
154
|
await clientSessions.get()
|
|
156
155
|
}
|
|
157
156
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
get(body?: LocksGetParams): SeamHttpRequest<LocksGetResponse, 'device'> {
|
|
158
|
+
return new SeamHttpRequest(this, {
|
|
159
|
+
path: '/locks/get',
|
|
161
160
|
method: 'post',
|
|
162
|
-
|
|
161
|
+
body,
|
|
162
|
+
responseKey: 'device',
|
|
163
163
|
})
|
|
164
|
-
|
|
165
|
-
return data.device
|
|
166
164
|
}
|
|
167
165
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
166
|
+
list(body?: LocksListParams): SeamHttpRequest<LocksListResponse, 'devices'> {
|
|
167
|
+
return new SeamHttpRequest(this, {
|
|
168
|
+
path: '/locks/list',
|
|
171
169
|
method: 'post',
|
|
172
|
-
|
|
170
|
+
body,
|
|
171
|
+
responseKey: 'devices',
|
|
173
172
|
})
|
|
174
|
-
|
|
175
|
-
return data.devices
|
|
176
173
|
}
|
|
177
174
|
|
|
178
|
-
|
|
175
|
+
lockDoor(
|
|
179
176
|
body?: LocksLockDoorBody,
|
|
180
177
|
options: Pick<SeamHttpRequestOptions, 'waitForActionAttempt'> = {},
|
|
181
|
-
):
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
): SeamHttpRequest<LocksLockDoorResponse, 'action_attempt'> {
|
|
179
|
+
return new SeamHttpRequest(this, {
|
|
180
|
+
path: '/locks/lock_door',
|
|
184
181
|
method: 'post',
|
|
185
|
-
|
|
182
|
+
body,
|
|
183
|
+
responseKey: 'action_attempt',
|
|
184
|
+
options,
|
|
186
185
|
})
|
|
187
|
-
const waitForActionAttempt =
|
|
188
|
-
options.waitForActionAttempt ?? this.defaults.waitForActionAttempt
|
|
189
|
-
if (waitForActionAttempt !== false) {
|
|
190
|
-
return await resolveActionAttempt(
|
|
191
|
-
data.action_attempt,
|
|
192
|
-
SeamHttpActionAttempts.fromClient(this.client, {
|
|
193
|
-
...this.defaults,
|
|
194
|
-
waitForActionAttempt: false,
|
|
195
|
-
}),
|
|
196
|
-
typeof waitForActionAttempt === 'boolean' ? {} : waitForActionAttempt,
|
|
197
|
-
)
|
|
198
|
-
}
|
|
199
|
-
return data.action_attempt
|
|
200
186
|
}
|
|
201
187
|
|
|
202
|
-
|
|
188
|
+
unlockDoor(
|
|
203
189
|
body?: LocksUnlockDoorBody,
|
|
204
190
|
options: Pick<SeamHttpRequestOptions, 'waitForActionAttempt'> = {},
|
|
205
|
-
):
|
|
206
|
-
|
|
207
|
-
|
|
191
|
+
): SeamHttpRequest<LocksUnlockDoorResponse, 'action_attempt'> {
|
|
192
|
+
return new SeamHttpRequest(this, {
|
|
193
|
+
path: '/locks/unlock_door',
|
|
208
194
|
method: 'post',
|
|
209
|
-
|
|
195
|
+
body,
|
|
196
|
+
responseKey: 'action_attempt',
|
|
197
|
+
options,
|
|
210
198
|
})
|
|
211
|
-
const waitForActionAttempt =
|
|
212
|
-
options.waitForActionAttempt ?? this.defaults.waitForActionAttempt
|
|
213
|
-
if (waitForActionAttempt !== false) {
|
|
214
|
-
return await resolveActionAttempt(
|
|
215
|
-
data.action_attempt,
|
|
216
|
-
SeamHttpActionAttempts.fromClient(this.client, {
|
|
217
|
-
...this.defaults,
|
|
218
|
-
waitForActionAttempt: false,
|
|
219
|
-
}),
|
|
220
|
-
typeof waitForActionAttempt === 'boolean' ? {} : waitForActionAttempt,
|
|
221
|
-
)
|
|
222
|
-
}
|
|
223
|
-
return data.action_attempt
|
|
224
199
|
}
|
|
225
200
|
}
|
|
226
201
|
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
limitToSeamHttpRequestOptions,
|
|
32
32
|
parseOptions,
|
|
33
33
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
|
+
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
35
|
|
|
35
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
36
37
|
|
|
@@ -153,26 +154,26 @@ export class SeamHttpNetworks {
|
|
|
153
154
|
await clientSessions.get()
|
|
154
155
|
}
|
|
155
156
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
get(
|
|
158
|
+
body?: NetworksGetParams,
|
|
159
|
+
): SeamHttpRequest<NetworksGetResponse, 'network'> {
|
|
160
|
+
return new SeamHttpRequest(this, {
|
|
161
|
+
path: '/networks/get',
|
|
159
162
|
method: 'post',
|
|
160
|
-
|
|
163
|
+
body,
|
|
164
|
+
responseKey: 'network',
|
|
161
165
|
})
|
|
162
|
-
|
|
163
|
-
return data.network
|
|
164
166
|
}
|
|
165
167
|
|
|
166
|
-
|
|
168
|
+
list(
|
|
167
169
|
body?: NetworksListParams,
|
|
168
|
-
):
|
|
169
|
-
|
|
170
|
-
|
|
170
|
+
): SeamHttpRequest<NetworksListResponse, 'networks'> {
|
|
171
|
+
return new SeamHttpRequest(this, {
|
|
172
|
+
path: '/networks/list',
|
|
171
173
|
method: 'post',
|
|
172
|
-
|
|
174
|
+
body,
|
|
175
|
+
responseKey: 'networks',
|
|
173
176
|
})
|
|
174
|
-
|
|
175
|
-
return data.networks
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
179
|
|