Skip to content

Commit f7555a9

Browse files
authored
Merge pull request #28 from seamapi/return-action-attemps
Return action attempts for other endpoints
2 parents 024a0c9 + fdc2f3a commit f7555a9

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

generate-routes.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,26 @@ const ignoredEndpointPaths = [
6868
'/health/service/[service_name]',
6969
'/noise_sensors/simulate/trigger_noise_threshold',
7070
'/phones/simulate/create_sandbox_phone',
71+
'/workspaces/reset_sandbox',
7172
] as const
7273

73-
const endpointResources: Partial<Record<keyof typeof openapi.paths, null>> = {
74+
const endpointResources: Partial<
75+
Record<
76+
keyof typeof openapi.paths,
77+
null | 'action_attempt' | 'noise_threshold'
78+
>
79+
> = {
80+
// Set all ignored endpoints null to simplify code generation.
81+
...ignoredEndpointPaths.reduce((acc, cur) => ({ ...acc, [cur]: null }), {}),
82+
83+
// These endpoints return a deprecated action attempt or resource.
7484
'/access_codes/delete': null,
7585
'/access_codes/unmanaged/delete': null,
7686
'/access_codes/update': null,
77-
'/connect_webviews/view': null,
78-
'/noise_sensors/noise_thresholds/create': null,
87+
'/noise_sensors/noise_thresholds/create': 'noise_threshold',
7988
'/noise_sensors/noise_thresholds/delete': null,
8089
'/noise_sensors/noise_thresholds/update': null,
8190
'/thermostats/climate_setting_schedules/update': null,
82-
'/workspaces/reset_sandbox': null,
8391
} as const
8492

8593
interface Route {

src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts

Lines changed: 11 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)