@seamapi/http 0.2.0 → 0.3.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.
Files changed (79) hide show
  1. package/dist/connect.cjs +33 -1
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +170 -127
  4. package/lib/seam/connect/client.d.ts +3 -3
  5. package/lib/seam/connect/client.js +1 -0
  6. package/lib/seam/connect/client.js.map +1 -1
  7. package/lib/seam/connect/index.d.ts +2 -0
  8. package/lib/seam/connect/index.js +2 -0
  9. package/lib/seam/connect/index.js.map +1 -1
  10. package/lib/seam/connect/options.d.ts +4 -2
  11. package/lib/seam/connect/options.js.map +1 -1
  12. package/lib/seam/connect/parse-options.js +6 -0
  13. package/lib/seam/connect/parse-options.js.map +1 -1
  14. package/lib/seam/connect/routes/access-codes-unmanaged.d.ts +7 -7
  15. package/lib/seam/connect/routes/access-codes-unmanaged.js.map +1 -1
  16. package/lib/seam/connect/routes/access-codes.d.ts +10 -10
  17. package/lib/seam/connect/routes/access-codes.js.map +1 -1
  18. package/lib/seam/connect/routes/acs-access-groups.d.ts +11 -11
  19. package/lib/seam/connect/routes/acs-access-groups.js.map +1 -1
  20. package/lib/seam/connect/routes/acs-credentials.d.ts +6 -6
  21. package/lib/seam/connect/routes/acs-credentials.js.map +1 -1
  22. package/lib/seam/connect/routes/acs-systems.d.ts +4 -4
  23. package/lib/seam/connect/routes/acs-systems.js.map +1 -1
  24. package/lib/seam/connect/routes/acs-users.d.ts +11 -11
  25. package/lib/seam/connect/routes/acs-users.js.map +1 -1
  26. package/lib/seam/connect/routes/action-attempts.d.ts +4 -4
  27. package/lib/seam/connect/routes/action-attempts.js.map +1 -1
  28. package/lib/seam/connect/routes/client-sessions.d.ts +8 -8
  29. package/lib/seam/connect/routes/client-sessions.js.map +1 -1
  30. package/lib/seam/connect/routes/connect-webviews.d.ts +6 -6
  31. package/lib/seam/connect/routes/connect-webviews.js.map +1 -1
  32. package/lib/seam/connect/routes/connected-accounts.d.ts +3 -3
  33. package/lib/seam/connect/routes/connected-accounts.js.map +1 -1
  34. package/lib/seam/connect/routes/devices-unmanaged.d.ts +5 -5
  35. package/lib/seam/connect/routes/devices-unmanaged.js.map +1 -1
  36. package/lib/seam/connect/routes/devices.d.ts +8 -8
  37. package/lib/seam/connect/routes/devices.js.map +1 -1
  38. package/lib/seam/connect/routes/events.d.ts +4 -4
  39. package/lib/seam/connect/routes/events.js.map +1 -1
  40. package/lib/seam/connect/routes/locks.d.ts +6 -6
  41. package/lib/seam/connect/routes/locks.js.map +1 -1
  42. package/lib/seam/connect/routes/noise-sensors-noise-thresholds.d.ts +7 -7
  43. package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js.map +1 -1
  44. package/lib/seam/connect/routes/thermostats-climate-setting-schedules.d.ts +7 -7
  45. package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js.map +1 -1
  46. package/lib/seam/connect/routes/thermostats.d.ts +10 -10
  47. package/lib/seam/connect/routes/thermostats.js.map +1 -1
  48. package/lib/seam/connect/routes/webhooks.d.ts +4 -4
  49. package/lib/seam/connect/routes/webhooks.js.map +1 -1
  50. package/lib/seam/connect/routes/workspaces.d.ts +1 -1
  51. package/lib/seam/connect/routes/workspaces.js.map +1 -1
  52. package/lib/version.d.ts +2 -0
  53. package/lib/version.js +3 -0
  54. package/lib/version.js.map +1 -0
  55. package/package.json +6 -2
  56. package/src/lib/seam/connect/client.ts +4 -3
  57. package/src/lib/seam/connect/index.ts +2 -0
  58. package/src/lib/seam/connect/options.ts +3 -2
  59. package/src/lib/seam/connect/parse-options.ts +8 -0
  60. package/src/lib/seam/connect/routes/access-codes-unmanaged.ts +7 -7
  61. package/src/lib/seam/connect/routes/access-codes.ts +10 -10
  62. package/src/lib/seam/connect/routes/acs-access-groups.ts +12 -11
  63. package/src/lib/seam/connect/routes/acs-credentials.ts +6 -6
  64. package/src/lib/seam/connect/routes/acs-systems.ts +4 -4
  65. package/src/lib/seam/connect/routes/acs-users.ts +13 -11
  66. package/src/lib/seam/connect/routes/action-attempts.ts +4 -4
  67. package/src/lib/seam/connect/routes/client-sessions.ts +8 -8
  68. package/src/lib/seam/connect/routes/connect-webviews.ts +7 -6
  69. package/src/lib/seam/connect/routes/connected-accounts.ts +3 -3
  70. package/src/lib/seam/connect/routes/devices-unmanaged.ts +6 -5
  71. package/src/lib/seam/connect/routes/devices.ts +10 -8
  72. package/src/lib/seam/connect/routes/events.ts +4 -4
  73. package/src/lib/seam/connect/routes/locks.ts +6 -6
  74. package/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +7 -7
  75. package/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts +7 -7
  76. package/src/lib/seam/connect/routes/thermostats.ts +10 -10
  77. package/src/lib/seam/connect/routes/webhooks.ts +4 -4
  78. package/src/lib/seam/connect/routes/workspaces.ts +1 -1
  79. package/src/lib/version.ts +3 -0
