Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
max_attempts: 3
retry_wait_seconds: 1
timeout_minutes: 2
command: npm run codegen
command: npm run generate
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ $ git clone https://github.com/seamapi/docs.git
$ cd docs
$ nvm install
$ npm install
$ npm run codegen
$ npm run generate
```

Primary development tasks are defined under `scripts` in `package.json`
Expand Down
45 changes: 0 additions & 45 deletions codegen/data/paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,12 @@
3. Create `acs_credential`s, which are the digital means of granting access to users, such as PIN codes, mobile keys, and plastic (RFID) cards.
If you are developing a mobile app to provide access for your users, you can also use [Seam's iOS and Android SDKs](https://docs.seam.co/latest/capability-guides/mobile-access/mobile-device-sdks) that pair with the Seam API to create and manage mobile keys.

/acs/systems:
title: Systems

/acs/users:
title: ACS Users

/acs/entrances:
title: Entrances

/acs/access_groups:
title: Access Groups

/acs/credentials:
title: Credentials

/acs/encoders:
title: Encoders

/acs/encoders/simulate:
title: Encoder Simulations

/phones:
title: Phones

/phones/simulate:
title: Phone Simulations

Expand Down Expand Up @@ -99,15 +81,9 @@

---

/noise_sensors/noise_thresholds:
title: Noise Thresholds

/noise_sensors/simulate:
title: Noise Sensor Simulations

/user_identities:
title: User Identities

/access_codes:
title: Access Codes
include_groups:
Expand Down Expand Up @@ -135,28 +111,10 @@
title: Spaces
alpha: "**Early Access Preview.** The spaces API is currently in Alpha. We're actively developing it and seeking early feedback at [support@seam.co](mailto:support@seam.co). Expect breaking changes as we refine the design."

/connected_accounts:
title: Connected Accounts

/customers:
title: Customers
alpha: "**Early Access Preview.** The customers API is currently in Alpha. We're actively developing it and seeking early feedback at [support@seam.co](mailto:support@seam.co). Expect breaking changes as we refine the design."

/client_sessions:
title: Client Sessions

/connect_webviews:
title: Connect Webviews

/webhooks:
title: Webhooks

/workspaces:
title: Workspaces

/devices:
title: Devices

/devices/unmanaged:
title: Unmanaged Devices

Expand Down Expand Up @@ -200,6 +158,3 @@

/locks/simulate:
title: Lock Simulations

/instant_keys:
title: Instant Keys
16 changes: 0 additions & 16 deletions codegen/layouts/report.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@
{{#if (or noTitle.routes.length noTitle.endpoints.length noTitle.namespaces.length )}}

## Untitled
{{#if noTitle.namespaces.length }}

### Namespaces

{{#each noTitle.namespaces}}
- `{{name}}`
{{/each}}
{{/if}}
{{#if noTitle.routes.length }}

### Routes

{{#each noTitle.routes}}
- `{{name}}`
{{/each}}
{{/if}}
{{#if noTitle.endpoints.length }}

### Endpoints
Expand Down
9 changes: 9 additions & 0 deletions codegen/lib/reference.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { Blueprint, Endpoint } from '@seamapi/blueprint'
import type Metalsmith from 'metalsmith'

import { toCapitalCase } from 'lib/handlebars/helpers.js'

import {
type ApiEndpointLayoutContext,
type ApiNamespaceLayoutContext,
Expand Down Expand Up @@ -42,6 +44,13 @@ export const reference = (

const { blueprint } = metadata

for (const { path, name } of [...blueprint.routes, ...blueprint.namespaces]) {
if (path in pathMetadata) continue
pathMetadata[path] = PathMetadataSchema.valueSchema.parse({
title: toCapitalCase(name),
})
}

const { resources } = blueprint

const namespaces = blueprint.namespaces.filter(
Expand Down
37 changes: 2 additions & 35 deletions codegen/lib/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import type {
import { openapi } from '@seamapi/types/connect'
import type Metalsmith from 'metalsmith'

import { PathMetadataSchema } from './path-metadata.js'

const defaultDeprecatedMessage = 'No deprecated message provided'
const defaultDraftMessage = 'No draft message provided'
const defaultUndocumentedMessage = 'No undocumented message provided'
Expand Down Expand Up @@ -108,24 +106,12 @@ function generateReport(metadata: Metadata): Report {
},
}

const pathMetadata =
'pathMetadata' in metadata
? PathMetadataSchema.parse(metadata.pathMetadata)
: {}

const routes = blueprint.routes ?? []
for (const route of routes) {
processRoute(route, report, metadata)
processRoute(route, report)
}

for (const namespace of blueprint.namespaces ?? []) {
if (
!namespace.isUndocumented &&
pathMetadata[namespace.path]?.title == null
) {
addUntitledNamespaceToReport(namespace.path, report)
}

processNamespace(namespace, report)
}

Expand Down Expand Up @@ -267,7 +253,7 @@ function processProperty(
}
}

function processRoute(route: Route, report: Report, metadata: Metadata): void {
function processRoute(route: Route, report: Report): void {
if (route.isUndocumented) {
report.undocumented.routes.push({
name: route.path,
Expand All @@ -289,30 +275,11 @@ function processRoute(route: Route, report: Report, metadata: Metadata): void {
})
}

const pathMetadata =
'pathMetadata' in metadata
? PathMetadataSchema.parse(metadata.pathMetadata)
: {}

if (pathMetadata[route.path]?.title == null && !route.isUndocumented) {
report.noTitle.routes.push({ name: route.path })
}

// TODO: route description

for (const endpoint of route.endpoints) {
processEndpoint(endpoint, report)
}
}

const addUntitledNamespaceToReport = (
namespace: string,
report: Report,
): void => {
if (report.noTitle.namespaces.some((n) => n.name === namespace)) return
report.noTitle.namespaces.push({ name: namespace })
}

function processNamespace(namespace: Namespace, report: Report): void {
const addNamespace = (section: ReportItem[], reason: string): void => {
if (section.some((item) => item.name === namespace.path)) return
Expand Down
4 changes: 4 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@
* [Set to Off Mode](api/thermostats/off.md)
* [Update a Climate Preset](api/thermostats/update_climate_preset.md)
* [Update the Thermostat Weekly Program](api/thermostats/update_weekly_program.md)
* [Daily Programs](api/thermostats/daily_programs/README.md)
* [Create a Thermostat Daily Program](api/thermostats/daily_programs/create.md)
* [Delete a Thermostat Daily Program](api/thermostats/daily_programs/delete.md)
* [Update a Thermostat Daily Program](api/thermostats/daily_programs/update.md)
* [Thermostat Schedules](api/thermostats/schedules/README.md)
* [Create a Thermostat Schedule](api/thermostats/schedules/create.md)
* [Delete a Thermostat Schedule](api/thermostats/schedules/delete.md)
Expand Down
6 changes: 0 additions & 6 deletions docs/api/_report.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Documentation Report

## Untitled

### Routes

- `/thermostats/daily_programs`

## Undocumented

These items are intentionally undocumented.
Expand Down
119 changes: 119 additions & 0 deletions docs/api/thermostats/daily_programs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Daily Programs

## The thermostat_daily_program Object

- [Properties](./#properties)
- [Endpoints](./#endpoints)


Represents a thermostat daily program, consisting of a set of periods, each of which has a starting time and the key that identifies the climate preset to apply at the starting time.

{% tabs %}
{% tab title="Thermostat Daily Program" %}

A thermostat daily program resource.

```json
{
"created_at": "2025-06-14T16:54:17.946642Z",
"device_id": "58437d45-47ac-4ee6-ab27-7b2d1f2947d1",
"name": "Weekday Program",
"periods": [
{ "starts_at_time": "07:00:00", "climate_preset_key": "Home" },
{ "starts_at_time": "09:00:00", "climate_preset_key": "Away" },
{ "starts_at_time": "16:00:00", "climate_preset_key": "Home" },
{ "starts_at_time": "22:30:00", "climate_preset_key": "Sleep" }
],
"thermostat_daily_program_id": "ab8ef74c-c7cd-4100-aa32-0ef960c0080d",
"workspace_id": "8da8d923-e55b-45cd-84a3-6c96b3d3d454"
}
```
{% endtab %}
{% endtabs %}

---
## Properties

**`created_at`** *Datetime*

Date and time at which the thermostat daily program was created.




---

**`device_id`** *UUID*

ID of the thermostat device on which the thermostat daily program is configured.




---

**`name`** *String*

User-friendly name to identify the thermostat daily program.




---

**`periods`** *List* *of Objects*

Array of thermostat daily program periods.



<details>
<summary>Child Object Properties</summary>
<strong><code>climate_preset_key</code></strong> <i>String</i>

Key of the [climate preset](../../../capability-guides/thermostats/creating-and-managing-climate-presets/README.md) to activate at the `starts_at_time`.

<strong><code>starts_at_time</code></strong> <i>String</i>

Time at which the thermostat daily program period starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.

</details>

---

**`thermostat_daily_program_id`** *UUID*

ID of the thermostat daily program.




---

**`workspace_id`** *UUID*

ID of the [workspace](../../../core-concepts/workspaces/README.md) that contains the thermostat daily program.




---

## Endpoints


[**`/thermostats/daily_programs/create`**](./create.md)

Creates a new thermostat daily program. A daily program consists of a set of periods, where each period includes a start time and the key of a configured climate preset. Once you have defined a daily program, you can assign it to one or more days within a weekly program.


[**`/thermostats/daily_programs/delete`**](./delete.md)

Deletes a thermostat daily program.


[**`/thermostats/daily_programs/update`**](./update.md)

Updates a specified thermostat daily program. The periods that you specify overwrite any existing periods for the daily program.


Loading
Loading