Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit 05a4853

Browse files
authored
fix: Require option to use internal deviceModels (#226)
1 parent 2a139e6 commit 05a4853

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

docs/classes/Seam.md

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

src/seam-connect/routes.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,11 +498,23 @@ export abstract class Routes {
498498
}
499499

500500
public readonly deviceModels = {
501-
list: (params?: DeviceModelsListRequest) =>
502-
this.makeRequestAndFormat<DeviceModelsListResponse>("device_models", {
503-
url: "/internal/device_models/list",
504-
params,
505-
}),
501+
list: ({
502+
acknowledge_intentional_use_of_internal_api = false,
503+
...params
504+
}: DeviceModelsListRequest & {
505+
acknowledge_intentional_use_of_internal_api?: boolean
506+
} = {}) => {
507+
if (acknowledge_intentional_use_of_internal_api !== true) {
508+
throw new Error("This is an internal endpoint and should not be used.")
509+
}
510+
return this.makeRequestAndFormat<DeviceModelsListResponse>(
511+
"device_models",
512+
{
513+
url: "/internal/device_models/list",
514+
params,
515+
}
516+
)
517+
},
506518
}
507519

508520
public readonly thermostats = {

0 commit comments

Comments
 (0)