Skip to content

Commit

Permalink
v4.18.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjdhjd committed Dec 22, 2024
1 parent f25ea69 commit e91cf86
Show file tree
Hide file tree
Showing 10 changed files with 272 additions and 287 deletions.
5 changes: 5 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file. This project uses [semantic versioning](https://semver.org/).

## 4.18.0 (2024-12-08)
* Breaking change: the minimum supported node version is now node 20.
* Improvement: we've changed strategies to deal with Protect controller quirkiness/bugginess that results in network disconnects from the controller, while ensuring we have reasonable backpressure measures.
* Housekeeping.

## 4.17.0 (2024-12-08)
* Minor updates to the Protect JSON descriptions.
* Housekeeping.
Expand Down
28 changes: 14 additions & 14 deletions docs/ProtectApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Create an instance of the UniFi Protect API.
###### Get Signature
```ts
get bootstrap(): null | ProtectNvrBootstrapInterface
get bootstrap(): Nullable<ProtectNvrBootstrapInterface>
```
Access the Protect controller bootstrap JSON.
Expand All @@ -78,7 +78,7 @@ request to the Protect controller before accessing the bootstrap JSON.
###### Returns
`null` \| [`ProtectNvrBootstrapInterface`](ProtectTypes.md#protectnvrbootstrapinterface)
`Nullable`\<[`ProtectNvrBootstrapInterface`](ProtectTypes.md#protectnvrbootstrapinterface)\>
Returns the bootstrap JSON if the Protect controller has been bootstrapped, `null` otherwise.
Expand Down Expand Up @@ -206,7 +206,7 @@ process.stdout.write(util.inspect(ufp.bootstrap, { colors: true, depth: null, so
##### getSnapshot()

```ts
getSnapshot(device, options): Promise<null | Buffer<ArrayBufferLike>>
getSnapshot(device, options): Promise<Nullable<Buffer<ArrayBufferLike>>>
```

Retrieve a snapshot image from a Protect camera.
Expand All @@ -220,7 +220,7 @@ Retrieve a snapshot image from a Protect camera.

###### Returns

`Promise`\<`null` \| `Buffer`\<`ArrayBufferLike`\>\>
`Promise`\<`Nullable`\<`Buffer`\<`ArrayBufferLike`\>\>\>

Returns a promise that will resolve to a Buffer containing the JPEG image snapshot if successful, and `null` otherwise.

Expand All @@ -237,7 +237,7 @@ The `options` object for snapshot parameters accepts the following properties, a
##### getWsEndpoint()

```ts
getWsEndpoint(endpoint, params?): Promise<null | string>
getWsEndpoint(endpoint, params?): Promise<Nullable<string>>
```
Return a websocket API endpoint for the requested endpoint type.
Expand All @@ -251,7 +251,7 @@ Return a websocket API endpoint for the requested endpoint type.
###### Returns
`Promise`\<`null` \| `string`\>
`Promise`\<`Nullable`\<`string`\>\>
Returns a promise that will resolve to a URL to the requested endpoint if successful, and `null` otherwise.
Expand All @@ -271,7 +271,7 @@ Valid API endpoints are `livestream` and `talkback`.
retrieve(
url,
options,
logErrors): Promise<null | Response>
logErrors): Promise<Nullable<Response>>
```
Execute an HTTP fetch request to the Protect controller.
Expand All @@ -286,7 +286,7 @@ Execute an HTTP fetch request to the Protect controller.
###### Returns
`Promise`\<`null` \| `Response`\>
`Promise`\<`Nullable`\<`Response`\>\>
Returns a promise that will resolve to a Response object successful, and `null` otherwise.
Expand All @@ -299,7 +299,7 @@ This method should be used when direct access to the Protect controller is neede
##### updateDevice()
```ts
updateDevice<DeviceType>(device, payload): Promise<null | DeviceType>
updateDevice<DeviceType>(device, payload): Promise<Nullable<DeviceType>>
```
Update a Protect device's configuration on the UniFi Protect controller.
Expand All @@ -319,7 +319,7 @@ Update a Protect device's configuration on the UniFi Protect controller.
###### Returns
`Promise`\<`null` \| `DeviceType`\>
`Promise`\<`Nullable`\<`DeviceType`\>\>
Returns a promise that will resolve to the updated device-specific configuration JSON if successful, and `null` otherwise.
Expand Down Expand Up @@ -382,7 +382,7 @@ Returns the Protect controller name in the following format:
##### enableRtsp()
```ts
enableRtsp(device): Promise<null | ProtectCameraConfigInterface>
enableRtsp(device): Promise<Nullable<ProtectCameraConfigInterface>>
```
Utility method that enables all RTSP channels on a given Protect camera.
Expand All @@ -395,7 +395,7 @@ Utility method that enables all RTSP channels on a given Protect camera.
###### Returns
`Promise`\<`null` \| [`ProtectCameraConfigInterface`](ProtectTypes.md#protectcameraconfiginterface)\>
`Promise`\<`Nullable`\<[`ProtectCameraConfigInterface`](ProtectTypes.md#protectcameraconfiginterface)\>\>
Returns a promise that will resolve to the updated [ProtectCameraConfig](ProtectTypes.md#protectcameraconfig) if successful, and `null` otherwise.
Expand Down Expand Up @@ -540,7 +540,7 @@ Clear the login credentials and terminate any open connection to the UniFi Prote
### ProtectKnownDevicePayloads
```ts
type ProtectKnownDevicePayloads:
type ProtectKnownDevicePayloads =
| ProtectCameraConfigPayload
| ProtectChimeConfigPayload
| ProtectLightConfigPayload
Expand All @@ -556,7 +556,7 @@ Define our known Protect device payload types.
### ProtectKnownDeviceTypes
```ts
type ProtectKnownDeviceTypes:
type ProtectKnownDeviceTypes =
| ProtectCameraConfig
| ProtectChimeConfig
| ProtectLightConfig
Expand Down
8 changes: 4 additions & 4 deletions docs/ProtectApiEvents.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ UniFi Protect event utility class that provides functions for decoding realtime
##### decodePacket()

```ts
static decodePacket(log, packet): null | ProtectEventPacket
static decodePacket(log, packet): Nullable<ProtectEventPacket>
```

Decode a UniFi Protect event packet.
Expand All @@ -88,7 +88,7 @@ Decode a UniFi Protect event packet.

###### Returns

`null` \| [`ProtectEventPacket`](ProtectApiEvents.md#protecteventpacket)
`Nullable`\<[`ProtectEventPacket`](ProtectApiEvents.md#protecteventpacket)\>

###### Remarks

Expand All @@ -102,7 +102,7 @@ successfully logged into the Protect controller, events are generated automatica
### ProtectEventHeader

```ts
type ProtectEventHeader: {
type ProtectEventHeader = {
[key: string]: string | number | boolean | object; action: string;
id: string;
modelKey: string;
Expand Down Expand Up @@ -145,7 +145,7 @@ A UniFi Protect event packet represents a realtime event update from a UniFi Pro
### ProtectEventPacket

```ts
type ProtectEventPacket: {
type ProtectEventPacket = {
header: ProtectEventHeader;
payload: unknown;
};
Expand Down
4 changes: 2 additions & 2 deletions docs/ProtectLivestream.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ Returns a string containing the codec information,if it exists, or `null` otherw
###### Get Signature

```ts
get initSegment(): null | Buffer<ArrayBufferLike>
get initSegment(): Nullable<Buffer<ArrayBufferLike>>
```

The initialization segment that must be at the start of every fMP4 stream.

###### Returns

`null` \| `Buffer`\<`ArrayBufferLike`\>
`Nullable`\<`Buffer`\<`ArrayBufferLike`\>\>

Returns the initialization segment if it exists, or `null` otherwise.

Expand Down
Loading

0 comments on commit e91cf86

Please sign in to comment.