@seamapi/http 0.13.0 → 0.14.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 +3 -3
- package/dist/connect.cjs +296 -16
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +79 -12
- package/lib/seam/connect/parse-options.js +9 -0
- package/lib/seam/connect/parse-options.js.map +1 -1
- package/lib/seam/connect/routes/connected-accounts.d.ts +3 -3
- package/lib/seam/connect/routes/connected-accounts.js +3 -3
- package/lib/seam/connect/routes/connected-accounts.js.map +1 -1
- package/lib/seam/connect/routes/index.d.ts +3 -0
- package/lib/seam/connect/routes/index.js +3 -0
- package/lib/seam/connect/routes/index.js.map +1 -1
- package/lib/seam/connect/routes/networks.d.ts +23 -0
- package/lib/seam/connect/routes/networks.js +81 -0
- package/lib/seam/connect/routes/networks.js.map +1 -0
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.d.ts +1 -1
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js +2 -1
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js.map +1 -1
- package/lib/seam/connect/routes/phones.d.ts +19 -0
- package/lib/seam/connect/routes/phones.js +73 -0
- package/lib/seam/connect/routes/phones.js.map +1 -0
- package/lib/seam/connect/routes/user-identities-enrollment-automations.d.ts +27 -0
- package/lib/seam/connect/routes/user-identities-enrollment-automations.js +89 -0
- package/lib/seam/connect/routes/user-identities-enrollment-automations.js.map +1 -0
- package/lib/seam/connect/routes/user-identities.d.ts +9 -3
- package/lib/seam/connect/routes/user-identities.js +15 -3
- package/lib/seam/connect/routes/user-identities.js.map +1 -1
- package/lib/seam/connect/routes/webhooks.d.ts +3 -3
- package/lib/seam/connect/routes/webhooks.js +3 -3
- package/lib/seam/connect/routes/webhooks.js.map +1 -1
- package/lib/seam/connect/routes/workspaces.d.ts +5 -5
- package/lib/seam/connect/routes/workspaces.js +6 -6
- package/lib/seam/connect/routes/workspaces.js.map +1 -1
- package/lib/seam/connect/seam-http.d.ts +3 -1
- package/lib/seam/connect/seam-http.js +7 -1
- package/lib/seam/connect/seam-http.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/src/lib/seam/connect/parse-options.ts +17 -0
- package/src/lib/seam/connect/routes/connected-accounts.ts +5 -9
- package/src/lib/seam/connect/routes/index.ts +3 -0
- package/src/lib/seam/connect/routes/networks.ts +171 -0
- package/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +11 -6
- package/src/lib/seam/connect/routes/phones.ts +151 -0
- package/src/lib/seam/connect/routes/user-identities-enrollment-automations.ts +214 -0
- package/src/lib/seam/connect/routes/user-identities.ts +35 -10
- package/src/lib/seam/connect/routes/webhooks.ts +5 -9
- package/src/lib/seam/connect/routes/workspaces.ts +9 -13
- package/src/lib/seam/connect/seam-http.ts +10 -0
- package/src/lib/version.ts +1 -1
|
@@ -3,11 +3,7 @@
|
|
|
3
3
|
* Do not edit this file or add other files to this directory.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type {
|
|
7
|
-
RouteRequestBody,
|
|
8
|
-
RouteRequestParams,
|
|
9
|
-
RouteResponse,
|
|
10
|
-
} from '@seamapi/types/connect'
|
|
6
|
+
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
11
7
|
import type { SetNonNullable } from 'type-fest'
|
|
12
8
|
|
|
13
9
|
import { warnOnInsecureuserIdentifierKey } from 'lib/seam/connect/auth.js'
|
|
@@ -34,6 +30,7 @@ import {
|
|
|
34
30
|
} from 'lib/seam/connect/parse-options.js'
|
|
35
31
|
|
|
36
32
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
33
|
+
import { SeamHttpUserIdentitiesEnrollmentAutomations } from './user-identities-enrollment-automations.js'
|
|
37
34
|
|
|
38
35
|
export class SeamHttpUserIdentities {
|
|
39
36
|
client: Client
|
|
@@ -135,6 +132,13 @@ export class SeamHttpUserIdentities {
|
|
|
135
132
|
return new SeamHttpUserIdentities(constructorOptions)
|
|
136
133
|
}
|
|
137
134
|
|
|
135
|
+
get enrollmentAutomations(): SeamHttpUserIdentitiesEnrollmentAutomations {
|
|
136
|
+
return SeamHttpUserIdentitiesEnrollmentAutomations.fromClient(
|
|
137
|
+
this.client,
|
|
138
|
+
this.defaults,
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
|
|
138
142
|
async addAcsUser(body?: UserIdentitiesAddAcsUserBody): Promise<void> {
|
|
139
143
|
await this.client.request<UserIdentitiesAddAcsUserResponse>({
|
|
140
144
|
url: '/user_identities/add_acs_user',
|
|
@@ -178,12 +182,12 @@ export class SeamHttpUserIdentities {
|
|
|
178
182
|
}
|
|
179
183
|
|
|
180
184
|
async list(
|
|
181
|
-
|
|
185
|
+
body?: UserIdentitiesListParams,
|
|
182
186
|
): Promise<UserIdentitiesListResponse['user_identities']> {
|
|
183
187
|
const { data } = await this.client.request<UserIdentitiesListResponse>({
|
|
184
188
|
url: '/user_identities/list',
|
|
185
|
-
method: '
|
|
186
|
-
|
|
189
|
+
method: 'post',
|
|
190
|
+
data: body,
|
|
187
191
|
})
|
|
188
192
|
|
|
189
193
|
return data.user_identities
|
|
@@ -204,6 +208,19 @@ export class SeamHttpUserIdentities {
|
|
|
204
208
|
return data.accessible_devices
|
|
205
209
|
}
|
|
206
210
|
|
|
211
|
+
async listAcsSystems(
|
|
212
|
+
body?: UserIdentitiesListAcsSystemsParams,
|
|
213
|
+
): Promise<UserIdentitiesListAcsSystemsResponse['acs_systems']> {
|
|
214
|
+
const { data } =
|
|
215
|
+
await this.client.request<UserIdentitiesListAcsSystemsResponse>({
|
|
216
|
+
url: '/user_identities/list_acs_systems',
|
|
217
|
+
method: 'post',
|
|
218
|
+
data: body,
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
return data.acs_systems
|
|
222
|
+
}
|
|
223
|
+
|
|
207
224
|
async listAcsUsers(
|
|
208
225
|
body?: UserIdentitiesListAcsUsersParams,
|
|
209
226
|
): Promise<UserIdentitiesListAcsUsersResponse['acs_users']> {
|
|
@@ -271,8 +288,7 @@ export type UserIdentitiesGrantAccessToDeviceResponse = SetNonNullable<
|
|
|
271
288
|
|
|
272
289
|
export type UserIdentitiesGrantAccessToDeviceOptions = never
|
|
273
290
|
|
|
274
|
-
export type UserIdentitiesListParams =
|
|
275
|
-
RouteRequestParams<'/user_identities/list'>
|
|
291
|
+
export type UserIdentitiesListParams = RouteRequestBody<'/user_identities/list'>
|
|
276
292
|
|
|
277
293
|
export type UserIdentitiesListResponse = SetNonNullable<
|
|
278
294
|
Required<RouteResponse<'/user_identities/list'>>
|
|
@@ -289,6 +305,15 @@ export type UserIdentitiesListAccessibleDevicesResponse = SetNonNullable<
|
|
|
289
305
|
|
|
290
306
|
export type UserIdentitiesListAccessibleDevicesOptions = never
|
|
291
307
|
|
|
308
|
+
export type UserIdentitiesListAcsSystemsParams =
|
|
309
|
+
RouteRequestBody<'/user_identities/list_acs_systems'>
|
|
310
|
+
|
|
311
|
+
export type UserIdentitiesListAcsSystemsResponse = SetNonNullable<
|
|
312
|
+
Required<RouteResponse<'/user_identities/list_acs_systems'>>
|
|
313
|
+
>
|
|
314
|
+
|
|
315
|
+
export type UserIdentitiesListAcsSystemsOptions = never
|
|
316
|
+
|
|
292
317
|
export type UserIdentitiesListAcsUsersParams =
|
|
293
318
|
RouteRequestBody<'/user_identities/list_acs_users'>
|
|
294
319
|
|
|
@@ -3,11 +3,7 @@
|
|
|
3
3
|
* Do not edit this file or add other files to this directory.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type {
|
|
7
|
-
RouteRequestBody,
|
|
8
|
-
RouteRequestParams,
|
|
9
|
-
RouteResponse,
|
|
10
|
-
} from '@seamapi/types/connect'
|
|
6
|
+
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
11
7
|
import type { SetNonNullable } from 'type-fest'
|
|
12
8
|
|
|
13
9
|
import { warnOnInsecureuserIdentifierKey } from 'lib/seam/connect/auth.js'
|
|
@@ -166,12 +162,12 @@ export class SeamHttpWebhooks {
|
|
|
166
162
|
}
|
|
167
163
|
|
|
168
164
|
async list(
|
|
169
|
-
|
|
165
|
+
body?: WebhooksListParams,
|
|
170
166
|
): Promise<WebhooksListResponse['webhooks']> {
|
|
171
167
|
const { data } = await this.client.request<WebhooksListResponse>({
|
|
172
168
|
url: '/webhooks/list',
|
|
173
|
-
method: '
|
|
174
|
-
|
|
169
|
+
method: 'post',
|
|
170
|
+
data: body,
|
|
175
171
|
})
|
|
176
172
|
|
|
177
173
|
return data.webhooks
|
|
@@ -202,7 +198,7 @@ export type WebhooksGetResponse = SetNonNullable<
|
|
|
202
198
|
|
|
203
199
|
export type WebhooksGetOptions = never
|
|
204
200
|
|
|
205
|
-
export type WebhooksListParams =
|
|
201
|
+
export type WebhooksListParams = RouteRequestBody<'/webhooks/list'>
|
|
206
202
|
|
|
207
203
|
export type WebhooksListResponse = SetNonNullable<
|
|
208
204
|
Required<RouteResponse<'/webhooks/list'>>
|
|
@@ -3,11 +3,7 @@
|
|
|
3
3
|
* Do not edit this file or add other files to this directory.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type {
|
|
7
|
-
RouteRequestBody,
|
|
8
|
-
RouteRequestParams,
|
|
9
|
-
RouteResponse,
|
|
10
|
-
} from '@seamapi/types/connect'
|
|
6
|
+
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
11
7
|
import type { SetNonNullable } from 'type-fest'
|
|
12
8
|
|
|
13
9
|
import { warnOnInsecureuserIdentifierKey } from 'lib/seam/connect/auth.js'
|
|
@@ -148,24 +144,24 @@ export class SeamHttpWorkspaces {
|
|
|
148
144
|
}
|
|
149
145
|
|
|
150
146
|
async get(
|
|
151
|
-
|
|
147
|
+
body?: WorkspacesGetParams,
|
|
152
148
|
): Promise<WorkspacesGetResponse['workspace']> {
|
|
153
149
|
const { data } = await this.client.request<WorkspacesGetResponse>({
|
|
154
150
|
url: '/workspaces/get',
|
|
155
|
-
method: '
|
|
156
|
-
|
|
151
|
+
method: 'post',
|
|
152
|
+
data: body,
|
|
157
153
|
})
|
|
158
154
|
|
|
159
155
|
return data.workspace
|
|
160
156
|
}
|
|
161
157
|
|
|
162
158
|
async list(
|
|
163
|
-
|
|
159
|
+
body?: WorkspacesListParams,
|
|
164
160
|
): Promise<WorkspacesListResponse['workspaces']> {
|
|
165
161
|
const { data } = await this.client.request<WorkspacesListResponse>({
|
|
166
162
|
url: '/workspaces/list',
|
|
167
|
-
method: '
|
|
168
|
-
|
|
163
|
+
method: 'post',
|
|
164
|
+
data: body,
|
|
169
165
|
})
|
|
170
166
|
|
|
171
167
|
return data.workspaces
|
|
@@ -188,7 +184,7 @@ export type WorkspacesCreateResponse = SetNonNullable<
|
|
|
188
184
|
|
|
189
185
|
export type WorkspacesCreateOptions = never
|
|
190
186
|
|
|
191
|
-
export type WorkspacesGetParams =
|
|
187
|
+
export type WorkspacesGetParams = RouteRequestBody<'/workspaces/get'>
|
|
192
188
|
|
|
193
189
|
export type WorkspacesGetResponse = SetNonNullable<
|
|
194
190
|
Required<RouteResponse<'/workspaces/get'>>
|
|
@@ -196,7 +192,7 @@ export type WorkspacesGetResponse = SetNonNullable<
|
|
|
196
192
|
|
|
197
193
|
export type WorkspacesGetOptions = never
|
|
198
194
|
|
|
199
|
-
export type WorkspacesListParams =
|
|
195
|
+
export type WorkspacesListParams = RouteRequestBody<'/workspaces/list'>
|
|
200
196
|
|
|
201
197
|
export type WorkspacesListResponse = SetNonNullable<
|
|
202
198
|
Required<RouteResponse<'/workspaces/list'>>
|
|
@@ -27,7 +27,9 @@ import {
|
|
|
27
27
|
SeamHttpDevices,
|
|
28
28
|
SeamHttpEvents,
|
|
29
29
|
SeamHttpLocks,
|
|
30
|
+
SeamHttpNetworks,
|
|
30
31
|
SeamHttpNoiseSensors,
|
|
32
|
+
SeamHttpPhones,
|
|
31
33
|
SeamHttpThermostats,
|
|
32
34
|
SeamHttpUserIdentities,
|
|
33
35
|
SeamHttpWebhooks,
|
|
@@ -170,10 +172,18 @@ export class SeamHttp {
|
|
|
170
172
|
return SeamHttpLocks.fromClient(this.client, this.defaults)
|
|
171
173
|
}
|
|
172
174
|
|
|
175
|
+
get networks(): SeamHttpNetworks {
|
|
176
|
+
return SeamHttpNetworks.fromClient(this.client, this.defaults)
|
|
177
|
+
}
|
|
178
|
+
|
|
173
179
|
get noiseSensors(): SeamHttpNoiseSensors {
|
|
174
180
|
return SeamHttpNoiseSensors.fromClient(this.client, this.defaults)
|
|
175
181
|
}
|
|
176
182
|
|
|
183
|
+
get phones(): SeamHttpPhones {
|
|
184
|
+
return SeamHttpPhones.fromClient(this.client, this.defaults)
|
|
185
|
+
}
|
|
186
|
+
|
|
177
187
|
get thermostats(): SeamHttpThermostats {
|
|
178
188
|
return SeamHttpThermostats.fromClient(this.client, this.defaults)
|
|
179
189
|
}
|
package/src/lib/version.ts
CHANGED