@seamapi/http 0.26.0 → 0.28.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/README.md +8 -5
- package/dist/connect.cjs +190 -7
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +48 -9
- package/lib/seam/connect/routes/access-codes-simulate.d.ts +21 -0
- package/lib/seam/connect/routes/access-codes-simulate.js +88 -0
- package/lib/seam/connect/routes/access-codes-simulate.js.map +1 -0
- package/lib/seam/connect/routes/access-codes-unmanaged.d.ts +1 -1
- package/lib/seam/connect/routes/access-codes-unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/access-codes.d.ts +3 -1
- package/lib/seam/connect/routes/access-codes.js +4 -0
- package/lib/seam/connect/routes/access-codes.js.map +1 -1
- package/lib/seam/connect/routes/acs-access-groups.d.ts +1 -1
- package/lib/seam/connect/routes/acs-access-groups.js.map +1 -1
- package/lib/seam/connect/routes/acs-credential-pools.d.ts +1 -1
- package/lib/seam/connect/routes/acs-credential-pools.js.map +1 -1
- package/lib/seam/connect/routes/acs-credential-provisioning-automations.d.ts +1 -1
- package/lib/seam/connect/routes/acs-credential-provisioning-automations.js.map +1 -1
- package/lib/seam/connect/routes/acs-credentials.d.ts +4 -4
- package/lib/seam/connect/routes/acs-credentials.js +3 -3
- package/lib/seam/connect/routes/acs-credentials.js.map +1 -1
- package/lib/seam/connect/routes/acs-entrances.d.ts +1 -1
- package/lib/seam/connect/routes/acs-entrances.js.map +1 -1
- package/lib/seam/connect/routes/acs-systems.d.ts +1 -1
- package/lib/seam/connect/routes/acs-systems.js.map +1 -1
- package/lib/seam/connect/routes/acs-users.d.ts +1 -1
- package/lib/seam/connect/routes/acs-users.js.map +1 -1
- package/lib/seam/connect/routes/action-attempts.d.ts +1 -1
- package/lib/seam/connect/routes/action-attempts.js.map +1 -1
- package/lib/seam/connect/routes/client-sessions.d.ts +2 -2
- package/lib/seam/connect/routes/client-sessions.js +1 -1
- package/lib/seam/connect/routes/client-sessions.js.map +1 -1
- package/lib/seam/connect/routes/connect-webviews.d.ts +1 -1
- package/lib/seam/connect/routes/connect-webviews.js.map +1 -1
- package/lib/seam/connect/routes/connected-accounts.d.ts +1 -1
- package/lib/seam/connect/routes/connected-accounts.js.map +1 -1
- package/lib/seam/connect/routes/devices-simulate.d.ts +1 -1
- package/lib/seam/connect/routes/devices-simulate.js.map +1 -1
- package/lib/seam/connect/routes/devices-unmanaged.d.ts +1 -1
- package/lib/seam/connect/routes/devices-unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/devices.d.ts +1 -1
- package/lib/seam/connect/routes/devices.js.map +1 -1
- package/lib/seam/connect/routes/events.d.ts +1 -1
- package/lib/seam/connect/routes/events.js.map +1 -1
- package/lib/seam/connect/routes/index.d.ts +2 -0
- package/lib/seam/connect/routes/index.js +2 -0
- package/lib/seam/connect/routes/index.js.map +1 -1
- package/lib/seam/connect/routes/locks.d.ts +1 -1
- package/lib/seam/connect/routes/locks.js.map +1 -1
- package/lib/seam/connect/routes/networks.d.ts +1 -1
- package/lib/seam/connect/routes/networks.js.map +1 -1
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.d.ts +1 -1
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js.map +1 -1
- package/lib/seam/connect/routes/noise-sensors-simulate.d.ts +21 -0
- package/lib/seam/connect/routes/noise-sensors-simulate.js +88 -0
- package/lib/seam/connect/routes/noise-sensors-simulate.js.map +1 -0
- package/lib/seam/connect/routes/noise-sensors.d.ts +2 -0
- package/lib/seam/connect/routes/noise-sensors.js +4 -0
- package/lib/seam/connect/routes/noise-sensors.js.map +1 -1
- package/lib/seam/connect/routes/phones-simulate.d.ts +1 -1
- package/lib/seam/connect/routes/phones-simulate.js.map +1 -1
- package/lib/seam/connect/routes/phones.d.ts +1 -1
- package/lib/seam/connect/routes/phones.js.map +1 -1
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.d.ts +1 -1
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js.map +1 -1
- package/lib/seam/connect/routes/thermostats.d.ts +1 -1
- package/lib/seam/connect/routes/thermostats.js.map +1 -1
- package/lib/seam/connect/routes/user-identities-enrollment-automations.d.ts +1 -1
- package/lib/seam/connect/routes/user-identities-enrollment-automations.js.map +1 -1
- package/lib/seam/connect/routes/user-identities.d.ts +2 -2
- package/lib/seam/connect/routes/user-identities.js +1 -1
- package/lib/seam/connect/routes/user-identities.js.map +1 -1
- package/lib/seam/connect/routes/webhooks.d.ts +1 -1
- package/lib/seam/connect/routes/webhooks.js.map +1 -1
- package/lib/seam/connect/routes/workspaces.d.ts +3 -3
- package/lib/seam/connect/routes/workspaces.js +3 -2
- package/lib/seam/connect/routes/workspaces.js.map +1 -1
- package/lib/types.d.ts +3 -0
- package/lib/types.js +2 -0
- package/lib/types.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +4 -8
- package/src/lib/seam/connect/routes/access-codes-simulate.ts +182 -0
- package/src/lib/seam/connect/routes/access-codes-unmanaged.ts +1 -1
- package/src/lib/seam/connect/routes/access-codes.ts +6 -1
- package/src/lib/seam/connect/routes/acs-access-groups.ts +1 -1
- package/src/lib/seam/connect/routes/acs-credential-pools.ts +1 -1
- package/src/lib/seam/connect/routes/acs-credential-provisioning-automations.ts +1 -1
- package/src/lib/seam/connect/routes/acs-credentials.ts +7 -11
- package/src/lib/seam/connect/routes/acs-entrances.ts +1 -1
- package/src/lib/seam/connect/routes/acs-systems.ts +1 -1
- package/src/lib/seam/connect/routes/acs-users.ts +1 -1
- package/src/lib/seam/connect/routes/action-attempts.ts +1 -1
- package/src/lib/seam/connect/routes/client-sessions.ts +3 -3
- package/src/lib/seam/connect/routes/connect-webviews.ts +1 -1
- package/src/lib/seam/connect/routes/connected-accounts.ts +1 -1
- package/src/lib/seam/connect/routes/devices-simulate.ts +1 -1
- package/src/lib/seam/connect/routes/devices-unmanaged.ts +1 -1
- package/src/lib/seam/connect/routes/devices.ts +1 -1
- package/src/lib/seam/connect/routes/events.ts +1 -1
- package/src/lib/seam/connect/routes/index.ts +2 -0
- package/src/lib/seam/connect/routes/locks.ts +1 -1
- package/src/lib/seam/connect/routes/networks.ts +1 -1
- package/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +1 -1
- package/src/lib/seam/connect/routes/noise-sensors-simulate.ts +176 -0
- package/src/lib/seam/connect/routes/noise-sensors.ts +5 -0
- package/src/lib/seam/connect/routes/phones-simulate.ts +1 -1
- package/src/lib/seam/connect/routes/phones.ts +1 -1
- package/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts +1 -1
- package/src/lib/seam/connect/routes/thermostats.ts +1 -1
- package/src/lib/seam/connect/routes/user-identities-enrollment-automations.ts +1 -1
- package/src/lib/seam/connect/routes/user-identities.ts +3 -6
- package/src/lib/seam/connect/routes/webhooks.ts +1 -1
- package/src/lib/seam/connect/routes/workspaces.ts +9 -4
- package/src/lib/types.ts +8 -0
- package/src/lib/version.ts +1 -1
|
@@ -0,0 +1,182 @@
|
|
|
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
|
+
|
|
8
|
+
import {
|
|
9
|
+
getAuthHeadersForClientSessionToken,
|
|
10
|
+
warnOnInsecureuserIdentifierKey,
|
|
11
|
+
} from 'lib/seam/connect/auth.js'
|
|
12
|
+
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
13
|
+
import {
|
|
14
|
+
isSeamHttpOptionsWithApiKey,
|
|
15
|
+
isSeamHttpOptionsWithClient,
|
|
16
|
+
isSeamHttpOptionsWithClientSessionToken,
|
|
17
|
+
isSeamHttpOptionsWithConsoleSessionToken,
|
|
18
|
+
isSeamHttpOptionsWithPersonalAccessToken,
|
|
19
|
+
type SeamHttpFromPublishableKeyOptions,
|
|
20
|
+
SeamHttpInvalidOptionsError,
|
|
21
|
+
type SeamHttpOptions,
|
|
22
|
+
type SeamHttpOptionsWithApiKey,
|
|
23
|
+
type SeamHttpOptionsWithClient,
|
|
24
|
+
type SeamHttpOptionsWithClientSessionToken,
|
|
25
|
+
type SeamHttpOptionsWithConsoleSessionToken,
|
|
26
|
+
type SeamHttpOptionsWithPersonalAccessToken,
|
|
27
|
+
type SeamHttpRequestOptions,
|
|
28
|
+
} from 'lib/seam/connect/options.js'
|
|
29
|
+
import {
|
|
30
|
+
limitToSeamHttpRequestOptions,
|
|
31
|
+
parseOptions,
|
|
32
|
+
} from 'lib/seam/connect/parse-options.js'
|
|
33
|
+
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
|
+
|
|
36
|
+
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
|
+
|
|
38
|
+
export class SeamHttpAccessCodesSimulate {
|
|
39
|
+
client: Client
|
|
40
|
+
readonly defaults: Required<SeamHttpRequestOptions>
|
|
41
|
+
|
|
42
|
+
constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
|
|
43
|
+
const options = parseOptions(apiKeyOrOptions)
|
|
44
|
+
this.client = 'client' in options ? options.client : createClient(options)
|
|
45
|
+
this.defaults = limitToSeamHttpRequestOptions(options)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static fromClient(
|
|
49
|
+
client: SeamHttpOptionsWithClient['client'],
|
|
50
|
+
options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
|
|
51
|
+
): SeamHttpAccessCodesSimulate {
|
|
52
|
+
const constructorOptions = { ...options, client }
|
|
53
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
54
|
+
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
55
|
+
}
|
|
56
|
+
return new SeamHttpAccessCodesSimulate(constructorOptions)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static fromApiKey(
|
|
60
|
+
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
61
|
+
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
62
|
+
): SeamHttpAccessCodesSimulate {
|
|
63
|
+
const constructorOptions = { ...options, apiKey }
|
|
64
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
65
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
66
|
+
}
|
|
67
|
+
return new SeamHttpAccessCodesSimulate(constructorOptions)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static fromClientSessionToken(
|
|
71
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
72
|
+
options: Omit<
|
|
73
|
+
SeamHttpOptionsWithClientSessionToken,
|
|
74
|
+
'clientSessionToken'
|
|
75
|
+
> = {},
|
|
76
|
+
): SeamHttpAccessCodesSimulate {
|
|
77
|
+
const constructorOptions = { ...options, clientSessionToken }
|
|
78
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
79
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
80
|
+
}
|
|
81
|
+
return new SeamHttpAccessCodesSimulate(constructorOptions)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
static async fromPublishableKey(
|
|
85
|
+
publishableKey: string,
|
|
86
|
+
userIdentifierKey: string,
|
|
87
|
+
options: SeamHttpFromPublishableKeyOptions = {},
|
|
88
|
+
): Promise<SeamHttpAccessCodesSimulate> {
|
|
89
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey)
|
|
90
|
+
const clientOptions = parseOptions({ ...options, publishableKey })
|
|
91
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
92
|
+
throw new SeamHttpInvalidOptionsError(
|
|
93
|
+
'The client option cannot be used with SeamHttp.fromPublishableKey',
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
const client = createClient(clientOptions)
|
|
97
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client)
|
|
98
|
+
const { token } = await clientSessions.getOrCreate({
|
|
99
|
+
user_identifier_key: userIdentifierKey,
|
|
100
|
+
})
|
|
101
|
+
return SeamHttpAccessCodesSimulate.fromClientSessionToken(token, options)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
static fromConsoleSessionToken(
|
|
105
|
+
consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
|
|
106
|
+
workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
|
|
107
|
+
options: Omit<
|
|
108
|
+
SeamHttpOptionsWithConsoleSessionToken,
|
|
109
|
+
'consoleSessionToken' | 'workspaceId'
|
|
110
|
+
> = {},
|
|
111
|
+
): SeamHttpAccessCodesSimulate {
|
|
112
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId }
|
|
113
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
114
|
+
throw new SeamHttpInvalidOptionsError(
|
|
115
|
+
'Missing consoleSessionToken or workspaceId',
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
return new SeamHttpAccessCodesSimulate(constructorOptions)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
static fromPersonalAccessToken(
|
|
122
|
+
personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
|
|
123
|
+
workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
|
|
124
|
+
options: Omit<
|
|
125
|
+
SeamHttpOptionsWithPersonalAccessToken,
|
|
126
|
+
'personalAccessToken' | 'workspaceId'
|
|
127
|
+
> = {},
|
|
128
|
+
): SeamHttpAccessCodesSimulate {
|
|
129
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId }
|
|
130
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
131
|
+
throw new SeamHttpInvalidOptionsError(
|
|
132
|
+
'Missing personalAccessToken or workspaceId',
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
return new SeamHttpAccessCodesSimulate(constructorOptions)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
async updateClientSessionToken(
|
|
139
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
140
|
+
): Promise<void> {
|
|
141
|
+
const { headers } = this.client.defaults
|
|
142
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
143
|
+
clientSessionToken,
|
|
144
|
+
})
|
|
145
|
+
for (const key of Object.keys(authHeaders)) {
|
|
146
|
+
if (headers[key] == null) {
|
|
147
|
+
throw new Error(
|
|
148
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
153
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
154
|
+
await clientSessions.get()
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
createUnmanagedAccessCode(
|
|
158
|
+
body?: AccessCodesSimulateCreateUnmanagedAccessCodeBody,
|
|
159
|
+
): SeamHttpRequest<
|
|
160
|
+
AccessCodesSimulateCreateUnmanagedAccessCodeResponse,
|
|
161
|
+
'access_code'
|
|
162
|
+
> {
|
|
163
|
+
return new SeamHttpRequest(this, {
|
|
164
|
+
path: '/access_codes/simulate/create_unmanaged_access_code',
|
|
165
|
+
method: 'post',
|
|
166
|
+
body,
|
|
167
|
+
responseKey: 'access_code',
|
|
168
|
+
})
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export type AccessCodesSimulateCreateUnmanagedAccessCodeBody =
|
|
173
|
+
RouteRequestBody<'/access_codes/simulate/create_unmanaged_access_code'>
|
|
174
|
+
|
|
175
|
+
export type AccessCodesSimulateCreateUnmanagedAccessCodeResponse =
|
|
176
|
+
SetNonNullable<
|
|
177
|
+
Required<
|
|
178
|
+
RouteResponse<'/access_codes/simulate/create_unmanaged_access_code'>
|
|
179
|
+
>
|
|
180
|
+
>
|
|
181
|
+
|
|
182
|
+
export type AccessCodesSimulateCreateUnmanagedAccessCodeOptions = never
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,7 +31,9 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
|
+
import { SeamHttpAccessCodesSimulate } from './access-codes-simulate.js'
|
|
36
37
|
import { SeamHttpAccessCodesUnmanaged } from './access-codes-unmanaged.js'
|
|
37
38
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
38
39
|
|
|
@@ -159,6 +160,10 @@ export class SeamHttpAccessCodes {
|
|
|
159
160
|
return SeamHttpAccessCodesUnmanaged.fromClient(this.client, this.defaults)
|
|
160
161
|
}
|
|
161
162
|
|
|
163
|
+
get simulate(): SeamHttpAccessCodesSimulate {
|
|
164
|
+
return SeamHttpAccessCodesSimulate.fromClient(this.client, this.defaults)
|
|
165
|
+
}
|
|
166
|
+
|
|
162
167
|
create(
|
|
163
168
|
body?: AccessCodesCreateBody,
|
|
164
169
|
): SeamHttpRequest<AccessCodesCreateResponse, 'access_code'> {
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -154,14 +154,12 @@ export class SeamHttpAcsCredentials {
|
|
|
154
154
|
await clientSessions.get()
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
assign(
|
|
158
|
-
body?: AcsCredentialsAssignBody,
|
|
159
|
-
): SeamHttpRequest<AcsCredentialsAssignResponse, 'acs_credential'> {
|
|
157
|
+
assign(body?: AcsCredentialsAssignBody): SeamHttpRequest<void, undefined> {
|
|
160
158
|
return new SeamHttpRequest(this, {
|
|
161
159
|
path: '/acs/credentials/assign',
|
|
162
160
|
method: 'post',
|
|
163
161
|
body,
|
|
164
|
-
responseKey:
|
|
162
|
+
responseKey: undefined,
|
|
165
163
|
})
|
|
166
164
|
}
|
|
167
165
|
|
|
@@ -209,23 +207,21 @@ export class SeamHttpAcsCredentials {
|
|
|
209
207
|
|
|
210
208
|
unassign(
|
|
211
209
|
body?: AcsCredentialsUnassignBody,
|
|
212
|
-
): SeamHttpRequest<
|
|
210
|
+
): SeamHttpRequest<void, undefined> {
|
|
213
211
|
return new SeamHttpRequest(this, {
|
|
214
212
|
path: '/acs/credentials/unassign',
|
|
215
213
|
method: 'post',
|
|
216
214
|
body,
|
|
217
|
-
responseKey:
|
|
215
|
+
responseKey: undefined,
|
|
218
216
|
})
|
|
219
217
|
}
|
|
220
218
|
|
|
221
|
-
update(
|
|
222
|
-
body?: AcsCredentialsUpdateBody,
|
|
223
|
-
): SeamHttpRequest<AcsCredentialsUpdateResponse, 'acs_credential'> {
|
|
219
|
+
update(body?: AcsCredentialsUpdateBody): SeamHttpRequest<void, undefined> {
|
|
224
220
|
return new SeamHttpRequest(this, {
|
|
225
221
|
path: '/acs/credentials/update',
|
|
226
222
|
method: 'post',
|
|
227
223
|
body,
|
|
228
|
-
responseKey:
|
|
224
|
+
responseKey: undefined,
|
|
229
225
|
})
|
|
230
226
|
}
|
|
231
227
|
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
export class SeamHttpClientSessions {
|
|
37
37
|
client: Client
|
|
@@ -196,12 +196,12 @@ export class SeamHttpClientSessions {
|
|
|
196
196
|
|
|
197
197
|
grantAccess(
|
|
198
198
|
body?: ClientSessionsGrantAccessBody,
|
|
199
|
-
): SeamHttpRequest<
|
|
199
|
+
): SeamHttpRequest<void, undefined> {
|
|
200
200
|
return new SeamHttpRequest(this, {
|
|
201
201
|
path: '/client_sessions/grant_access',
|
|
202
202
|
method: 'post',
|
|
203
203
|
body,
|
|
204
|
-
responseKey:
|
|
204
|
+
responseKey: undefined,
|
|
205
205
|
})
|
|
206
206
|
}
|
|
207
207
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
import { SeamHttpDevicesSimulate } from './devices-simulate.js'
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './access-codes.js'
|
|
2
|
+
export * from './access-codes-simulate.js'
|
|
2
3
|
export * from './access-codes-unmanaged.js'
|
|
3
4
|
export * from './acs.js'
|
|
4
5
|
export * from './acs-access-groups.js'
|
|
@@ -20,6 +21,7 @@ export * from './locks.js'
|
|
|
20
21
|
export * from './networks.js'
|
|
21
22
|
export * from './noise-sensors.js'
|
|
22
23
|
export * from './noise-sensors-noise-thresholds.js'
|
|
24
|
+
export * from './noise-sensors-simulate.js'
|
|
23
25
|
export * from './phones.js'
|
|
24
26
|
export * from './phones-simulate.js'
|
|
25
27
|
export * from './thermostats.js'
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
-
import type { SetNonNullable } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
import {
|
|
10
9
|
getAuthHeadersForClientSessionToken,
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
parseOptions,
|
|
33
32
|
} from 'lib/seam/connect/parse-options.js'
|
|
34
33
|
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpClientSessions } from './client-sessions.js'
|
|
37
37
|
|