use new packages for imports & new webserial transport

This commit is contained in:
Sacha Weatherstone
2025-03-01 14:00:06 +08:00
parent f31ac24707
commit 5a62b67e79
64 changed files with 445 additions and 437 deletions
+3 -5
View File
@@ -1,5 +1,5 @@
import type { Message } from "@bufbuild/protobuf";
import { Protobuf } from "@meshtastic/js";
import { Protobuf } from "@meshtastic/core";
import {
IsBoolean,
IsEnum,
@@ -10,8 +10,7 @@ import {
} from "class-validator";
export class ChannelValidation
implements Omit<Protobuf.Channel.Channel, keyof Message | "settings">
{
implements Omit<Protobuf.Channel.Channel, keyof Message | "settings"> {
@IsNumber()
index: number;
@@ -22,8 +21,7 @@ export class ChannelValidation
}
export class Channel_SettingsValidation
implements Omit<Protobuf.Channel.ChannelSettings, keyof Message | "psk">
{
implements Omit<Protobuf.Channel.ChannelSettings, keyof Message | "psk"> {
@IsNumber()
channelNum: number;
+6 -8
View File
@@ -1,14 +1,12 @@
import type { Message } from "@bufbuild/protobuf";
import { Protobuf } from "@meshtastic/js";
import { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsEnum, IsInt } from "class-validator";
export class BluetoothValidation
implements
Omit<
Protobuf.Config.Config_BluetoothConfig,
keyof Message | "deviceLoggingEnabled"
>
{
export class BluetoothValidation implements
Omit<
Protobuf.Config.Config_BluetoothConfig,
keyof Message | "deviceLoggingEnabled"
> {
@IsBoolean()
enabled: boolean;
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Message } from "@bufbuild/protobuf";
import { Protobuf } from "@meshtastic/js";
import { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsEnum, IsInt, IsString } from "class-validator";
export class DeviceValidation
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Message } from "@bufbuild/protobuf";
import { Protobuf } from "@meshtastic/js";
import { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsEnum, IsInt } from "class-validator";
export class DisplayValidation
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Message } from "@bufbuild/protobuf";
import { Protobuf } from "@meshtastic/js";
import { Protobuf } from "@meshtastic/core";
import { IsArray, IsBoolean, IsEnum, IsInt, Max, Min } from "class-validator";
export class LoRaValidation
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Message } from "@bufbuild/protobuf";
import { Protobuf } from "@meshtastic/js";
import { Protobuf } from "@meshtastic/core";
import {
IsBoolean,
IsEnum,
+6 -8
View File
@@ -1,16 +1,14 @@
import type { Message } from "@bufbuild/protobuf";
import { Protobuf } from "@meshtastic/js";
import { Protobuf } from "@meshtastic/core";
import { IsArray, IsBoolean, IsEnum, IsInt } from "class-validator";
const DeprecatedPositionValidationFields = ["gpsEnabled", "gpsAttemptTime"];
export class PositionValidation
implements
Omit<
Protobuf.Config.Config_PositionConfig,
keyof Message | (typeof DeprecatedPositionValidationFields)[number]
>
{
export class PositionValidation implements
Omit<
Protobuf.Config.Config_PositionConfig,
keyof Message | (typeof DeprecatedPositionValidationFields)[number]
> {
@IsInt()
positionBroadcastSecs: number;
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Message } from "@bufbuild/protobuf";
import type { Protobuf } from "@meshtastic/js";
import type { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsInt, IsNumber, Max, Min } from "class-validator";
export class PowerValidation
+6 -8
View File
@@ -1,14 +1,12 @@
import type { Message } from "@bufbuild/protobuf";
import type { Protobuf } from "@meshtastic/js";
import type { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsString } from "class-validator";
export class SecurityValidation
implements
Omit<
Protobuf.Config.Config_SecurityConfig,
keyof Message | "adminKey" | "privateKey" | "publicKey"
>
{
export class SecurityValidation implements
Omit<
Protobuf.Config.Config_SecurityConfig,
keyof Message | "adminKey" | "privateKey" | "publicKey"
> {
@IsBoolean()
adminChannelEnabled: boolean;
@@ -1,14 +1,12 @@
import type { Message } from "@bufbuild/protobuf";
import type { Protobuf } from "@meshtastic/js";
import type { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsInt } from "class-validator";
export class AmbientLightingValidation
implements
Omit<
Protobuf.ModuleConfig.ModuleConfig_AmbientLightingConfig,
keyof Message
>
{
export class AmbientLightingValidation implements
Omit<
Protobuf.ModuleConfig.ModuleConfig_AmbientLightingConfig,
keyof Message
> {
@IsBoolean()
ledState: boolean;
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Message } from "@bufbuild/protobuf";
import { Protobuf } from "@meshtastic/js";
import { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsEnum, IsInt } from "class-validator";
export class AudioValidation
+11 -6
View File
@@ -1,11 +1,13 @@
import type { Message } from "@bufbuild/protobuf";
import { Protobuf } from "@meshtastic/js";
import { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsEnum, IsInt, Length } from "class-validator";
export class CannedMessageValidation
implements
Omit<Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig, keyof Message>
{
Omit<
Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig,
keyof Message
> {
@IsBoolean()
rotary1Enabled: boolean;
@@ -19,13 +21,16 @@ export class CannedMessageValidation
inputbrokerPinPress: number;
@IsEnum(Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar)
inputbrokerEventCw: Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar;
inputbrokerEventCw:
Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar;
@IsEnum(Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar)
inputbrokerEventCcw: Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar;
inputbrokerEventCcw:
Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar;
@IsEnum(Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar)
inputbrokerEventPress: Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar;
inputbrokerEventPress:
Protobuf.ModuleConfig.ModuleConfig_CannedMessageConfig_InputEventChar;
@IsBoolean()
updown1Enabled: boolean;
@@ -1,14 +1,12 @@
import type { Message } from "@bufbuild/protobuf";
import type { Protobuf } from "@meshtastic/js";
import type { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsInt, Length } from "class-validator";
export class DetectionSensorValidation
implements
Omit<
Protobuf.ModuleConfig.ModuleConfig_DetectionSensorConfig,
keyof Message
>
{
export class DetectionSensorValidation implements
Omit<
Protobuf.ModuleConfig.ModuleConfig_DetectionSensorConfig,
keyof Message
> {
@IsBoolean()
enabled: boolean;
@@ -1,14 +1,12 @@
import type { Message } from "@bufbuild/protobuf";
import type { Protobuf } from "@meshtastic/js";
import type { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsInt } from "class-validator";
export class ExternalNotificationValidation
implements
Omit<
Protobuf.ModuleConfig.ModuleConfig_ExternalNotificationConfig,
keyof Message
>
{
export class ExternalNotificationValidation implements
Omit<
Protobuf.ModuleConfig.ModuleConfig_ExternalNotificationConfig,
keyof Message
> {
@IsBoolean()
enabled: boolean;
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Message } from "@bufbuild/protobuf";
import type { Protobuf } from "@meshtastic/js";
import type { Protobuf } from "@meshtastic/core";
import {
IsBoolean,
IsNumber,
+2 -3
View File
@@ -1,11 +1,10 @@
import type { Message } from "@bufbuild/protobuf";
import type { Protobuf } from "@meshtastic/js";
import type { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsInt } from "class-validator";
export class NeighborInfoValidation
implements
Omit<Protobuf.ModuleConfig.ModuleConfig_NeighborInfoConfig, keyof Message>
{
Omit<Protobuf.ModuleConfig.ModuleConfig_NeighborInfoConfig, keyof Message> {
@IsBoolean()
enabled: boolean;
+2 -3
View File
@@ -1,11 +1,10 @@
import type { Message } from "@bufbuild/protobuf";
import type { Protobuf } from "@meshtastic/js";
import type { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsInt } from "class-validator";
export class PaxcounterValidation
implements
Omit<Protobuf.ModuleConfig.ModuleConfig_PaxcounterConfig, keyof Message>
{
Omit<Protobuf.ModuleConfig.ModuleConfig_PaxcounterConfig, keyof Message> {
@IsBoolean()
enabled: boolean;
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Message } from "@bufbuild/protobuf";
import type { Protobuf } from "@meshtastic/js";
import type { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsInt } from "class-validator";
export class RangeTestValidation
+2 -3
View File
@@ -1,11 +1,10 @@
import type { Message } from "@bufbuild/protobuf";
import { Protobuf } from "@meshtastic/js";
import { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsEnum, IsInt } from "class-validator";
export class SerialValidation
implements
Omit<Protobuf.ModuleConfig.ModuleConfig_SerialConfig, keyof Message>
{
Omit<Protobuf.ModuleConfig.ModuleConfig_SerialConfig, keyof Message> {
@IsBoolean()
enabled: boolean;
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Message } from "@bufbuild/protobuf";
import type { Protobuf } from "@meshtastic/js";
import type { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsInt } from "class-validator";
export class StoreForwardValidation
+2 -3
View File
@@ -1,11 +1,10 @@
import type { Message } from "@bufbuild/protobuf";
import type { Protobuf } from "@meshtastic/js";
import type { Protobuf } from "@meshtastic/core";
import { IsBoolean, IsInt } from "class-validator";
export class TelemetryValidation
implements
Omit<Protobuf.ModuleConfig.ModuleConfig_TelemetryConfig, keyof Message>
{
Omit<Protobuf.ModuleConfig.ModuleConfig_TelemetryConfig, keyof Message> {
@IsInt()
deviceUpdateInterval: number;