From 52130931e015bd954258d4819244476590dfc5ad Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Tue, 11 Apr 2023 15:33:49 -0300 Subject: [PATCH 01/18] feat: add new method to list noise thresholds --- docs/classes/Seam.md | 39 +- docs/interfaces/AccessCodeBase.md | 12 +- docs/interfaces/ActionAttemptResultTypeMap.md | 4 +- docs/interfaces/ActionAttemptWithError.md | 10 +- docs/interfaces/ConnectWebview.md | 34 +- docs/interfaces/ConnectedAccount.md | 14 +- docs/interfaces/Device.md | 20 +- docs/interfaces/DeviceProvider.md | 8 +- docs/interfaces/LockProperties.md | 30 +- docs/interfaces/ManagedAccessCodeBase.md | 16 +- docs/interfaces/OngoingAccessCode.md | 22 +- docs/interfaces/PendingActionAttempt.md | 10 +- docs/interfaces/SeamError.md | 4 +- docs/interfaces/SeamWarning.md | 4 +- docs/interfaces/SuccessfulActionAttempt.md | 10 +- docs/interfaces/TimeBoundAccessCode.md | 26 +- docs/interfaces/UnmanagedAccessCode.md | 18 +- docs/interfaces/UserIdentifier.md | 2 +- docs/interfaces/Webhook.md | 8 +- docs/modules.md | 58 +- src/seam-connect/routes.ts | 15 + src/types/models.ts | 1 + src/types/route-requests.ts | 19 + tests/fixtures/plugins/get-server-plugin.ts | 8 +- .../workers/helpers/add-fake-minut-devices.ts | 47 ++ .../workers/helpers/start-and-seed-server.ts | 5 +- tests/routes.test.ts | 574 +++++++++--------- 27 files changed, 589 insertions(+), 429 deletions(-) create mode 100644 tests/fixtures/workers/helpers/add-fake-minut-devices.ts diff --git a/docs/classes/Seam.md b/docs/classes/Seam.md index 3d2a6b36..8f091e77 100644 --- a/docs/classes/Seam.md +++ b/docs/classes/Seam.md @@ -24,6 +24,7 @@ - [devices](Seam.md#devices) - [events](Seam.md#events) - [locks](Seam.md#locks) +- [noiseThresholds](Seam.md#noisethresholds) - [webhooks](Seam.md#webhooks) - [workspaces](Seam.md#workspaces) @@ -79,7 +80,7 @@ Routes.accessCodes #### Defined in -[src/seam-connect/routes.ts:270](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L270) +[src/seam-connect/routes.ts:272](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L272) ___ @@ -99,7 +100,7 @@ Routes.actionAttempts #### Defined in -[src/seam-connect/routes.ts:385](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L385) +[src/seam-connect/routes.ts:387](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L387) ___ @@ -132,7 +133,7 @@ Routes.connectWebviews #### Defined in -[src/seam-connect/routes.ts:238](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L238) +[src/seam-connect/routes.ts:240](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L240) ___ @@ -154,7 +155,7 @@ Routes.connectedAccounts #### Defined in -[src/seam-connect/routes.ts:360](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L360) +[src/seam-connect/routes.ts:362](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L362) ___ @@ -181,7 +182,7 @@ Routes.devices #### Defined in -[src/seam-connect/routes.ts:179](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L179) +[src/seam-connect/routes.ts:181](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L181) ___ @@ -201,7 +202,7 @@ Routes.events #### Defined in -[src/seam-connect/routes.ts:226](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L226) +[src/seam-connect/routes.ts:228](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L228) ___ @@ -224,7 +225,27 @@ Routes.locks #### Defined in -[src/seam-connect/routes.ts:144](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L144) +[src/seam-connect/routes.ts:146](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L146) + +___ + +### noiseThresholds + +• `Readonly` **noiseThresholds**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `list` | (`params`: [`NoiseThresholdsListRequest`](../modules.md#noisethresholdslistrequest)) => `Promise`<{ `device_id`: `string` ; `ends_daily_at`: `string` ; `name`: `string` ; `noise_threshold_decibels`: `number` ; `noise_threshold_id`: `string` ; `noise_threshold_nrs?`: `number` ; `starts_daily_at`: `string` }[]\> | + +#### Inherited from + +Routes.noiseThresholds + +#### Defined in + +[src/seam-connect/routes.ts:397](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L397) ___ @@ -247,7 +268,7 @@ Routes.webhooks #### Defined in -[src/seam-connect/routes.ts:395](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L395) +[src/seam-connect/routes.ts:410](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L410) ___ @@ -269,7 +290,7 @@ Routes.workspaces #### Defined in -[src/seam-connect/routes.ts:128](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L128) +[src/seam-connect/routes.ts:130](https://github.com/seamapi/javascript/blob/main/src/seam-connect/routes.ts#L130) ## Methods diff --git a/docs/interfaces/AccessCodeBase.md b/docs/interfaces/AccessCodeBase.md index 3849dc86..8e8fdb61 100644 --- a/docs/interfaces/AccessCodeBase.md +++ b/docs/interfaces/AccessCodeBase.md @@ -29,7 +29,7 @@ #### Defined in -[src/types/models.ts:221](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L221) +[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) ___ @@ -39,7 +39,7 @@ ___ #### Defined in -[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) +[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) ___ @@ -49,7 +49,7 @@ ___ #### Defined in -[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) +[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) ___ @@ -59,7 +59,7 @@ ___ #### Defined in -[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) +[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) ___ @@ -69,7 +69,7 @@ ___ #### Defined in -[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) +[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) ___ @@ -79,4 +79,4 @@ ___ #### Defined in -[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) +[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) diff --git a/docs/interfaces/ActionAttemptResultTypeMap.md b/docs/interfaces/ActionAttemptResultTypeMap.md index 827a19b8..2b27304e 100644 --- a/docs/interfaces/ActionAttemptResultTypeMap.md +++ b/docs/interfaces/ActionAttemptResultTypeMap.md @@ -36,7 +36,7 @@ Record.CREATE\_ACCESS\_CODE #### Defined in -[src/types/models.ts:184](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L184) +[src/types/models.ts:185](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L185) ___ @@ -86,4 +86,4 @@ Record.UPDATE\_ACCESS\_CODE #### Defined in -[src/types/models.ts:185](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L185) +[src/types/models.ts:186](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L186) diff --git a/docs/interfaces/ActionAttemptWithError.md b/docs/interfaces/ActionAttemptWithError.md index e7f9ac0f..2e95df4e 100644 --- a/docs/interfaces/ActionAttemptWithError.md +++ b/docs/interfaces/ActionAttemptWithError.md @@ -36,7 +36,7 @@ ActionAttemptBase.action\_attempt\_id #### Defined in -[src/types/models.ts:158](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L158) +[src/types/models.ts:159](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L159) ___ @@ -50,7 +50,7 @@ ActionAttemptBase.action\_type #### Defined in -[src/types/models.ts:159](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L159) +[src/types/models.ts:160](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L160) ___ @@ -71,7 +71,7 @@ ActionAttemptBase.error #### Defined in -[src/types/models.ts:176](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L176) +[src/types/models.ts:177](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L177) ___ @@ -85,7 +85,7 @@ ActionAttemptBase.result #### Defined in -[src/types/models.ts:175](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L175) +[src/types/models.ts:176](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L176) ___ @@ -99,4 +99,4 @@ ActionAttemptBase.status #### Defined in -[src/types/models.ts:174](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L174) +[src/types/models.ts:175](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L175) diff --git a/docs/interfaces/ConnectWebview.md b/docs/interfaces/ConnectWebview.md index a5344c39..2ff206d2 100644 --- a/docs/interfaces/ConnectWebview.md +++ b/docs/interfaces/ConnectWebview.md @@ -32,7 +32,7 @@ #### Defined in -[src/types/models.ts:206](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L206) +[src/types/models.ts:207](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L207) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[src/types/models.ts:204](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L204) +[src/types/models.ts:205](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L205) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[src/types/models.ts:208](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L208) +[src/types/models.ts:209](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L209) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[src/types/models.ts:207](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L207) +[src/types/models.ts:208](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L208) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[src/types/models.ts:216](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L216) +[src/types/models.ts:217](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L217) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[src/types/models.ts:201](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L201) +[src/types/models.ts:202](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L202) ___ @@ -92,7 +92,7 @@ ___ #### Defined in -[src/types/models.ts:212](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L212) +[src/types/models.ts:213](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L213) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[src/types/models.ts:209](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L209) +[src/types/models.ts:210](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L210) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[src/types/models.ts:217](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L217) +[src/types/models.ts:218](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L218) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[src/types/models.ts:214](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L214) +[src/types/models.ts:215](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L215) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[src/types/models.ts:213](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L213) +[src/types/models.ts:214](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L214) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[src/types/models.ts:203](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L203) +[src/types/models.ts:204](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L204) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[src/types/models.ts:210](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L210) +[src/types/models.ts:211](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L211) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[src/types/models.ts:205](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L205) +[src/types/models.ts:206](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L206) ___ @@ -172,7 +172,7 @@ ___ #### Defined in -[src/types/models.ts:211](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L211) +[src/types/models.ts:212](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L212) ___ @@ -182,7 +182,7 @@ ___ #### Defined in -[src/types/models.ts:215](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L215) +[src/types/models.ts:216](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L216) ___ @@ -192,4 +192,4 @@ ___ #### Defined in -[src/types/models.ts:202](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L202) +[src/types/models.ts:203](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L203) diff --git a/docs/interfaces/ConnectedAccount.md b/docs/interfaces/ConnectedAccount.md index bbbd26f8..f037ac2d 100644 --- a/docs/interfaces/ConnectedAccount.md +++ b/docs/interfaces/ConnectedAccount.md @@ -22,7 +22,7 @@ #### Defined in -[src/types/models.ts:264](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L264) +[src/types/models.ts:265](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L265) ___ @@ -32,7 +32,7 @@ ___ #### Defined in -[src/types/models.ts:261](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L261) +[src/types/models.ts:262](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L262) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[src/types/models.ts:262](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L262) +[src/types/models.ts:263](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L263) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[src/types/models.ts:267](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L267) +[src/types/models.ts:268](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L268) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[src/types/models.ts:265](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L265) +[src/types/models.ts:266](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L266) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[src/types/models.ts:263](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L263) +[src/types/models.ts:264](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L264) ___ @@ -82,4 +82,4 @@ ___ #### Defined in -[src/types/models.ts:266](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L266) +[src/types/models.ts:267](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L267) diff --git a/docs/interfaces/Device.md b/docs/interfaces/Device.md index 7be166ae..77f9d4cd 100644 --- a/docs/interfaces/Device.md +++ b/docs/interfaces/Device.md @@ -32,7 +32,7 @@ #### Defined in -[src/types/models.ts:93](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L93) +[src/types/models.ts:94](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L94) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[src/types/models.ts:92](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L92) +[src/types/models.ts:93](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L93) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[src/types/models.ts:96](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L96) +[src/types/models.ts:97](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L97) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[src/types/models.ts:87](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L87) +[src/types/models.ts:88](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L88) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[src/types/models.ts:91](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L91) +[src/types/models.ts:92](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L92) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[src/types/models.ts:94](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L94) +[src/types/models.ts:95](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L95) ___ @@ -92,7 +92,7 @@ ___ #### Defined in -[src/types/models.ts:90](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L90) +[src/types/models.ts:91](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L91) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[src/types/models.ts:89](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L89) +[src/types/models.ts:90](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L90) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[src/types/models.ts:95](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L95) +[src/types/models.ts:96](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L96) ___ @@ -122,4 +122,4 @@ ___ #### Defined in -[src/types/models.ts:88](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L88) +[src/types/models.ts:89](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L89) diff --git a/docs/interfaces/DeviceProvider.md b/docs/interfaces/DeviceProvider.md index 8fb544a0..80fc81fa 100644 --- a/docs/interfaces/DeviceProvider.md +++ b/docs/interfaces/DeviceProvider.md @@ -19,7 +19,7 @@ #### Defined in -[src/types/models.ts:111](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L111) +[src/types/models.ts:112](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L112) ___ @@ -29,7 +29,7 @@ ___ #### Defined in -[src/types/models.ts:112](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L112) +[src/types/models.ts:113](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L113) ___ @@ -39,7 +39,7 @@ ___ #### Defined in -[src/types/models.ts:113](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L113) +[src/types/models.ts:114](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L114) ___ @@ -49,4 +49,4 @@ ___ #### Defined in -[src/types/models.ts:114](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L114) +[src/types/models.ts:115](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L115) diff --git a/docs/interfaces/LockProperties.md b/docs/interfaces/LockProperties.md index 9451fda6..24048b34 100644 --- a/docs/interfaces/LockProperties.md +++ b/docs/interfaces/LockProperties.md @@ -47,7 +47,7 @@ #### Defined in -[src/types/models.ts:135](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L135) +[src/types/models.ts:136](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L136) ___ @@ -68,7 +68,7 @@ CommonDeviceProperties.battery #### Defined in -[src/types/models.ts:71](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L71) +[src/types/models.ts:72](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L72) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[src/types/models.ts:120](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L120) +[src/types/models.ts:121](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L121) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[src/types/models.ts:119](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L119) +[src/types/models.ts:120](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L120) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[src/types/models.ts:121](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L121) +[src/types/models.ts:122](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L122) ___ @@ -112,7 +112,7 @@ CommonDeviceProperties.image\_url #### Defined in -[src/types/models.ts:75](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L75) +[src/types/models.ts:76](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L76) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[src/types/models.ts:118](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L118) +[src/types/models.ts:119](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L119) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[src/types/models.ts:122](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L122) +[src/types/models.ts:123](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L123) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[src/types/models.ts:124](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L124) +[src/types/models.ts:125](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L125) ___ @@ -156,7 +156,7 @@ CommonDeviceProperties.name #### Defined in -[src/types/models.ts:69](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L69) +[src/types/models.ts:70](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L70) ___ @@ -170,7 +170,7 @@ CommonDeviceProperties.online #### Defined in -[src/types/models.ts:70](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L70) +[src/types/models.ts:71](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L71) ___ @@ -190,7 +190,7 @@ ___ #### Defined in -[src/types/models.ts:127](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L127) +[src/types/models.ts:128](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L128) ___ @@ -200,7 +200,7 @@ ___ #### Defined in -[src/types/models.ts:125](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L125) +[src/types/models.ts:126](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L126) ___ @@ -210,7 +210,7 @@ ___ #### Defined in -[src/types/models.ts:144](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L144) +[src/types/models.ts:145](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L145) ___ @@ -220,4 +220,4 @@ ___ #### Defined in -[src/types/models.ts:123](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L123) +[src/types/models.ts:124](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L124) diff --git a/docs/interfaces/ManagedAccessCodeBase.md b/docs/interfaces/ManagedAccessCodeBase.md index 4a96573a..241c06e4 100644 --- a/docs/interfaces/ManagedAccessCodeBase.md +++ b/docs/interfaces/ManagedAccessCodeBase.md @@ -37,7 +37,7 @@ #### Defined in -[src/types/models.ts:221](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L221) +[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) ___ @@ -51,7 +51,7 @@ ___ #### Defined in -[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) +[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) ___ @@ -61,7 +61,7 @@ ___ #### Defined in -[src/types/models.ts:230](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L230) +[src/types/models.ts:231](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L231) ___ @@ -75,7 +75,7 @@ ___ #### Defined in -[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) +[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) ___ @@ -89,7 +89,7 @@ ___ #### Defined in -[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) +[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) ___ @@ -99,7 +99,7 @@ ___ #### Defined in -[src/types/models.ts:231](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L231) +[src/types/models.ts:232](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L232) ___ @@ -113,7 +113,7 @@ ___ #### Defined in -[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) +[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) ___ @@ -127,4 +127,4 @@ ___ #### Defined in -[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) +[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) diff --git a/docs/interfaces/OngoingAccessCode.md b/docs/interfaces/OngoingAccessCode.md index f33b66fe..9d3cde30 100644 --- a/docs/interfaces/OngoingAccessCode.md +++ b/docs/interfaces/OngoingAccessCode.md @@ -36,7 +36,7 @@ #### Defined in -[src/types/models.ts:221](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L221) +[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) ___ @@ -50,7 +50,7 @@ ___ #### Defined in -[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) +[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[src/types/models.ts:230](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L230) +[src/types/models.ts:231](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L231) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[src/types/models.ts:236](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L236) +[src/types/models.ts:237](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L237) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) +[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) +[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[src/types/models.ts:231](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L231) +[src/types/models.ts:232](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L232) ___ @@ -130,7 +130,7 @@ ___ #### Defined in -[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) +[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[src/types/models.ts:237](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L237) +[src/types/models.ts:238](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L238) ___ @@ -150,7 +150,7 @@ ___ #### Defined in -[src/types/models.ts:235](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L235) +[src/types/models.ts:236](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L236) ___ @@ -164,4 +164,4 @@ ___ #### Defined in -[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) +[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) diff --git a/docs/interfaces/PendingActionAttempt.md b/docs/interfaces/PendingActionAttempt.md index 671b10ff..f3308190 100644 --- a/docs/interfaces/PendingActionAttempt.md +++ b/docs/interfaces/PendingActionAttempt.md @@ -36,7 +36,7 @@ ActionAttemptBase.action\_attempt\_id #### Defined in -[src/types/models.ts:158](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L158) +[src/types/models.ts:159](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L159) ___ @@ -50,7 +50,7 @@ ActionAttemptBase.action\_type #### Defined in -[src/types/models.ts:159](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L159) +[src/types/models.ts:160](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L160) ___ @@ -64,7 +64,7 @@ ActionAttemptBase.error #### Defined in -[src/types/models.ts:169](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L169) +[src/types/models.ts:170](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L170) ___ @@ -78,7 +78,7 @@ ActionAttemptBase.result #### Defined in -[src/types/models.ts:168](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L168) +[src/types/models.ts:169](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L169) ___ @@ -92,4 +92,4 @@ ActionAttemptBase.status #### Defined in -[src/types/models.ts:167](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L167) +[src/types/models.ts:168](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L168) diff --git a/docs/interfaces/SeamError.md b/docs/interfaces/SeamError.md index b9b81564..eb1578fd 100644 --- a/docs/interfaces/SeamError.md +++ b/docs/interfaces/SeamError.md @@ -17,7 +17,7 @@ #### Defined in -[src/types/models.ts:57](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L57) +[src/types/models.ts:58](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L58) ___ @@ -27,4 +27,4 @@ ___ #### Defined in -[src/types/models.ts:58](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L58) +[src/types/models.ts:59](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L59) diff --git a/docs/interfaces/SeamWarning.md b/docs/interfaces/SeamWarning.md index c5f47a4d..64a80431 100644 --- a/docs/interfaces/SeamWarning.md +++ b/docs/interfaces/SeamWarning.md @@ -17,7 +17,7 @@ #### Defined in -[src/types/models.ts:63](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L63) +[src/types/models.ts:64](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L64) ___ @@ -27,4 +27,4 @@ ___ #### Defined in -[src/types/models.ts:62](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L62) +[src/types/models.ts:63](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L63) diff --git a/docs/interfaces/SuccessfulActionAttempt.md b/docs/interfaces/SuccessfulActionAttempt.md index 5c59a224..99aa2323 100644 --- a/docs/interfaces/SuccessfulActionAttempt.md +++ b/docs/interfaces/SuccessfulActionAttempt.md @@ -36,7 +36,7 @@ ActionAttemptBase.action\_attempt\_id #### Defined in -[src/types/models.ts:158](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L158) +[src/types/models.ts:159](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L159) ___ @@ -50,7 +50,7 @@ ActionAttemptBase.action\_type #### Defined in -[src/types/models.ts:159](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L159) +[src/types/models.ts:160](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L160) ___ @@ -64,7 +64,7 @@ ActionAttemptBase.error #### Defined in -[src/types/models.ts:191](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L191) +[src/types/models.ts:192](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L192) ___ @@ -78,7 +78,7 @@ ActionAttemptBase.result #### Defined in -[src/types/models.ts:192](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L192) +[src/types/models.ts:193](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L193) ___ @@ -92,4 +92,4 @@ ActionAttemptBase.status #### Defined in -[src/types/models.ts:190](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L190) +[src/types/models.ts:191](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L191) diff --git a/docs/interfaces/TimeBoundAccessCode.md b/docs/interfaces/TimeBoundAccessCode.md index fc0cdfc4..ece2bb37 100644 --- a/docs/interfaces/TimeBoundAccessCode.md +++ b/docs/interfaces/TimeBoundAccessCode.md @@ -38,7 +38,7 @@ #### Defined in -[src/types/models.ts:221](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L221) +[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) +[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[src/types/models.ts:230](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L230) +[src/types/models.ts:231](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L231) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[src/types/models.ts:242](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L242) +[src/types/models.ts:243](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L243) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) +[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[src/types/models.ts:245](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L245) +[src/types/models.ts:246](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L246) ___ @@ -114,7 +114,7 @@ ___ #### Defined in -[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) +[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) ___ @@ -128,7 +128,7 @@ ___ #### Defined in -[src/types/models.ts:231](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L231) +[src/types/models.ts:232](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L232) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) +[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[src/types/models.ts:244](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L244) +[src/types/models.ts:245](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L245) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[src/types/models.ts:243](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L243) +[src/types/models.ts:244](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L244) ___ @@ -172,7 +172,7 @@ ___ #### Defined in -[src/types/models.ts:241](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L241) +[src/types/models.ts:242](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L242) ___ @@ -186,4 +186,4 @@ ___ #### Defined in -[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) +[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) diff --git a/docs/interfaces/UnmanagedAccessCode.md b/docs/interfaces/UnmanagedAccessCode.md index ba95c3b9..8b58a6c0 100644 --- a/docs/interfaces/UnmanagedAccessCode.md +++ b/docs/interfaces/UnmanagedAccessCode.md @@ -34,7 +34,7 @@ #### Defined in -[src/types/models.ts:221](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L221) +[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) ___ @@ -48,7 +48,7 @@ ___ #### Defined in -[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) +[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) ___ @@ -58,7 +58,7 @@ ___ #### Defined in -[src/types/models.ts:250](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L250) +[src/types/models.ts:251](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L251) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) +[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) +[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) +[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[src/types/models.ts:251](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L251) +[src/types/models.ts:252](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L252) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[src/types/models.ts:249](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L249) +[src/types/models.ts:250](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L250) ___ @@ -134,4 +134,4 @@ ___ #### Defined in -[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) +[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) diff --git a/docs/interfaces/UserIdentifier.md b/docs/interfaces/UserIdentifier.md index 42db52cc..88a95631 100644 --- a/docs/interfaces/UserIdentifier.md +++ b/docs/interfaces/UserIdentifier.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/models.ts:257](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L257) +[src/types/models.ts:258](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L258) diff --git a/docs/interfaces/Webhook.md b/docs/interfaces/Webhook.md index 6c39e537..3ab24154 100644 --- a/docs/interfaces/Webhook.md +++ b/docs/interfaces/Webhook.md @@ -19,7 +19,7 @@ #### Defined in -[src/types/models.ts:273](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L273) +[src/types/models.ts:274](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L274) ___ @@ -29,7 +29,7 @@ ___ #### Defined in -[src/types/models.ts:274](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L274) +[src/types/models.ts:275](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L275) ___ @@ -39,7 +39,7 @@ ___ #### Defined in -[src/types/models.ts:272](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L272) +[src/types/models.ts:273](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L273) ___ @@ -49,4 +49,4 @@ ___ #### Defined in -[src/types/models.ts:271](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L271) +[src/types/models.ts:272](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L272) diff --git a/docs/modules.md b/docs/modules.md index 0434e85e..fce0c6a0 100644 --- a/docs/modules.md +++ b/docs/modules.md @@ -114,6 +114,8 @@ - [LockDevice](modules.md#lockdevice) - [LockDeviceType](modules.md#lockdevicetype) - [NoiseDetectionDeviceType](modules.md#noisedetectiondevicetype) +- [NoiseThresholdsListRequest](modules.md#noisethresholdslistrequest) +- [NoiseThresholdsListResponse](modules.md#noisethresholdslistresponse) - [Provider](modules.md#provider) - [ProviderCategory](modules.md#providercategory) - [SeamWebhookEvent](modules.md#seamwebhookevent) @@ -165,7 +167,7 @@ ___ #### Defined in -[src/types/models.ts:254](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L254) +[src/types/models.ts:255](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L255) ___ @@ -284,7 +286,7 @@ ___ #### Defined in -[src/types/models.ts:195](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L195) +[src/types/models.ts:196](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L196) ___ @@ -294,7 +296,7 @@ ___ #### Defined in -[src/types/models.ts:150](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L150) +[src/types/models.ts:151](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L151) ___ @@ -304,7 +306,7 @@ ___ #### Defined in -[src/types/models.ts:147](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L147) +[src/types/models.ts:148](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L148) ___ @@ -314,7 +316,7 @@ ___ #### Defined in -[src/types/models.ts:66](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L66) +[src/types/models.ts:67](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L67) ___ @@ -335,7 +337,7 @@ ___ #### Defined in -[src/types/models.ts:68](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L68) +[src/types/models.ts:69](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L69) ___ @@ -388,7 +390,7 @@ ___ #### Defined in -[src/types/models.ts:78](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L78) +[src/types/models.ts:79](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L79) ___ @@ -428,7 +430,7 @@ ___ #### Defined in -[src/types/models.ts:287](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L287) +[src/types/models.ts:288](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L288) ___ @@ -438,7 +440,7 @@ ___ #### Defined in -[src/types/models.ts:148](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L148) +[src/types/models.ts:149](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L149) ___ @@ -462,13 +464,45 @@ ___ ___ +### NoiseThresholdsListRequest + +Ƭ **NoiseThresholdsListRequest**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `device_id` | `string` | + +#### Defined in + +[src/types/route-requests.ts:156](https://github.com/seamapi/javascript/blob/main/src/types/route-requests.ts#L156) + +___ + +### NoiseThresholdsListResponse + +Ƭ **NoiseThresholdsListResponse**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `noise_thresholds` | { `device_id`: `string` ; `ends_daily_at`: `string` ; `name`: `string` ; `noise_threshold_decibels`: `number` ; `noise_threshold_id`: `string` ; `noise_threshold_nrs?`: `number` ; `starts_daily_at`: `string` }[] | + +#### Defined in + +[src/types/route-requests.ts:160](https://github.com/seamapi/javascript/blob/main/src/types/route-requests.ts#L160) + +___ + ### Provider Ƭ **Provider**: typeof [`PROVIDERS`](modules.md#providers)[`number`] #### Defined in -[src/types/models.ts:51](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L51) +[src/types/models.ts:52](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L52) ___ @@ -480,7 +514,7 @@ This type can allow for other provider categories as they are added #### Defined in -[src/types/models.ts:54](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L54) +[src/types/models.ts:55](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L55) ___ @@ -534,7 +568,7 @@ ___ #### Defined in -[src/types/models.ts:99](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L99) +[src/types/models.ts:100](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L100) ___ diff --git a/src/seam-connect/routes.ts b/src/seam-connect/routes.ts index 6aee230f..ef02edb6 100644 --- a/src/seam-connect/routes.ts +++ b/src/seam-connect/routes.ts @@ -34,6 +34,8 @@ import { UnmanagedDeviceUpdateRequest, WebhookCreateRequest, WebhookGetRequest, + NoiseThresholdsListRequest, + NoiseThresholdsListResponse, } from "../types/route-requests" import { AccessCodeCreateMultipleResponse, @@ -392,6 +394,19 @@ export abstract class Routes { }), } + public readonly noiseThresholds = { + list: (params: NoiseThresholdsListRequest) => + this.makeRequestAndFormat( + "noise_thresholds", + { + url: "/noise_sensors/noise_thresholds/list", + params: { + device_id: params.device_id, + }, + } + ), + } + public readonly webhooks = { list: () => this.makeRequestAndFormat("webhooks", { diff --git a/src/types/models.ts b/src/types/models.ts index 7428b86c..a3b1f5a0 100644 --- a/src/types/models.ts +++ b/src/types/models.ts @@ -47,6 +47,7 @@ export const PROVIDERS = [ "schlage", "smartthings", "yale_access", + "minut", ] export type Provider = typeof PROVIDERS[number] diff --git a/src/types/route-requests.ts b/src/types/route-requests.ts index 327ea56e..eff743a6 100644 --- a/src/types/route-requests.ts +++ b/src/types/route-requests.ts @@ -152,3 +152,22 @@ export interface EventsListRequest { event_type?: string connected_account_id?: string } + +export type NoiseThresholdsListRequest = { + device_id: string +} + +export type NoiseThresholdsListResponse = { + noise_thresholds: { + device_id: string + noise_threshold_id: string + starts_daily_at: string + ends_daily_at: string + noise_threshold_decibels: number + name: string + /** + * Only present if the noise threshold is from Noiseaware + */ + noise_threshold_nrs?: number + }[] +} diff --git a/tests/fixtures/plugins/get-server-plugin.ts b/tests/fixtures/plugins/get-server-plugin.ts index 0fc2a1fa..ed7df4fd 100644 --- a/tests/fixtures/plugins/get-server-plugin.ts +++ b/tests/fixtures/plugins/get-server-plugin.ts @@ -3,7 +3,7 @@ import { URL } from "url" import defaultAxios from "axios" import knex from "knex" import path from "path" -import Seam, { AccessCode } from "../../../src" +import Seam, { AccessCode, Device } from "../../../src" type SeedLock = { connectedAccountId: string @@ -12,6 +12,11 @@ type SeedLock = { accessCode: AccessCode } +type SeedNoiseSensors = { + device_with_quiet_hours: Device + device_without_quiet_hours: Device +} + export type WorkerPublishedMessage = { serverUrl: string externalDatabaseUrl: string @@ -21,6 +26,7 @@ export type WorkerPublishedMessage = { workspaceId: string connectWebviewId: string devices: { + minut: SeedNoiseSensors schlageLock: SeedLock augustLock: SeedLock } diff --git a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts new file mode 100644 index 00000000..3aead714 --- /dev/null +++ b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts @@ -0,0 +1,47 @@ +import { Axios } from "axios" +import getDeviceType from "./get-device-type" + +const addFakeMinutDevices = async (axios: Axios) => { + const defaultConfig = { + sound_level_high: { + value: 60, + duration_seconds: 600, + notifications: [], + }, + sound_level_high_quiet_hours: { + value: 60, + duration_seconds: 600, + notifications: [], + enabled: true, + starts_at: "20:00", + ends_at: "08:00", + }, + } + + await axios.post("/internal/scenarios/factories/load", { + factory_name: "create_minut_devices", + input: { + devicesConfig: [ + defaultConfig, + { + ...defaultConfig, + sound_level_high_quiet_hours: { + ...defaultConfig.sound_level_high_quiet_hours, + enabled: false, + }, + }, + ], + }, + sync: true, + }) + + const devices = await getDeviceType(axios, "minut") + const [device_with_quiet_hours, device_without_quiet_hours] = devices + + return { + device_with_quiet_hours, + device_without_quiet_hours, + } +} + +export default addFakeMinutDevices diff --git a/tests/fixtures/workers/helpers/start-and-seed-server.ts b/tests/fixtures/workers/helpers/start-and-seed-server.ts index fe63b517..6f34e332 100644 --- a/tests/fixtures/workers/helpers/start-and-seed-server.ts +++ b/tests/fixtures/workers/helpers/start-and-seed-server.ts @@ -6,6 +6,7 @@ import getTestDatabase from "./get-test-database" import getTestSvix from "./get-test-svix" import addFakeSchlageDevices from "./add-fake-schlage-devices" import addFakeAugustDevices from "./add-fake-august-devices" +import addFakeMinutDevices from "./add-fake-minut-devices" const SEAM_ADMIN_PASSWORD = "1234" @@ -77,9 +78,10 @@ const startAndSeedServer = async () => { ;(axios.defaults.headers as any).Authorization = `Bearer ${api_key}` - const [schlageLock, augustLock, connectWebview] = await Promise.all([ + const [schlageLock, augustLock, minut, connectWebview] = await Promise.all([ addFakeSchlageDevices(axios), addFakeAugustDevices(axios), + addFakeMinutDevices(axios), axios.post("/connect_webviews/create", { accepted_providers: ["schlage", "august"], }), @@ -94,6 +96,7 @@ const startAndSeedServer = async () => { workspaceId: workspace.workspace_id, connectWebviewId: connectWebview.data.connect_webview.connect_webview_id, devices: { + minut, schlageLock, augustLock, }, diff --git a/tests/routes.test.ts b/tests/routes.test.ts index d3173100..73361602 100644 --- a/tests/routes.test.ts +++ b/tests/routes.test.ts @@ -2,296 +2,310 @@ import test from "ava" import { Provider } from "../src" import { testAPIMethod } from "./fixtures/helpers/test-api-method-macro" -// Workspaces -test(testAPIMethod("workspaces.list"), {}, "Workspace[]") -test(testAPIMethod("workspaces.get"), {}, "Workspace") -test(testAPIMethod("workspaces.resetSandbox"), { modifiesState: true }, "{}") +// // Workspaces +// test(testAPIMethod("workspaces.list"), {}, "Workspace[]") +// test(testAPIMethod("workspaces.get"), {}, "Workspace") +// test(testAPIMethod("workspaces.resetSandbox"), { modifiesState: true }, "{}") -// Locks -test(testAPIMethod("locks.list"), {}, "LockDevice[]") -test( - "with connected account ID", - testAPIMethod("locks.list"), - { - args: (seed) => [seed.devices.schlageLock.connectedAccountId], - }, - "LockDevice[]" -) -test( - testAPIMethod("locks.get"), - { args: (seed) => [seed.devices.schlageLock.id1] }, - "LockDevice" -) -test( - testAPIMethod("locks.lockDoor"), - { - args: (seed) => [seed.devices.schlageLock.id1], - modifiesState: true, - }, - "{}" -) -test( - testAPIMethod("locks.unlockDoor"), - { - args: (seed) => [seed.devices.schlageLock.id1], - modifiesState: true, - }, - "{}" -) +// // Locks +// test(testAPIMethod("locks.list"), {}, "LockDevice[]") +// test( +// "with connected account ID", +// testAPIMethod("locks.list"), +// { +// args: (seed) => [seed.devices.schlageLock.connectedAccountId], +// }, +// "LockDevice[]" +// ) +// test( +// testAPIMethod("locks.get"), +// { args: (seed) => [seed.devices.schlageLock.id1] }, +// "LockDevice" +// ) +// test( +// testAPIMethod("locks.lockDoor"), +// { +// args: (seed) => [seed.devices.schlageLock.id1], +// modifiesState: true, +// }, +// "{}" +// ) +// test( +// testAPIMethod("locks.unlockDoor"), +// { +// args: (seed) => [seed.devices.schlageLock.id1], +// modifiesState: true, +// }, +// "{}" +// ) -// Devices -test(testAPIMethod("devices.list"), {}, "AnyDevice[]") -test( - "with connected account ID", - testAPIMethod("devices.list"), - { - args: (seed) => [ - { connected_account_id: seed.devices.schlageLock.connectedAccountId }, - ], - }, - "AnyDevice[]" -) -test( - "by ID", - testAPIMethod("devices.get"), - { - args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], - }, - "AnyDevice" -) -test( - "by name", - testAPIMethod("devices.get"), - { - args: (seed) => [{ name: seed.devices.schlageLock.name1 }], - }, - "AnyDevice" -) -test( - testAPIMethod("devices.update"), - { - args: (seed) => [ - { - device_id: seed.devices.schlageLock.id1, - name: "New Name", - }, - ], - modifiesState: true, - }, - "{}" -) -test( - "delete", - testAPIMethod("devices.delete"), - { - args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], - modifiesState: true, - }, - "{}" -) -test(testAPIMethod("devices.unmanaged.list"), {}, "UnmanagedDevice[]") -test(testAPIMethod("devices.listDeviceProviders"), {}, "DeviceProvider[]") -test( - "with provider_category", - testAPIMethod("devices.listDeviceProviders"), - { - args: [ - { - provider_category: "stable", - }, - ], - }, - "DeviceProvider[]" -) +// // Devices +// test(testAPIMethod("devices.list"), {}, "AnyDevice[]") +// test( +// "with connected account ID", +// testAPIMethod("devices.list"), +// { +// args: (seed) => [ +// { connected_account_id: seed.devices.schlageLock.connectedAccountId }, +// ], +// }, +// "AnyDevice[]" +// ) +// test( +// "by ID", +// testAPIMethod("devices.get"), +// { +// args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], +// }, +// "AnyDevice" +// ) +// test( +// "by name", +// testAPIMethod("devices.get"), +// { +// args: (seed) => [{ name: seed.devices.schlageLock.name1 }], +// }, +// "AnyDevice" +// ) +// test( +// testAPIMethod("devices.update"), +// { +// args: (seed) => [ +// { +// device_id: seed.devices.schlageLock.id1, +// name: "New Name", +// }, +// ], +// modifiesState: true, +// }, +// "{}" +// ) +// test( +// "delete", +// testAPIMethod("devices.delete"), +// { +// args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], +// modifiesState: true, +// }, +// "{}" +// ) +// test(testAPIMethod("devices.unmanaged.list"), {}, "UnmanagedDevice[]") +// test(testAPIMethod("devices.listDeviceProviders"), {}, "DeviceProvider[]") +// test( +// "with provider_category", +// testAPIMethod("devices.listDeviceProviders"), +// { +// args: [ +// { +// provider_category: "stable", +// }, +// ], +// }, +// "DeviceProvider[]" +// ) -// Connect Webviews -test(testAPIMethod("connectWebviews.list"), {}, "ConnectWebview[]") -test( - testAPIMethod("connectWebviews.get"), - { - args: (seed) => [seed.connectWebviewId], - }, - "ConnectWebview" -) -test( - testAPIMethod("connectWebviews.create"), - { - args: [ - { - accepted_providers: ["august"], - }, - ], - modifiesState: true, - }, - "ConnectWebview" -) -test( - testAPIMethod("connectWebviews.delete"), - { - args: (seed) => [ - { - connect_webview_id: seed.connectWebviewId, - }, - ], - modifiesState: true, - }, - "{}" -) +// // Connect Webviews +// test(testAPIMethod("connectWebviews.list"), {}, "ConnectWebview[]") +// test( +// testAPIMethod("connectWebviews.get"), +// { +// args: (seed) => [seed.connectWebviewId], +// }, +// "ConnectWebview" +// ) +// test( +// testAPIMethod("connectWebviews.create"), +// { +// args: [ +// { +// accepted_providers: ["august"], +// }, +// ], +// modifiesState: true, +// }, +// "ConnectWebview" +// ) +// test( +// testAPIMethod("connectWebviews.delete"), +// { +// args: (seed) => [ +// { +// connect_webview_id: seed.connectWebviewId, +// }, +// ], +// modifiesState: true, +// }, +// "{}" +// ) -// Access Codes -test( - testAPIMethod("accessCodes.list"), - { - args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], - }, - "AccessCode[]" -) -test( - testAPIMethod("accessCodes.create"), - { - args: (seed) => [ - { - device_id: seed.devices.schlageLock.id1, - name: "Created by Ava", - code: "4321", - }, - ], - modifiesState: true, - }, - "AccessCode" -) -test( - testAPIMethod("accessCodes.createMultiple"), - { - args: (seed) => [ - { - device_ids: [seed.devices.schlageLock.id1], - name: "Created by Ava", - }, - ], - modifiesState: true, - }, - "AccessCode[]" -) -test( - "by access code ID", - testAPIMethod("accessCodes.get"), - { - args: (seed) => [ - { - access_code_id: seed.devices.augustLock.accessCode.access_code_id, - }, - ], - }, - "AccessCode" -) -test( - "by device ID and code", - testAPIMethod("accessCodes.get"), - { - args: (seed) => [ - { - device_id: seed.devices.augustLock.id1, - code: seed.devices.augustLock.accessCode.code!, - }, - ], - }, - "AccessCode" -) -test( - "change type to timebound", - testAPIMethod("accessCodes.update"), - { - args: (seed) => [ - { - access_code_id: seed.devices.schlageLock.accessCode.access_code_id, - name: "new name", - starts_at: new Date(), - ends_at: new Date(Date.now() + 1000 * 60 * 60), - }, - ], - modifiesState: true, - }, - "TimeBoundAccessCode" -) -test( - "scheduled", - testAPIMethod("accessCodes.create"), - { - args: (seed) => [ - { - device_id: seed.devices.augustLock.id1, - name: "Created by Ava", - code: "4321", - starts_at: new Date(), - ends_at: new Date(Date.now() + 1000 * 60 * 60), - }, - ], - modifiesState: true, - }, - "AccessCode" -) -test( - testAPIMethod("accessCodes.update"), - { - args: (seed) => [ - { - access_code_id: seed.devices.augustLock.accessCode.access_code_id, - name: "new name", - }, - ], - modifiesState: true, - }, - "AccessCode" -) -test( - "change type to ongoing", - testAPIMethod("accessCodes.update"), - { - args: (seed) => [ - { - access_code_id: seed.devices.augustLock.accessCode.access_code_id, - type: "ongoing", - }, - ], - modifiesState: true, - }, - "OngoingAccessCode" -) -test(testAPIMethod("connectedAccounts.list"), {}, "ConnectedAccount[]") -test( - "by email", - testAPIMethod("connectedAccounts.get"), - { - args: (seed) => [ - { - email: "user-3@example.com", - }, - ], - }, - "ConnectedAccount" -) -test( - "by ID", - testAPIMethod("connectedAccounts.get"), - { - args: (seed) => [ - { - connected_account_id: seed.devices.augustLock.connectedAccountId, - }, - ], - }, - "ConnectedAccount" -) +// // Access Codes +// test( +// testAPIMethod("accessCodes.list"), +// { +// args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], +// }, +// "AccessCode[]" +// ) +// test( +// testAPIMethod("accessCodes.create"), +// { +// args: (seed) => [ +// { +// device_id: seed.devices.schlageLock.id1, +// name: "Created by Ava", +// code: "4321", +// }, +// ], +// modifiesState: true, +// }, +// "AccessCode" +// ) +// test( +// testAPIMethod("accessCodes.createMultiple"), +// { +// args: (seed) => [ +// { +// device_ids: [seed.devices.schlageLock.id1], +// name: "Created by Ava", +// }, +// ], +// modifiesState: true, +// }, +// "AccessCode[]" +// ) +// test( +// "by access code ID", +// testAPIMethod("accessCodes.get"), +// { +// args: (seed) => [ +// { +// access_code_id: seed.devices.augustLock.accessCode.access_code_id, +// }, +// ], +// }, +// "AccessCode" +// ) +// test( +// "by device ID and code", +// testAPIMethod("accessCodes.get"), +// { +// args: (seed) => [ +// { +// device_id: seed.devices.augustLock.id1, +// code: seed.devices.augustLock.accessCode.code!, +// }, +// ], +// }, +// "AccessCode" +// ) +// test( +// "change type to timebound", +// testAPIMethod("accessCodes.update"), +// { +// args: (seed) => [ +// { +// access_code_id: seed.devices.schlageLock.accessCode.access_code_id, +// name: "new name", +// starts_at: new Date(), +// ends_at: new Date(Date.now() + 1000 * 60 * 60), +// }, +// ], +// modifiesState: true, +// }, +// "TimeBoundAccessCode" +// ) +// test( +// "scheduled", +// testAPIMethod("accessCodes.create"), +// { +// args: (seed) => [ +// { +// device_id: seed.devices.augustLock.id1, +// name: "Created by Ava", +// code: "4321", +// starts_at: new Date(), +// ends_at: new Date(Date.now() + 1000 * 60 * 60), +// }, +// ], +// modifiesState: true, +// }, +// "AccessCode" +// ) +// test( +// testAPIMethod("accessCodes.update"), +// { +// args: (seed) => [ +// { +// access_code_id: seed.devices.augustLock.accessCode.access_code_id, +// name: "new name", +// }, +// ], +// modifiesState: true, +// }, +// "AccessCode" +// ) +// test( +// "change type to ongoing", +// testAPIMethod("accessCodes.update"), +// { +// args: (seed) => [ +// { +// access_code_id: seed.devices.augustLock.accessCode.access_code_id, +// type: "ongoing", +// }, +// ], +// modifiesState: true, +// }, +// "OngoingAccessCode" +// ) +// test(testAPIMethod("connectedAccounts.list"), {}, "ConnectedAccount[]") +// test( +// "by email", +// testAPIMethod("connectedAccounts.get"), +// { +// args: (seed) => [ +// { +// email: "user-3@example.com", +// }, +// ], +// }, +// "ConnectedAccount" +// ) +// test( +// "by ID", +// testAPIMethod("connectedAccounts.get"), +// { +// args: (seed) => [ +// { +// connected_account_id: seed.devices.augustLock.connectedAccountId, +// }, +// ], +// }, +// "ConnectedAccount" +// ) +// test( +// testAPIMethod("connectedAccounts.delete"), +// { +// args: (seed) => [ +// { +// connected_account_id: seed.devices.augustLock.connectedAccountId, +// }, +// ], +// modifiesState: true, +// }, +// "{}" +// ) + +// Noise Thresholds test( - testAPIMethod("connectedAccounts.delete"), + testAPIMethod("noiseThresholds.list"), { args: (seed) => [ { - connected_account_id: seed.devices.augustLock.connectedAccountId, + device_id: seed.devices.minut.device_with_quiet_hours.device_id, }, ], modifiesState: true, }, - "{}" + "NoiseThresholdsListResponse" ) From 5a453bd3ec6793562a1ca07c27e30265e305b0d2 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Mon, 17 Apr 2023 14:20:18 -0300 Subject: [PATCH 02/18] add noise thresholds list --- docs/classes/Seam.md | 2 +- .../AccessCodeCreateMultipleResponse.md | 2 +- docs/interfaces/AccessCodeCreateResponse.md | 4 +- docs/interfaces/AccessCodeGetResponse.md | 2 +- docs/interfaces/AccessCodesListResponse.md | 2 +- .../interfaces/ActionAttemptCreateResponse.md | 2 +- docs/interfaces/ActionAttemptGetResponse.md | 2 +- .../ConnectWebviewCreateResponse.md | 2 +- docs/interfaces/ConnectWebviewGetResponse.md | 2 +- .../interfaces/ConnectWebviewsListResponse.md | 2 +- .../ConnectedAccountsGetResponse.md | 2 +- .../ConnectedAccountsListResponse.md | 2 +- docs/interfaces/DeviceGetResponse.md | 2 +- .../interfaces/DeviceProvidersListResponse.md | 2 +- docs/interfaces/DevicesListResponse.md | 2 +- docs/interfaces/EventsListResponse.md | 2 +- docs/interfaces/LockGetResponse.md | 2 +- docs/interfaces/LocksListResponse.md | 2 +- .../UnmanagedAccessCodesGetResponse.md | 2 +- .../UnmanagedAccessCodesListResponse.md | 2 +- .../interfaces/UnmanagedDeviceListResponse.md | 2 +- docs/interfaces/WebhookGetResponse.md | 2 +- docs/interfaces/WebhookListResponse.md | 2 +- docs/interfaces/WorkspaceGetResponse.md | 2 +- .../WorkspaceResetSandboxResponse.md | 2 +- docs/interfaces/WorkspacesListResponse.md | 2 +- docs/modules.md | 27 +- src/cli/commands/index.ts | 1 + src/cli/commands/noise-thresholds.ts | 36 ++ src/seam-connect/routes.ts | 2 +- src/types/models.ts | 13 + src/types/route-requests.ts | 15 - src/types/route-responses.ts | 5 + .../workers/helpers/add-fake-minut-devices.ts | 2 +- .../workers/helpers/start-and-seed-server.ts | 7 +- tests/routes.test.ts | 581 +++++++++--------- 36 files changed, 405 insertions(+), 338 deletions(-) create mode 100644 src/cli/commands/noise-thresholds.ts diff --git a/docs/classes/Seam.md b/docs/classes/Seam.md index 8f091e77..7018aefe 100644 --- a/docs/classes/Seam.md +++ b/docs/classes/Seam.md @@ -237,7 +237,7 @@ ___ | Name | Type | | :------ | :------ | -| `list` | (`params`: [`NoiseThresholdsListRequest`](../modules.md#noisethresholdslistrequest)) => `Promise`<{ `device_id`: `string` ; `ends_daily_at`: `string` ; `name`: `string` ; `noise_threshold_decibels`: `number` ; `noise_threshold_id`: `string` ; `noise_threshold_nrs?`: `number` ; `starts_daily_at`: `string` }[]\> | +| `list` | (`params`: [`NoiseThresholdsListRequest`](../modules.md#noisethresholdslistrequest)) => `Promise`<[`NoiseThresholds`](../modules.md#noisethresholds)[]\> | #### Inherited from diff --git a/docs/interfaces/AccessCodeCreateMultipleResponse.md b/docs/interfaces/AccessCodeCreateMultipleResponse.md index 753283b0..4f48d8a8 100644 --- a/docs/interfaces/AccessCodeCreateMultipleResponse.md +++ b/docs/interfaces/AccessCodeCreateMultipleResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:84](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L84) +[src/types/route-responses.ts:85](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L85) diff --git a/docs/interfaces/AccessCodeCreateResponse.md b/docs/interfaces/AccessCodeCreateResponse.md index 52090acf..8e4ad25f 100644 --- a/docs/interfaces/AccessCodeCreateResponse.md +++ b/docs/interfaces/AccessCodeCreateResponse.md @@ -29,7 +29,7 @@ #### Defined in -[src/types/route-responses.ts:77](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L77) +[src/types/route-responses.ts:78](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L78) ___ @@ -43,4 +43,4 @@ ___ #### Defined in -[src/types/route-responses.ts:121](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L121) +[src/types/route-responses.ts:122](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L122) diff --git a/docs/interfaces/AccessCodeGetResponse.md b/docs/interfaces/AccessCodeGetResponse.md index 89e075d6..f4051e32 100644 --- a/docs/interfaces/AccessCodeGetResponse.md +++ b/docs/interfaces/AccessCodeGetResponse.md @@ -22,4 +22,4 @@ #### Defined in -[src/types/route-responses.ts:77](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L77) +[src/types/route-responses.ts:78](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L78) diff --git a/docs/interfaces/AccessCodesListResponse.md b/docs/interfaces/AccessCodesListResponse.md index 49179e29..f66a09f5 100644 --- a/docs/interfaces/AccessCodesListResponse.md +++ b/docs/interfaces/AccessCodesListResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:74](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L74) +[src/types/route-responses.ts:75](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L75) diff --git a/docs/interfaces/ActionAttemptCreateResponse.md b/docs/interfaces/ActionAttemptCreateResponse.md index 7f74ab8b..c4b4142b 100644 --- a/docs/interfaces/ActionAttemptCreateResponse.md +++ b/docs/interfaces/ActionAttemptCreateResponse.md @@ -22,4 +22,4 @@ #### Defined in -[src/types/route-responses.ts:117](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L117) +[src/types/route-responses.ts:118](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L118) diff --git a/docs/interfaces/ActionAttemptGetResponse.md b/docs/interfaces/ActionAttemptGetResponse.md index 5a05d5f3..af3abe60 100644 --- a/docs/interfaces/ActionAttemptGetResponse.md +++ b/docs/interfaces/ActionAttemptGetResponse.md @@ -28,4 +28,4 @@ #### Defined in -[src/types/route-responses.ts:121](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L121) +[src/types/route-responses.ts:122](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L122) diff --git a/docs/interfaces/ConnectWebviewCreateResponse.md b/docs/interfaces/ConnectWebviewCreateResponse.md index 6c7aeaa0..35c30348 100644 --- a/docs/interfaces/ConnectWebviewCreateResponse.md +++ b/docs/interfaces/ConnectWebviewCreateResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:66](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L66) +[src/types/route-responses.ts:67](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L67) diff --git a/docs/interfaces/ConnectWebviewGetResponse.md b/docs/interfaces/ConnectWebviewGetResponse.md index 66b518ce..457fc9f9 100644 --- a/docs/interfaces/ConnectWebviewGetResponse.md +++ b/docs/interfaces/ConnectWebviewGetResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:63](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L63) +[src/types/route-responses.ts:64](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L64) diff --git a/docs/interfaces/ConnectWebviewsListResponse.md b/docs/interfaces/ConnectWebviewsListResponse.md index 5add8efc..e898fef5 100644 --- a/docs/interfaces/ConnectWebviewsListResponse.md +++ b/docs/interfaces/ConnectWebviewsListResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:60](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L60) +[src/types/route-responses.ts:61](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L61) diff --git a/docs/interfaces/ConnectedAccountsGetResponse.md b/docs/interfaces/ConnectedAccountsGetResponse.md index a63a149a..8b63beec 100644 --- a/docs/interfaces/ConnectedAccountsGetResponse.md +++ b/docs/interfaces/ConnectedAccountsGetResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:100](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L100) +[src/types/route-responses.ts:101](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L101) diff --git a/docs/interfaces/ConnectedAccountsListResponse.md b/docs/interfaces/ConnectedAccountsListResponse.md index 9f140c68..6be83d7c 100644 --- a/docs/interfaces/ConnectedAccountsListResponse.md +++ b/docs/interfaces/ConnectedAccountsListResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:97](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L97) +[src/types/route-responses.ts:98](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L98) diff --git a/docs/interfaces/DeviceGetResponse.md b/docs/interfaces/DeviceGetResponse.md index 2eac80c0..f2f6d922 100644 --- a/docs/interfaces/DeviceGetResponse.md +++ b/docs/interfaces/DeviceGetResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:45](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L45) +[src/types/route-responses.ts:46](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L46) diff --git a/docs/interfaces/DeviceProvidersListResponse.md b/docs/interfaces/DeviceProvidersListResponse.md index 74640480..28ec7c02 100644 --- a/docs/interfaces/DeviceProvidersListResponse.md +++ b/docs/interfaces/DeviceProvidersListResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:55](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L55) +[src/types/route-responses.ts:56](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L56) diff --git a/docs/interfaces/DevicesListResponse.md b/docs/interfaces/DevicesListResponse.md index 042aab09..e944f5cb 100644 --- a/docs/interfaces/DevicesListResponse.md +++ b/docs/interfaces/DevicesListResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:42](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L42) +[src/types/route-responses.ts:43](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L43) diff --git a/docs/interfaces/EventsListResponse.md b/docs/interfaces/EventsListResponse.md index 5b20ab74..4680a519 100644 --- a/docs/interfaces/EventsListResponse.md +++ b/docs/interfaces/EventsListResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:126](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L126) +[src/types/route-responses.ts:127](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L127) diff --git a/docs/interfaces/LockGetResponse.md b/docs/interfaces/LockGetResponse.md index 45fcdd1d..437bc20e 100644 --- a/docs/interfaces/LockGetResponse.md +++ b/docs/interfaces/LockGetResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:37](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L37) +[src/types/route-responses.ts:38](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L38) diff --git a/docs/interfaces/LocksListResponse.md b/docs/interfaces/LocksListResponse.md index cdde2437..30e4bdea 100644 --- a/docs/interfaces/LocksListResponse.md +++ b/docs/interfaces/LocksListResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:33](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L33) +[src/types/route-responses.ts:34](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L34) diff --git a/docs/interfaces/UnmanagedAccessCodesGetResponse.md b/docs/interfaces/UnmanagedAccessCodesGetResponse.md index 81967f39..cae110ba 100644 --- a/docs/interfaces/UnmanagedAccessCodesGetResponse.md +++ b/docs/interfaces/UnmanagedAccessCodesGetResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:92](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L92) +[src/types/route-responses.ts:93](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L93) diff --git a/docs/interfaces/UnmanagedAccessCodesListResponse.md b/docs/interfaces/UnmanagedAccessCodesListResponse.md index d47094c9..4611321f 100644 --- a/docs/interfaces/UnmanagedAccessCodesListResponse.md +++ b/docs/interfaces/UnmanagedAccessCodesListResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:89](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L89) +[src/types/route-responses.ts:90](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L90) diff --git a/docs/interfaces/UnmanagedDeviceListResponse.md b/docs/interfaces/UnmanagedDeviceListResponse.md index 318226d0..ae530d76 100644 --- a/docs/interfaces/UnmanagedDeviceListResponse.md +++ b/docs/interfaces/UnmanagedDeviceListResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:50](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L50) +[src/types/route-responses.ts:51](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L51) diff --git a/docs/interfaces/WebhookGetResponse.md b/docs/interfaces/WebhookGetResponse.md index 1a4d8637..95f276b2 100644 --- a/docs/interfaces/WebhookGetResponse.md +++ b/docs/interfaces/WebhookGetResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:109](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L109) +[src/types/route-responses.ts:110](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L110) diff --git a/docs/interfaces/WebhookListResponse.md b/docs/interfaces/WebhookListResponse.md index 41d04af6..76fc36e2 100644 --- a/docs/interfaces/WebhookListResponse.md +++ b/docs/interfaces/WebhookListResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:105](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L105) +[src/types/route-responses.ts:106](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L106) diff --git a/docs/interfaces/WorkspaceGetResponse.md b/docs/interfaces/WorkspaceGetResponse.md index fcd70264..31aa9c57 100644 --- a/docs/interfaces/WorkspaceGetResponse.md +++ b/docs/interfaces/WorkspaceGetResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:23](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L23) +[src/types/route-responses.ts:24](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L24) diff --git a/docs/interfaces/WorkspaceResetSandboxResponse.md b/docs/interfaces/WorkspaceResetSandboxResponse.md index 44541584..4ccf561a 100644 --- a/docs/interfaces/WorkspaceResetSandboxResponse.md +++ b/docs/interfaces/WorkspaceResetSandboxResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:28](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L28) +[src/types/route-responses.ts:29](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L29) diff --git a/docs/interfaces/WorkspacesListResponse.md b/docs/interfaces/WorkspacesListResponse.md index 1445f70b..8ff5a9bf 100644 --- a/docs/interfaces/WorkspacesListResponse.md +++ b/docs/interfaces/WorkspacesListResponse.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/route-responses.ts:20](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L20) +[src/types/route-responses.ts:21](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L21) diff --git a/docs/modules.md b/docs/modules.md index fce0c6a0..e4656721 100644 --- a/docs/modules.md +++ b/docs/modules.md @@ -114,6 +114,7 @@ - [LockDevice](modules.md#lockdevice) - [LockDeviceType](modules.md#lockdevicetype) - [NoiseDetectionDeviceType](modules.md#noisedetectiondevicetype) +- [NoiseThresholds](modules.md#noisethresholds) - [NoiseThresholdsListRequest](modules.md#noisethresholdslistrequest) - [NoiseThresholdsListResponse](modules.md#noisethresholdslistresponse) - [Provider](modules.md#provider) @@ -464,6 +465,28 @@ ___ ___ +### NoiseThresholds + +Ƭ **NoiseThresholds**: `Object` + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `device_id` | `string` | - | +| `ends_daily_at` | `string` | - | +| `name` | `string` | - | +| `noise_threshold_decibels` | `number` | - | +| `noise_threshold_id` | `string` | - | +| `noise_threshold_nrs?` | `number` | Only present if the noise threshold is from Noiseaware | +| `starts_daily_at` | `string` | - | + +#### Defined in + +[src/types/models.ts:290](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L290) + +___ + ### NoiseThresholdsListRequest Ƭ **NoiseThresholdsListRequest**: `Object` @@ -488,11 +511,11 @@ ___ | Name | Type | | :------ | :------ | -| `noise_thresholds` | { `device_id`: `string` ; `ends_daily_at`: `string` ; `name`: `string` ; `noise_threshold_decibels`: `number` ; `noise_threshold_id`: `string` ; `noise_threshold_nrs?`: `number` ; `starts_daily_at`: `string` }[] | +| `noise_thresholds` | [`NoiseThresholds`](modules.md#noisethresholds)[] | #### Defined in -[src/types/route-requests.ts:160](https://github.com/seamapi/javascript/blob/main/src/types/route-requests.ts#L160) +[src/types/route-responses.ts:130](https://github.com/seamapi/javascript/blob/main/src/types/route-responses.ts#L130) ___ diff --git a/src/cli/commands/index.ts b/src/cli/commands/index.ts index 17e98978..d313dfe0 100644 --- a/src/cli/commands/index.ts +++ b/src/cli/commands/index.ts @@ -6,3 +6,4 @@ export * as devices from "./devices" export * as locks from "./locks" export * as workspaces from "./workspaces" export * as webhooks from "./webhooks" +export * as noiseThresholds from "./noise-thresholds" diff --git a/src/cli/commands/noise-thresholds.ts b/src/cli/commands/noise-thresholds.ts new file mode 100644 index 00000000..14139d5c --- /dev/null +++ b/src/cli/commands/noise-thresholds.ts @@ -0,0 +1,36 @@ +import { CommandModule } from "yargs" +import executeCommand from "../lib/execute-command" +import { GlobalOptions } from "../lib/global-options" + +const command: CommandModule = { + command: "noise-thresholds", + aliases: ["noise-thresholds", "nt"], + describe: "interact with noise thresholds", + builder: (yargs) => { + return yargs.demandCommand().command( + "list", + "list noise thresholds", + (yargs) => { + return yargs.option("device-id", { + describe: "filter by device ID", + demandOption: true, + type: "string", + }) + }, + async (argv) => { + await executeCommand( + "noiseThresholds.list", + [ + { + device_id: argv.deviceId, + }, + ], + argv + ) + } + ) + }, + handler: () => {}, +} + +export default command diff --git a/src/seam-connect/routes.ts b/src/seam-connect/routes.ts index ef02edb6..62fb8374 100644 --- a/src/seam-connect/routes.ts +++ b/src/seam-connect/routes.ts @@ -35,7 +35,6 @@ import { WebhookCreateRequest, WebhookGetRequest, NoiseThresholdsListRequest, - NoiseThresholdsListResponse, } from "../types/route-requests" import { AccessCodeCreateMultipleResponse, @@ -63,6 +62,7 @@ import { WorkspaceGetResponse, WorkspaceResetSandboxResponse, WorkspacesListResponse, + NoiseThresholdsListResponse, } from "../types/route-responses" export abstract class Routes { diff --git a/src/types/models.ts b/src/types/models.ts index a3b1f5a0..11710379 100644 --- a/src/types/models.ts +++ b/src/types/models.ts @@ -286,3 +286,16 @@ type Flatten = : never export type Event = Flatten + +export type NoiseThresholds = { + device_id: string + noise_threshold_id: string + starts_daily_at: string + ends_daily_at: string + noise_threshold_decibels: number + name: string + /** + * Only present if the noise threshold is from Noiseaware + */ + noise_threshold_nrs?: number +} diff --git a/src/types/route-requests.ts b/src/types/route-requests.ts index eff743a6..ee97e09a 100644 --- a/src/types/route-requests.ts +++ b/src/types/route-requests.ts @@ -156,18 +156,3 @@ export interface EventsListRequest { export type NoiseThresholdsListRequest = { device_id: string } - -export type NoiseThresholdsListResponse = { - noise_thresholds: { - device_id: string - noise_threshold_id: string - starts_daily_at: string - ends_daily_at: string - noise_threshold_decibels: number - name: string - /** - * Only present if the noise threshold is from Noiseaware - */ - noise_threshold_nrs?: number - }[] -} diff --git a/src/types/route-responses.ts b/src/types/route-responses.ts index 6e7ee4fa..ce852daa 100644 --- a/src/types/route-responses.ts +++ b/src/types/route-responses.ts @@ -13,6 +13,7 @@ import { UnmanagedDevice, Webhook, Workspace, + NoiseThresholds, } from "./models" // Workspaces @@ -125,3 +126,7 @@ export interface ActionAttemptGetResponse { export interface EventsListResponse { events: Event[] } + +export type NoiseThresholdsListResponse = { + noise_thresholds: NoiseThresholds[] +} diff --git a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts index 3aead714..1728f53f 100644 --- a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts +++ b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts @@ -35,7 +35,7 @@ const addFakeMinutDevices = async (axios: Axios) => { sync: true, }) - const devices = await getDeviceType(axios, "minut") + const devices = await getDeviceType(axios, "minut_sensor") const [device_with_quiet_hours, device_without_quiet_hours] = devices return { diff --git a/tests/fixtures/workers/helpers/start-and-seed-server.ts b/tests/fixtures/workers/helpers/start-and-seed-server.ts index 6f34e332..c0d305ba 100644 --- a/tests/fixtures/workers/helpers/start-and-seed-server.ts +++ b/tests/fixtures/workers/helpers/start-and-seed-server.ts @@ -83,7 +83,12 @@ const startAndSeedServer = async () => { addFakeAugustDevices(axios), addFakeMinutDevices(axios), axios.post("/connect_webviews/create", { - accepted_providers: ["schlage", "august"], + accepted_providers: [ + "schlage", + "august", + // TODO: Uncomment this line when Minut is ready + // "minut" + ], }), ]) diff --git a/tests/routes.test.ts b/tests/routes.test.ts index 73361602..91ad8336 100644 --- a/tests/routes.test.ts +++ b/tests/routes.test.ts @@ -2,299 +2,299 @@ import test from "ava" import { Provider } from "../src" import { testAPIMethod } from "./fixtures/helpers/test-api-method-macro" -// // Workspaces -// test(testAPIMethod("workspaces.list"), {}, "Workspace[]") -// test(testAPIMethod("workspaces.get"), {}, "Workspace") -// test(testAPIMethod("workspaces.resetSandbox"), { modifiesState: true }, "{}") +// Workspaces +test(testAPIMethod("workspaces.list"), {}, "Workspace[]") +test(testAPIMethod("workspaces.get"), {}, "Workspace") +test(testAPIMethod("workspaces.resetSandbox"), { modifiesState: true }, "{}") -// // Locks -// test(testAPIMethod("locks.list"), {}, "LockDevice[]") -// test( -// "with connected account ID", -// testAPIMethod("locks.list"), -// { -// args: (seed) => [seed.devices.schlageLock.connectedAccountId], -// }, -// "LockDevice[]" -// ) -// test( -// testAPIMethod("locks.get"), -// { args: (seed) => [seed.devices.schlageLock.id1] }, -// "LockDevice" -// ) -// test( -// testAPIMethod("locks.lockDoor"), -// { -// args: (seed) => [seed.devices.schlageLock.id1], -// modifiesState: true, -// }, -// "{}" -// ) -// test( -// testAPIMethod("locks.unlockDoor"), -// { -// args: (seed) => [seed.devices.schlageLock.id1], -// modifiesState: true, -// }, -// "{}" -// ) +// Locks +test(testAPIMethod("locks.list"), {}, "LockDevice[]") +test( + "with connected account ID", + testAPIMethod("locks.list"), + { + args: (seed) => [seed.devices.schlageLock.connectedAccountId], + }, + "LockDevice[]" +) +test( + testAPIMethod("locks.get"), + { args: (seed) => [seed.devices.schlageLock.id1] }, + "LockDevice" +) +test( + testAPIMethod("locks.lockDoor"), + { + args: (seed) => [seed.devices.schlageLock.id1], + modifiesState: true, + }, + "{}" +) +test( + testAPIMethod("locks.unlockDoor"), + { + args: (seed) => [seed.devices.schlageLock.id1], + modifiesState: true, + }, + "{}" +) -// // Devices -// test(testAPIMethod("devices.list"), {}, "AnyDevice[]") -// test( -// "with connected account ID", -// testAPIMethod("devices.list"), -// { -// args: (seed) => [ -// { connected_account_id: seed.devices.schlageLock.connectedAccountId }, -// ], -// }, -// "AnyDevice[]" -// ) -// test( -// "by ID", -// testAPIMethod("devices.get"), -// { -// args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], -// }, -// "AnyDevice" -// ) -// test( -// "by name", -// testAPIMethod("devices.get"), -// { -// args: (seed) => [{ name: seed.devices.schlageLock.name1 }], -// }, -// "AnyDevice" -// ) -// test( -// testAPIMethod("devices.update"), -// { -// args: (seed) => [ -// { -// device_id: seed.devices.schlageLock.id1, -// name: "New Name", -// }, -// ], -// modifiesState: true, -// }, -// "{}" -// ) -// test( -// "delete", -// testAPIMethod("devices.delete"), -// { -// args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], -// modifiesState: true, -// }, -// "{}" -// ) -// test(testAPIMethod("devices.unmanaged.list"), {}, "UnmanagedDevice[]") -// test(testAPIMethod("devices.listDeviceProviders"), {}, "DeviceProvider[]") -// test( -// "with provider_category", -// testAPIMethod("devices.listDeviceProviders"), -// { -// args: [ -// { -// provider_category: "stable", -// }, -// ], -// }, -// "DeviceProvider[]" -// ) +// Devices +test(testAPIMethod("devices.list"), {}, "AnyDevice[]") +test( + "with connected account ID", + testAPIMethod("devices.list"), + { + args: (seed) => [ + { connected_account_id: seed.devices.schlageLock.connectedAccountId }, + ], + }, + "AnyDevice[]" +) +test( + "by ID", + testAPIMethod("devices.get"), + { + args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], + }, + "AnyDevice" +) +test( + "by name", + testAPIMethod("devices.get"), + { + args: (seed) => [{ name: seed.devices.schlageLock.name1 }], + }, + "AnyDevice" +) +test( + testAPIMethod("devices.update"), + { + args: (seed) => [ + { + device_id: seed.devices.schlageLock.id1, + name: "New Name", + }, + ], + modifiesState: true, + }, + "{}" +) +test( + "delete", + testAPIMethod("devices.delete"), + { + args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], + modifiesState: true, + }, + "{}" +) +test(testAPIMethod("devices.unmanaged.list"), {}, "UnmanagedDevice[]") +test(testAPIMethod("devices.listDeviceProviders"), {}, "DeviceProvider[]") +test( + "with provider_category", + testAPIMethod("devices.listDeviceProviders"), + { + args: [ + { + provider_category: "stable", + }, + ], + }, + "DeviceProvider[]" +) -// // Connect Webviews -// test(testAPIMethod("connectWebviews.list"), {}, "ConnectWebview[]") -// test( -// testAPIMethod("connectWebviews.get"), -// { -// args: (seed) => [seed.connectWebviewId], -// }, -// "ConnectWebview" -// ) -// test( -// testAPIMethod("connectWebviews.create"), -// { -// args: [ -// { -// accepted_providers: ["august"], -// }, -// ], -// modifiesState: true, -// }, -// "ConnectWebview" -// ) -// test( -// testAPIMethod("connectWebviews.delete"), -// { -// args: (seed) => [ -// { -// connect_webview_id: seed.connectWebviewId, -// }, -// ], -// modifiesState: true, -// }, -// "{}" -// ) +// Connect Webviews +test(testAPIMethod("connectWebviews.list"), {}, "ConnectWebview[]") +test( + testAPIMethod("connectWebviews.get"), + { + args: (seed) => [seed.connectWebviewId], + }, + "ConnectWebview" +) +test( + testAPIMethod("connectWebviews.create"), + { + args: [ + { + accepted_providers: ["august"], + }, + ], + modifiesState: true, + }, + "ConnectWebview" +) +test( + testAPIMethod("connectWebviews.delete"), + { + args: (seed) => [ + { + connect_webview_id: seed.connectWebviewId, + }, + ], + modifiesState: true, + }, + "{}" +) -// // Access Codes -// test( -// testAPIMethod("accessCodes.list"), -// { -// args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], -// }, -// "AccessCode[]" -// ) -// test( -// testAPIMethod("accessCodes.create"), -// { -// args: (seed) => [ -// { -// device_id: seed.devices.schlageLock.id1, -// name: "Created by Ava", -// code: "4321", -// }, -// ], -// modifiesState: true, -// }, -// "AccessCode" -// ) -// test( -// testAPIMethod("accessCodes.createMultiple"), -// { -// args: (seed) => [ -// { -// device_ids: [seed.devices.schlageLock.id1], -// name: "Created by Ava", -// }, -// ], -// modifiesState: true, -// }, -// "AccessCode[]" -// ) -// test( -// "by access code ID", -// testAPIMethod("accessCodes.get"), -// { -// args: (seed) => [ -// { -// access_code_id: seed.devices.augustLock.accessCode.access_code_id, -// }, -// ], -// }, -// "AccessCode" -// ) -// test( -// "by device ID and code", -// testAPIMethod("accessCodes.get"), -// { -// args: (seed) => [ -// { -// device_id: seed.devices.augustLock.id1, -// code: seed.devices.augustLock.accessCode.code!, -// }, -// ], -// }, -// "AccessCode" -// ) -// test( -// "change type to timebound", -// testAPIMethod("accessCodes.update"), -// { -// args: (seed) => [ -// { -// access_code_id: seed.devices.schlageLock.accessCode.access_code_id, -// name: "new name", -// starts_at: new Date(), -// ends_at: new Date(Date.now() + 1000 * 60 * 60), -// }, -// ], -// modifiesState: true, -// }, -// "TimeBoundAccessCode" -// ) -// test( -// "scheduled", -// testAPIMethod("accessCodes.create"), -// { -// args: (seed) => [ -// { -// device_id: seed.devices.augustLock.id1, -// name: "Created by Ava", -// code: "4321", -// starts_at: new Date(), -// ends_at: new Date(Date.now() + 1000 * 60 * 60), -// }, -// ], -// modifiesState: true, -// }, -// "AccessCode" -// ) -// test( -// testAPIMethod("accessCodes.update"), -// { -// args: (seed) => [ -// { -// access_code_id: seed.devices.augustLock.accessCode.access_code_id, -// name: "new name", -// }, -// ], -// modifiesState: true, -// }, -// "AccessCode" -// ) -// test( -// "change type to ongoing", -// testAPIMethod("accessCodes.update"), -// { -// args: (seed) => [ -// { -// access_code_id: seed.devices.augustLock.accessCode.access_code_id, -// type: "ongoing", -// }, -// ], -// modifiesState: true, -// }, -// "OngoingAccessCode" -// ) -// test(testAPIMethod("connectedAccounts.list"), {}, "ConnectedAccount[]") -// test( -// "by email", -// testAPIMethod("connectedAccounts.get"), -// { -// args: (seed) => [ -// { -// email: "user-3@example.com", -// }, -// ], -// }, -// "ConnectedAccount" -// ) -// test( -// "by ID", -// testAPIMethod("connectedAccounts.get"), -// { -// args: (seed) => [ -// { -// connected_account_id: seed.devices.augustLock.connectedAccountId, -// }, -// ], -// }, -// "ConnectedAccount" -// ) -// test( -// testAPIMethod("connectedAccounts.delete"), -// { -// args: (seed) => [ -// { -// connected_account_id: seed.devices.augustLock.connectedAccountId, -// }, -// ], -// modifiesState: true, -// }, -// "{}" -// ) +// Access Codes +test( + testAPIMethod("accessCodes.list"), + { + args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], + }, + "AccessCode[]" +) +test( + testAPIMethod("accessCodes.create"), + { + args: (seed) => [ + { + device_id: seed.devices.schlageLock.id1, + name: "Created by Ava", + code: "4321", + }, + ], + modifiesState: true, + }, + "AccessCode" +) +test( + testAPIMethod("accessCodes.createMultiple"), + { + args: (seed) => [ + { + device_ids: [seed.devices.schlageLock.id1], + name: "Created by Ava", + }, + ], + modifiesState: true, + }, + "AccessCode[]" +) +test( + "by access code ID", + testAPIMethod("accessCodes.get"), + { + args: (seed) => [ + { + access_code_id: seed.devices.augustLock.accessCode.access_code_id, + }, + ], + }, + "AccessCode" +) +test( + "by device ID and code", + testAPIMethod("accessCodes.get"), + { + args: (seed) => [ + { + device_id: seed.devices.augustLock.id1, + code: seed.devices.augustLock.accessCode.code!, + }, + ], + }, + "AccessCode" +) +test( + "change type to timebound", + testAPIMethod("accessCodes.update"), + { + args: (seed) => [ + { + access_code_id: seed.devices.schlageLock.accessCode.access_code_id, + name: "new name", + starts_at: new Date(), + ends_at: new Date(Date.now() + 1000 * 60 * 60), + }, + ], + modifiesState: true, + }, + "TimeBoundAccessCode" +) +test( + "scheduled", + testAPIMethod("accessCodes.create"), + { + args: (seed) => [ + { + device_id: seed.devices.augustLock.id1, + name: "Created by Ava", + code: "4321", + starts_at: new Date(), + ends_at: new Date(Date.now() + 1000 * 60 * 60), + }, + ], + modifiesState: true, + }, + "AccessCode" +) +test( + testAPIMethod("accessCodes.update"), + { + args: (seed) => [ + { + access_code_id: seed.devices.augustLock.accessCode.access_code_id, + name: "new name", + }, + ], + modifiesState: true, + }, + "AccessCode" +) +test( + "change type to ongoing", + testAPIMethod("accessCodes.update"), + { + args: (seed) => [ + { + access_code_id: seed.devices.augustLock.accessCode.access_code_id, + type: "ongoing", + }, + ], + modifiesState: true, + }, + "OngoingAccessCode" +) +test(testAPIMethod("connectedAccounts.list"), {}, "ConnectedAccount[]") +test( + "by email", + testAPIMethod("connectedAccounts.get"), + { + args: (seed) => [ + { + email: "user-3@example.com", + }, + ], + }, + "ConnectedAccount" +) +test( + "by ID", + testAPIMethod("connectedAccounts.get"), + { + args: (seed) => [ + { + connected_account_id: seed.devices.augustLock.connectedAccountId, + }, + ], + }, + "ConnectedAccount" +) +test( + testAPIMethod("connectedAccounts.delete"), + { + args: (seed) => [ + { + connected_account_id: seed.devices.augustLock.connectedAccountId, + }, + ], + modifiesState: true, + }, + "{}" +) // Noise Thresholds test( @@ -305,7 +305,6 @@ test( device_id: seed.devices.minut.device_with_quiet_hours.device_id, }, ], - modifiesState: true, }, - "NoiseThresholdsListResponse" + "NoiseThresholds[]" ) From cdc31240fd0fcd8ff214748fa10ac86935478a30 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Mon, 17 Apr 2023 15:49:16 -0300 Subject: [PATCH 03/18] fix variable NOISE_DETECTION_DEVICE_TYPES --- docs/interfaces/AccessCodeBase.md | 12 +++---- docs/interfaces/ActionAttemptResultTypeMap.md | 4 +-- docs/interfaces/ActionAttemptWithError.md | 10 +++--- docs/interfaces/ConnectWebview.md | 34 +++++++++---------- docs/interfaces/ConnectedAccount.md | 14 ++++---- docs/interfaces/Device.md | 20 +++++------ docs/interfaces/DeviceProvider.md | 8 ++--- docs/interfaces/LockProperties.md | 30 ++++++++-------- docs/interfaces/ManagedAccessCodeBase.md | 16 ++++----- docs/interfaces/OngoingAccessCode.md | 22 ++++++------ docs/interfaces/PendingActionAttempt.md | 10 +++--- docs/interfaces/SeamError.md | 4 +-- docs/interfaces/SeamWarning.md | 4 +-- docs/interfaces/SuccessfulActionAttempt.md | 10 +++--- docs/interfaces/TimeBoundAccessCode.md | 26 +++++++------- docs/interfaces/UnmanagedAccessCode.md | 18 +++++----- docs/interfaces/UserIdentifier.md | 2 +- docs/interfaces/Webhook.md | 8 ++--- docs/modules.md | 32 ++++++++--------- src/types/models.ts | 5 ++- 20 files changed, 146 insertions(+), 143 deletions(-) diff --git a/docs/interfaces/AccessCodeBase.md b/docs/interfaces/AccessCodeBase.md index 8e8fdb61..ec060f32 100644 --- a/docs/interfaces/AccessCodeBase.md +++ b/docs/interfaces/AccessCodeBase.md @@ -29,7 +29,7 @@ #### Defined in -[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) +[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) ___ @@ -39,7 +39,7 @@ ___ #### Defined in -[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) +[src/types/models.ts:228](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L228) ___ @@ -49,7 +49,7 @@ ___ #### Defined in -[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) +[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) ___ @@ -59,7 +59,7 @@ ___ #### Defined in -[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) +[src/types/models.ts:229](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L229) ___ @@ -69,7 +69,7 @@ ___ #### Defined in -[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) +[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) ___ @@ -79,4 +79,4 @@ ___ #### Defined in -[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) +[src/types/models.ts:230](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L230) diff --git a/docs/interfaces/ActionAttemptResultTypeMap.md b/docs/interfaces/ActionAttemptResultTypeMap.md index 2b27304e..e886b581 100644 --- a/docs/interfaces/ActionAttemptResultTypeMap.md +++ b/docs/interfaces/ActionAttemptResultTypeMap.md @@ -36,7 +36,7 @@ Record.CREATE\_ACCESS\_CODE #### Defined in -[src/types/models.ts:185](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L185) +[src/types/models.ts:188](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L188) ___ @@ -86,4 +86,4 @@ Record.UPDATE\_ACCESS\_CODE #### Defined in -[src/types/models.ts:186](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L186) +[src/types/models.ts:189](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L189) diff --git a/docs/interfaces/ActionAttemptWithError.md b/docs/interfaces/ActionAttemptWithError.md index 2e95df4e..cf947dc5 100644 --- a/docs/interfaces/ActionAttemptWithError.md +++ b/docs/interfaces/ActionAttemptWithError.md @@ -36,7 +36,7 @@ ActionAttemptBase.action\_attempt\_id #### Defined in -[src/types/models.ts:159](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L159) +[src/types/models.ts:162](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L162) ___ @@ -50,7 +50,7 @@ ActionAttemptBase.action\_type #### Defined in -[src/types/models.ts:160](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L160) +[src/types/models.ts:163](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L163) ___ @@ -71,7 +71,7 @@ ActionAttemptBase.error #### Defined in -[src/types/models.ts:177](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L177) +[src/types/models.ts:180](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L180) ___ @@ -85,7 +85,7 @@ ActionAttemptBase.result #### Defined in -[src/types/models.ts:176](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L176) +[src/types/models.ts:179](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L179) ___ @@ -99,4 +99,4 @@ ActionAttemptBase.status #### Defined in -[src/types/models.ts:175](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L175) +[src/types/models.ts:178](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L178) diff --git a/docs/interfaces/ConnectWebview.md b/docs/interfaces/ConnectWebview.md index 2ff206d2..543258dd 100644 --- a/docs/interfaces/ConnectWebview.md +++ b/docs/interfaces/ConnectWebview.md @@ -32,7 +32,7 @@ #### Defined in -[src/types/models.ts:207](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L207) +[src/types/models.ts:210](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L210) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[src/types/models.ts:205](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L205) +[src/types/models.ts:208](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L208) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[src/types/models.ts:209](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L209) +[src/types/models.ts:212](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L212) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[src/types/models.ts:208](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L208) +[src/types/models.ts:211](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L211) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[src/types/models.ts:217](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L217) +[src/types/models.ts:220](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L220) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[src/types/models.ts:202](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L202) +[src/types/models.ts:205](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L205) ___ @@ -92,7 +92,7 @@ ___ #### Defined in -[src/types/models.ts:213](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L213) +[src/types/models.ts:216](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L216) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[src/types/models.ts:210](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L210) +[src/types/models.ts:213](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L213) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[src/types/models.ts:218](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L218) +[src/types/models.ts:221](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L221) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[src/types/models.ts:215](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L215) +[src/types/models.ts:218](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L218) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[src/types/models.ts:214](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L214) +[src/types/models.ts:217](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L217) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[src/types/models.ts:204](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L204) +[src/types/models.ts:207](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L207) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[src/types/models.ts:211](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L211) +[src/types/models.ts:214](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L214) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[src/types/models.ts:206](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L206) +[src/types/models.ts:209](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L209) ___ @@ -172,7 +172,7 @@ ___ #### Defined in -[src/types/models.ts:212](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L212) +[src/types/models.ts:215](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L215) ___ @@ -182,7 +182,7 @@ ___ #### Defined in -[src/types/models.ts:216](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L216) +[src/types/models.ts:219](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L219) ___ @@ -192,4 +192,4 @@ ___ #### Defined in -[src/types/models.ts:203](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L203) +[src/types/models.ts:206](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L206) diff --git a/docs/interfaces/ConnectedAccount.md b/docs/interfaces/ConnectedAccount.md index f037ac2d..6d85a22f 100644 --- a/docs/interfaces/ConnectedAccount.md +++ b/docs/interfaces/ConnectedAccount.md @@ -22,7 +22,7 @@ #### Defined in -[src/types/models.ts:265](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L265) +[src/types/models.ts:268](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L268) ___ @@ -32,7 +32,7 @@ ___ #### Defined in -[src/types/models.ts:262](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L262) +[src/types/models.ts:265](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L265) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[src/types/models.ts:263](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L263) +[src/types/models.ts:266](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L266) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[src/types/models.ts:268](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L268) +[src/types/models.ts:271](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L271) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[src/types/models.ts:266](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L266) +[src/types/models.ts:269](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L269) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[src/types/models.ts:264](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L264) +[src/types/models.ts:267](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L267) ___ @@ -82,4 +82,4 @@ ___ #### Defined in -[src/types/models.ts:267](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L267) +[src/types/models.ts:270](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L270) diff --git a/docs/interfaces/Device.md b/docs/interfaces/Device.md index 77f9d4cd..3f9a24d3 100644 --- a/docs/interfaces/Device.md +++ b/docs/interfaces/Device.md @@ -32,7 +32,7 @@ #### Defined in -[src/types/models.ts:94](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L94) +[src/types/models.ts:97](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L97) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[src/types/models.ts:93](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L93) +[src/types/models.ts:96](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L96) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[src/types/models.ts:97](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L97) +[src/types/models.ts:100](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L100) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[src/types/models.ts:88](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L88) +[src/types/models.ts:91](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L91) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[src/types/models.ts:92](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L92) +[src/types/models.ts:95](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L95) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[src/types/models.ts:95](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L95) +[src/types/models.ts:98](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L98) ___ @@ -92,7 +92,7 @@ ___ #### Defined in -[src/types/models.ts:91](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L91) +[src/types/models.ts:94](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L94) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[src/types/models.ts:90](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L90) +[src/types/models.ts:93](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L93) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[src/types/models.ts:96](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L96) +[src/types/models.ts:99](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L99) ___ @@ -122,4 +122,4 @@ ___ #### Defined in -[src/types/models.ts:89](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L89) +[src/types/models.ts:92](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L92) diff --git a/docs/interfaces/DeviceProvider.md b/docs/interfaces/DeviceProvider.md index 80fc81fa..e2a45249 100644 --- a/docs/interfaces/DeviceProvider.md +++ b/docs/interfaces/DeviceProvider.md @@ -19,7 +19,7 @@ #### Defined in -[src/types/models.ts:112](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L112) +[src/types/models.ts:115](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L115) ___ @@ -29,7 +29,7 @@ ___ #### Defined in -[src/types/models.ts:113](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L113) +[src/types/models.ts:116](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L116) ___ @@ -39,7 +39,7 @@ ___ #### Defined in -[src/types/models.ts:114](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L114) +[src/types/models.ts:117](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L117) ___ @@ -49,4 +49,4 @@ ___ #### Defined in -[src/types/models.ts:115](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L115) +[src/types/models.ts:118](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L118) diff --git a/docs/interfaces/LockProperties.md b/docs/interfaces/LockProperties.md index 24048b34..9cbef440 100644 --- a/docs/interfaces/LockProperties.md +++ b/docs/interfaces/LockProperties.md @@ -47,7 +47,7 @@ #### Defined in -[src/types/models.ts:136](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L136) +[src/types/models.ts:139](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L139) ___ @@ -68,7 +68,7 @@ CommonDeviceProperties.battery #### Defined in -[src/types/models.ts:72](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L72) +[src/types/models.ts:75](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L75) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[src/types/models.ts:121](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L121) +[src/types/models.ts:124](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L124) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[src/types/models.ts:120](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L120) +[src/types/models.ts:123](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L123) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[src/types/models.ts:122](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L122) +[src/types/models.ts:125](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L125) ___ @@ -112,7 +112,7 @@ CommonDeviceProperties.image\_url #### Defined in -[src/types/models.ts:76](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L76) +[src/types/models.ts:79](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L79) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[src/types/models.ts:119](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L119) +[src/types/models.ts:122](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L122) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[src/types/models.ts:123](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L123) +[src/types/models.ts:126](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L126) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[src/types/models.ts:125](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L125) +[src/types/models.ts:128](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L128) ___ @@ -156,7 +156,7 @@ CommonDeviceProperties.name #### Defined in -[src/types/models.ts:70](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L70) +[src/types/models.ts:73](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L73) ___ @@ -170,7 +170,7 @@ CommonDeviceProperties.online #### Defined in -[src/types/models.ts:71](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L71) +[src/types/models.ts:74](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L74) ___ @@ -190,7 +190,7 @@ ___ #### Defined in -[src/types/models.ts:128](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L128) +[src/types/models.ts:131](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L131) ___ @@ -200,7 +200,7 @@ ___ #### Defined in -[src/types/models.ts:126](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L126) +[src/types/models.ts:129](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L129) ___ @@ -210,7 +210,7 @@ ___ #### Defined in -[src/types/models.ts:145](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L145) +[src/types/models.ts:148](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L148) ___ @@ -220,4 +220,4 @@ ___ #### Defined in -[src/types/models.ts:124](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L124) +[src/types/models.ts:127](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L127) diff --git a/docs/interfaces/ManagedAccessCodeBase.md b/docs/interfaces/ManagedAccessCodeBase.md index 241c06e4..a1d4972f 100644 --- a/docs/interfaces/ManagedAccessCodeBase.md +++ b/docs/interfaces/ManagedAccessCodeBase.md @@ -37,7 +37,7 @@ #### Defined in -[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) +[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) ___ @@ -51,7 +51,7 @@ ___ #### Defined in -[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) +[src/types/models.ts:228](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L228) ___ @@ -61,7 +61,7 @@ ___ #### Defined in -[src/types/models.ts:231](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L231) +[src/types/models.ts:234](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L234) ___ @@ -75,7 +75,7 @@ ___ #### Defined in -[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) +[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) ___ @@ -89,7 +89,7 @@ ___ #### Defined in -[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) +[src/types/models.ts:229](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L229) ___ @@ -99,7 +99,7 @@ ___ #### Defined in -[src/types/models.ts:232](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L232) +[src/types/models.ts:235](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L235) ___ @@ -113,7 +113,7 @@ ___ #### Defined in -[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) +[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) ___ @@ -127,4 +127,4 @@ ___ #### Defined in -[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) +[src/types/models.ts:230](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L230) diff --git a/docs/interfaces/OngoingAccessCode.md b/docs/interfaces/OngoingAccessCode.md index 9d3cde30..2fc71b4d 100644 --- a/docs/interfaces/OngoingAccessCode.md +++ b/docs/interfaces/OngoingAccessCode.md @@ -36,7 +36,7 @@ #### Defined in -[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) +[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) ___ @@ -50,7 +50,7 @@ ___ #### Defined in -[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) +[src/types/models.ts:228](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L228) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[src/types/models.ts:231](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L231) +[src/types/models.ts:234](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L234) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[src/types/models.ts:237](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L237) +[src/types/models.ts:240](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L240) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) +[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) +[src/types/models.ts:229](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L229) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[src/types/models.ts:232](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L232) +[src/types/models.ts:235](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L235) ___ @@ -130,7 +130,7 @@ ___ #### Defined in -[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) +[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[src/types/models.ts:238](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L238) +[src/types/models.ts:241](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L241) ___ @@ -150,7 +150,7 @@ ___ #### Defined in -[src/types/models.ts:236](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L236) +[src/types/models.ts:239](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L239) ___ @@ -164,4 +164,4 @@ ___ #### Defined in -[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) +[src/types/models.ts:230](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L230) diff --git a/docs/interfaces/PendingActionAttempt.md b/docs/interfaces/PendingActionAttempt.md index f3308190..c13bd782 100644 --- a/docs/interfaces/PendingActionAttempt.md +++ b/docs/interfaces/PendingActionAttempt.md @@ -36,7 +36,7 @@ ActionAttemptBase.action\_attempt\_id #### Defined in -[src/types/models.ts:159](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L159) +[src/types/models.ts:162](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L162) ___ @@ -50,7 +50,7 @@ ActionAttemptBase.action\_type #### Defined in -[src/types/models.ts:160](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L160) +[src/types/models.ts:163](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L163) ___ @@ -64,7 +64,7 @@ ActionAttemptBase.error #### Defined in -[src/types/models.ts:170](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L170) +[src/types/models.ts:173](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L173) ___ @@ -78,7 +78,7 @@ ActionAttemptBase.result #### Defined in -[src/types/models.ts:169](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L169) +[src/types/models.ts:172](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L172) ___ @@ -92,4 +92,4 @@ ActionAttemptBase.status #### Defined in -[src/types/models.ts:168](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L168) +[src/types/models.ts:171](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L171) diff --git a/docs/interfaces/SeamError.md b/docs/interfaces/SeamError.md index eb1578fd..1ed4e7ad 100644 --- a/docs/interfaces/SeamError.md +++ b/docs/interfaces/SeamError.md @@ -17,7 +17,7 @@ #### Defined in -[src/types/models.ts:58](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L58) +[src/types/models.ts:61](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L61) ___ @@ -27,4 +27,4 @@ ___ #### Defined in -[src/types/models.ts:59](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L59) +[src/types/models.ts:62](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L62) diff --git a/docs/interfaces/SeamWarning.md b/docs/interfaces/SeamWarning.md index 64a80431..220705e9 100644 --- a/docs/interfaces/SeamWarning.md +++ b/docs/interfaces/SeamWarning.md @@ -17,7 +17,7 @@ #### Defined in -[src/types/models.ts:64](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L64) +[src/types/models.ts:67](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L67) ___ @@ -27,4 +27,4 @@ ___ #### Defined in -[src/types/models.ts:63](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L63) +[src/types/models.ts:66](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L66) diff --git a/docs/interfaces/SuccessfulActionAttempt.md b/docs/interfaces/SuccessfulActionAttempt.md index 99aa2323..9588e0a3 100644 --- a/docs/interfaces/SuccessfulActionAttempt.md +++ b/docs/interfaces/SuccessfulActionAttempt.md @@ -36,7 +36,7 @@ ActionAttemptBase.action\_attempt\_id #### Defined in -[src/types/models.ts:159](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L159) +[src/types/models.ts:162](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L162) ___ @@ -50,7 +50,7 @@ ActionAttemptBase.action\_type #### Defined in -[src/types/models.ts:160](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L160) +[src/types/models.ts:163](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L163) ___ @@ -64,7 +64,7 @@ ActionAttemptBase.error #### Defined in -[src/types/models.ts:192](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L192) +[src/types/models.ts:195](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L195) ___ @@ -78,7 +78,7 @@ ActionAttemptBase.result #### Defined in -[src/types/models.ts:193](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L193) +[src/types/models.ts:196](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L196) ___ @@ -92,4 +92,4 @@ ActionAttemptBase.status #### Defined in -[src/types/models.ts:191](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L191) +[src/types/models.ts:194](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L194) diff --git a/docs/interfaces/TimeBoundAccessCode.md b/docs/interfaces/TimeBoundAccessCode.md index ece2bb37..ae0e8565 100644 --- a/docs/interfaces/TimeBoundAccessCode.md +++ b/docs/interfaces/TimeBoundAccessCode.md @@ -38,7 +38,7 @@ #### Defined in -[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) +[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) +[src/types/models.ts:228](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L228) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[src/types/models.ts:231](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L231) +[src/types/models.ts:234](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L234) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[src/types/models.ts:243](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L243) +[src/types/models.ts:246](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L246) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) +[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[src/types/models.ts:246](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L246) +[src/types/models.ts:249](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L249) ___ @@ -114,7 +114,7 @@ ___ #### Defined in -[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) +[src/types/models.ts:229](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L229) ___ @@ -128,7 +128,7 @@ ___ #### Defined in -[src/types/models.ts:232](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L232) +[src/types/models.ts:235](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L235) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) +[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[src/types/models.ts:245](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L245) +[src/types/models.ts:248](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L248) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[src/types/models.ts:244](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L244) +[src/types/models.ts:247](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L247) ___ @@ -172,7 +172,7 @@ ___ #### Defined in -[src/types/models.ts:242](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L242) +[src/types/models.ts:245](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L245) ___ @@ -186,4 +186,4 @@ ___ #### Defined in -[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) +[src/types/models.ts:230](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L230) diff --git a/docs/interfaces/UnmanagedAccessCode.md b/docs/interfaces/UnmanagedAccessCode.md index 8b58a6c0..deb97e43 100644 --- a/docs/interfaces/UnmanagedAccessCode.md +++ b/docs/interfaces/UnmanagedAccessCode.md @@ -34,7 +34,7 @@ #### Defined in -[src/types/models.ts:222](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L222) +[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) ___ @@ -48,7 +48,7 @@ ___ #### Defined in -[src/types/models.ts:225](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L225) +[src/types/models.ts:228](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L228) ___ @@ -58,7 +58,7 @@ ___ #### Defined in -[src/types/models.ts:251](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L251) +[src/types/models.ts:254](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L254) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[src/types/models.ts:223](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L223) +[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[src/types/models.ts:226](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L226) +[src/types/models.ts:229](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L229) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[src/types/models.ts:224](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L224) +[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[src/types/models.ts:252](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L252) +[src/types/models.ts:255](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L255) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[src/types/models.ts:250](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L250) +[src/types/models.ts:253](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L253) ___ @@ -134,4 +134,4 @@ ___ #### Defined in -[src/types/models.ts:227](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L227) +[src/types/models.ts:230](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L230) diff --git a/docs/interfaces/UserIdentifier.md b/docs/interfaces/UserIdentifier.md index 88a95631..ffbb388f 100644 --- a/docs/interfaces/UserIdentifier.md +++ b/docs/interfaces/UserIdentifier.md @@ -16,4 +16,4 @@ #### Defined in -[src/types/models.ts:258](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L258) +[src/types/models.ts:261](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L261) diff --git a/docs/interfaces/Webhook.md b/docs/interfaces/Webhook.md index 3ab24154..c6c11034 100644 --- a/docs/interfaces/Webhook.md +++ b/docs/interfaces/Webhook.md @@ -19,7 +19,7 @@ #### Defined in -[src/types/models.ts:274](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L274) +[src/types/models.ts:277](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L277) ___ @@ -29,7 +29,7 @@ ___ #### Defined in -[src/types/models.ts:275](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L275) +[src/types/models.ts:278](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L278) ___ @@ -39,7 +39,7 @@ ___ #### Defined in -[src/types/models.ts:273](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L273) +[src/types/models.ts:276](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L276) ___ @@ -49,4 +49,4 @@ ___ #### Defined in -[src/types/models.ts:272](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L272) +[src/types/models.ts:275](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L275) diff --git a/docs/modules.md b/docs/modules.md index e4656721..4612142c 100644 --- a/docs/modules.md +++ b/docs/modules.md @@ -168,7 +168,7 @@ ___ #### Defined in -[src/types/models.ts:255](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L255) +[src/types/models.ts:258](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L258) ___ @@ -287,7 +287,7 @@ ___ #### Defined in -[src/types/models.ts:196](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L196) +[src/types/models.ts:199](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L199) ___ @@ -297,7 +297,7 @@ ___ #### Defined in -[src/types/models.ts:151](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L151) +[src/types/models.ts:154](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L154) ___ @@ -307,7 +307,7 @@ ___ #### Defined in -[src/types/models.ts:148](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L148) +[src/types/models.ts:151](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L151) ___ @@ -317,7 +317,7 @@ ___ #### Defined in -[src/types/models.ts:67](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L67) +[src/types/models.ts:70](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L70) ___ @@ -338,7 +338,7 @@ ___ #### Defined in -[src/types/models.ts:69](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L69) +[src/types/models.ts:72](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L72) ___ @@ -391,7 +391,7 @@ ___ #### Defined in -[src/types/models.ts:79](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L79) +[src/types/models.ts:82](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L82) ___ @@ -401,7 +401,7 @@ ___ #### Defined in -[src/types/models.ts:33](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L33) +[src/types/models.ts:36](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L36) ___ @@ -431,7 +431,7 @@ ___ #### Defined in -[src/types/models.ts:288](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L288) +[src/types/models.ts:291](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L291) ___ @@ -441,7 +441,7 @@ ___ #### Defined in -[src/types/models.ts:149](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L149) +[src/types/models.ts:152](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L152) ___ @@ -461,7 +461,7 @@ ___ #### Defined in -[src/types/models.ts:30](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L30) +[src/types/models.ts:33](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L33) ___ @@ -483,7 +483,7 @@ ___ #### Defined in -[src/types/models.ts:290](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L290) +[src/types/models.ts:293](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L293) ___ @@ -525,7 +525,7 @@ ___ #### Defined in -[src/types/models.ts:52](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L52) +[src/types/models.ts:55](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L55) ___ @@ -537,7 +537,7 @@ This type can allow for other provider categories as they are added #### Defined in -[src/types/models.ts:55](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L55) +[src/types/models.ts:58](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L58) ___ @@ -591,7 +591,7 @@ ___ #### Defined in -[src/types/models.ts:100](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L100) +[src/types/models.ts:103](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L103) ___ @@ -670,7 +670,7 @@ ___ #### Defined in -[src/types/models.ts:35](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L35) +[src/types/models.ts:38](https://github.com/seamapi/javascript/blob/main/src/types/models.ts#L38) ## Functions diff --git a/src/types/models.ts b/src/types/models.ts index 11710379..38fd90fe 100644 --- a/src/types/models.ts +++ b/src/types/models.ts @@ -26,7 +26,10 @@ export const LOCK_DEVICE_TYPES = [ ] export type LockDeviceType = typeof LOCK_DEVICE_TYPES[number] -export const NOISE_DETECTION_DEVICE_TYPES = ["noiseaware_activity_zone"] +export const NOISE_DETECTION_DEVICE_TYPES = [ + "noiseaware_activity_zone", + "minut_sensor", +] export type NoiseDetectionDeviceType = typeof NOISE_DETECTION_DEVICE_TYPES[number] From 8e641fd3118a539c91185d5c88e41ba7e641a346 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Mon, 17 Apr 2023 17:14:08 -0300 Subject: [PATCH 04/18] debug ci --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 28f0a195..c9b295e6 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "pack:cli": "pkg -c package.json dist/cli/entry.js", "format": "prettier --write .", "format:check": "prettier --check .", - "test": "npm run build:json-response-schemas && ava", + "test": "DEBUG=testcontainers* && npm run build:json-response-schemas && ava", "test:watch": "npm run build:json-response-schemas && ava --watch", "cli:dev": "esr src/cli/entry.ts" }, From 164c916f4d36db08eb0266c6129c7d339f6e4261 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Mon, 17 Apr 2023 17:22:54 -0300 Subject: [PATCH 05/18] maybe the error is in minut scenario --- .../workers/helpers/add-fake-minut-devices.ts | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts index 1728f53f..989f6f9e 100644 --- a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts +++ b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts @@ -18,22 +18,28 @@ const addFakeMinutDevices = async (axios: Axios) => { }, } - await axios.post("/internal/scenarios/factories/load", { - factory_name: "create_minut_devices", - input: { - devicesConfig: [ - defaultConfig, - { - ...defaultConfig, - sound_level_high_quiet_hours: { - ...defaultConfig.sound_level_high_quiet_hours, - enabled: false, + try { + await axios.post("/internal/scenarios/factories/load", { + factory_name: "create_minut_devices", + input: { + devicesConfig: [ + defaultConfig, + { + ...defaultConfig, + sound_level_high_quiet_hours: { + ...defaultConfig.sound_level_high_quiet_hours, + enabled: false, + }, }, - }, - ], - }, - sync: true, - }) + ], + }, + sync: true, + }) + } catch (e) { + // @ts-ignore + console.log(e.response.data) + throw new Error(`Failed load minut scenario`) + } const devices = await getDeviceType(axios, "minut_sensor") const [device_with_quiet_hours, device_without_quiet_hours] = devices From d60df9a43991ee70204362f859e1916ce0a3f716 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Mon, 17 Apr 2023 17:59:07 -0300 Subject: [PATCH 06/18] more debug --- tests/fixtures/workers/helpers/get-device-type.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/fixtures/workers/helpers/get-device-type.ts b/tests/fixtures/workers/helpers/get-device-type.ts index 86f7bc63..da9f28c9 100644 --- a/tests/fixtures/workers/helpers/get-device-type.ts +++ b/tests/fixtures/workers/helpers/get-device-type.ts @@ -13,6 +13,7 @@ const getDeviceType = async (axios: Axios, deviceType: string) => { return filteredDevices } + console.log("devices", devices) throw new Error(`Failed to find ${deviceType} devices`) } From 99dfcdd358cfcf045dea6b002d9b206f85331e15 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Mon, 17 Apr 2023 18:13:14 -0300 Subject: [PATCH 07/18] even more debug --- tests/fixtures/workers/helpers/add-fake-minut-devices.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts index 989f6f9e..f6ba9d30 100644 --- a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts +++ b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts @@ -19,7 +19,7 @@ const addFakeMinutDevices = async (axios: Axios) => { } try { - await axios.post("/internal/scenarios/factories/load", { + const { data } = await axios.post("/internal/scenarios/factories/load", { factory_name: "create_minut_devices", input: { devicesConfig: [ @@ -35,6 +35,7 @@ const addFakeMinutDevices = async (axios: Axios) => { }, sync: true, }) + console.log({ data }) } catch (e) { // @ts-ignore console.log(e.response.data) From 844d37df06bab97268421bbce31dee228d73e70f Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Mon, 17 Apr 2023 19:02:41 -0300 Subject: [PATCH 08/18] retry --- .../workers/helpers/add-fake-minut-devices.ts | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts index f6ba9d30..6dcb0d8d 100644 --- a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts +++ b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts @@ -1,5 +1,28 @@ -import { Axios } from "axios" +import { Axios, AxiosResponse } from "axios" import getDeviceType from "./get-device-type" +import { AxiosError } from "axios" + +async function retryAxiosCall( + axios_fn: Promise>, + maxRetries: number +) { + let retryCount = 0 + + while (retryCount < maxRetries) { + try { + await axios_fn + } catch (error) { + console.log( + `Attempt ${retryCount + 1} failed. Error: ${ + (error as AxiosError).response?.data.error.message + }` + ) + retryCount++ + } + } + + throw new Error(`Failed load Minut scenario`) +} const addFakeMinutDevices = async (axios: Axios) => { const defaultConfig = { @@ -18,8 +41,9 @@ const addFakeMinutDevices = async (axios: Axios) => { }, } - try { - const { data } = await axios.post("/internal/scenarios/factories/load", { + const create_minut_devices = axios.post( + "/internal/scenarios/factories/load", + { factory_name: "create_minut_devices", input: { devicesConfig: [ @@ -34,13 +58,10 @@ const addFakeMinutDevices = async (axios: Axios) => { ], }, sync: true, - }) - console.log({ data }) - } catch (e) { - // @ts-ignore - console.log(e.response.data) - throw new Error(`Failed load minut scenario`) - } + } + ) + + retryAxiosCall(create_minut_devices, 5) const devices = await getDeviceType(axios, "minut_sensor") const [device_with_quiet_hours, device_without_quiet_hours] = devices From 6bc20c50dacdef6d168524f6439ed7e7edc4455e Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Mon, 17 Apr 2023 20:01:51 -0300 Subject: [PATCH 09/18] missing await --- tests/fixtures/workers/helpers/add-fake-minut-devices.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts index 6dcb0d8d..f96b13d8 100644 --- a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts +++ b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts @@ -61,7 +61,7 @@ const addFakeMinutDevices = async (axios: Axios) => { } ) - retryAxiosCall(create_minut_devices, 5) + await retryAxiosCall(create_minut_devices, 5) const devices = await getDeviceType(axios, "minut_sensor") const [device_with_quiet_hours, device_without_quiet_hours] = devices From e8a58768df17d4146f6560bda733f0b4934bdabc Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Mon, 17 Apr 2023 20:18:06 -0300 Subject: [PATCH 10/18] final try --- .../workers/helpers/add-fake-minut-devices.ts | 70 ++++++++----------- 1 file changed, 31 insertions(+), 39 deletions(-) diff --git a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts index f96b13d8..d660bb8b 100644 --- a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts +++ b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts @@ -2,29 +2,9 @@ import { Axios, AxiosResponse } from "axios" import getDeviceType from "./get-device-type" import { AxiosError } from "axios" -async function retryAxiosCall( - axios_fn: Promise>, - maxRetries: number -) { +async function retryAxiosCall(axios: Axios, maxRetries: number) { let retryCount = 0 - while (retryCount < maxRetries) { - try { - await axios_fn - } catch (error) { - console.log( - `Attempt ${retryCount + 1} failed. Error: ${ - (error as AxiosError).response?.data.error.message - }` - ) - retryCount++ - } - } - - throw new Error(`Failed load Minut scenario`) -} - -const addFakeMinutDevices = async (axios: Axios) => { const defaultConfig = { sound_level_high: { value: 60, @@ -41,27 +21,39 @@ const addFakeMinutDevices = async (axios: Axios) => { }, } - const create_minut_devices = axios.post( - "/internal/scenarios/factories/load", - { - factory_name: "create_minut_devices", - input: { - devicesConfig: [ - defaultConfig, - { - ...defaultConfig, - sound_level_high_quiet_hours: { - ...defaultConfig.sound_level_high_quiet_hours, - enabled: false, + while (retryCount < maxRetries) { + try { + await axios.post("/internal/scenarios/factories/load", { + factory_name: "create_minut_devices", + input: { + devicesConfig: [ + defaultConfig, + { + ...defaultConfig, + sound_level_high_quiet_hours: { + ...defaultConfig.sound_level_high_quiet_hours, + enabled: false, + }, }, - }, - ], - }, - sync: true, + ], + }, + sync: true, + }) + } catch (error) { + console.log( + `Attempt ${retryCount + 1} failed. Error: ${ + (error as AxiosError).response?.data.error.message + }` + ) + retryCount++ } - ) + } - await retryAxiosCall(create_minut_devices, 5) + throw new Error(`Failed load Minut scenario`) +} + +const addFakeMinutDevices = async (axios: Axios) => { + await retryAxiosCall(axios, 5) const devices = await getDeviceType(axios, "minut_sensor") const [device_with_quiet_hours, device_without_quiet_hours] = devices From 46f73a2f1bb911bad7bc8cc10be82cb122ee71f2 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Mon, 17 Apr 2023 20:40:47 -0300 Subject: [PATCH 11/18] remove logs --- .../workers/helpers/add-fake-minut-devices.ts | 52 ++++++------------- .../workers/helpers/get-device-type.ts | 1 - 2 files changed, 16 insertions(+), 37 deletions(-) diff --git a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts index d660bb8b..871b5727 100644 --- a/tests/fixtures/workers/helpers/add-fake-minut-devices.ts +++ b/tests/fixtures/workers/helpers/add-fake-minut-devices.ts @@ -1,10 +1,7 @@ import { Axios, AxiosResponse } from "axios" import getDeviceType from "./get-device-type" -import { AxiosError } from "axios" - -async function retryAxiosCall(axios: Axios, maxRetries: number) { - let retryCount = 0 +const addFakeMinutDevices = async (axios: Axios) => { const defaultConfig = { sound_level_high: { value: 60, @@ -21,39 +18,22 @@ async function retryAxiosCall(axios: Axios, maxRetries: number) { }, } - while (retryCount < maxRetries) { - try { - await axios.post("/internal/scenarios/factories/load", { - factory_name: "create_minut_devices", - input: { - devicesConfig: [ - defaultConfig, - { - ...defaultConfig, - sound_level_high_quiet_hours: { - ...defaultConfig.sound_level_high_quiet_hours, - enabled: false, - }, - }, - ], + await axios.post("/internal/scenarios/factories/load", { + factory_name: "create_minut_devices", + input: { + devicesConfig: [ + defaultConfig, + { + ...defaultConfig, + sound_level_high_quiet_hours: { + ...defaultConfig.sound_level_high_quiet_hours, + enabled: false, + }, }, - sync: true, - }) - } catch (error) { - console.log( - `Attempt ${retryCount + 1} failed. Error: ${ - (error as AxiosError).response?.data.error.message - }` - ) - retryCount++ - } - } - - throw new Error(`Failed load Minut scenario`) -} - -const addFakeMinutDevices = async (axios: Axios) => { - await retryAxiosCall(axios, 5) + ], + }, + sync: true, + }) const devices = await getDeviceType(axios, "minut_sensor") const [device_with_quiet_hours, device_without_quiet_hours] = devices diff --git a/tests/fixtures/workers/helpers/get-device-type.ts b/tests/fixtures/workers/helpers/get-device-type.ts index da9f28c9..86f7bc63 100644 --- a/tests/fixtures/workers/helpers/get-device-type.ts +++ b/tests/fixtures/workers/helpers/get-device-type.ts @@ -13,7 +13,6 @@ const getDeviceType = async (axios: Axios, deviceType: string) => { return filteredDevices } - console.log("devices", devices) throw new Error(`Failed to find ${deviceType} devices`) } From 7e0909712653e36e8c9a441305bee6a9dbfc093a Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Tue, 18 Apr 2023 10:46:27 -0300 Subject: [PATCH 12/18] another try --- .../fixtures/helpers/test-api-method-macro.ts | 5 +- tests/fixtures/plugins/get-server-plugin.ts | 9 +++- tests/fixtures/workers/get-server-worker.ts | 16 ++++-- .../workers/helpers/start-and-seed-server.ts | 53 +++++++++++++------ tests/routes.test.ts | 1 + 5 files changed, 60 insertions(+), 24 deletions(-) diff --git a/tests/fixtures/helpers/test-api-method-macro.ts b/tests/fixtures/helpers/test-api-method-macro.ts index 5cb49bd3..a9d73d90 100644 --- a/tests/fixtures/helpers/test-api-method-macro.ts +++ b/tests/fixtures/helpers/test-api-method-macro.ts @@ -20,6 +20,7 @@ interface Input { | ParametersByPath | ((seed: WorkerPublishedMessage["seed"]) => ParametersByPath) modifiesState?: boolean + load_devices_from?: ("minut" | "schlage" | "august")[] } // Ava simplifies types so unfortunately we need to wrap the macro @@ -32,9 +33,9 @@ export const testAPIMethod = ( input: Input, responseTypeName: string ) { - const { args = [], modifiesState = false } = input + const { args = [], modifiesState = false, load_devices_from } = input - const server = await getServer(modifiesState) + const server = await getServer(modifiesState, load_devices_from) let func: any = server.client for (const funcName of methodPath.split(".")) { diff --git a/tests/fixtures/plugins/get-server-plugin.ts b/tests/fixtures/plugins/get-server-plugin.ts index ed7df4fd..89c4a8d4 100644 --- a/tests/fixtures/plugins/get-server-plugin.ts +++ b/tests/fixtures/plugins/get-server-plugin.ts @@ -39,9 +39,14 @@ const serverWorker = registerSharedTypeScriptWorker({ ), }) -export const getServer = async (writable = false) => { +export const getServer = async ( + writable = false, + load_devices_from: ("minut" | "schlage" | "august")[] = ["august", "schlage"] +) => { const message = serverWorker.publish( - writable ? "GET_WRITABLE_SERVER" : "GET_READABLE_SERVER" + writable + ? `GET_WRITABLE_SERVER:${load_devices_from.join(",")}` + : `GET_READABLE_SERVER:${load_devices_from.join(",")}` ) const reply = await message.replies().next() diff --git a/tests/fixtures/workers/get-server-worker.ts b/tests/fixtures/workers/get-server-worker.ts index 6bbd4485..b6a6ec09 100644 --- a/tests/fixtures/workers/get-server-worker.ts +++ b/tests/fixtures/workers/get-server-worker.ts @@ -10,17 +10,25 @@ let readableServer: Except< const getServer = async (protocol: SharedWorker.Protocol) => { for await (const message of protocol.subscribe()) { const { data } = message + const [command, load_devices_from] = (data as string).split(":") as [ + "GET_READABLE_SERVER" | "GET_WRITABLE_SERVER", + string + ] - if (data === "GET_READABLE_SERVER") { + if (command === "GET_READABLE_SERVER") { if (!readableServer) { // We don't care about the teardown function for a long running server - const { teardownFn, ...server } = await startAndSeedServer() + const { teardownFn, ...server } = await startAndSeedServer( + load_devices_from.split(",") as ("minut" | "schlage" | "august")[] + ) readableServer = server } message.reply(readableServer) - } else if (data === "GET_WRITABLE_SERVER") { - const writableServer = await startAndSeedServer() + } else if (command === "GET_WRITABLE_SERVER") { + const writableServer = await startAndSeedServer( + load_devices_from.split(",") as ("minut" | "schlage" | "august")[] + ) const { teardownFn, ...server } = writableServer diff --git a/tests/fixtures/workers/helpers/start-and-seed-server.ts b/tests/fixtures/workers/helpers/start-and-seed-server.ts index c0d305ba..4b0d4f29 100644 --- a/tests/fixtures/workers/helpers/start-and-seed-server.ts +++ b/tests/fixtures/workers/helpers/start-and-seed-server.ts @@ -10,7 +10,9 @@ import addFakeMinutDevices from "./add-fake-minut-devices" const SEAM_ADMIN_PASSWORD = "1234" -const startAndSeedServer = async () => { +const startAndSeedServer = async ( + load_devices_from: ("minut" | "schlage" | "august")[] = ["august", "schlage"] +) => { const database = await getTestDatabase() const svix = await getTestSvix({ env: { @@ -78,20 +80,43 @@ const startAndSeedServer = async () => { ;(axios.defaults.headers as any).Authorization = `Bearer ${api_key}` - const [schlageLock, augustLock, minut, connectWebview] = await Promise.all([ - addFakeSchlageDevices(axios), - addFakeAugustDevices(axios), - addFakeMinutDevices(axios), + const providersMap = { + schlage: () => addFakeSchlageDevices(axios), + august: () => addFakeAugustDevices(axios), + minut: () => addFakeMinutDevices(axios), + } + const [connectWebview, ...devicesByProvider] = await Promise.all([ axios.post("/connect_webviews/create", { - accepted_providers: [ - "schlage", - "august", - // TODO: Uncomment this line when Minut is ready - // "minut" - ], + // TODO: remove filter when minut is ready + accepted_providers: load_devices_from.filter( + (provider) => provider !== "minut" + ), }), + ...load_devices_from.map((provider) => providersMap[provider]()), ]) + const devices = { + ...load_devices_from.reduce((acc, provider, index) => { + if (provider === "schlage") { + // @ts-ignore + acc["schlageLock"] = devicesByProvider[index] + return acc + } + + if (provider === "august") { + // @ts-ignore + acc["augustLock"] = devicesByProvider[index] + return acc + } + + // @ts-ignore + acc[provider] = devicesByProvider[index] + return acc + }, {}), + } + + console.log(devices) + return { serverUrl, externalDatabaseUrl: database.externalDatabaseUrl, @@ -100,11 +125,7 @@ const startAndSeedServer = async () => { apiKey: api_key, workspaceId: workspace.workspace_id, connectWebviewId: connectWebview.data.connect_webview.connect_webview_id, - devices: { - minut, - schlageLock, - augustLock, - }, + devices, }, teardownFn: () => server.stop(), } diff --git a/tests/routes.test.ts b/tests/routes.test.ts index 91ad8336..4ce14aac 100644 --- a/tests/routes.test.ts +++ b/tests/routes.test.ts @@ -305,6 +305,7 @@ test( device_id: seed.devices.minut.device_with_quiet_hours.device_id, }, ], + load_devices_from: ["minut"], }, "NoiseThresholds[]" ) From 3d3a4d99728cdb07164100141894f7d0932e2a8e Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Tue, 18 Apr 2023 11:03:40 -0300 Subject: [PATCH 13/18] add serial to test --- tests/routes.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/routes.test.ts b/tests/routes.test.ts index 4ce14aac..d61ed17b 100644 --- a/tests/routes.test.ts +++ b/tests/routes.test.ts @@ -1,5 +1,4 @@ import test from "ava" -import { Provider } from "../src" import { testAPIMethod } from "./fixtures/helpers/test-api-method-macro" // Workspaces @@ -297,7 +296,7 @@ test( ) // Noise Thresholds -test( +test.serial( testAPIMethod("noiseThresholds.list"), { args: (seed) => [ From ddb410b2a9e49161bb21aac381f14979280a081f Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Tue, 18 Apr 2023 11:39:19 -0300 Subject: [PATCH 14/18] add serial --- tests/routes.test.ts | 105 +++++++++++++++++++++++-------------------- 1 file changed, 57 insertions(+), 48 deletions(-) diff --git a/tests/routes.test.ts b/tests/routes.test.ts index d61ed17b..741033cd 100644 --- a/tests/routes.test.ts +++ b/tests/routes.test.ts @@ -1,14 +1,33 @@ import test from "ava" import { testAPIMethod } from "./fixtures/helpers/test-api-method-macro" +// Noise Thresholds +test.serial( + testAPIMethod("noiseThresholds.list"), + { + args: (seed) => [ + { + device_id: seed.devices.minut.device_with_quiet_hours.device_id, + }, + ], + modifiesState: true, + load_devices_from: ["minut"], + }, + "NoiseThresholds[]" +) + // Workspaces -test(testAPIMethod("workspaces.list"), {}, "Workspace[]") -test(testAPIMethod("workspaces.get"), {}, "Workspace") -test(testAPIMethod("workspaces.resetSandbox"), { modifiesState: true }, "{}") +test.serial(testAPIMethod("workspaces.list"), {}, "Workspace[]") +test.serial(testAPIMethod("workspaces.get"), {}, "Workspace") +test.serial( + testAPIMethod("workspaces.resetSandbox"), + { modifiesState: true }, + "{}" +) // Locks -test(testAPIMethod("locks.list"), {}, "LockDevice[]") -test( +test.serial(testAPIMethod("locks.list"), {}, "LockDevice[]") +test.serial( "with connected account ID", testAPIMethod("locks.list"), { @@ -16,12 +35,12 @@ test( }, "LockDevice[]" ) -test( +test.serial( testAPIMethod("locks.get"), { args: (seed) => [seed.devices.schlageLock.id1] }, "LockDevice" ) -test( +test.serial( testAPIMethod("locks.lockDoor"), { args: (seed) => [seed.devices.schlageLock.id1], @@ -29,7 +48,7 @@ test( }, "{}" ) -test( +test.serial( testAPIMethod("locks.unlockDoor"), { args: (seed) => [seed.devices.schlageLock.id1], @@ -39,8 +58,8 @@ test( ) // Devices -test(testAPIMethod("devices.list"), {}, "AnyDevice[]") -test( +test.serial(testAPIMethod("devices.list"), {}, "AnyDevice[]") +test.serial( "with connected account ID", testAPIMethod("devices.list"), { @@ -50,7 +69,7 @@ test( }, "AnyDevice[]" ) -test( +test.serial( "by ID", testAPIMethod("devices.get"), { @@ -58,7 +77,7 @@ test( }, "AnyDevice" ) -test( +test.serial( "by name", testAPIMethod("devices.get"), { @@ -66,7 +85,7 @@ test( }, "AnyDevice" ) -test( +test.serial( testAPIMethod("devices.update"), { args: (seed) => [ @@ -79,7 +98,7 @@ test( }, "{}" ) -test( +test.serial( "delete", testAPIMethod("devices.delete"), { @@ -88,9 +107,13 @@ test( }, "{}" ) -test(testAPIMethod("devices.unmanaged.list"), {}, "UnmanagedDevice[]") -test(testAPIMethod("devices.listDeviceProviders"), {}, "DeviceProvider[]") -test( +test.serial(testAPIMethod("devices.unmanaged.list"), {}, "UnmanagedDevice[]") +test.serial( + testAPIMethod("devices.listDeviceProviders"), + {}, + "DeviceProvider[]" +) +test.serial( "with provider_category", testAPIMethod("devices.listDeviceProviders"), { @@ -104,15 +127,15 @@ test( ) // Connect Webviews -test(testAPIMethod("connectWebviews.list"), {}, "ConnectWebview[]") -test( +test.serial(testAPIMethod("connectWebviews.list"), {}, "ConnectWebview[]") +test.serial( testAPIMethod("connectWebviews.get"), { args: (seed) => [seed.connectWebviewId], }, "ConnectWebview" ) -test( +test.serial( testAPIMethod("connectWebviews.create"), { args: [ @@ -124,7 +147,7 @@ test( }, "ConnectWebview" ) -test( +test.serial( testAPIMethod("connectWebviews.delete"), { args: (seed) => [ @@ -138,14 +161,14 @@ test( ) // Access Codes -test( +test.serial( testAPIMethod("accessCodes.list"), { args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], }, "AccessCode[]" ) -test( +test.serial( testAPIMethod("accessCodes.create"), { args: (seed) => [ @@ -159,7 +182,7 @@ test( }, "AccessCode" ) -test( +test.serial( testAPIMethod("accessCodes.createMultiple"), { args: (seed) => [ @@ -172,7 +195,7 @@ test( }, "AccessCode[]" ) -test( +test.serial( "by access code ID", testAPIMethod("accessCodes.get"), { @@ -184,7 +207,7 @@ test( }, "AccessCode" ) -test( +test.serial( "by device ID and code", testAPIMethod("accessCodes.get"), { @@ -197,7 +220,7 @@ test( }, "AccessCode" ) -test( +test.serial( "change type to timebound", testAPIMethod("accessCodes.update"), { @@ -213,7 +236,7 @@ test( }, "TimeBoundAccessCode" ) -test( +test.serial( "scheduled", testAPIMethod("accessCodes.create"), { @@ -230,7 +253,7 @@ test( }, "AccessCode" ) -test( +test.serial( testAPIMethod("accessCodes.update"), { args: (seed) => [ @@ -243,7 +266,7 @@ test( }, "AccessCode" ) -test( +test.serial( "change type to ongoing", testAPIMethod("accessCodes.update"), { @@ -257,8 +280,8 @@ test( }, "OngoingAccessCode" ) -test(testAPIMethod("connectedAccounts.list"), {}, "ConnectedAccount[]") -test( +test.serial(testAPIMethod("connectedAccounts.list"), {}, "ConnectedAccount[]") +test.serial( "by email", testAPIMethod("connectedAccounts.get"), { @@ -270,7 +293,7 @@ test( }, "ConnectedAccount" ) -test( +test.serial( "by ID", testAPIMethod("connectedAccounts.get"), { @@ -282,7 +305,7 @@ test( }, "ConnectedAccount" ) -test( +test.serial( testAPIMethod("connectedAccounts.delete"), { args: (seed) => [ @@ -294,17 +317,3 @@ test( }, "{}" ) - -// Noise Thresholds -test.serial( - testAPIMethod("noiseThresholds.list"), - { - args: (seed) => [ - { - device_id: seed.devices.minut.device_with_quiet_hours.device_id, - }, - ], - load_devices_from: ["minut"], - }, - "NoiseThresholds[]" -) From e56a9efbe6ebba54dc017d3c274f88091b081006 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Tue, 18 Apr 2023 11:44:14 -0300 Subject: [PATCH 15/18] remove serial add modifiesState --- tests/routes.test.ts | 78 ++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 43 deletions(-) diff --git a/tests/routes.test.ts b/tests/routes.test.ts index 741033cd..e2a20f38 100644 --- a/tests/routes.test.ts +++ b/tests/routes.test.ts @@ -2,7 +2,7 @@ import test from "ava" import { testAPIMethod } from "./fixtures/helpers/test-api-method-macro" // Noise Thresholds -test.serial( +test( testAPIMethod("noiseThresholds.list"), { args: (seed) => [ @@ -17,17 +17,13 @@ test.serial( ) // Workspaces -test.serial(testAPIMethod("workspaces.list"), {}, "Workspace[]") -test.serial(testAPIMethod("workspaces.get"), {}, "Workspace") -test.serial( - testAPIMethod("workspaces.resetSandbox"), - { modifiesState: true }, - "{}" -) +test(testAPIMethod("workspaces.list"), {}, "Workspace[]") +test(testAPIMethod("workspaces.get"), {}, "Workspace") +test(testAPIMethod("workspaces.resetSandbox"), { modifiesState: true }, "{}") // Locks -test.serial(testAPIMethod("locks.list"), {}, "LockDevice[]") -test.serial( +test(testAPIMethod("locks.list"), {}, "LockDevice[]") +test( "with connected account ID", testAPIMethod("locks.list"), { @@ -35,12 +31,12 @@ test.serial( }, "LockDevice[]" ) -test.serial( +test( testAPIMethod("locks.get"), { args: (seed) => [seed.devices.schlageLock.id1] }, "LockDevice" ) -test.serial( +test( testAPIMethod("locks.lockDoor"), { args: (seed) => [seed.devices.schlageLock.id1], @@ -48,7 +44,7 @@ test.serial( }, "{}" ) -test.serial( +test( testAPIMethod("locks.unlockDoor"), { args: (seed) => [seed.devices.schlageLock.id1], @@ -58,8 +54,8 @@ test.serial( ) // Devices -test.serial(testAPIMethod("devices.list"), {}, "AnyDevice[]") -test.serial( +test(testAPIMethod("devices.list"), {}, "AnyDevice[]") +test( "with connected account ID", testAPIMethod("devices.list"), { @@ -69,7 +65,7 @@ test.serial( }, "AnyDevice[]" ) -test.serial( +test( "by ID", testAPIMethod("devices.get"), { @@ -77,7 +73,7 @@ test.serial( }, "AnyDevice" ) -test.serial( +test( "by name", testAPIMethod("devices.get"), { @@ -85,7 +81,7 @@ test.serial( }, "AnyDevice" ) -test.serial( +test( testAPIMethod("devices.update"), { args: (seed) => [ @@ -98,7 +94,7 @@ test.serial( }, "{}" ) -test.serial( +test( "delete", testAPIMethod("devices.delete"), { @@ -107,13 +103,9 @@ test.serial( }, "{}" ) -test.serial(testAPIMethod("devices.unmanaged.list"), {}, "UnmanagedDevice[]") -test.serial( - testAPIMethod("devices.listDeviceProviders"), - {}, - "DeviceProvider[]" -) -test.serial( +test(testAPIMethod("devices.unmanaged.list"), {}, "UnmanagedDevice[]") +test(testAPIMethod("devices.listDeviceProviders"), {}, "DeviceProvider[]") +test( "with provider_category", testAPIMethod("devices.listDeviceProviders"), { @@ -127,15 +119,15 @@ test.serial( ) // Connect Webviews -test.serial(testAPIMethod("connectWebviews.list"), {}, "ConnectWebview[]") -test.serial( +test(testAPIMethod("connectWebviews.list"), {}, "ConnectWebview[]") +test( testAPIMethod("connectWebviews.get"), { args: (seed) => [seed.connectWebviewId], }, "ConnectWebview" ) -test.serial( +test( testAPIMethod("connectWebviews.create"), { args: [ @@ -147,7 +139,7 @@ test.serial( }, "ConnectWebview" ) -test.serial( +test( testAPIMethod("connectWebviews.delete"), { args: (seed) => [ @@ -161,14 +153,14 @@ test.serial( ) // Access Codes -test.serial( +test( testAPIMethod("accessCodes.list"), { args: (seed) => [{ device_id: seed.devices.schlageLock.id1 }], }, "AccessCode[]" ) -test.serial( +test( testAPIMethod("accessCodes.create"), { args: (seed) => [ @@ -182,7 +174,7 @@ test.serial( }, "AccessCode" ) -test.serial( +test( testAPIMethod("accessCodes.createMultiple"), { args: (seed) => [ @@ -195,7 +187,7 @@ test.serial( }, "AccessCode[]" ) -test.serial( +test( "by access code ID", testAPIMethod("accessCodes.get"), { @@ -207,7 +199,7 @@ test.serial( }, "AccessCode" ) -test.serial( +test( "by device ID and code", testAPIMethod("accessCodes.get"), { @@ -220,7 +212,7 @@ test.serial( }, "AccessCode" ) -test.serial( +test( "change type to timebound", testAPIMethod("accessCodes.update"), { @@ -236,7 +228,7 @@ test.serial( }, "TimeBoundAccessCode" ) -test.serial( +test( "scheduled", testAPIMethod("accessCodes.create"), { @@ -253,7 +245,7 @@ test.serial( }, "AccessCode" ) -test.serial( +test( testAPIMethod("accessCodes.update"), { args: (seed) => [ @@ -266,7 +258,7 @@ test.serial( }, "AccessCode" ) -test.serial( +test( "change type to ongoing", testAPIMethod("accessCodes.update"), { @@ -280,8 +272,8 @@ test.serial( }, "OngoingAccessCode" ) -test.serial(testAPIMethod("connectedAccounts.list"), {}, "ConnectedAccount[]") -test.serial( +test(testAPIMethod("connectedAccounts.list"), {}, "ConnectedAccount[]") +test( "by email", testAPIMethod("connectedAccounts.get"), { @@ -293,7 +285,7 @@ test.serial( }, "ConnectedAccount" ) -test.serial( +test( "by ID", testAPIMethod("connectedAccounts.get"), { @@ -305,7 +297,7 @@ test.serial( }, "ConnectedAccount" ) -test.serial( +test( testAPIMethod("connectedAccounts.delete"), { args: (seed) => [ From af387a042c28fef7774a02d10ee1957a6da74636 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Tue, 18 Apr 2023 11:46:29 -0300 Subject: [PATCH 16/18] remove ts-ignore from startandseedserver --- tests/fixtures/workers/helpers/start-and-seed-server.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/fixtures/workers/helpers/start-and-seed-server.ts b/tests/fixtures/workers/helpers/start-and-seed-server.ts index 4b0d4f29..7aeef75b 100644 --- a/tests/fixtures/workers/helpers/start-and-seed-server.ts +++ b/tests/fixtures/workers/helpers/start-and-seed-server.ts @@ -98,25 +98,20 @@ const startAndSeedServer = async ( const devices = { ...load_devices_from.reduce((acc, provider, index) => { if (provider === "schlage") { - // @ts-ignore acc["schlageLock"] = devicesByProvider[index] return acc } if (provider === "august") { - // @ts-ignore acc["augustLock"] = devicesByProvider[index] return acc } - // @ts-ignore acc[provider] = devicesByProvider[index] return acc - }, {}), + }, {} as Record<"augustLock" | "minut" | "schlageLock", any>), } - console.log(devices) - return { serverUrl, externalDatabaseUrl: database.externalDatabaseUrl, From 972f852dd50012b39e925ee87e2027004bbc8871 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Tue, 18 Apr 2023 13:11:43 -0300 Subject: [PATCH 17/18] improve readability --- .../workers/helpers/start-and-seed-server.ts | 51 ++++++++----------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/tests/fixtures/workers/helpers/start-and-seed-server.ts b/tests/fixtures/workers/helpers/start-and-seed-server.ts index 7aeef75b..c3dec526 100644 --- a/tests/fixtures/workers/helpers/start-and-seed-server.ts +++ b/tests/fixtures/workers/helpers/start-and-seed-server.ts @@ -80,36 +80,29 @@ const startAndSeedServer = async ( ;(axios.defaults.headers as any).Authorization = `Bearer ${api_key}` - const providersMap = { - schlage: () => addFakeSchlageDevices(axios), - august: () => addFakeAugustDevices(axios), - minut: () => addFakeMinutDevices(axios), + const connectWebview = await axios.post("/connect_webviews/create", { + // TODO: remove filter when minut is ready + accepted_providers: load_devices_from.filter( + (provider) => provider !== "minut" + ), + }) + + const devices: { + augustLock?: Awaited> + minut?: Awaited> + schlageLock?: Awaited> + } = {} + + if (load_devices_from.includes("schlage")) { + devices["schlageLock"] = await addFakeSchlageDevices(axios) } - const [connectWebview, ...devicesByProvider] = await Promise.all([ - axios.post("/connect_webviews/create", { - // TODO: remove filter when minut is ready - accepted_providers: load_devices_from.filter( - (provider) => provider !== "minut" - ), - }), - ...load_devices_from.map((provider) => providersMap[provider]()), - ]) - - const devices = { - ...load_devices_from.reduce((acc, provider, index) => { - if (provider === "schlage") { - acc["schlageLock"] = devicesByProvider[index] - return acc - } - - if (provider === "august") { - acc["augustLock"] = devicesByProvider[index] - return acc - } - - acc[provider] = devicesByProvider[index] - return acc - }, {} as Record<"augustLock" | "minut" | "schlageLock", any>), + + if (load_devices_from.includes("schlage")) { + devices["augustLock"] = await addFakeAugustDevices(axios) + } + + if (load_devices_from.includes("schlage")) { + devices["minut"] = await addFakeMinutDevices(axios) } return { From 4eef8a6867c4c58b2c8ad610dd558971e6875084 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Tue, 18 Apr 2023 13:32:07 -0300 Subject: [PATCH 18/18] fix wrong include --- tests/fixtures/workers/helpers/start-and-seed-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures/workers/helpers/start-and-seed-server.ts b/tests/fixtures/workers/helpers/start-and-seed-server.ts index c3dec526..830feacc 100644 --- a/tests/fixtures/workers/helpers/start-and-seed-server.ts +++ b/tests/fixtures/workers/helpers/start-and-seed-server.ts @@ -101,7 +101,7 @@ const startAndSeedServer = async ( devices["augustLock"] = await addFakeAugustDevices(axios) } - if (load_devices_from.includes("schlage")) { + if (load_devices_from.includes("minut")) { devices["minut"] = await addFakeMinutDevices(axios) }