@seamapi/http 0.16.1 → 0.17.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 -0
- package/dist/connect.cjs +464 -0
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +29 -0
- 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 +1 -0
- package/lib/seam/connect/routes/acs-users.js +15 -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 +1 -0
- package/lib/seam/connect/routes/webhooks.js +15 -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 +2 -2
- 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 +23 -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 +23 -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,
|
|
@@ -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']> {
|
|
@@ -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