@@ -82,7 +82,7 @@ export class SeamHttpEvents {
82
82
  return SeamHttpEvents.fromClientSessionToken(token, options)
83
83
  }
84
84
 
85
- async get(body: EventsGetBody): Promise<EventsGetResponse['event']> {
85
+ async get(body?: EventsGetParams): Promise<EventsGetResponse['event']> {
86
86
  const { data } = await this.client.request<EventsGetResponse>({
87
87
  url: '/events/get',
88
88
  method: 'post',
@@ -91,7 +91,7 @@ export class SeamHttpEvents {
91
91
  return data.event
92
92
  }
93
93
 
94
- async list(body: EventsListBody): Promise<EventsListResponse['events']> {
94
+ async list(body?: EventsListParams): Promise<EventsListResponse['events']> {
95
95
  const { data } = await this.client.request<EventsListResponse>({
96
96
  url: '/events/list',
97
97
  method: 'post',
@@ -101,13 +101,13 @@ export class SeamHttpEvents {
101
101
  }
102
102
  }
103
103
 
104
- export type EventsGetBody = RouteRequestBody<'/events/get'>
104
+ export type EventsGetParams = RouteRequestBody<'/events/get'>
105
105
 
106
106
  export type EventsGetResponse = SetNonNullable<
107
107
  Required<RouteResponse<'/events/get'>>
108
108
  >
109
109
 
110
- export type EventsListBody = RouteRequestBody<'/events/list'>
110
+ export type EventsListParams = RouteRequestBody<'/events/list'>
111
111
 
112
112
  export type EventsListResponse = SetNonNullable<
113
113
  Required<RouteResponse<'/events/list'>>
@@ -82,7 +82,7 @@ export class SeamHttpLocks {
82
82
  return SeamHttpLocks.fromClientSessionToken(token, options)
83
83
  }
84
84
 
85
- async get(body: LocksGetBody): Promise<LocksGetResponse['device']> {
85
+ async get(body?: LocksGetParams): Promise<LocksGetResponse['device']> {
86
86
  const { data } = await this.client.request<LocksGetResponse>({
87
87
  url: '/locks/get',
88
88
  method: 'post',
@@ -91,7 +91,7 @@ export class SeamHttpLocks {
91
91
  return data.device
92
92
  }
93
93
 
94
- async list(body: LocksListBody): Promise<LocksListResponse['devices']> {
94
+ async list(body?: LocksListParams): Promise<LocksListResponse['devices']> {
95
95
  const { data } = await this.client.request<LocksListResponse>({
96
96
  url: '/locks/list',
97
97
  method: 'post',
@@ -101,7 +101,7 @@ export class SeamHttpLocks {
101
101
  }
102
102
 
103
103
  async lockDoor(
104
- body: LocksLockDoorBody,
104
+ body?: LocksLockDoorBody,
105
105
  ): Promise<LocksLockDoorResponse['action_attempt']> {
106
106
  const { data } = await this.client.request<LocksLockDoorResponse>({
107
107
  url: '/locks/lock_door',
@@ -112,7 +112,7 @@ export class SeamHttpLocks {
112
112
  }
113
113
 
114
114
  async unlockDoor(
115
- body: LocksUnlockDoorBody,
115
+ body?: LocksUnlockDoorBody,
116
116
  ): Promise<LocksUnlockDoorResponse['action_attempt']> {
117
117
  const { data } = await this.client.request<LocksUnlockDoorResponse>({
118
118
  url: '/locks/unlock_door',
@@ -123,13 +123,13 @@ export class SeamHttpLocks {
123
123
  }
124
124
  }
125
125
 
126
- export type LocksGetBody = RouteRequestBody<'/locks/get'>
126
+ export type LocksGetParams = RouteRequestBody<'/locks/get'>
127
127
 
128
128
  export type LocksGetResponse = SetNonNullable<
129
129
  Required<RouteResponse<'/locks/get'>>
130
130
  >
131
131
 
132
- export type LocksListBody = RouteRequestBody<'/locks/list'>
132
+ export type LocksListParams = RouteRequestBody<'/locks/list'>
133
133
 
134
134
  export type LocksListResponse = SetNonNullable<
135
135
  Required<RouteResponse<'/locks/list'>>
@@ -85,7 +85,7 @@ export class SeamHttpNoiseSensorsNoiseThresholds {
85
85
  )
86
86
  }
87
87
 
88
- async create(body: NoiseSensorsNoiseThresholdsCreateBody): Promise<void> {
88
+ async create(body?: NoiseSensorsNoiseThresholdsCreateBody): Promise<void> {
89
89
  await this.client.request<NoiseSensorsNoiseThresholdsCreateResponse>({
90
90
  url: '/noise_sensors/noise_thresholds/create',
91
91
  method: 'post',
@@ -93,7 +93,7 @@ export class SeamHttpNoiseSensorsNoiseThresholds {
93
93
  })
94
94
  }
95
95
 
96
- async delete(body: NoiseSensorsNoiseThresholdsDeleteBody): Promise<void> {
96
+ async delete(body?: NoiseSensorsNoiseThresholdsDeleteBody): Promise<void> {
97
97
  await this.client.request<NoiseSensorsNoiseThresholdsDeleteResponse>({
98
98
  url: '/noise_sensors/noise_thresholds/delete',
99
99
  method: 'post',
@@ -102,7 +102,7 @@ export class SeamHttpNoiseSensorsNoiseThresholds {
102
102
  }
103
103
 
104
104
  async get(
105
- body: NoiseSensorsNoiseThresholdsGetBody,
105
+ body?: NoiseSensorsNoiseThresholdsGetParams,
106
106
  ): Promise<NoiseSensorsNoiseThresholdsGetResponse['noise_threshold']> {
107
107
  const { data } =
108
108
  await this.client.request<NoiseSensorsNoiseThresholdsGetResponse>({
@@ -114,7 +114,7 @@ export class SeamHttpNoiseSensorsNoiseThresholds {
114
114
  }
115
115
 
116
116
  async list(
117
- body: NoiseSensorsNoiseThresholdsListBody,
117
+ body?: NoiseSensorsNoiseThresholdsListParams,
118
118
  ): Promise<NoiseSensorsNoiseThresholdsListResponse['noise_thresholds']> {
119
119
  const { data } =
120
120
  await this.client.request<NoiseSensorsNoiseThresholdsListResponse>({
@@ -125,7 +125,7 @@ export class SeamHttpNoiseSensorsNoiseThresholds {
125
125
  return data.noise_thresholds
126
126
  }
127
127
 
128
- async update(body: NoiseSensorsNoiseThresholdsUpdateBody): Promise<void> {
128
+ async update(body?: NoiseSensorsNoiseThresholdsUpdateBody): Promise<void> {
129
129
  await this.client.request<NoiseSensorsNoiseThresholdsUpdateResponse>({
130
130
  url: '/noise_sensors/noise_thresholds/update',
131
131
  method: 'post',
@@ -148,14 +148,14 @@ export type NoiseSensorsNoiseThresholdsDeleteResponse = SetNonNullable<
148
148
  Required<RouteResponse<'/noise_sensors/noise_thresholds/delete'>>
149
149
  >
150
150
 
151
- export type NoiseSensorsNoiseThresholdsGetBody =
151
+ export type NoiseSensorsNoiseThresholdsGetParams =
152
152
  RouteRequestBody<'/noise_sensors/noise_thresholds/get'>
153
153
 
154
154
  export type NoiseSensorsNoiseThresholdsGetResponse = SetNonNullable<
155
155
  Required<RouteResponse<'/noise_sensors/noise_thresholds/get'>>
156
156
  >
157
157
 
158
- export type NoiseSensorsNoiseThresholdsListBody =
158
+ export type NoiseSensorsNoiseThresholdsListParams =
159
159
  RouteRequestBody<'/noise_sensors/noise_thresholds/list'>
160
160
 
161
161
  export type NoiseSensorsNoiseThresholdsListResponse = SetNonNullable<
@@ -86,7 +86,7 @@ export class SeamHttpThermostatsClimateSettingSchedules {
86
86
  }
87
87
 
88
88
  async create(
89
- body: ThermostatsClimateSettingSchedulesCreateBody,
89
+ body?: ThermostatsClimateSettingSchedulesCreateBody,
90
90
  ): Promise<
91
91
  ThermostatsClimateSettingSchedulesCreateResponse['climate_setting_schedule']
92
92
  > {
@@ -102,7 +102,7 @@ export class SeamHttpThermostatsClimateSettingSchedules {
102
102
  }
103
103
 
104
104
  async delete(
105
- body: ThermostatsClimateSettingSchedulesDeleteBody,
105
+ body?: ThermostatsClimateSettingSchedulesDeleteBody,
106
106
  ): Promise<void> {
107
107
  await this.client.request<ThermostatsClimateSettingSchedulesDeleteResponse>(
108
108
  {
@@ -114,7 +114,7 @@ export class SeamHttpThermostatsClimateSettingSchedules {
114
114
  }
115
115
 
116
116
  async get(
117
- body: ThermostatsClimateSettingSchedulesGetBody,
117
+ body?: ThermostatsClimateSettingSchedulesGetParams,
118
118
  ): Promise<
119
119
  ThermostatsClimateSettingSchedulesGetResponse['climate_setting_schedule']
120
120
  > {
@@ -128,7 +128,7 @@ export class SeamHttpThermostatsClimateSettingSchedules {
128
128
  }
129
129
 
130
130
  async list(
131
- body: ThermostatsClimateSettingSchedulesListBody,
131
+ body?: ThermostatsClimateSettingSchedulesListParams,
132
132
  ): Promise<
133
133
  ThermostatsClimateSettingSchedulesListResponse['climate_setting_schedules']
134
134
  > {
@@ -144,7 +144,7 @@ export class SeamHttpThermostatsClimateSettingSchedules {
144
144
  }
145
145
 
146
146
  async update(
147
- body: ThermostatsClimateSettingSchedulesUpdateBody,
147
+ body?: ThermostatsClimateSettingSchedulesUpdateBody,
148
148
  ): Promise<void> {
149
149
  await this.client.request<ThermostatsClimateSettingSchedulesUpdateResponse>(
150
150
  {
@@ -170,14 +170,14 @@ export type ThermostatsClimateSettingSchedulesDeleteResponse = SetNonNullable<
170
170
  Required<RouteResponse<'/thermostats/climate_setting_schedules/delete'>>
171
171
  >
172
172
 
173
- export type ThermostatsClimateSettingSchedulesGetBody =
173
+ export type ThermostatsClimateSettingSchedulesGetParams =
174
174
  RouteRequestBody<'/thermostats/climate_setting_schedules/get'>
175
175
 
176
176
  export type ThermostatsClimateSettingSchedulesGetResponse = SetNonNullable<
177
177
  Required<RouteResponse<'/thermostats/climate_setting_schedules/get'>>
178
178
  >
179
179
 
180
- export type ThermostatsClimateSettingSchedulesListBody =
180
+ export type ThermostatsClimateSettingSchedulesListParams =
181
181
  RouteRequestBody<'/thermostats/climate_setting_schedules/list'>
182
182
 
183
183
  export type ThermostatsClimateSettingSchedulesListResponse = SetNonNullable<
@@ -87,7 +87,7 @@ export class SeamHttpThermostats {
87
87
  return SeamHttpThermostatsClimateSettingSchedules.fromClient(this.client)
88
88
  }
89
89
 
90
- async cool(body: ThermostatsCoolBody): Promise<void> {
90
+ async cool(body?: ThermostatsCoolBody): Promise<void> {
91
91
  await this.client.request<ThermostatsCoolResponse>({
92
92
  url: '/thermostats/cool',
93
93
  method: 'post',
@@ -96,7 +96,7 @@ export class SeamHttpThermostats {
96
96
  }
97
97
 
98
98
  async get(
99
- body: ThermostatsGetBody,
99
+ body?: ThermostatsGetParams,
100
100
  ): Promise<ThermostatsGetResponse['thermostat']> {
101
101
  const { data } = await this.client.request<ThermostatsGetResponse>({
102
102
  url: '/thermostats/get',
@@ -106,7 +106,7 @@ export class SeamHttpThermostats {
106
106
  return data.thermostat
107
107
  }
108
108
 
109
- async heat(body: ThermostatsHeatBody): Promise<void> {
109
+ async heat(body?: ThermostatsHeatBody): Promise<void> {
110
110
  await this.client.request<ThermostatsHeatResponse>({
111
111
  url: '/thermostats/heat',
112
112
  method: 'post',
@@ -114,7 +114,7 @@ export class SeamHttpThermostats {
114
114
  })
115
115
  }
116
116
 
117
- async heatCool(body: ThermostatsHeatCoolBody): Promise<void> {
117
+ async heatCool(body?: ThermostatsHeatCoolBody): Promise<void> {
118
118
  await this.client.request<ThermostatsHeatCoolResponse>({
119
119
  url: '/thermostats/heat_cool',
120
120
  method: 'post',
@@ -123,7 +123,7 @@ export class SeamHttpThermostats {
123
123
  }
124
124
 
125
125
  async list(
126
- body: ThermostatsListBody,
126
+ body?: ThermostatsListParams,
127
127
  ): Promise<ThermostatsListResponse['thermostats']> {
128
128
  const { data } = await this.client.request<ThermostatsListResponse>({
129
129
  url: '/thermostats/list',
@@ -133,7 +133,7 @@ export class SeamHttpThermostats {
133
133
  return data.thermostats
134
134
  }
135
135
 
136
- async off(body: ThermostatsOffBody): Promise<void> {
136
+ async off(body?: ThermostatsOffBody): Promise<void> {
137
137
  await this.client.request<ThermostatsOffResponse>({
138
138
  url: '/thermostats/off',
139
139
  method: 'post',
@@ -141,7 +141,7 @@ export class SeamHttpThermostats {
141
141
  })
142
142
  }
143
143
 
144
- async setFanMode(body: ThermostatsSetFanModeBody): Promise<void> {
144
+ async setFanMode(body?: ThermostatsSetFanModeBody): Promise<void> {
145
145
  await this.client.request<ThermostatsSetFanModeResponse>({
146
146
  url: '/thermostats/set_fan_mode',
147
147
  method: 'post',
@@ -149,7 +149,7 @@ export class SeamHttpThermostats {
149
149
  })
150
150
  }
151
151
 
152
- async update(body: ThermostatsUpdateBody): Promise<void> {
152
+ async update(body?: ThermostatsUpdateBody): Promise<void> {
153
153
  await this.client.request<ThermostatsUpdateResponse>({
154
154
  url: '/thermostats/update',
155
155
  method: 'post',
@@ -164,7 +164,7 @@ export type ThermostatsCoolResponse = SetNonNullable<
164
164
  Required<RouteResponse<'/thermostats/cool'>>
165
165
  >
166
166
 
167
- export type ThermostatsGetBody = RouteRequestBody<'/thermostats/get'>
167
+ export type ThermostatsGetParams = RouteRequestBody<'/thermostats/get'>
168
168
 
169
169
  export type ThermostatsGetResponse = SetNonNullable<
170
170
  Required<RouteResponse<'/thermostats/get'>>
@@ -182,7 +182,7 @@ export type ThermostatsHeatCoolResponse = SetNonNullable<
182
182
  Required<RouteResponse<'/thermostats/heat_cool'>>
183
183
  >
184
184
 
185
- export type ThermostatsListBody = RouteRequestBody<'/thermostats/list'>
185
+ export type ThermostatsListParams = RouteRequestBody<'/thermostats/list'>
186
186
 
187
187
  export type ThermostatsListResponse = SetNonNullable<
188
188
  Required<RouteResponse<'/thermostats/list'>>
@@ -87,7 +87,7 @@ export class SeamHttpWebhooks {
87
87
  }
88
88
 
89
89
  async create(
90
- body: WebhooksCreateBody,
90
+ body?: WebhooksCreateBody,
91
91
  ): Promise<WebhooksCreateResponse['webhook']> {
92
92
  const { data } = await this.client.request<WebhooksCreateResponse>({
93
93
  url: '/webhooks/create',
@@ -97,7 +97,7 @@ export class SeamHttpWebhooks {
97
97
  return data.webhook
98
98
  }
99
99
 
100
- async delete(body: WebhooksDeleteBody): Promise<void> {
100
+ async delete(body?: WebhooksDeleteBody): Promise<void> {
101
101
  await this.client.request<WebhooksDeleteResponse>({
102
102
  url: '/webhooks/delete',
103
103
  method: 'post',
@@ -105,7 +105,7 @@ export class SeamHttpWebhooks {
105
105
  })
106
106
  }
107
107
 
108
- async get(body: WebhooksGetBody): Promise<WebhooksGetResponse['webhook']> {
108
+ async get(body?: WebhooksGetParams): Promise<WebhooksGetResponse['webhook']> {
109
109
  const { data } = await this.client.request<WebhooksGetResponse>({
110
110
  url: '/webhooks/get',
111
111
  method: 'post',
@@ -138,7 +138,7 @@ export type WebhooksDeleteResponse = SetNonNullable<
138
138
  Required<RouteResponse<'/webhooks/delete'>>
139
139
  >
140
140
 
141
- export type WebhooksGetBody = RouteRequestBody<'/webhooks/get'>
141
+ export type WebhooksGetParams = RouteRequestBody<'/webhooks/get'>
142
142
 
143
143
  export type WebhooksGetResponse = SetNonNullable<
144
144
  Required<RouteResponse<'/webhooks/get'>>
@@ -108,7 +108,7 @@ export class SeamHttpWorkspaces {
108
108
  return data.workspaces
109
109
  }
110
110
 
111
- async resetSandbox(body: WorkspacesResetSandboxBody): Promise<void> {
111
+ async resetSandbox(body?: WorkspacesResetSandboxBody): Promise<void> {
112
112
  await this.client.request<WorkspacesResetSandboxResponse>({
113
113
  url: '/workspaces/reset_sandbox',
114
114
  method: 'post',
@@ -0,0 +1,3 @@
1
+ const seamapiJavascriptHttpVersion = '0.3.0'
2
+
3
+ export default seamapiJavascriptHttpVersion