@seamapi/http 2.4.3 → 2.5.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/lib/request-parameters.d.ts +1 -1
- package/lib/request-parameters.js +7 -2
- package/lib/request-parameters.js.map +1 -1
- package/lib/routes/access-codes/access-codes.d.ts +1 -1
- package/lib/routes/access-codes/access-codes.js +30 -11
- package/lib/routes/access-codes/access-codes.js.map +1 -1
- package/lib/routes/access-codes/simulate/simulate.js +3 -2
- package/lib/routes/access-codes/simulate/simulate.js.map +1 -1
- package/lib/routes/access-codes/unmanaged/unmanaged.d.ts +1 -1
- package/lib/routes/access-codes/unmanaged/unmanaged.js +15 -6
- package/lib/routes/access-codes/unmanaged/unmanaged.js.map +1 -1
- package/lib/routes/access-grants/access-grants.d.ts +1 -1
- package/lib/routes/access-grants/access-grants.js +21 -8
- package/lib/routes/access-grants/access-grants.js.map +1 -1
- package/lib/routes/access-grants/unmanaged/unmanaged.js +9 -4
- package/lib/routes/access-grants/unmanaged/unmanaged.js.map +1 -1
- package/lib/routes/access-methods/access-methods.d.ts +1 -1
- package/lib/routes/access-methods/access-methods.js +21 -8
- package/lib/routes/access-methods/access-methods.js.map +1 -1
- package/lib/routes/access-methods/unmanaged/unmanaged.js +6 -3
- package/lib/routes/access-methods/unmanaged/unmanaged.js.map +1 -1
- package/lib/routes/acs/access-groups/access-groups.js +21 -8
- package/lib/routes/acs/access-groups/access-groups.js.map +1 -1
- package/lib/routes/acs/credentials/credentials.js +24 -9
- package/lib/routes/acs/credentials/credentials.js.map +1 -1
- package/lib/routes/acs/encoders/encoders.js +15 -6
- package/lib/routes/acs/encoders/encoders.js.map +1 -1
- package/lib/routes/acs/encoders/simulate/simulate.js +12 -5
- package/lib/routes/acs/encoders/simulate/simulate.js.map +1 -1
- package/lib/routes/acs/entrances/entrances.js +15 -6
- package/lib/routes/acs/entrances/entrances.js.map +1 -1
- package/lib/routes/acs/systems/systems.js +12 -5
- package/lib/routes/acs/systems/systems.js.map +1 -1
- package/lib/routes/acs/users/users.d.ts +1 -1
- package/lib/routes/acs/users/users.js +33 -12
- package/lib/routes/acs/users/users.js.map +1 -1
- package/lib/routes/action-attempts/action-attempts.js +6 -3
- package/lib/routes/action-attempts/action-attempts.js.map +1 -1
- package/lib/routes/client-sessions/client-sessions.d.ts +1 -1
- package/lib/routes/client-sessions/client-sessions.js +21 -8
- package/lib/routes/client-sessions/client-sessions.js.map +1 -1
- package/lib/routes/connect-webviews/connect-webviews.js +12 -5
- package/lib/routes/connect-webviews/connect-webviews.js.map +1 -1
- package/lib/routes/connected-accounts/connected-accounts.d.ts +1 -1
- package/lib/routes/connected-accounts/connected-accounts.js +15 -6
- package/lib/routes/connected-accounts/connected-accounts.js.map +1 -1
- package/lib/routes/connected-accounts/simulate/simulate.js +3 -2
- package/lib/routes/connected-accounts/simulate/simulate.js.map +1 -1
- package/lib/routes/customers/customers.js +9 -4
- package/lib/routes/customers/customers.js.map +1 -1
- package/lib/routes/devices/devices.d.ts +1 -1
- package/lib/routes/devices/devices.js +15 -6
- package/lib/routes/devices/devices.js.map +1 -1
- package/lib/routes/devices/simulate/simulate.js +18 -7
- package/lib/routes/devices/simulate/simulate.js.map +1 -1
- package/lib/routes/devices/unmanaged/unmanaged.d.ts +1 -1
- package/lib/routes/devices/unmanaged/unmanaged.js +9 -4
- package/lib/routes/devices/unmanaged/unmanaged.js.map +1 -1
- package/lib/routes/events/events.d.ts +1 -1
- package/lib/routes/events/events.js +6 -3
- package/lib/routes/events/events.js.map +1 -1
- package/lib/routes/instant-keys/instant-keys.d.ts +1 -1
- package/lib/routes/instant-keys/instant-keys.js +9 -4
- package/lib/routes/instant-keys/instant-keys.js.map +1 -1
- package/lib/routes/locks/locks.d.ts +1 -1
- package/lib/routes/locks/locks.js +15 -6
- package/lib/routes/locks/locks.js.map +1 -1
- package/lib/routes/locks/simulate/simulate.js +6 -3
- package/lib/routes/locks/simulate/simulate.js.map +1 -1
- package/lib/routes/noise-sensors/noise-sensors.js +3 -2
- package/lib/routes/noise-sensors/noise-sensors.js.map +1 -1
- package/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.js +15 -6
- package/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.js.map +1 -1
- package/lib/routes/noise-sensors/simulate/simulate.js +3 -2
- package/lib/routes/noise-sensors/simulate/simulate.js.map +1 -1
- package/lib/routes/phones/phones.js +9 -4
- package/lib/routes/phones/phones.js.map +1 -1
- package/lib/routes/phones/simulate/simulate.js +3 -2
- package/lib/routes/phones/simulate/simulate.js.map +1 -1
- package/lib/routes/spaces/spaces.d.ts +1 -1
- package/lib/routes/spaces/spaces.js +36 -13
- package/lib/routes/spaces/spaces.js.map +1 -1
- package/lib/routes/thermostats/daily-programs/daily-programs.js +13 -4
- package/lib/routes/thermostats/daily-programs/daily-programs.js.map +1 -1
- package/lib/routes/thermostats/schedules/schedules.js +20 -6
- package/lib/routes/thermostats/schedules/schedules.js.map +1 -1
- package/lib/routes/thermostats/simulate/simulate.js +6 -3
- package/lib/routes/thermostats/simulate/simulate.js.map +1 -1
- package/lib/routes/thermostats/thermostats.js +42 -15
- package/lib/routes/thermostats/thermostats.js.map +1 -1
- package/lib/routes/user-identities/unmanaged/unmanaged.js +9 -4
- package/lib/routes/user-identities/unmanaged/unmanaged.js.map +1 -1
- package/lib/routes/user-identities/user-identities.d.ts +1 -1
- package/lib/routes/user-identities/user-identities.js +42 -15
- package/lib/routes/user-identities/user-identities.js.map +1 -1
- package/lib/routes/webhooks/webhooks.js +15 -6
- package/lib/routes/webhooks/webhooks.js.map +1 -1
- package/lib/routes/workspaces/workspaces.js +15 -6
- package/lib/routes/workspaces/workspaces.js.map +1 -1
- package/lib/seam-http-request.d.ts +3 -0
- package/lib/seam-http-request.js +2 -0
- package/lib/seam-http-request.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/lib/request-parameters.ts +12 -1
- package/src/lib/routes/access-codes/access-codes.ts +31 -44
- package/src/lib/routes/access-codes/simulate/simulate.ts +3 -7
- package/src/lib/routes/access-codes/unmanaged/unmanaged.ts +16 -34
- package/src/lib/routes/access-grants/access-grants.ts +22 -22
- package/src/lib/routes/access-grants/unmanaged/unmanaged.ts +9 -19
- package/src/lib/routes/access-methods/access-methods.ts +22 -30
- package/src/lib/routes/access-methods/unmanaged/unmanaged.ts +6 -13
- package/src/lib/routes/acs/access-groups/access-groups.ts +21 -31
- package/src/lib/routes/acs/credentials/credentials.ts +24 -21
- package/src/lib/routes/acs/encoders/encoders.ts +15 -23
- package/src/lib/routes/acs/encoders/simulate/simulate.ts +12 -25
- package/src/lib/routes/acs/entrances/entrances.ts +15 -19
- package/src/lib/routes/acs/systems/systems.ts +12 -17
- package/src/lib/routes/acs/users/users.ts +34 -42
- package/src/lib/routes/action-attempts/action-attempts.ts +6 -5
- package/src/lib/routes/client-sessions/client-sessions.ts +22 -26
- package/src/lib/routes/connect-webviews/connect-webviews.ts +12 -9
- package/src/lib/routes/connected-accounts/connected-accounts.ts +16 -14
- package/src/lib/routes/connected-accounts/simulate/simulate.ts +3 -7
- package/src/lib/routes/customers/customers.ts +9 -7
- package/src/lib/routes/devices/devices.ts +16 -22
- package/src/lib/routes/devices/simulate/simulate.ts +18 -29
- package/src/lib/routes/devices/unmanaged/unmanaged.ts +10 -10
- package/src/lib/routes/events/events.ts +7 -8
- package/src/lib/routes/instant-keys/instant-keys.ts +10 -10
- package/src/lib/routes/locks/locks.ts +16 -14
- package/src/lib/routes/locks/simulate/simulate.ts +6 -13
- package/src/lib/routes/noise-sensors/noise-sensors.ts +3 -3
- package/src/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.ts +15 -31
- package/src/lib/routes/noise-sensors/simulate/simulate.ts +3 -7
- package/src/lib/routes/phones/phones.ts +9 -7
- package/src/lib/routes/phones/simulate/simulate.ts +3 -7
- package/src/lib/routes/spaces/spaces.ts +37 -40
- package/src/lib/routes/thermostats/daily-programs/daily-programs.ts +13 -19
- package/src/lib/routes/thermostats/schedules/schedules.ts +20 -27
- package/src/lib/routes/thermostats/simulate/simulate.ts +6 -13
- package/src/lib/routes/thermostats/thermostats.ts +42 -57
- package/src/lib/routes/user-identities/unmanaged/unmanaged.ts +9 -19
- package/src/lib/routes/user-identities/user-identities.ts +43 -68
- package/src/lib/routes/webhooks/webhooks.ts +15 -11
- package/src/lib/routes/workspaces/workspaces.ts +15 -11
- package/src/lib/seam-http-request.ts +11 -0
- package/src/lib/version.ts +1 -1
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
limitToSeamHttpRequestOptions,
|
|
29
29
|
parseOptions,
|
|
30
30
|
} from 'lib/parse-options.js'
|
|
31
|
-
import { assertValidRequestParameters } from 'lib/request-parameters.js'
|
|
32
31
|
import type { ActionAttempt } from 'lib/resources/action-attempt.js'
|
|
33
32
|
import type { Workspace } from 'lib/resources/workspace.js'
|
|
34
33
|
import { SeamHttpActionAttempts } from 'lib/routes/action-attempts/index.js'
|
|
@@ -168,12 +167,13 @@ export class SeamHttpWorkspaces {
|
|
|
168
167
|
parameters: WorkspacesCreateParameters,
|
|
169
168
|
options: WorkspacesCreateOptions = {},
|
|
170
169
|
): WorkspacesCreateRequest {
|
|
171
|
-
assertValidRequestParameters(parameters, '/workspaces/create', true)
|
|
172
|
-
|
|
173
170
|
return new SeamHttpRequest(this, {
|
|
174
171
|
pathname: '/workspaces/create',
|
|
175
172
|
method: 'POST',
|
|
176
173
|
body: parameters,
|
|
174
|
+
parameters,
|
|
175
|
+
hasRequiredParameters: true,
|
|
176
|
+
requiredParameterNames: ['name'],
|
|
177
177
|
responseKey: 'workspace',
|
|
178
178
|
options,
|
|
179
179
|
})
|
|
@@ -186,12 +186,13 @@ export class SeamHttpWorkspaces {
|
|
|
186
186
|
parameters?: WorkspacesGetParameters,
|
|
187
187
|
options: WorkspacesGetOptions = {},
|
|
188
188
|
): WorkspacesGetRequest {
|
|
189
|
-
assertValidRequestParameters(parameters, '/workspaces/get', false)
|
|
190
|
-
|
|
191
189
|
return new SeamHttpRequest(this, {
|
|
192
190
|
pathname: '/workspaces/get',
|
|
193
191
|
method: 'GET',
|
|
194
192
|
params: parameters,
|
|
193
|
+
parameters,
|
|
194
|
+
hasRequiredParameters: false,
|
|
195
|
+
requiredParameterNames: [],
|
|
195
196
|
responseKey: 'workspace',
|
|
196
197
|
options,
|
|
197
198
|
})
|
|
@@ -204,12 +205,13 @@ export class SeamHttpWorkspaces {
|
|
|
204
205
|
parameters?: WorkspacesListParameters,
|
|
205
206
|
options: WorkspacesListOptions = {},
|
|
206
207
|
): WorkspacesListRequest {
|
|
207
|
-
assertValidRequestParameters(parameters, '/workspaces/list', false)
|
|
208
|
-
|
|
209
208
|
return new SeamHttpRequest(this, {
|
|
210
209
|
pathname: '/workspaces/list',
|
|
211
210
|
method: 'GET',
|
|
212
211
|
params: parameters,
|
|
212
|
+
parameters,
|
|
213
|
+
hasRequiredParameters: false,
|
|
214
|
+
requiredParameterNames: [],
|
|
213
215
|
responseKey: 'workspaces',
|
|
214
216
|
options,
|
|
215
217
|
})
|
|
@@ -222,12 +224,13 @@ export class SeamHttpWorkspaces {
|
|
|
222
224
|
parameters?: WorkspacesResetSandboxParameters,
|
|
223
225
|
options: WorkspacesResetSandboxOptions = {},
|
|
224
226
|
): WorkspacesResetSandboxRequest {
|
|
225
|
-
assertValidRequestParameters(parameters, '/workspaces/reset_sandbox', false)
|
|
226
|
-
|
|
227
227
|
return new SeamHttpRequest(this, {
|
|
228
228
|
pathname: '/workspaces/reset_sandbox',
|
|
229
229
|
method: 'POST',
|
|
230
230
|
body: parameters,
|
|
231
|
+
parameters,
|
|
232
|
+
hasRequiredParameters: false,
|
|
233
|
+
requiredParameterNames: [],
|
|
231
234
|
responseKey: 'action_attempt',
|
|
232
235
|
options,
|
|
233
236
|
actionAttempts: SeamHttpActionAttempts.fromClient(this.client, {
|
|
@@ -244,12 +247,13 @@ export class SeamHttpWorkspaces {
|
|
|
244
247
|
parameters?: WorkspacesUpdateParameters,
|
|
245
248
|
options: WorkspacesUpdateOptions = {},
|
|
246
249
|
): WorkspacesUpdateRequest {
|
|
247
|
-
assertValidRequestParameters(parameters, '/workspaces/update', false)
|
|
248
|
-
|
|
249
250
|
return new SeamHttpRequest(this, {
|
|
250
251
|
pathname: '/workspaces/update',
|
|
251
252
|
method: 'PATCH',
|
|
252
253
|
body: parameters,
|
|
254
|
+
parameters,
|
|
255
|
+
hasRequiredParameters: false,
|
|
256
|
+
requiredParameterNames: [],
|
|
253
257
|
responseKey: undefined,
|
|
254
258
|
options,
|
|
255
259
|
})
|
|
@@ -3,6 +3,7 @@ import type { Method } from 'axios'
|
|
|
3
3
|
|
|
4
4
|
import type { Client } from './client.js'
|
|
5
5
|
import type { SeamHttpRequestOptions } from './options.js'
|
|
6
|
+
import { assertValidRequestParameters } from './request-parameters.js'
|
|
6
7
|
import {
|
|
7
8
|
type ActionAttemptsClient,
|
|
8
9
|
resolveActionAttempt,
|
|
@@ -22,6 +23,9 @@ interface SeamHttpRequestConfig<TResponseKey> {
|
|
|
22
23
|
readonly responseKey: TResponseKey
|
|
23
24
|
readonly options?: Pick<SeamHttpRequestOptions, 'waitForActionAttempt'>
|
|
24
25
|
readonly actionAttempts?: ActionAttemptsClient
|
|
26
|
+
readonly parameters?: unknown
|
|
27
|
+
readonly hasRequiredParameters?: boolean
|
|
28
|
+
readonly requiredParameterNames?: readonly string[]
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
export class SeamHttpRequest<
|
|
@@ -122,6 +126,13 @@ export class SeamHttpRequest<
|
|
|
122
126
|
}
|
|
123
127
|
|
|
124
128
|
async fetchResponse(): Promise<TResponse> {
|
|
129
|
+
assertValidRequestParameters(
|
|
130
|
+
this.#config.parameters,
|
|
131
|
+
this.pathname,
|
|
132
|
+
this.#config.hasRequiredParameters ?? false,
|
|
133
|
+
this.#config.requiredParameterNames ?? [],
|
|
134
|
+
)
|
|
135
|
+
|
|
125
136
|
const { client } = this.#parent
|
|
126
137
|
const response = await client.request({
|
|
127
138
|
url: this.pathname,
|
package/src/lib/version.ts
CHANGED