Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.
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
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,44 @@

Control locks, lights and other internet of things devices with Seam's simple API. Check out [the documentation](./docs/modules.md) or [some examples](./examples).


## Usage

```ts
import Seam from seamapi

const seam = new Seam()
// Seam will automatically use the SEAM_API_KEY environment variable if you
// don't provide an api_key to `new Seam()`

const someLock = await seam.locks.list().devices[0]
const someLockId = someLock.device_id

await seam.locks.lockDoor(someLockId)
const { device: someLockedLock } = await seam.locks.get(someLockId)
// someLockedLock.properties.locked === true

await seam.locks.unlockDoor(someLockId)

await seam.accessCodes.create(someLockId, { name: "Some Access Code", code: "1234" })

const accessCodeList = await seam.accessCodes.list(someLockId)
console.log(accessCodeList)
/*
{
access_codes: [
{
access_code_id: "some-access-code-1",
name: "Some Access Code",
code: "1234",
type: "ongoing",
created_at: "2022-02-01T12:57:40.843Z",
},
],
}
*/
```

## In Progress

This library is in progress!
37 changes: 37 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,43 @@ seamapi / [Exports](modules.md)

Control locks, lights and other internet of things devices with Seam's simple API. Check out [the documentation](./docs/modules.md) or [some examples](./examples).

## Usage

```ts
import Seam from seamapi

const seam = new Seam()
// Seam will automatically use the SEAM_API_KEY environment variable if you
// don't provide an api_key to `new Seam()`

const someLock = await seam.locks.list().devices[0]
const someLockId = someLock.device_id

await seam.locks.lockDoor(someLockId)
const { device: someLockedLock } = await seam.locks.get(someLockId)
// someLockedLock.properties.locked === true

await seam.locks.unlockDoor(someLockId)

await seam.accessCodes.create(someLockId, { name: "Some Access Code", code: "1234" })

const accessCodeList = await seam.accessCodes.list(someLockId)
console.log(accessCodeList)
/*
{
access_codes: [
{
access_code_id: "some-access-code-1",
name: "Some Access Code",
code: "1234",
type: "ongoing",
created_at: "2022-02-01T12:57:40.843Z",
},
],
}
*/
```

## In Progress

This library is in progress!
10 changes: 5 additions & 5 deletions docs/interfaces/AccessCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#### Defined in

[src/types/models.ts:67](https://github.com/hello-seam/seamapi-javascript/blob/main/src/types/models.ts#L67)
[src/types/models.ts:68](https://github.com/hello-seam/seamapi-javascript/blob/main/src/types/models.ts#L68)

___

Expand All @@ -30,7 +30,7 @@ ___

#### Defined in

[src/types/models.ts:63](https://github.com/hello-seam/seamapi-javascript/blob/main/src/types/models.ts#L63)
[src/types/models.ts:64](https://github.com/hello-seam/seamapi-javascript/blob/main/src/types/models.ts#L64)

___

Expand All @@ -40,7 +40,7 @@ ___

#### Defined in

[src/types/models.ts:66](https://github.com/hello-seam/seamapi-javascript/blob/main/src/types/models.ts#L66)
[src/types/models.ts:67](https://github.com/hello-seam/seamapi-javascript/blob/main/src/types/models.ts#L67)

___

Expand All @@ -50,7 +50,7 @@ ___

#### Defined in

[src/types/models.ts:64](https://github.com/hello-seam/seamapi-javascript/blob/main/src/types/models.ts#L64)
[src/types/models.ts:65](https://github.com/hello-seam/seamapi-javascript/blob/main/src/types/models.ts#L65)

___

Expand All @@ -60,4 +60,4 @@ ___

#### Defined in

[src/types/models.ts:65](https://github.com/hello-seam/seamapi-javascript/blob/main/src/types/models.ts#L65)
[src/types/models.ts:66](https://github.com/hello-seam/seamapi-javascript/blob/main/src/types/models.ts#L66)
11 changes: 11 additions & 0 deletions docs/interfaces/ConnectWebview.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [device\_selection\_mode](ConnectWebview.md#device_selection_mode)
- [login\_successful](ConnectWebview.md#login_successful)
- [status](ConnectWebview.md#status)
- [url](ConnectWebview.md#url)
- [workspace\_id](ConnectWebview.md#workspace_id)

## Properties
Expand Down Expand Up @@ -120,6 +121,16 @@ ___

___

### url

• **url**: `string`

#### Defined in

[src/types/models.ts:60](https://github.com/hello-seam/seamapi-javascript/blob/main/src/types/models.ts#L60)

___

### workspace\_id

• **workspace\_id**: `string`
Expand Down
1 change: 1 addition & 0 deletions src/types/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export interface ConnectWebview {
login_successful: boolean
status: "pending" | "authorized"
connected_account_id: null | string
url: string
}

export interface AccessCode {
Expand Down
Loading