Skip to content

Commit

Permalink
v4.17.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjdhjd committed Dec 9, 2024
1 parent 86ab16b commit f25ea69
Show file tree
Hide file tree
Showing 12 changed files with 653 additions and 1,247 deletions.
4 changes: 4 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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

## 4.17.0 (2024-12-08)
* Minor updates to the Protect JSON descriptions.
* Housekeeping.

## 4.16.0 (2024-10-05)
* New feature: ufp - a command line utility to query and execute some utility commands using the Protect API. You'll need to create either ~/.ufp.json or ufp.json in your current directory with the properties `controller`, `username`, `password` all defined in a valid JSON.
* Housekeeping.
Expand Down
14 changes: 11 additions & 3 deletions docs/ProtectApi.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**unifi-protect**](README.md)**Docs**
[**unifi-protect**](README.md)

***

Expand Down Expand Up @@ -63,6 +63,8 @@ Create an instance of the UniFi Protect API.
##### bootstrap
###### Get Signature
```ts
get bootstrap(): null | ProtectNvrBootstrapInterface
```
Expand Down Expand Up @@ -204,7 +206,7 @@ process.stdout.write(util.inspect(ufp.bootstrap, { colors: true, depth: null, so
##### getSnapshot()

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

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

###### Returns

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

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

Expand Down Expand Up @@ -330,6 +332,8 @@ Use this method to change the configuration of a given Protect device or control
##### isAdminUser
###### Get Signature
```ts
get isAdminUser(): boolean
```
Expand All @@ -344,6 +348,8 @@ Returns `true` if the logged in user has administrative privileges, `false` othe
##### isThrottled
###### Get Signature
```ts
get isThrottled(): boolean
```
Expand All @@ -358,6 +364,8 @@ Returns `true` if the API has returned too many errors and is now throttled for
##### name
###### Get Signature
```ts
get name(): string
```
Expand Down
12 changes: 6 additions & 6 deletions docs/ProtectApiEvents.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**unifi-protect**](README.md)**Docs**
[**unifi-protect**](README.md)

***

Expand Down Expand Up @@ -84,7 +84,7 @@ Decode a UniFi Protect event packet.
| Parameter | Type | Description |
| ------ | ------ | ------ |
| `log` | [`ProtectLogging`](ProtectLogging.md#protectlogging) | Logging functions to use. |
| `packet` | `Buffer` | Input packet to decode. |
| `packet` | `Buffer`\<`ArrayBufferLike`\> | Input packet to decode. |

###### Returns

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

```ts
type ProtectEventHeader: {
[key: string]: boolean | number | object | string; action: string;
[key: string]: string | number | boolean | object; action: string;
id: string;
modelKey: string;
newUpdateId: string;
Expand All @@ -112,11 +112,11 @@ type ProtectEventHeader: {

UniFi Protect event header.

#### Index Signature
#### Type declaration

\[`key`: `string`\]: `boolean` \| `number` \| `object` \| `string`
#### Index Signature

#### Type declaration
\[`key`: `string`\]: `string` \| `number` \| `boolean` \| `object`

| Name | Type |
| ------ | ------ |
Expand Down
14 changes: 9 additions & 5 deletions docs/ProtectLivestream.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**unifi-protect**](README.md)**Docs**
[**unifi-protect**](README.md)

***

Expand Down Expand Up @@ -89,6 +89,8 @@ new ProtectLivestream(api, log): ProtectLivestream

##### codec

###### Get Signature

```ts
get codec(): string
```
Expand All @@ -113,15 +115,17 @@ Returns a string containing the codec information,if it exists, or `null` otherw

##### initSegment

###### Get Signature

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

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

###### Returns

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

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

Expand All @@ -130,14 +134,14 @@ Returns the initialization segment if it exists, or `null` otherwise.
##### getInitSegment()

```ts
getInitSegment(): Promise<Buffer>
getInitSegment(): Promise<Buffer<ArrayBufferLike>>
```

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

###### Returns

`Promise`\<`Buffer`\>
`Promise`\<`Buffer`\<`ArrayBufferLike`\>\>

Returns a promise that resolves once the initialization segment has been seen, or returning it immediately if it already has been.

Expand Down
2 changes: 1 addition & 1 deletion docs/ProtectLogging.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**unifi-protect**](README.md)**Docs**
[**unifi-protect**](README.md)

***

Expand Down
60 changes: 50 additions & 10 deletions docs/ProtectTypes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**unifi-protect**](README.md)**Docs**
[**unifi-protect**](README.md)

***

Expand Down Expand Up @@ -65,7 +65,8 @@ A semi-complete description of the UniFi Protect camera JSON.
| `currentResolution` | `string` |
| `displayName` | `string` |
| `elementInfo` | `null` |
| `featureFlags` | \{ `audio`: `string`[]; `audioCodecs`: `string`[]; `audioStyle`: `string`[]; `canAdjustIrLedLevel`: `boolean`; `canMagicZoom`: `boolean`; `canOpticalZoom`: `boolean`; `canTouchFocus`: `boolean`; `hasAccelerometer`: `boolean`; `hasAec`: `boolean`; `hasAutoICROnly`: `boolean`; `hasBattery`: `boolean`; `hasBluetooth`: `boolean`; `hasChime`: `boolean`; `hasColorLcdScreen`: `boolean`; `hasExternalIr`: `boolean`; `hasFlash`: `boolean`; `hasHdr`: `boolean`; `hasIcrSensitivity`: `boolean`; `hasInfrared`: `boolean`; `hasLcdScreen`: `boolean`; `hasLdc`: `boolean`; `hasLedIr`: `boolean`; `hasLedStatus`: `boolean`; `hasLineCrossing`: `boolean`; `hasLineCrossingCounting`: `boolean`; `hasLineIn`: `boolean`; `hasLiveviewTracking`: `boolean`; `hasLuxCheck`: `boolean`; `hasMic`: `boolean`; `hasMotionZones`: `boolean`; `hasNewMotionAlgorithm`: `boolean`; `hasPackageCamera`: `boolean`; `hasPrivacyMask`: `boolean`; `hasRtc`: `boolean`; `hasSdCard`: `boolean`; `hasSmartDetect`: `boolean`; `hasSpeaker`: `boolean`; `hasSquareEventThumbnail`: `boolean`; `hasVerticalFlip`: `boolean`; `hasWifi`: `boolean`; `isDoorbell`: `boolean`; `isPtz`: `boolean`; `motionAlgorithms`: `string`[]; `privacyMaskCapability`: \{ `maxMasks`: `number`; `rectangleOnly`: `boolean`; \}; `smartDetectAudioTypes`: `string`[]; `smartDetectTypes`: `string`[]; `supportDoorAccessConfig`: `boolean`; `videoCodecs`: `string`[]; `videoModeMaxFps`: `number`[]; `videoModes`: `string`[]; \} |
| `enableNfc` | `boolean` |
| `featureFlags` | \{ `audio`: `string`[]; `audioCodecs`: `string`[]; `audioStyle`: `string`[]; `canAdjustIrLedLevel`: `boolean`; `canMagicZoom`: `boolean`; `canOpticalZoom`: `boolean`; `canTouchFocus`: `boolean`; `hasAccelerometer`: `boolean`; `hasAec`: `boolean`; `hasAutoICROnly`: `boolean`; `hasBattery`: `boolean`; `hasBluetooth`: `boolean`; `hasChime`: `boolean`; `hasColorLcdScreen`: `boolean`; `hasExternalIr`: `boolean`; `hasFingerprintSensor`: `boolean`; `hasFlash`: `boolean`; `hasHdr`: `boolean`; `hasIcrSensitivity`: `boolean`; `hasInfrared`: `boolean`; `hasLcdScreen`: `boolean`; `hasLdc`: `boolean`; `hasLedIr`: `boolean`; `hasLedStatus`: `boolean`; `hasLineCrossing`: `boolean`; `hasLineCrossingCounting`: `boolean`; `hasLineIn`: `boolean`; `hasLiveviewTracking`: `boolean`; `hasLuxCheck`: `boolean`; `hasMic`: `boolean`; `hasMotionZones`: `boolean`; `hasNewMotionAlgorithm`: `boolean`; `hasPackageCamera`: `boolean`; `hasPrivacyMask`: `boolean`; `hasRtc`: `boolean`; `hasSdCard`: `boolean`; `hasSmartDetect`: `boolean`; `hasSpeaker`: `boolean`; `hasSquareEventThumbnail`: `boolean`; `hasVerticalFlip`: `boolean`; `hasWifi`: `boolean`; `isDoorbell`: `boolean`; `isPtz`: `boolean`; `maxScaleDownLevel`: `number`; `motionAlgorithms`: `string`[]; `privacyMaskCapability`: \{ `maxMasks`: `number`; `rectangleOnly`: `boolean`; \}; `smartDetectAudioTypes`: `string`[]; `smartDetectTypes`: `string`[]; `supportDoorAccessConfig`: `boolean`; `supportLpDetectionWithoutVehicle`: `boolean`; `supportNfc`: `boolean`; `videoCodecs`: `string`[]; `videoModeMaxFps`: `number`[]; `videoModes`: `string`[]; \} |
| `featureFlags.audio` | `string`[] |
| `featureFlags.audioCodecs` | `string`[] |
| `featureFlags.audioStyle` | `string`[] |
Expand All @@ -81,6 +82,7 @@ A semi-complete description of the UniFi Protect camera JSON.
| `featureFlags.hasChime` | `boolean` |
| `featureFlags.hasColorLcdScreen` | `boolean` |
| `featureFlags.hasExternalIr` | `boolean` |
| `featureFlags.hasFingerprintSensor` | `boolean` |
| `featureFlags.hasFlash` | `boolean` |
| `featureFlags.hasHdr` | `boolean` |
| `featureFlags.hasIcrSensitivity` | `boolean` |
Expand Down Expand Up @@ -108,18 +110,35 @@ A semi-complete description of the UniFi Protect camera JSON.
| `featureFlags.hasWifi` | `boolean` |
| `featureFlags.isDoorbell` | `boolean` |
| `featureFlags.isPtz` | `boolean` |
| `featureFlags.maxScaleDownLevel` | `number` |
| `featureFlags.motionAlgorithms` | `string`[] |
| `featureFlags.privacyMaskCapability` | \{ `maxMasks`: `number`; `rectangleOnly`: `boolean`; \} |
| `featureFlags.privacyMaskCapability.maxMasks` | `number` |
| `featureFlags.privacyMaskCapability.rectangleOnly` | `boolean` |
| `featureFlags.smartDetectAudioTypes` | `string`[] |
| `featureFlags.smartDetectTypes` | `string`[] |
| `featureFlags.supportDoorAccessConfig` | `boolean` |
| `featureFlags.supportLpDetectionWithoutVehicle` | `boolean` |
| `featureFlags.supportNfc` | `boolean` |
| `featureFlags.videoCodecs` | `string`[] |
| `featureFlags.videoModeMaxFps` | `number`[] |
| `featureFlags.videoModes` | `string`[] |
| `fingerprintSettings` | \{ `enable`: `boolean`; `enablePrintLatency`: `boolean`; `mode`: `string`; `reportCaptureComplete`: `boolean`; `reportFingerTouch`: `boolean`; \} |
| `fingerprintSettings.enable` | `boolean` |
| `fingerprintSettings.enablePrintLatency` | `boolean` |
| `fingerprintSettings.mode` | `string` |
| `fingerprintSettings.reportCaptureComplete` | `boolean` |
| `fingerprintSettings.reportFingerTouch` | `boolean` |
| `fingerprintState` | \{ `fingerprintId`: `string`; `free`: `number`; `progress`: `string`; `status`: `string`; `total`: `number`; \} |
| `fingerprintState.fingerprintId` | `string` |
| `fingerprintState.free` | `number` |
| `fingerprintState.progress` | `string` |
| `fingerprintState.status` | `string` |
| `fingerprintState.total` | `number` |
| `firmwareBuild` | `string` |
| `firmwareVersion` | `string` |
| `fwUpdateState` | `string` |
| `guid` | `string` |
| `hardwareRevision` | `string` |
| `hasRecordings` | `boolean` |
| `hasSpeaker` | `boolean` |
Expand Down Expand Up @@ -148,7 +167,9 @@ A semi-complete description of the UniFi Protect camera JSON.
| `isLiveHeatmapEnabled` | `boolean` |
| `isManaged` | `boolean` |
| `isMicEnabled` | `boolean` |
| `isMissingRecordingDetected` | `boolean` |
| `isMotionDetected` | `boolean` |
| `isPairedWithAiPort` | `boolean` |
| `isPoorNetwork` | `boolean` |
| `isProbingForWifi` | `boolean` |
| `isProvisioned` | `boolean` |
Expand Down Expand Up @@ -205,6 +226,14 @@ A semi-complete description of the UniFi Protect camera JSON.
| `micVolume` | `number` |
| `modelKey` | `string` |
| `name` | `string` |
| `nfcSettings` | \{ `enableNfc`: `boolean`; `supportThirdPartyCard`: `boolean`; \} |
| `nfcSettings.enableNfc` | `boolean` |
| `nfcSettings.supportThirdPartyCard` | `boolean` |
| `nfcState` | \{ `cardId`: `string`; `isUACard`: `boolean`; `lastSeen`: `number`; `mode`: `string`; \} |
| `nfcState.cardId` | `string` |
| `nfcState.isUACard` | `boolean` |
| `nfcState.lastSeen` | `number` |
| `nfcState.mode` | `string` |
| `nvrMac` | `string` |
| `osdSettings` | \{ `isDateEnabled`: `boolean`; `isDebugEnabled`: `boolean`; `isLogoEnabled`: `boolean`; `isNameEnabled`: `boolean`; \} |
| `osdSettings.isDateEnabled` | `boolean` |
Expand Down Expand Up @@ -269,6 +298,7 @@ A semi-complete description of the UniFi Protect camera JSON.
| `stats.wifi.signalStrength` | `number` |
| `stats.wifiQuality` | `number` |
| `stats.wifiStrength` | `number` |
| `supportedScalingResolutions` | `string`[] |
| `talkbackSettings` | \{ `bindAddr`: `string`; `bindPort`: `number`; `bitsPerSample`: `number`; `channels`: `number`; `filterAddr`: `string`; `filterPort`: `number`; `quality`: `number`; `samplingRate`: `number`; `typeFmt`: `string`; `typeIn`: `string`; \} |
| `talkbackSettings.bindAddr` | `string` |
| `talkbackSettings.bindPort` | `number` |
Expand All @@ -290,8 +320,13 @@ A semi-complete description of the UniFi Protect camera JSON.
| `tiltLimitsOfPrivacyZones.side` | `string` |
| `type` | `string` |
| `upSince` | `number` |
| `uptime` | `number` |
| `useGlobal` | `boolean` |
| `videoCodec` | `string` |
| `videoCodecState` | `number` |
| `videoCodecSwitchingSince` | `number` |
| `videoMode` | `string` |
| `videoReconfigurationInProgress` | `boolean` |
| `voltage` | `number` |
| `wifiConnectionState` | \{ `channel`: `number`; `frequency`: `number`; `phyRate`: `number`; `signalQuality`: `number`; `signalStrength`: `number`; \} |
| `wifiConnectionState.channel` | `number` |
Expand Down Expand Up @@ -430,13 +465,18 @@ A description of metadata in UniFi Protect smart motion detect events.
| ------ | ------ |
| `deviceId` | \{ `text`: `string`; \} |
| `deviceId.text` | `string` |
| `fingerprint` | \{ `ulpId`: `string`; \} |
| `fingerprint.ulpId` | `string` |
| `isLowBattery` | `boolean` |
| `isWireless` | `boolean` |
| `licensePlate` | \{ `confidenceLevel`: `number`; `name`: `string`; \} |
| `licensePlate.confidenceLevel` | `number` |
| `licensePlate.name` | `string` |
| `name` | \{ `text`: `string`; \} |
| `name.text` | `string` |
| `nfc` | \{ `nfcId`: `string`; `ulpId`: `string`; \} |
| `nfc.nfcId` | `string` |
| `nfc.ulpId` | `string` |
| `reason` | `string` |

***
Expand Down Expand Up @@ -507,16 +547,16 @@ An semi-complete description of the UniFi Protect NVR bootstrap JSON.
#### Indexable

\[`key`: `string`\]:
\| [`ProtectCameraConfig`](ProtectTypes.md#protectcameraconfig)[]
\| [`ProtectChimeConfig`](ProtectTypes.md#protectchimeconfig)[]
\| [`ProtectLightConfig`](ProtectTypes.md#protectlightconfig)[]
\| [`ProtectNvrConfig`](ProtectTypes.md#protectnvrconfig)
\| [`ProtectNvrLiveviewConfig`](ProtectTypes.md#protectnvrliveviewconfig)[]
\| [`ProtectNvrUserConfig`](ProtectTypes.md#protectnvruserconfig)[]
\| [`ProtectSensorConfig`](ProtectTypes.md#protectsensorconfig)[]
\| [`ProtectViewerConfig`](ProtectTypes.md#protectviewerconfig)[]
\| `string`
\| `unknown`[]
\| [`ProtectCameraConfigInterface`](ProtectTypes.md#protectcameraconfiginterface)[]
\| [`ProtectChimeConfigInterface`](ProtectTypes.md#protectchimeconfiginterface)[]
\| [`ProtectLightConfigInterface`](ProtectTypes.md#protectlightconfiginterface)[]
\| [`ProtectNvrConfigInterface`](ProtectTypes.md#protectnvrconfiginterface)
\| [`ProtectNvrLiveviewConfigInterface`](ProtectTypes.md#protectnvrliveviewconfiginterface)[]
\| [`ProtectNvrUserConfigInterface`](ProtectTypes.md#protectnvruserconfiginterface)[]
\| [`ProtectSensorConfigInterface`](ProtectTypes.md#protectsensorconfiginterface)[]
\| [`ProtectViewerConfigInterface`](ProtectTypes.md#protectviewerconfiginterface)[]

#### Properties

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**unifi-protect****Docs**
**unifi-protect**

***

Expand Down
Loading

0 comments on commit f25ea69

Please sign in to comment.