-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathenum.ts
More file actions
45 lines (36 loc) · 1.2 KB
/
enum.ts
File metadata and controls
45 lines (36 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { pgEnum } from "drizzle-orm/pg-core";
import { z } from "zod";
// Enum for device exposure types
export const DeviceExposureEnum = pgEnum("exposure", [
"indoor",
"outdoor",
"mobile",
"unknown",
]);
export const MqttMessageFormatEnum = pgEnum("message_format", [
"json",
"csv",
"application/json",
"text/csv",
"debug_plain",
"",
]);
export const TtnProfileEnum = pgEnum("ttn_profile", [
"json",
"debug",
"sensebox/home",
"lora-serialization",
"cayenne-lpp",
]);
// Zod schema for validating device exposure types
export const DeviceExposureZodEnum = z.enum(DeviceExposureEnum.enumValues);
// Type inferred from the Zod schema for device exposure types
export type DeviceExposureType = z.infer<typeof DeviceExposureZodEnum>;
// Enum for device status types
export const DeviceStatusEnum = pgEnum("status", ["active", "inactive", "old"]);
// Zod schema for validating device status types
export const DeviceStatusZodEnum = z.enum(DeviceStatusEnum.enumValues);
// Type inferred from the Zod schema for device status types
export type DeviceStatusType = z.infer<typeof DeviceStatusZodEnum>;
// Enum for device model types
export const DeviceModelEnum = pgEnum("model", ["HOME_V2_LORA"]);