@seamapi/http 0.16.2 → 0.17.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 +8 -0
- package/dist/connect.cjs +478 -0
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +38 -1
- package/lib/seam/connect/auth.d.ts +2 -0
- package/lib/seam/connect/auth.js +1 -1
- package/lib/seam/connect/auth.js.map +1 -1
- package/lib/seam/connect/routes/access-codes-unmanaged.d.ts +1 -0
- package/lib/seam/connect/routes/access-codes-unmanaged.js +15 -1
- package/lib/seam/connect/routes/access-codes-unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/access-codes.d.ts +1 -0
- package/lib/seam/connect/routes/access-codes.js +15 -1
- package/lib/seam/connect/routes/access-codes.js.map +1 -1
- package/lib/seam/connect/routes/acs-access-groups.d.ts +1 -0
- package/lib/seam/connect/routes/acs-access-groups.js +15 -1
- package/lib/seam/connect/routes/acs-access-groups.js.map +1 -1
- package/lib/seam/connect/routes/acs-credential-pools.d.ts +1 -0
- package/lib/seam/connect/routes/acs-credential-pools.js +15 -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 -0
- package/lib/seam/connect/routes/acs-credential-provisioning-automations.js +15 -1
- package/lib/seam/connect/routes/acs-credential-provisioning-automations.js.map +1 -1
- package/lib/seam/connect/routes/acs-credentials.d.ts +1 -0
- package/lib/seam/connect/routes/acs-credentials.js +15 -1
- package/lib/seam/connect/routes/acs-credentials.js.map +1 -1
- package/lib/seam/connect/routes/acs-entrances.d.ts +1 -0
- package/lib/seam/connect/routes/acs-entrances.js +15 -1
- package/lib/seam/connect/routes/acs-entrances.js.map +1 -1
- package/lib/seam/connect/routes/acs-systems.d.ts +1 -0
- package/lib/seam/connect/routes/acs-systems.js +15 -1
- package/lib/seam/connect/routes/acs-systems.js.map +1 -1
- package/lib/seam/connect/routes/acs-users.d.ts +5 -0
- package/lib/seam/connect/routes/acs-users.js +22 -1
- package/lib/seam/connect/routes/acs-users.js.map +1 -1
- package/lib/seam/connect/routes/acs.d.ts +1 -0
- package/lib/seam/connect/routes/acs.js +15 -1
- package/lib/seam/connect/routes/acs.js.map +1 -1
- package/lib/seam/connect/routes/action-attempts.d.ts +1 -0
- package/lib/seam/connect/routes/action-attempts.js +15 -1
- package/lib/seam/connect/routes/action-attempts.js.map +1 -1
- package/lib/seam/connect/routes/client-sessions.d.ts +1 -0
- package/lib/seam/connect/routes/client-sessions.js +15 -1
- package/lib/seam/connect/routes/client-sessions.js.map +1 -1
- package/lib/seam/connect/routes/connect-webviews.d.ts +1 -0
- package/lib/seam/connect/routes/connect-webviews.js +15 -1
- package/lib/seam/connect/routes/connect-webviews.js.map +1 -1
- package/lib/seam/connect/routes/connected-accounts.d.ts +1 -0
- package/lib/seam/connect/routes/connected-accounts.js +15 -1
- package/lib/seam/connect/routes/connected-accounts.js.map +1 -1
- package/lib/seam/connect/routes/devices-unmanaged.d.ts +1 -0
- package/lib/seam/connect/routes/devices-unmanaged.js +15 -1
- package/lib/seam/connect/routes/devices-unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/devices.d.ts +1 -0
- package/lib/seam/connect/routes/devices.js +15 -1
- package/lib/seam/connect/routes/devices.js.map +1 -1
- package/lib/seam/connect/routes/events.d.ts +1 -0
- package/lib/seam/connect/routes/events.js +15 -1
- package/lib/seam/connect/routes/events.js.map +1 -1
- package/lib/seam/connect/routes/locks.d.ts +1 -0
- package/lib/seam/connect/routes/locks.js +15 -1
- package/lib/seam/connect/routes/locks.js.map +1 -1
- package/lib/seam/connect/routes/networks.d.ts +1 -0
- package/lib/seam/connect/routes/networks.js +15 -1
- package/lib/seam/connect/routes/networks.js.map +1 -1
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.d.ts +1 -0
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js +15 -1
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js.map +1 -1
- package/lib/seam/connect/routes/noise-sensors.d.ts +1 -0
- package/lib/seam/connect/routes/noise-sensors.js +15 -1
- package/lib/seam/connect/routes/noise-sensors.js.map +1 -1
- package/lib/seam/connect/routes/phones.d.ts +1 -0
- package/lib/seam/connect/routes/phones.js +15 -1
- package/lib/seam/connect/routes/phones.js.map +1 -1
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.d.ts +1 -0
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js +15 -1
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js.map +1 -1
- package/lib/seam/connect/routes/thermostats.d.ts +1 -0
- package/lib/seam/connect/routes/thermostats.js +15 -1
- package/lib/seam/connect/routes/thermostats.js.map +1 -1
- package/lib/seam/connect/routes/user-identities-enrollment-automations.d.ts +1 -0
- package/lib/seam/connect/routes/user-identities-enrollment-automations.js +15 -1
- package/lib/seam/connect/routes/user-identities-enrollment-automations.js.map +1 -1
- package/lib/seam/connect/routes/user-identities.d.ts +1 -0
- package/lib/seam/connect/routes/user-identities.js +15 -1
- package/lib/seam/connect/routes/user-identities.js.map +1 -1
- package/lib/seam/connect/routes/webhooks.d.ts +5 -0
- package/lib/seam/connect/routes/webhooks.js +22 -1
- package/lib/seam/connect/routes/webhooks.js.map +1 -1
- package/lib/seam/connect/routes/workspaces.d.ts +1 -0
- package/lib/seam/connect/routes/workspaces.js +15 -1
- package/lib/seam/connect/routes/workspaces.js.map +1 -1
- package/lib/seam/connect/seam-http.d.ts +1 -0
- package/lib/seam/connect/seam-http.js +15 -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/auth.ts +1 -1
- package/src/lib/seam/connect/routes/access-codes-unmanaged.ts +23 -1
- package/src/lib/seam/connect/routes/access-codes.ts +23 -1
- package/src/lib/seam/connect/routes/acs-access-groups.ts +23 -1
- package/src/lib/seam/connect/routes/acs-credential-pools.ts +23 -1
- package/src/lib/seam/connect/routes/acs-credential-provisioning-automations.ts +23 -1
- package/src/lib/seam/connect/routes/acs-credentials.ts +23 -1
- package/src/lib/seam/connect/routes/acs-entrances.ts +23 -1
- package/src/lib/seam/connect/routes/acs-systems.ts +23 -1
- package/src/lib/seam/connect/routes/acs-users.ts +42 -1
- package/src/lib/seam/connect/routes/acs.ts +23 -1
- package/src/lib/seam/connect/routes/action-attempts.ts +23 -1
- package/src/lib/seam/connect/routes/client-sessions.ts +23 -1
- package/src/lib/seam/connect/routes/connect-webviews.ts +23 -1
- package/src/lib/seam/connect/routes/connected-accounts.ts +23 -1
- package/src/lib/seam/connect/routes/devices-unmanaged.ts +23 -1
- package/src/lib/seam/connect/routes/devices.ts +23 -1
- package/src/lib/seam/connect/routes/events.ts +23 -1
- package/src/lib/seam/connect/routes/locks.ts +23 -1
- package/src/lib/seam/connect/routes/networks.ts +23 -1
- package/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +23 -1
- package/src/lib/seam/connect/routes/noise-sensors.ts +23 -1
- package/src/lib/seam/connect/routes/phones.ts +23 -1
- package/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts +23 -1
- package/src/lib/seam/connect/routes/thermostats.ts +23 -1
- package/src/lib/seam/connect/routes/user-identities-enrollment-automations.ts +23 -1
- package/src/lib/seam/connect/routes/user-identities.ts +23 -1
- package/src/lib/seam/connect/routes/webhooks.ts +39 -1
- package/src/lib/seam/connect/routes/workspaces.ts +23 -1
- package/src/lib/seam/connect/seam-http.ts +23 -1
- package/src/lib/version.ts +1 -1
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
7
|
import type { SetNonNullable } from 'type-fest'
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getAuthHeadersForClientSessionToken,
|
|
11
|
+
warnOnInsecureuserIdentifierKey,
|
|
12
|
+
} from 'lib/seam/connect/auth.js'
|
|
10
13
|
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
11
14
|
import {
|
|
12
15
|
isSeamHttpOptionsWithApiKey,
|
|
@@ -133,6 +136,25 @@ export class SeamHttpLocks {
|
|
|
133
136
|
return new SeamHttpLocks(constructorOptions)
|
|
134
137
|
}
|
|
135
138
|
|
|
139
|
+
async updateClientSessionToken(
|
|
140
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
141
|
+
): Promise<void> {
|
|
142
|
+
const { headers } = this.client.defaults
|
|
143
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
144
|
+
clientSessionToken,
|
|
145
|
+
})
|
|
146
|
+
for (const key of Object.keys(authHeaders)) {
|
|
147
|
+
if (headers[key] == null) {
|
|
148
|
+
throw new Error(
|
|
149
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
154
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
155
|
+
await clientSessions.get()
|
|
156
|
+
}
|
|
157
|
+
|
|
136
158
|
async get(body?: LocksGetParams): Promise<LocksGetResponse['device']> {
|
|
137
159
|
const { data } = await this.client.request<LocksGetResponse>({
|
|
138
160
|
url: '/locks/get',
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
7
|
import type { SetNonNullable } from 'type-fest'
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getAuthHeadersForClientSessionToken,
|
|
11
|
+
warnOnInsecureuserIdentifierKey,
|
|
12
|
+
} from 'lib/seam/connect/auth.js'
|
|
10
13
|
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
11
14
|
import {
|
|
12
15
|
isSeamHttpOptionsWithApiKey,
|
|
@@ -131,6 +134,25 @@ export class SeamHttpNetworks {
|
|
|
131
134
|
return new SeamHttpNetworks(constructorOptions)
|
|
132
135
|
}
|
|
133
136
|
|
|
137
|
+
async updateClientSessionToken(
|
|
138
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
139
|
+
): Promise<void> {
|
|
140
|
+
const { headers } = this.client.defaults
|
|
141
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
142
|
+
clientSessionToken,
|
|
143
|
+
})
|
|
144
|
+
for (const key of Object.keys(authHeaders)) {
|
|
145
|
+
if (headers[key] == null) {
|
|
146
|
+
throw new Error(
|
|
147
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
152
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
153
|
+
await clientSessions.get()
|
|
154
|
+
}
|
|
155
|
+
|
|
134
156
|
async get(body?: NetworksGetParams): Promise<NetworksGetResponse['network']> {
|
|
135
157
|
const { data } = await this.client.request<NetworksGetResponse>({
|
|
136
158
|
url: '/networks/get',
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
7
|
import type { SetNonNullable } from 'type-fest'
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getAuthHeadersForClientSessionToken,
|
|
11
|
+
warnOnInsecureuserIdentifierKey,
|
|
12
|
+
} from 'lib/seam/connect/auth.js'
|
|
10
13
|
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
11
14
|
import {
|
|
12
15
|
isSeamHttpOptionsWithApiKey,
|
|
@@ -134,6 +137,25 @@ export class SeamHttpNoiseSensorsNoiseThresholds {
|
|
|
134
137
|
return new SeamHttpNoiseSensorsNoiseThresholds(constructorOptions)
|
|
135
138
|
}
|
|
136
139
|
|
|
140
|
+
async updateClientSessionToken(
|
|
141
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
142
|
+
): Promise<void> {
|
|
143
|
+
const { headers } = this.client.defaults
|
|
144
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
145
|
+
clientSessionToken,
|
|
146
|
+
})
|
|
147
|
+
for (const key of Object.keys(authHeaders)) {
|
|
148
|
+
if (headers[key] == null) {
|
|
149
|
+
throw new Error(
|
|
150
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
155
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
156
|
+
await clientSessions.get()
|
|
157
|
+
}
|
|
158
|
+
|
|
137
159
|
async create(
|
|
138
160
|
body?: NoiseSensorsNoiseThresholdsCreateBody,
|
|
139
161
|
): Promise<NoiseSensorsNoiseThresholdsCreateResponse['noise_threshold']> {
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
* Do not edit this file or add other files to this directory.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
getAuthHeadersForClientSessionToken,
|
|
8
|
+
warnOnInsecureuserIdentifierKey,
|
|
9
|
+
} from 'lib/seam/connect/auth.js'
|
|
7
10
|
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
8
11
|
import {
|
|
9
12
|
isSeamHttpOptionsWithApiKey,
|
|
@@ -129,6 +132,25 @@ export class SeamHttpNoiseSensors {
|
|
|
129
132
|
return new SeamHttpNoiseSensors(constructorOptions)
|
|
130
133
|
}
|
|
131
134
|
|
|
135
|
+
async updateClientSessionToken(
|
|
136
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
137
|
+
): Promise<void> {
|
|
138
|
+
const { headers } = this.client.defaults
|
|
139
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
140
|
+
clientSessionToken,
|
|
141
|
+
})
|
|
142
|
+
for (const key of Object.keys(authHeaders)) {
|
|
143
|
+
if (headers[key] == null) {
|
|
144
|
+
throw new Error(
|
|
145
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
150
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
151
|
+
await clientSessions.get()
|
|
152
|
+
}
|
|
153
|
+
|
|
132
154
|
get noiseThresholds(): SeamHttpNoiseSensorsNoiseThresholds {
|
|
133
155
|
return SeamHttpNoiseSensorsNoiseThresholds.fromClient(
|
|
134
156
|
this.client,
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
7
|
import type { SetNonNullable } from 'type-fest'
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getAuthHeadersForClientSessionToken,
|
|
11
|
+
warnOnInsecureuserIdentifierKey,
|
|
12
|
+
} from 'lib/seam/connect/auth.js'
|
|
10
13
|
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
11
14
|
import {
|
|
12
15
|
isSeamHttpOptionsWithApiKey,
|
|
@@ -131,6 +134,25 @@ export class SeamHttpPhones {
|
|
|
131
134
|
return new SeamHttpPhones(constructorOptions)
|
|
132
135
|
}
|
|
133
136
|
|
|
137
|
+
async updateClientSessionToken(
|
|
138
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
139
|
+
): Promise<void> {
|
|
140
|
+
const { headers } = this.client.defaults
|
|
141
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
142
|
+
clientSessionToken,
|
|
143
|
+
})
|
|
144
|
+
for (const key of Object.keys(authHeaders)) {
|
|
145
|
+
if (headers[key] == null) {
|
|
146
|
+
throw new Error(
|
|
147
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
152
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
153
|
+
await clientSessions.get()
|
|
154
|
+
}
|
|
155
|
+
|
|
134
156
|
async list(body?: PhonesListParams): Promise<PhonesListResponse['phones']> {
|
|
135
157
|
const { data } = await this.client.request<PhonesListResponse>({
|
|
136
158
|
url: '/phones/list',
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
7
|
import type { SetNonNullable } from 'type-fest'
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getAuthHeadersForClientSessionToken,
|
|
11
|
+
warnOnInsecureuserIdentifierKey,
|
|
12
|
+
} from 'lib/seam/connect/auth.js'
|
|
10
13
|
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
11
14
|
import {
|
|
12
15
|
isSeamHttpOptionsWithApiKey,
|
|
@@ -134,6 +137,25 @@ export class SeamHttpThermostatsClimateSettingSchedules {
|
|
|
134
137
|
return new SeamHttpThermostatsClimateSettingSchedules(constructorOptions)
|
|
135
138
|
}
|
|
136
139
|
|
|
140
|
+
async updateClientSessionToken(
|
|
141
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
142
|
+
): Promise<void> {
|
|
143
|
+
const { headers } = this.client.defaults
|
|
144
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
145
|
+
clientSessionToken,
|
|
146
|
+
})
|
|
147
|
+
for (const key of Object.keys(authHeaders)) {
|
|
148
|
+
if (headers[key] == null) {
|
|
149
|
+
throw new Error(
|
|
150
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
155
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
156
|
+
await clientSessions.get()
|
|
157
|
+
}
|
|
158
|
+
|
|
137
159
|
async create(
|
|
138
160
|
body?: ThermostatsClimateSettingSchedulesCreateBody,
|
|
139
161
|
): Promise<
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
7
|
import type { SetNonNullable } from 'type-fest'
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getAuthHeadersForClientSessionToken,
|
|
11
|
+
warnOnInsecureuserIdentifierKey,
|
|
12
|
+
} from 'lib/seam/connect/auth.js'
|
|
10
13
|
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
11
14
|
import {
|
|
12
15
|
isSeamHttpOptionsWithApiKey,
|
|
@@ -132,6 +135,25 @@ export class SeamHttpThermostats {
|
|
|
132
135
|
return new SeamHttpThermostats(constructorOptions)
|
|
133
136
|
}
|
|
134
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
|
+
|
|
135
157
|
get climateSettingSchedules(): SeamHttpThermostatsClimateSettingSchedules {
|
|
136
158
|
return SeamHttpThermostatsClimateSettingSchedules.fromClient(
|
|
137
159
|
this.client,
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
7
|
import type { SetNonNullable } from 'type-fest'
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getAuthHeadersForClientSessionToken,
|
|
11
|
+
warnOnInsecureuserIdentifierKey,
|
|
12
|
+
} from 'lib/seam/connect/auth.js'
|
|
10
13
|
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
11
14
|
import {
|
|
12
15
|
isSeamHttpOptionsWithApiKey,
|
|
@@ -134,6 +137,25 @@ export class SeamHttpUserIdentitiesEnrollmentAutomations {
|
|
|
134
137
|
return new SeamHttpUserIdentitiesEnrollmentAutomations(constructorOptions)
|
|
135
138
|
}
|
|
136
139
|
|
|
140
|
+
async updateClientSessionToken(
|
|
141
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
142
|
+
): Promise<void> {
|
|
143
|
+
const { headers } = this.client.defaults
|
|
144
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
145
|
+
clientSessionToken,
|
|
146
|
+
})
|
|
147
|
+
for (const key of Object.keys(authHeaders)) {
|
|
148
|
+
if (headers[key] == null) {
|
|
149
|
+
throw new Error(
|
|
150
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
155
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
156
|
+
await clientSessions.get()
|
|
157
|
+
}
|
|
158
|
+
|
|
137
159
|
async get(
|
|
138
160
|
body?: UserIdentitiesEnrollmentAutomationsGetParams,
|
|
139
161
|
): Promise<
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
7
|
import type { SetNonNullable } from 'type-fest'
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getAuthHeadersForClientSessionToken,
|
|
11
|
+
warnOnInsecureuserIdentifierKey,
|
|
12
|
+
} from 'lib/seam/connect/auth.js'
|
|
10
13
|
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
11
14
|
import {
|
|
12
15
|
isSeamHttpOptionsWithApiKey,
|
|
@@ -132,6 +135,25 @@ export class SeamHttpUserIdentities {
|
|
|
132
135
|
return new SeamHttpUserIdentities(constructorOptions)
|
|
133
136
|
}
|
|
134
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
|
+
|
|
135
157
|
get enrollmentAutomations(): SeamHttpUserIdentitiesEnrollmentAutomations {
|
|
136
158
|
return SeamHttpUserIdentitiesEnrollmentAutomations.fromClient(
|
|
137
159
|
this.client,
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
7
|
import type { SetNonNullable } from 'type-fest'
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getAuthHeadersForClientSessionToken,
|
|
11
|
+
warnOnInsecureuserIdentifierKey,
|
|
12
|
+
} from 'lib/seam/connect/auth.js'
|
|
10
13
|
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
11
14
|
import {
|
|
12
15
|
isSeamHttpOptionsWithApiKey,
|
|
@@ -131,6 +134,25 @@ export class SeamHttpWebhooks {
|
|
|
131
134
|
return new SeamHttpWebhooks(constructorOptions)
|
|
132
135
|
}
|
|
133
136
|
|
|
137
|
+
async updateClientSessionToken(
|
|
138
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
139
|
+
): Promise<void> {
|
|
140
|
+
const { headers } = this.client.defaults
|
|
141
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
142
|
+
clientSessionToken,
|
|
143
|
+
})
|
|
144
|
+
for (const key of Object.keys(authHeaders)) {
|
|
145
|
+
if (headers[key] == null) {
|
|
146
|
+
throw new Error(
|
|
147
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
152
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
153
|
+
await clientSessions.get()
|
|
154
|
+
}
|
|
155
|
+
|
|
134
156
|
async create(
|
|
135
157
|
body?: WebhooksCreateBody,
|
|
136
158
|
): Promise<WebhooksCreateResponse['webhook']> {
|
|
@@ -172,6 +194,14 @@ export class SeamHttpWebhooks {
|
|
|
172
194
|
|
|
173
195
|
return data.webhooks
|
|
174
196
|
}
|
|
197
|
+
|
|
198
|
+
async update(body?: WebhooksUpdateBody): Promise<void> {
|
|
199
|
+
await this.client.request<WebhooksUpdateResponse>({
|
|
200
|
+
url: '/webhooks/update',
|
|
201
|
+
method: 'post',
|
|
202
|
+
data: body,
|
|
203
|
+
})
|
|
204
|
+
}
|
|
175
205
|
}
|
|
176
206
|
|
|
177
207
|
export type WebhooksCreateBody = RouteRequestBody<'/webhooks/create'>
|
|
@@ -205,3 +235,11 @@ export type WebhooksListResponse = SetNonNullable<
|
|
|
205
235
|
>
|
|
206
236
|
|
|
207
237
|
export type WebhooksListOptions = never
|
|
238
|
+
|
|
239
|
+
export type WebhooksUpdateBody = RouteRequestBody<'/webhooks/update'>
|
|
240
|
+
|
|
241
|
+
export type WebhooksUpdateResponse = SetNonNullable<
|
|
242
|
+
Required<RouteResponse<'/webhooks/update'>>
|
|
243
|
+
>
|
|
244
|
+
|
|
245
|
+
export type WebhooksUpdateOptions = never
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
7
|
import type { SetNonNullable } from 'type-fest'
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getAuthHeadersForClientSessionToken,
|
|
11
|
+
warnOnInsecureuserIdentifierKey,
|
|
12
|
+
} from 'lib/seam/connect/auth.js'
|
|
10
13
|
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
11
14
|
import {
|
|
12
15
|
isSeamHttpOptionsWithApiKey,
|
|
@@ -131,6 +134,25 @@ export class SeamHttpWorkspaces {
|
|
|
131
134
|
return new SeamHttpWorkspaces(constructorOptions)
|
|
132
135
|
}
|
|
133
136
|
|
|
137
|
+
async updateClientSessionToken(
|
|
138
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
139
|
+
): Promise<void> {
|
|
140
|
+
const { headers } = this.client.defaults
|
|
141
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
142
|
+
clientSessionToken,
|
|
143
|
+
})
|
|
144
|
+
for (const key of Object.keys(authHeaders)) {
|
|
145
|
+
if (headers[key] == null) {
|
|
146
|
+
throw new Error(
|
|
147
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
152
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
153
|
+
await clientSessions.get()
|
|
154
|
+
}
|
|
155
|
+
|
|
134
156
|
async create(
|
|
135
157
|
body?: WorkspacesCreateBody,
|
|
136
158
|
): Promise<WorkspacesCreateResponse['workspace']> {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getAuthHeadersForClientSessionToken,
|
|
3
|
+
warnOnInsecureuserIdentifierKey,
|
|
4
|
+
} from './auth.js'
|
|
2
5
|
import { type Client, createClient } from './client.js'
|
|
3
6
|
import {
|
|
4
7
|
isSeamHttpOptionsWithApiKey,
|
|
@@ -136,6 +139,25 @@ export class SeamHttp {
|
|
|
136
139
|
return new SeamHttp(constructorOptions)
|
|
137
140
|
}
|
|
138
141
|
|
|
142
|
+
async updateClientSessionToken(
|
|
143
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
144
|
+
): Promise<void> {
|
|
145
|
+
const { headers } = this.client.defaults
|
|
146
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
147
|
+
clientSessionToken,
|
|
148
|
+
})
|
|
149
|
+
for (const key of Object.keys(authHeaders)) {
|
|
150
|
+
if (headers[key] == null) {
|
|
151
|
+
throw new Error(
|
|
152
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
157
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
158
|
+
await clientSessions.get()
|
|
159
|
+
}
|
|
160
|
+
|
|
139
161
|
get accessCodes(): SeamHttpAccessCodes {
|
|
140
162
|
return SeamHttpAccessCodes.fromClient(this.client, this.defaults)
|
|
141
163
|
}
|
package/src/lib/version.ts
CHANGED