update meshtastic.js package version

This commit is contained in:
Sacha Weatherstone
2023-12-26 22:16:45 +10:00
parent dcab2c33d0
commit a4a5061171
54 changed files with 455 additions and 466 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ import {
} from "@components/UI/Dialog.js";
import { Input } from "@components/UI/Input.js";
import { Label } from "@components/UI/Label.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
import { useForm } from "react-hook-form";
export interface User {
+2 -2
View File
@@ -12,7 +12,7 @@ import { Input } from "@components/UI/Input.js";
import { Label } from "@components/UI/Label.js";
import { Switch } from "@components/UI/Switch.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
import { toByteArray } from "base64-js";
import { useEffect, useState } from "react";
@@ -33,7 +33,7 @@ export const ImportDialog = ({
const { connection } = useDevice();
useEffect(() => {
const base64String = QRCodeURL.split("e/#")[1]
const base64String = QRCodeURL.split("e/#")[1];
const paddedString = base64String
?.padEnd(base64String.length + ((4 - (base64String.length % 4)) % 4), "=")
.replace(/-/g, "+")
+3 -3
View File
@@ -9,7 +9,7 @@ import {
} from "@components/UI/Dialog.js";
import { Input } from "@components/UI/Input.js";
import { Label } from "@components/UI/Label.js";
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
import { Protobuf, Types } from "@meshtastic/js";
import { fromByteArray } from "base64-js";
import { ClipboardIcon } from "lucide-react";
import { useEffect, useState } from "react";
@@ -70,8 +70,8 @@ export const QRDialog = ({
{channel.settings?.name.length
? channel.settings.name
: channel.role === Protobuf.Channel_Role.PRIMARY
? "Primary"
: `Channel: ${channel.index}`}
? "Primary"
: `Channel: ${channel.index}`}
</Label>
<Checkbox
key={channel.index}
+5 -3
View File
@@ -2,7 +2,7 @@ import type { ChannelValidation } from "@app/validation/channel.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useToast } from "@core/hooks/useToast.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
import { fromByteArray, toByteArray } from "base64-js";
export interface SettingsPanelProps {
@@ -52,7 +52,8 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => {
type: "select",
name: "role",
label: "Role",
description: "Device telemetry is sent over PRIMARY. Only one PRIMARY allowed",
description:
"Device telemetry is sent over PRIMARY. Only one PRIMARY allowed",
properties: {
enumValue: Protobuf.Channel_Role,
},
@@ -70,7 +71,8 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => {
type: "text",
name: "settings.name",
label: "Name",
description: "A unique name for the channel <12 bytes, leave blank for default",
description:
"A unique name for the channel <12 bytes, leave blank for default",
},
{
type: "toggle",
@@ -1,7 +1,7 @@
import type { BluetoothValidation } from "@app/validation/config/bluetooth.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const Bluetooth = (): JSX.Element => {
const { config, setWorkingConfig } = useDevice();
@@ -1,7 +1,7 @@
import type { DeviceValidation } from "@app/validation/config/device.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const Device = (): JSX.Element => {
const { config, setWorkingConfig } = useDevice();
@@ -1,7 +1,7 @@
import type { DisplayValidation } from "@app/validation/config/display.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const Display = (): JSX.Element => {
const { config, setWorkingConfig } = useDevice();
@@ -1,7 +1,7 @@
import type { LoRaValidation } from "@app/validation/config/lora.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const LoRa = (): JSX.Element => {
const { config, setWorkingConfig } = useDevice();
@@ -1,7 +1,7 @@
import type { NetworkValidation } from "@app/validation/config/network.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const Network = (): JSX.Element => {
const { config, setWorkingConfig } = useDevice();
@@ -1,7 +1,7 @@
import type { PositionValidation } from "@app/validation/config/position.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const Position = (): JSX.Element => {
const { config, nodes, hardware, setWorkingConfig } = useDevice();
@@ -1,7 +1,7 @@
import type { PowerValidation } from "@app/validation/config/power.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const Power = (): JSX.Element => {
const { config, setWorkingConfig } = useDevice();
@@ -4,7 +4,7 @@ import { useAppStore } from "@core/stores/appStore.js";
import { useDeviceStore } from "@core/stores/deviceStore.js";
import { subscribeAll } from "@core/subscriptions.js";
import { randId } from "@core/utils/randId.js";
import { Constants, IBLEConnection } from "@meshtastic/meshtasticjs";
import { Constants, IBLEConnection } from "@meshtastic/js";
import { useCallback, useEffect, useState } from "react";
export const BLE = (): JSX.Element => {
@@ -6,7 +6,7 @@ import { useAppStore } from "@core/stores/appStore.js";
import { useDeviceStore } from "@core/stores/deviceStore.js";
import { subscribeAll } from "@core/subscriptions.js";
import { randId } from "@core/utils/randId.js";
import { IHTTPConnection } from "@meshtastic/meshtasticjs";
import { IHTTPConnection } from "@meshtastic/js";
import { Controller, useForm, useWatch } from "react-hook-form";
export const HTTP = (): JSX.Element => {
@@ -4,7 +4,7 @@ import { useAppStore } from "@core/stores/appStore.js";
import { useDeviceStore } from "@core/stores/deviceStore.js";
import { subscribeAll } from "@core/subscriptions.js";
import { randId } from "@core/utils/randId.js";
import { ISerialConnection } from "@meshtastic/meshtasticjs";
import { ISerialConnection } from "@meshtastic/js";
import { useCallback, useEffect, useState } from "react";
export const Serial = (): JSX.Element => {
@@ -2,7 +2,7 @@ import { Subtle } from "@app/components/UI/Typography/Subtle.js";
import { MessageWithState, useDevice } from "@app/core/stores/deviceStore.js";
import { Message } from "@components/PageComponents/Messages/Message.js";
import { MessageInput } from "@components/PageComponents/Messages/MessageInput.js";
import type { Types } from "@meshtastic/meshtasticjs";
import type { Types } from "@meshtastic/js";
import { InboxIcon } from "lucide-react";
export interface ChannelChatProps {
@@ -1,6 +1,6 @@
import type { MessageWithState } from "@app/core/stores/deviceStore.js";
import { Hashicon } from "@emeraldpay/hashicon-react";
import type { Protobuf } from "@meshtastic/meshtasticjs";
import type { Protobuf } from "@meshtastic/js";
import {
AlertCircleIcon,
CheckCircle2Icon,
@@ -1,7 +1,7 @@
import { Button } from "@components/UI/Button.js";
import { Input } from "@components/UI/Input.js";
import { useDevice } from "@core/stores/deviceStore.js";
import type { Types } from "@meshtastic/meshtasticjs";
import type { Types } from "@meshtastic/js";
import { SendIcon } from "lucide-react";
export interface MessageInputProps {
@@ -1,7 +1,7 @@
import { useDevice } from "@app/core/stores/deviceStore.js";
import type { AmbientLightingValidation } from "@app/validation/moduleConfig/ambientLighting.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const AmbientLighting = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
@@ -1,7 +1,7 @@
import type { AudioValidation } from "@app/validation/moduleConfig/audio.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const Audio = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
@@ -1,7 +1,7 @@
import type { CannedMessageValidation } from "@app/validation/moduleConfig/cannedMessage.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const CannedMessage = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
@@ -1,7 +1,7 @@
import { useDevice } from "@app/core/stores/deviceStore.js";
import type { DetectionSensorValidation } from "@app/validation/moduleConfig/detectionSensor.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const DetectionSensor = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
@@ -36,7 +36,8 @@ export const DetectionSensor = (): JSX.Element => {
type: "number",
name: "minimumBroadcastSecs",
label: "Minimum Broadcast Seconds",
description: "The interval in seconds of how often we can send a message to the mesh when a state change is detected",
description:
"The interval in seconds of how often we can send a message to the mesh when a state change is detected",
disabledBy: [
{
fieldName: "enabled",
@@ -47,7 +48,8 @@ export const DetectionSensor = (): JSX.Element => {
type: "number",
name: "stateBroadcastSecs",
label: "State Broadcast Seconds",
description: "The interval in seconds of how often we should send a message to the mesh with the current state regardless of changes",
description:
"The interval in seconds of how often we should send a message to the mesh with the current state regardless of changes",
disabledBy: [
{
fieldName: "enabled",
@@ -69,7 +71,8 @@ export const DetectionSensor = (): JSX.Element => {
type: "text",
name: "name",
label: "Friendly Name",
description: "Used to format the message sent to mesh, max 20 Characters",
description:
"Used to format the message sent to mesh, max 20 Characters",
disabledBy: [
{
fieldName: "enabled",
@@ -91,7 +94,8 @@ export const DetectionSensor = (): JSX.Element => {
type: "toggle",
name: "detectionTriggeredHigh",
label: "Detection Triggered High",
description: "Whether or not the GPIO pin state detection is triggered on HIGH (1), otherwise LOW (0)",
description:
"Whether or not the GPIO pin state detection is triggered on HIGH (1), otherwise LOW (0)",
disabledBy: [
{
fieldName: "enabled",
@@ -1,7 +1,7 @@
import type { ExternalNotificationValidation } from "@app/validation/moduleConfig/externalNotification.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const ExternalNotification = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
@@ -189,7 +189,7 @@ export const ExternalNotification = (): JSX.Element => {
{
fieldName: "enabled",
},
]
],
},
],
},
@@ -1,7 +1,7 @@
import { useDevice } from "@app/core/stores/deviceStore.js";
import type { MQTTValidation } from "@app/validation/moduleConfig/mqtt.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const MQTT = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
@@ -1,7 +1,7 @@
import { useDevice } from "@app/core/stores/deviceStore.js";
import type { NeighborInfoValidation } from "@app/validation/moduleConfig/neighborInfo.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const NeighborInfo = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
@@ -36,7 +36,8 @@ export const NeighborInfo = (): JSX.Element => {
type: "number",
name: "updateInterval",
label: "Update Interval",
description: "Interval in seconds of how often we should try to send our Neighbor Info to the mesh",
description:
"Interval in seconds of how often we should try to send our Neighbor Info to the mesh",
disabledBy: [
{
fieldName: "enabled",
@@ -1,7 +1,7 @@
import type { RangeTestValidation } from "@app/validation/moduleConfig/rangeTest.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const RangeTest = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
@@ -1,7 +1,7 @@
import type { SerialValidation } from "@app/validation/moduleConfig/serial.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const Serial = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
@@ -1,7 +1,7 @@
import type { StoreForwardValidation } from "@app/validation/moduleConfig/storeForward.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const StoreForward = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
@@ -1,7 +1,7 @@
import type { TelemetryValidation } from "@app/validation/moduleConfig/telemetry.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export const Telemetry = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
+1 -1
View File
@@ -3,7 +3,7 @@ import { createContext, useContext } from "react";
import { produce } from "immer";
import { create } from "zustand";
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
import { Protobuf, Types } from "@meshtastic/js";
export type Page = "messages" | "map" | "config" | "channels" | "peers";
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Device } from "@core/stores/deviceStore.js";
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
import { Protobuf, Types } from "@meshtastic/js";
export const subscribeAll = (
device: Device,
+3 -3
View File
@@ -9,7 +9,7 @@ import { Channel } from "@components/PageComponents/Channel.js";
import { PageLayout } from "@components/PageLayout.js";
import { Sidebar } from "@components/Sidebar.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
import { Protobuf, Types } from "@meshtastic/js";
import { ImportIcon, QrCodeIcon } from "lucide-react";
import { useState } from "react";
@@ -17,8 +17,8 @@ export const getChannelName = (channel: Protobuf.Channel) =>
channel.settings?.name.length
? channel.settings?.name
: channel.index === 0
? "Primary"
: `Ch ${channel.index}`;
? "Primary"
: `Ch ${channel.index}`;
export const ChannelsPage = (): JSX.Element => {
const { channels, setDialogOpen } = useDevice();
+1 -1
View File
@@ -5,7 +5,7 @@ import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.js";
import { SidebarButton } from "@components/UI/Sidebar/sidebarButton.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Hashicon } from "@emeraldpay/hashicon-react";
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
import { Protobuf, Types } from "@meshtastic/js";
import { getChannelName } from "@pages/Channels.js";
import { HashIcon } from "lucide-react";
import { useState } from "react";
+1 -1
View File
@@ -4,7 +4,7 @@ import { Table } from "@components/generic/Table/index.js";
import { TimeAgo } from "@components/generic/Table/tmp/TimeAgo.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Hashicon } from "@emeraldpay/hashicon-react";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
import { base16 } from "rfc4648";
export const PeersPage = (): JSX.Element => {
+1 -1
View File
@@ -7,7 +7,7 @@ import {
Length,
} from "class-validator";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export class ChannelValidation
implements Omit<Protobuf.Channel, keyof Protobuf.native.Message | "settings">
+1 -1
View File
@@ -1,6 +1,6 @@
import { IsBoolean, IsEnum, IsInt } from "class-validator";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export class BluetoothValidation
implements
+1 -1
View File
@@ -1,6 +1,6 @@
import { IsBoolean, IsEnum, IsInt } from "class-validator";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export class DeviceValidation
implements Omit<Protobuf.Config_DeviceConfig, keyof Protobuf.native.Message>
+1 -1
View File
@@ -1,6 +1,6 @@
import { IsBoolean, IsEnum, IsInt } from "class-validator";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export class DisplayValidation
implements Omit<Protobuf.Config_DisplayConfig, keyof Protobuf.native.Message>
+1 -1
View File
@@ -1,6 +1,6 @@
import { IsArray, IsBoolean, IsEnum, IsInt, Max, Min } from "class-validator";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export class LoRaValidation
implements Omit<Protobuf.Config_LoRaConfig, keyof Protobuf.native.Message>
+1 -1
View File
@@ -7,7 +7,7 @@ import {
Length,
} from "class-validator";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export class NetworkValidation
implements
+1 -1
View File
@@ -1,6 +1,6 @@
import { IsBoolean, IsInt, IsNumber } from "class-validator";
import type { Protobuf } from "@meshtastic/meshtasticjs";
import type { Protobuf } from "@meshtastic/js";
export class PositionValidation
implements Omit<Protobuf.Config_PositionConfig, keyof Protobuf.native.Message>
+1 -1
View File
@@ -1,6 +1,6 @@
import { IsBoolean, IsInt, Max, Min } from "class-validator";
import type { Protobuf } from "@meshtastic/meshtasticjs";
import type { Protobuf } from "@meshtastic/js";
export class PowerValidation
implements Omit<Protobuf.Config_PowerConfig, keyof Protobuf.native.Message>
@@ -1,6 +1,6 @@
import { IsBoolean, IsInt } from "class-validator";
import type { Protobuf } from "@meshtastic/meshtasticjs";
import type { Protobuf } from "@meshtastic/js";
export class AmbientLightingValidation
implements
+1 -1
View File
@@ -1,6 +1,6 @@
import { IsBoolean, IsEnum, IsInt } from "class-validator";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export class AudioValidation
implements
+1 -1
View File
@@ -1,6 +1,6 @@
import { IsBoolean, IsEnum, IsInt, Length } from "class-validator";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export class CannedMessageValidation
implements
@@ -1,6 +1,6 @@
import { IsBoolean, IsInt, Length } from "class-validator";
import type { Protobuf } from "@meshtastic/meshtasticjs";
import type { Protobuf } from "@meshtastic/js";
export class DetectionSensorValidation
implements
@@ -1,6 +1,6 @@
import { IsBoolean, IsInt } from "class-validator";
import type { Protobuf } from "@meshtastic/meshtasticjs";
import type { Protobuf } from "@meshtastic/js";
export class ExternalNotificationValidation
implements
+1 -1
View File
@@ -1,6 +1,6 @@
import { IsBoolean, IsString, Length } from "class-validator";
import type { Protobuf } from "@meshtastic/meshtasticjs";
import type { Protobuf } from "@meshtastic/js";
export class MQTTValidation
implements
+2 -2
View File
@@ -1,6 +1,6 @@
import { IsBoolean, IsInt, Length } from "class-validator";
import type { Protobuf } from "@meshtastic/meshtasticjs";
import type { Protobuf } from "@meshtastic/js";
export class NeighborInfoValidation
implements
@@ -14,4 +14,4 @@ export class NeighborInfoValidation
@IsInt()
updateInterval: number;
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
import { IsBoolean, IsInt } from "class-validator";
import type { Protobuf } from "@meshtastic/meshtasticjs";
import type { Protobuf } from "@meshtastic/js";
export class RangeTestValidation
implements
+1 -1
View File
@@ -1,6 +1,6 @@
import { IsBoolean, IsEnum, IsInt } from "class-validator";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { Protobuf } from "@meshtastic/js";
export class SerialValidation
implements
+1 -1
View File
@@ -1,6 +1,6 @@
import { IsBoolean, IsInt } from "class-validator";
import type { Protobuf } from "@meshtastic/meshtasticjs";
import type { Protobuf } from "@meshtastic/js";
export class StoreForwardValidation
implements
+1 -1
View File
@@ -1,6 +1,6 @@
import { IsBoolean, IsInt } from "class-validator";
import type { Protobuf } from "@meshtastic/meshtasticjs";
import type { Protobuf } from "@meshtastic/js";
export class TelemetryValidation
implements