Compat with latest JS lib
This commit is contained in:
@@ -3,7 +3,8 @@ import { IsBoolean, IsInt, IsNumber, IsString, Length } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class ChannelSettingsValidation
|
||||
implements Omit<Protobuf.ChannelSettings, "psk">
|
||||
implements
|
||||
Omit<Protobuf.ChannelSettings, keyof Protobuf.native.Message | "psk">
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@@ -2,7 +2,10 @@ import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class BluetoothValidation implements Protobuf.Config_BluetoothConfig {
|
||||
export class BluetoothValidation
|
||||
implements
|
||||
Omit<Protobuf.Config_BluetoothConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class DeviceValidation implements Protobuf.Config_DeviceConfig {
|
||||
export class DeviceValidation
|
||||
implements Omit<Protobuf.Config_DeviceConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsEnum(Protobuf.Config_DeviceConfig_Role)
|
||||
role: Protobuf.Config_DeviceConfig_Role;
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class DisplayValidation implements Protobuf.Config_DisplayConfig {
|
||||
export class DisplayValidation
|
||||
implements Omit<Protobuf.Config_DisplayConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsInt()
|
||||
screenOnSecs: number;
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ import { IsArray, IsBoolean, IsEnum, IsInt, Max, Min } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class LoRaValidation implements Protobuf.Config_LoRaConfig {
|
||||
export class LoRaValidation
|
||||
implements Omit<Protobuf.Config_LoRaConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
usePreset: boolean;
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@ import { IsBoolean, IsEnum, IsIP, IsOptional, Length } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class NetworkValidation implements Protobuf.Config_NetworkConfig {
|
||||
export class NetworkValidation
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.Config_NetworkConfig,
|
||||
keyof Protobuf.native.Message | "ipv4Config"
|
||||
>
|
||||
{
|
||||
@IsBoolean()
|
||||
wifiEnabled: boolean;
|
||||
|
||||
@@ -21,14 +27,17 @@ export class NetworkValidation implements Protobuf.Config_NetworkConfig {
|
||||
ethEnabled: boolean;
|
||||
|
||||
@IsEnum(Protobuf.Config_NetworkConfig_AddressMode)
|
||||
// @IsOptional()
|
||||
addressMode: Protobuf.Config_NetworkConfig_AddressMode;
|
||||
|
||||
ipv4Config: NetworkValidation_IpV4Config;
|
||||
}
|
||||
|
||||
export class NetworkValidation_IpV4Config
|
||||
implements Protobuf.Config_NetworkConfig_IpV4Config
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.Config_NetworkConfig_IpV4Config,
|
||||
keyof Protobuf.native.Message
|
||||
>
|
||||
{
|
||||
@IsIP()
|
||||
@IsOptional()
|
||||
|
||||
@@ -2,7 +2,10 @@ import { IsBoolean, IsInt, IsNumber } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class PositionValidation implements Protobuf.Config_PositionConfig {
|
||||
export class PositionValidation
|
||||
implements
|
||||
Omit<Protobuf.Config_PositionConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsInt()
|
||||
positionBroadcastSecs: number;
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ import { IsBoolean, IsInt, Max, Min } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class PowerValidation implements Protobuf.Config_PowerConfig {
|
||||
export class PowerValidation
|
||||
implements Omit<Protobuf.Config_PowerConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
isPowerSaving: boolean;
|
||||
|
||||
|
||||
@@ -3,7 +3,11 @@ import { IsBoolean, IsOptional, IsString, Length } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class UserValidation
|
||||
implements Omit<Protobuf.User, "ID" | "macaddr" | "hwModel">
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.User,
|
||||
keyof Protobuf.native.Message | "ID" | "macaddr" | "hwModel"
|
||||
>
|
||||
{
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
|
||||
@@ -2,7 +2,10 @@ import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class AudioValidation implements Protobuf.ModuleConfig_AudioConfig {
|
||||
export class AudioValidation
|
||||
implements
|
||||
Omit<Protobuf.ModuleConfig_AudioConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
codec2Enabled: boolean;
|
||||
|
||||
@@ -13,14 +16,14 @@ export class AudioValidation implements Protobuf.ModuleConfig_AudioConfig {
|
||||
bitrate: Protobuf.ModuleConfig_AudioConfig_Audio_Baud;
|
||||
|
||||
@IsInt()
|
||||
i2SWs: number;
|
||||
i2sWs: number;
|
||||
|
||||
@IsInt()
|
||||
i2SSd: number;
|
||||
i2sSd: number;
|
||||
|
||||
@IsInt()
|
||||
i2SDin: number;
|
||||
i2sDin: number;
|
||||
|
||||
@IsInt()
|
||||
i2SSck: number;
|
||||
i2sSck: number;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,11 @@ import { IsBoolean, IsEnum, IsInt, Length } from "class-validator";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class CannedMessageValidation
|
||||
implements Protobuf.ModuleConfig_CannedMessageConfig
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.ModuleConfig_CannedMessageConfig,
|
||||
keyof Protobuf.native.Message
|
||||
>
|
||||
{
|
||||
@IsBoolean()
|
||||
rotary1Enabled: boolean;
|
||||
|
||||
@@ -3,7 +3,11 @@ import { IsBoolean, IsInt } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class ExternalNotificationValidation
|
||||
implements Protobuf.ModuleConfig_ExternalNotificationConfig
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.ModuleConfig_ExternalNotificationConfig,
|
||||
keyof Protobuf.native.Message
|
||||
>
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@@ -2,7 +2,10 @@ import { IsBoolean, Length } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class MQTTValidation implements Protobuf.ModuleConfig_MQTTConfig {
|
||||
export class MQTTValidation
|
||||
implements
|
||||
Omit<Protobuf.ModuleConfig_MQTTConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@ import { IsBoolean, IsInt } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class RangeTestValidation
|
||||
implements Protobuf.ModuleConfig_RangeTestConfig
|
||||
implements
|
||||
Omit<Protobuf.ModuleConfig_RangeTestConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@@ -2,7 +2,10 @@ import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class SerialValidation implements Protobuf.ModuleConfig_SerialConfig {
|
||||
export class SerialValidation
|
||||
implements
|
||||
Omit<Protobuf.ModuleConfig_SerialConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
|
||||
@@ -3,7 +3,11 @@ import { IsBoolean, IsInt } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class StoreForwardValidation
|
||||
implements Protobuf.ModuleConfig_StoreForwardConfig
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.ModuleConfig_StoreForwardConfig,
|
||||
keyof Protobuf.native.Message
|
||||
>
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@@ -3,7 +3,8 @@ import { IsBoolean, IsInt } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class TelemetryValidation
|
||||
implements Protobuf.ModuleConfig_TelemetryConfig
|
||||
implements
|
||||
Omit<Protobuf.ModuleConfig_TelemetryConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsInt()
|
||||
deviceUpdateInterval: number;
|
||||
|
||||
Reference in New Issue
Block a user