@seamapi/http 0.5.0 → 0.6.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.
- package/dist/connect.cjs +142 -22
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +46 -10
- package/lib/seam/connect/routes/acs-access-groups.d.ts +0 -9
- package/lib/seam/connect/routes/acs-access-groups.js +0 -22
- package/lib/seam/connect/routes/acs-access-groups.js.map +1 -1
- package/lib/seam/connect/routes/acs-credentials.d.ts +6 -0
- package/lib/seam/connect/routes/acs-credentials.js +14 -0
- package/lib/seam/connect/routes/acs-credentials.js.map +1 -1
- package/lib/seam/connect/routes/client-sessions.d.ts +3 -0
- package/lib/seam/connect/routes/client-sessions.js +7 -0
- package/lib/seam/connect/routes/client-sessions.js.map +1 -1
- package/lib/seam/connect/routes/index.d.ts +1 -0
- package/lib/seam/connect/routes/index.js +1 -0
- package/lib/seam/connect/routes/index.js.map +1 -1
- package/lib/seam/connect/routes/user-identities.d.ts +38 -0
- package/lib/seam/connect/routes/user-identities.js +121 -0
- package/lib/seam/connect/routes/user-identities.js.map +1 -0
- package/lib/seam/connect/seam-http.d.ts +2 -1
- package/lib/seam/connect/seam-http.js +4 -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 +2 -2
- package/src/lib/seam/connect/routes/acs-access-groups.ts +0 -48
- package/src/lib/seam/connect/routes/acs-credentials.ts +30 -0
- package/src/lib/seam/connect/routes/client-sessions.ts +15 -0
- package/src/lib/seam/connect/routes/index.ts +1 -0
- package/src/lib/seam/connect/routes/user-identities.ts +261 -0
- package/src/lib/seam/connect/seam-http.ts +5 -0
- package/src/lib/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seam-http.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/seam-http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,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C,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACxD,CAAC;IAED,IAAI,OAAO;QACT,OAAO,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAChD,CAAC;IAED,IAAI,MAAM;QACR,OAAO,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC/C,CAAC;IAED,IAAI,KAAK;QACP,OAAO,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC9C,CAAC;IAED,IAAI,YAAY;QACd,OAAO,oBAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACrD,CAAC;IAED,IAAI,WAAW;QACb,OAAO,mBAAmB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACpD,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,sBAAsB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACvD,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACjD,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACnD,CAAC;CACF"}
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const seamapiJavascriptHttpVersion = "0.
|
|
1
|
+
declare const seamapiJavascriptHttpVersion = "0.6.0";
|
|
2
2
|
export default seamapiJavascriptHttpVersion;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seamapi/http",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "JavaScript HTTP client for the Seam API written in TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@seamapi/fake-seam-connect": "^1.43.0",
|
|
95
|
-
"@seamapi/types": "^1.
|
|
95
|
+
"@seamapi/types": "^1.44.1",
|
|
96
96
|
"@types/eslint": "^8.44.2",
|
|
97
97
|
"@types/node": "^18.11.18",
|
|
98
98
|
"ava": "^5.0.1",
|
|
@@ -128,25 +128,6 @@ export class SeamHttpAcsAccessGroups {
|
|
|
128
128
|
})
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
async create(
|
|
132
|
-
body?: AcsAccessGroupsCreateBody,
|
|
133
|
-
): Promise<AcsAccessGroupsCreateResponse['acs_access_group']> {
|
|
134
|
-
const { data } = await this.client.request<AcsAccessGroupsCreateResponse>({
|
|
135
|
-
url: '/acs/access_groups/create',
|
|
136
|
-
method: 'post',
|
|
137
|
-
data: body,
|
|
138
|
-
})
|
|
139
|
-
return data.acs_access_group
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
async delete(body?: AcsAccessGroupsDeleteBody): Promise<void> {
|
|
143
|
-
await this.client.request<AcsAccessGroupsDeleteResponse>({
|
|
144
|
-
url: '/acs/access_groups/delete',
|
|
145
|
-
method: 'post',
|
|
146
|
-
data: body,
|
|
147
|
-
})
|
|
148
|
-
}
|
|
149
|
-
|
|
150
131
|
async get(
|
|
151
132
|
body?: AcsAccessGroupsGetParams,
|
|
152
133
|
): Promise<AcsAccessGroupsGetResponse['acs_access_group']> {
|
|
@@ -188,14 +169,6 @@ export class SeamHttpAcsAccessGroups {
|
|
|
188
169
|
data: body,
|
|
189
170
|
})
|
|
190
171
|
}
|
|
191
|
-
|
|
192
|
-
async update(body?: AcsAccessGroupsUpdateBody): Promise<void> {
|
|
193
|
-
await this.client.request<AcsAccessGroupsUpdateResponse>({
|
|
194
|
-
url: '/acs/access_groups/update',
|
|
195
|
-
method: 'post',
|
|
196
|
-
data: body,
|
|
197
|
-
})
|
|
198
|
-
}
|
|
199
172
|
}
|
|
200
173
|
|
|
201
174
|
export type AcsAccessGroupsAddUserBody =
|
|
@@ -205,20 +178,6 @@ export type AcsAccessGroupsAddUserResponse = SetNonNullable<
|
|
|
205
178
|
Required<RouteResponse<'/acs/access_groups/add_user'>>
|
|
206
179
|
>
|
|
207
180
|
|
|
208
|
-
export type AcsAccessGroupsCreateBody =
|
|
209
|
-
RouteRequestBody<'/acs/access_groups/create'>
|
|
210
|
-
|
|
211
|
-
export type AcsAccessGroupsCreateResponse = SetNonNullable<
|
|
212
|
-
Required<RouteResponse<'/acs/access_groups/create'>>
|
|
213
|
-
>
|
|
214
|
-
|
|
215
|
-
export type AcsAccessGroupsDeleteBody =
|
|
216
|
-
RouteRequestBody<'/acs/access_groups/delete'>
|
|
217
|
-
|
|
218
|
-
export type AcsAccessGroupsDeleteResponse = SetNonNullable<
|
|
219
|
-
Required<RouteResponse<'/acs/access_groups/delete'>>
|
|
220
|
-
>
|
|
221
|
-
|
|
222
181
|
export type AcsAccessGroupsGetParams =
|
|
223
182
|
RouteRequestBody<'/acs/access_groups/get'>
|
|
224
183
|
|
|
@@ -246,10 +205,3 @@ export type AcsAccessGroupsRemoveUserBody =
|
|
|
246
205
|
export type AcsAccessGroupsRemoveUserResponse = SetNonNullable<
|
|
247
206
|
Required<RouteResponse<'/acs/access_groups/remove_user'>>
|
|
248
207
|
>
|
|
249
|
-
|
|
250
|
-
export type AcsAccessGroupsUpdateBody =
|
|
251
|
-
RouteRequestBody<'/acs/access_groups/update'>
|
|
252
|
-
|
|
253
|
-
export type AcsAccessGroupsUpdateResponse = SetNonNullable<
|
|
254
|
-
Required<RouteResponse<'/acs/access_groups/update'>>
|
|
255
|
-
>
|
|
@@ -120,6 +120,14 @@ export class SeamHttpAcsCredentials {
|
|
|
120
120
|
return new SeamHttpAcsCredentials(constructorOptions)
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
async assign(body?: AcsCredentialsAssignBody): Promise<void> {
|
|
124
|
+
await this.client.request<AcsCredentialsAssignResponse>({
|
|
125
|
+
url: '/acs/credentials/assign',
|
|
126
|
+
method: 'post',
|
|
127
|
+
data: body,
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
|
|
123
131
|
async create(
|
|
124
132
|
body?: AcsCredentialsCreateBody,
|
|
125
133
|
): Promise<AcsCredentialsCreateResponse['acs_credential']> {
|
|
@@ -160,8 +168,23 @@ export class SeamHttpAcsCredentials {
|
|
|
160
168
|
})
|
|
161
169
|
return data.acs_credentials
|
|
162
170
|
}
|
|
171
|
+
|
|
172
|
+
async unassign(body?: AcsCredentialsUnassignBody): Promise<void> {
|
|
173
|
+
await this.client.request<AcsCredentialsUnassignResponse>({
|
|
174
|
+
url: '/acs/credentials/unassign',
|
|
175
|
+
method: 'post',
|
|
176
|
+
data: body,
|
|
177
|
+
})
|
|
178
|
+
}
|
|
163
179
|
}
|
|
164
180
|
|
|
181
|
+
export type AcsCredentialsAssignBody =
|
|
182
|
+
RouteRequestBody<'/acs/credentials/assign'>
|
|
183
|
+
|
|
184
|
+
export type AcsCredentialsAssignResponse = SetNonNullable<
|
|
185
|
+
Required<RouteResponse<'/acs/credentials/assign'>>
|
|
186
|
+
>
|
|
187
|
+
|
|
165
188
|
export type AcsCredentialsCreateBody =
|
|
166
189
|
RouteRequestBody<'/acs/credentials/create'>
|
|
167
190
|
|
|
@@ -187,3 +210,10 @@ export type AcsCredentialsListParams = RouteRequestBody<'/acs/credentials/list'>
|
|
|
187
210
|
export type AcsCredentialsListResponse = SetNonNullable<
|
|
188
211
|
Required<RouteResponse<'/acs/credentials/list'>>
|
|
189
212
|
>
|
|
213
|
+
|
|
214
|
+
export type AcsCredentialsUnassignBody =
|
|
215
|
+
RouteRequestBody<'/acs/credentials/unassign'>
|
|
216
|
+
|
|
217
|
+
export type AcsCredentialsUnassignResponse = SetNonNullable<
|
|
218
|
+
Required<RouteResponse<'/acs/credentials/unassign'>>
|
|
219
|
+
>
|
|
@@ -182,6 +182,14 @@ export class SeamHttpClientSessions {
|
|
|
182
182
|
})
|
|
183
183
|
return data.client_sessions
|
|
184
184
|
}
|
|
185
|
+
|
|
186
|
+
async revoke(body?: ClientSessionsRevokeBody): Promise<void> {
|
|
187
|
+
await this.client.request<ClientSessionsRevokeResponse>({
|
|
188
|
+
url: '/client_sessions/revoke',
|
|
189
|
+
method: 'post',
|
|
190
|
+
data: body,
|
|
191
|
+
})
|
|
192
|
+
}
|
|
185
193
|
}
|
|
186
194
|
|
|
187
195
|
export type ClientSessionsCreateBody =
|
|
@@ -223,3 +231,10 @@ export type ClientSessionsListParams = RouteRequestBody<'/client_sessions/list'>
|
|
|
223
231
|
export type ClientSessionsListResponse = SetNonNullable<
|
|
224
232
|
Required<RouteResponse<'/client_sessions/list'>>
|
|
225
233
|
>
|
|
234
|
+
|
|
235
|
+
export type ClientSessionsRevokeBody =
|
|
236
|
+
RouteRequestBody<'/client_sessions/revoke'>
|
|
237
|
+
|
|
238
|
+
export type ClientSessionsRevokeResponse = SetNonNullable<
|
|
239
|
+
Required<RouteResponse<'/client_sessions/revoke'>>
|
|
240
|
+
>
|
|
@@ -17,5 +17,6 @@ export * from './noise-sensors.js'
|
|
|
17
17
|
export * from './noise-sensors-noise-thresholds.js'
|
|
18
18
|
export * from './thermostats.js'
|
|
19
19
|
export * from './thermostats-climate-setting-schedules.js'
|
|
20
|
+
export * from './user-identities.js'
|
|
20
21
|
export * from './webhooks.js'
|
|
21
22
|
export * from './workspaces.js'
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by generate-routes.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
+
import type { SetNonNullable } from 'type-fest'
|
|
8
|
+
|
|
9
|
+
import { warnOnInsecureuserIdentifierKey } from 'lib/seam/connect/auth.js'
|
|
10
|
+
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
11
|
+
import {
|
|
12
|
+
isSeamHttpOptionsWithApiKey,
|
|
13
|
+
isSeamHttpOptionsWithClient,
|
|
14
|
+
isSeamHttpOptionsWithClientSessionToken,
|
|
15
|
+
isSeamHttpOptionsWithConsoleSessionToken,
|
|
16
|
+
isSeamHttpOptionsWithPersonalAccessToken,
|
|
17
|
+
type SeamHttpFromPublishableKeyOptions,
|
|
18
|
+
SeamHttpInvalidOptionsError,
|
|
19
|
+
type SeamHttpOptions,
|
|
20
|
+
type SeamHttpOptionsWithApiKey,
|
|
21
|
+
type SeamHttpOptionsWithClient,
|
|
22
|
+
type SeamHttpOptionsWithClientSessionToken,
|
|
23
|
+
type SeamHttpOptionsWithConsoleSessionToken,
|
|
24
|
+
type SeamHttpOptionsWithPersonalAccessToken,
|
|
25
|
+
} from 'lib/seam/connect/options.js'
|
|
26
|
+
import { parseOptions } from 'lib/seam/connect/parse-options.js'
|
|
27
|
+
|
|
28
|
+
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
29
|
+
|
|
30
|
+
export class SeamHttpUserIdentities {
|
|
31
|
+
client: Client
|
|
32
|
+
|
|
33
|
+
constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
|
|
34
|
+
const clientOptions = parseOptions(apiKeyOrOptions)
|
|
35
|
+
this.client = createClient(clientOptions)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static fromClient(
|
|
39
|
+
client: SeamHttpOptionsWithClient['client'],
|
|
40
|
+
options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
|
|
41
|
+
): SeamHttpUserIdentities {
|
|
42
|
+
const constructorOptions = { ...options, client }
|
|
43
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
44
|
+
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
45
|
+
}
|
|
46
|
+
return new SeamHttpUserIdentities(constructorOptions)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static fromApiKey(
|
|
50
|
+
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
51
|
+
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
52
|
+
): SeamHttpUserIdentities {
|
|
53
|
+
const constructorOptions = { ...options, apiKey }
|
|
54
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
55
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
56
|
+
}
|
|
57
|
+
return new SeamHttpUserIdentities(constructorOptions)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static fromClientSessionToken(
|
|
61
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
62
|
+
options: Omit<
|
|
63
|
+
SeamHttpOptionsWithClientSessionToken,
|
|
64
|
+
'clientSessionToken'
|
|
65
|
+
> = {},
|
|
66
|
+
): SeamHttpUserIdentities {
|
|
67
|
+
const constructorOptions = { ...options, clientSessionToken }
|
|
68
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
69
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
70
|
+
}
|
|
71
|
+
return new SeamHttpUserIdentities(constructorOptions)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static async fromPublishableKey(
|
|
75
|
+
publishableKey: string,
|
|
76
|
+
userIdentifierKey: string,
|
|
77
|
+
options: SeamHttpFromPublishableKeyOptions = {},
|
|
78
|
+
): Promise<SeamHttpUserIdentities> {
|
|
79
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey)
|
|
80
|
+
const clientOptions = parseOptions({ ...options, publishableKey })
|
|
81
|
+
const client = createClient(clientOptions)
|
|
82
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client)
|
|
83
|
+
const { token } = await clientSessions.getOrCreate({
|
|
84
|
+
user_identifier_key: userIdentifierKey,
|
|
85
|
+
})
|
|
86
|
+
return SeamHttpUserIdentities.fromClientSessionToken(token, options)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
static fromConsoleSessionToken(
|
|
90
|
+
consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
|
|
91
|
+
workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
|
|
92
|
+
options: Omit<
|
|
93
|
+
SeamHttpOptionsWithConsoleSessionToken,
|
|
94
|
+
'consoleSessionToken' | 'workspaceId'
|
|
95
|
+
> = {},
|
|
96
|
+
): SeamHttpUserIdentities {
|
|
97
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId }
|
|
98
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
99
|
+
throw new SeamHttpInvalidOptionsError(
|
|
100
|
+
'Missing consoleSessionToken or workspaceId',
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
return new SeamHttpUserIdentities(constructorOptions)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
static fromPersonalAccessToken(
|
|
107
|
+
personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
|
|
108
|
+
workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
|
|
109
|
+
options: Omit<
|
|
110
|
+
SeamHttpOptionsWithPersonalAccessToken,
|
|
111
|
+
'personalAccessToken' | 'workspaceId'
|
|
112
|
+
> = {},
|
|
113
|
+
): SeamHttpUserIdentities {
|
|
114
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId }
|
|
115
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
116
|
+
throw new SeamHttpInvalidOptionsError(
|
|
117
|
+
'Missing personalAccessToken or workspaceId',
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
return new SeamHttpUserIdentities(constructorOptions)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async addAcsUser(body?: UserIdentitiesAddAcsUserBody): Promise<void> {
|
|
124
|
+
await this.client.request<UserIdentitiesAddAcsUserResponse>({
|
|
125
|
+
url: '/user_identities/add_acs_user',
|
|
126
|
+
method: 'post',
|
|
127
|
+
data: body,
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async create(
|
|
132
|
+
body?: UserIdentitiesCreateBody,
|
|
133
|
+
): Promise<UserIdentitiesCreateResponse['user_identity']> {
|
|
134
|
+
const { data } = await this.client.request<UserIdentitiesCreateResponse>({
|
|
135
|
+
url: '/user_identities/create',
|
|
136
|
+
method: 'post',
|
|
137
|
+
data: body,
|
|
138
|
+
})
|
|
139
|
+
return data.user_identity
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
async get(
|
|
143
|
+
body?: UserIdentitiesGetParams,
|
|
144
|
+
): Promise<UserIdentitiesGetResponse['user_identity']> {
|
|
145
|
+
const { data } = await this.client.request<UserIdentitiesGetResponse>({
|
|
146
|
+
url: '/user_identities/get',
|
|
147
|
+
method: 'post',
|
|
148
|
+
data: body,
|
|
149
|
+
})
|
|
150
|
+
return data.user_identity
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
async grantAccessToDevice(
|
|
154
|
+
body?: UserIdentitiesGrantAccessToDeviceBody,
|
|
155
|
+
): Promise<void> {
|
|
156
|
+
await this.client.request<UserIdentitiesGrantAccessToDeviceResponse>({
|
|
157
|
+
url: '/user_identities/grant_access_to_device',
|
|
158
|
+
method: 'post',
|
|
159
|
+
data: body,
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
async listAccessibleDevices(
|
|
164
|
+
body?: UserIdentitiesListAccessibleDevicesParams,
|
|
165
|
+
): Promise<
|
|
166
|
+
UserIdentitiesListAccessibleDevicesResponse['accessible_devices']
|
|
167
|
+
> {
|
|
168
|
+
const { data } =
|
|
169
|
+
await this.client.request<UserIdentitiesListAccessibleDevicesResponse>({
|
|
170
|
+
url: '/user_identities/list_accessible_devices',
|
|
171
|
+
method: 'post',
|
|
172
|
+
data: body,
|
|
173
|
+
})
|
|
174
|
+
return data.accessible_devices
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
async listAcsUsers(
|
|
178
|
+
body?: UserIdentitiesListAcsUsersParams,
|
|
179
|
+
): Promise<UserIdentitiesListAcsUsersResponse['acs_users']> {
|
|
180
|
+
const { data } =
|
|
181
|
+
await this.client.request<UserIdentitiesListAcsUsersResponse>({
|
|
182
|
+
url: '/user_identities/list_acs_users',
|
|
183
|
+
method: 'post',
|
|
184
|
+
data: body,
|
|
185
|
+
})
|
|
186
|
+
return data.acs_users
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
async removeAcsUser(body?: UserIdentitiesRemoveAcsUserBody): Promise<void> {
|
|
190
|
+
await this.client.request<UserIdentitiesRemoveAcsUserResponse>({
|
|
191
|
+
url: '/user_identities/remove_acs_user',
|
|
192
|
+
method: 'post',
|
|
193
|
+
data: body,
|
|
194
|
+
})
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
async revokeAccessToDevice(
|
|
198
|
+
body?: UserIdentitiesRevokeAccessToDeviceBody,
|
|
199
|
+
): Promise<void> {
|
|
200
|
+
await this.client.request<UserIdentitiesRevokeAccessToDeviceResponse>({
|
|
201
|
+
url: '/user_identities/revoke_access_to_device',
|
|
202
|
+
method: 'post',
|
|
203
|
+
data: body,
|
|
204
|
+
})
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export type UserIdentitiesAddAcsUserBody =
|
|
209
|
+
RouteRequestBody<'/user_identities/add_acs_user'>
|
|
210
|
+
|
|
211
|
+
export type UserIdentitiesAddAcsUserResponse = SetNonNullable<
|
|
212
|
+
Required<RouteResponse<'/user_identities/add_acs_user'>>
|
|
213
|
+
>
|
|
214
|
+
|
|
215
|
+
export type UserIdentitiesCreateBody =
|
|
216
|
+
RouteRequestBody<'/user_identities/create'>
|
|
217
|
+
|
|
218
|
+
export type UserIdentitiesCreateResponse = SetNonNullable<
|
|
219
|
+
Required<RouteResponse<'/user_identities/create'>>
|
|
220
|
+
>
|
|
221
|
+
|
|
222
|
+
export type UserIdentitiesGetParams = RouteRequestBody<'/user_identities/get'>
|
|
223
|
+
|
|
224
|
+
export type UserIdentitiesGetResponse = SetNonNullable<
|
|
225
|
+
Required<RouteResponse<'/user_identities/get'>>
|
|
226
|
+
>
|
|
227
|
+
|
|
228
|
+
export type UserIdentitiesGrantAccessToDeviceBody =
|
|
229
|
+
RouteRequestBody<'/user_identities/grant_access_to_device'>
|
|
230
|
+
|
|
231
|
+
export type UserIdentitiesGrantAccessToDeviceResponse = SetNonNullable<
|
|
232
|
+
Required<RouteResponse<'/user_identities/grant_access_to_device'>>
|
|
233
|
+
>
|
|
234
|
+
|
|
235
|
+
export type UserIdentitiesListAccessibleDevicesParams =
|
|
236
|
+
RouteRequestBody<'/user_identities/list_accessible_devices'>
|
|
237
|
+
|
|
238
|
+
export type UserIdentitiesListAccessibleDevicesResponse = SetNonNullable<
|
|
239
|
+
Required<RouteResponse<'/user_identities/list_accessible_devices'>>
|
|
240
|
+
>
|
|
241
|
+
|
|
242
|
+
export type UserIdentitiesListAcsUsersParams =
|
|
243
|
+
RouteRequestBody<'/user_identities/list_acs_users'>
|
|
244
|
+
|
|
245
|
+
export type UserIdentitiesListAcsUsersResponse = SetNonNullable<
|
|
246
|
+
Required<RouteResponse<'/user_identities/list_acs_users'>>
|
|
247
|
+
>
|
|
248
|
+
|
|
249
|
+
export type UserIdentitiesRemoveAcsUserBody =
|
|
250
|
+
RouteRequestBody<'/user_identities/remove_acs_user'>
|
|
251
|
+
|
|
252
|
+
export type UserIdentitiesRemoveAcsUserResponse = SetNonNullable<
|
|
253
|
+
Required<RouteResponse<'/user_identities/remove_acs_user'>>
|
|
254
|
+
>
|
|
255
|
+
|
|
256
|
+
export type UserIdentitiesRevokeAccessToDeviceBody =
|
|
257
|
+
RouteRequestBody<'/user_identities/revoke_access_to_device'>
|
|
258
|
+
|
|
259
|
+
export type UserIdentitiesRevokeAccessToDeviceResponse = SetNonNullable<
|
|
260
|
+
Required<RouteResponse<'/user_identities/revoke_access_to_device'>>
|
|
261
|
+
>
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
SeamHttpLocks,
|
|
29
29
|
SeamHttpNoiseSensors,
|
|
30
30
|
SeamHttpThermostats,
|
|
31
|
+
SeamHttpUserIdentities,
|
|
31
32
|
SeamHttpWebhooks,
|
|
32
33
|
SeamHttpWorkspaces,
|
|
33
34
|
} from './routes/index.js'
|
|
@@ -169,6 +170,10 @@ export class SeamHttp {
|
|
|
169
170
|
return SeamHttpThermostats.fromClient(this.client)
|
|
170
171
|
}
|
|
171
172
|
|
|
173
|
+
get userIdentities(): SeamHttpUserIdentities {
|
|
174
|
+
return SeamHttpUserIdentities.fromClient(this.client)
|
|
175
|
+
}
|
|
176
|
+
|
|
172
177
|
get webhooks(): SeamHttpWebhooks {
|
|
173
178
|
return SeamHttpWebhooks.fromClient(this.client)
|
|
174
179
|
}
|
package/src/lib/version.ts
CHANGED