@deepintel-ltd/farmpro-contracts 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,8 @@ export declare const deviceErrorSchema: z.ZodObject<{
9
9
  code: string;
10
10
  message: string;
11
11
  }>;
12
+ export declare const fieldDeviceTypeSchema: z.ZodEnum<["GREENHOUSE", "OPEN_FIELD"]>;
13
+ export declare const deviceTransportSchema: z.ZodEnum<["WIFI", "LORA", "CELLULAR_DIRECT"]>;
12
14
  export declare const actuatorTypeSchema: z.ZodEnum<["IRRIGATION_VALVE", "FERT_PUMP_A", "FERT_PUMP_B", "FAN"]>;
13
15
  export declare const actuatorStatesSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
14
16
  export declare const heartbeatRequestSchema: z.ZodObject<{
@@ -539,6 +541,9 @@ export declare const createDeviceRequestSchema: z.ZodObject<{
539
541
  } | undefined;
540
542
  gpioMap?: Record<string, number> | undefined;
541
543
  }>>;
544
+ fieldType: z.ZodOptional<z.ZodEnum<["GREENHOUSE", "OPEN_FIELD"]>>;
545
+ transport: z.ZodOptional<z.ZodEnum<["WIFI", "LORA", "CELLULAR_DIRECT"]>>;
546
+ gatewayId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
542
547
  }, "strip", z.ZodTypeAny, {
543
548
  name: string;
544
549
  config?: {
@@ -557,6 +562,9 @@ export declare const createDeviceRequestSchema: z.ZodObject<{
557
562
  } | undefined;
558
563
  gpioMap?: Record<string, number> | undefined;
559
564
  } | undefined;
565
+ fieldType?: "GREENHOUSE" | "OPEN_FIELD" | undefined;
566
+ transport?: "WIFI" | "LORA" | "CELLULAR_DIRECT" | undefined;
567
+ gatewayId?: string | null | undefined;
560
568
  }, {
561
569
  name: string;
562
570
  config?: {
@@ -575,6 +583,9 @@ export declare const createDeviceRequestSchema: z.ZodObject<{
575
583
  } | undefined;
576
584
  gpioMap?: Record<string, number> | undefined;
577
585
  } | undefined;
586
+ fieldType?: "GREENHOUSE" | "OPEN_FIELD" | undefined;
587
+ transport?: "WIFI" | "LORA" | "CELLULAR_DIRECT" | undefined;
588
+ gatewayId?: string | null | undefined;
578
589
  }>;
579
590
  export declare const createDeviceResponseSchema: z.ZodObject<{
580
591
  device: z.ZodObject<{
@@ -621,6 +632,10 @@ export declare const deviceSummarySchema: z.ZodObject<{
621
632
  name: z.ZodString;
622
633
  fieldId: z.ZodString;
623
634
  farmId: z.ZodString;
635
+ fieldType: z.ZodEnum<["GREENHOUSE", "OPEN_FIELD"]>;
636
+ transport: z.ZodEnum<["WIFI", "LORA", "CELLULAR_DIRECT"]>;
637
+ gatewayId: z.ZodNullable<z.ZodString>;
638
+ gatewayName: z.ZodNullable<z.ZodString>;
624
639
  lastSeenAt: z.ZodNullable<z.ZodString>;
625
640
  bufferedReadingsCount: z.ZodNullable<z.ZodNumber>;
626
641
  bufferOverflow: z.ZodBoolean;
@@ -728,6 +743,10 @@ export declare const deviceSummarySchema: z.ZodObject<{
728
743
  } | undefined;
729
744
  gpioMap?: Record<string, number> | undefined;
730
745
  } | null;
746
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
747
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
748
+ gatewayId: string | null;
749
+ gatewayName: string | null;
731
750
  lastSeenAt: string | null;
732
751
  isOnline: boolean;
733
752
  }, {
@@ -755,6 +774,10 @@ export declare const deviceSummarySchema: z.ZodObject<{
755
774
  } | undefined;
756
775
  gpioMap?: Record<string, number> | undefined;
757
776
  } | null;
777
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
778
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
779
+ gatewayId: string | null;
780
+ gatewayName: string | null;
758
781
  lastSeenAt: string | null;
759
782
  isOnline: boolean;
760
783
  }>;
@@ -764,6 +787,10 @@ export declare const listDevicesResponseSchema: z.ZodObject<{
764
787
  name: z.ZodString;
765
788
  fieldId: z.ZodString;
766
789
  farmId: z.ZodString;
790
+ fieldType: z.ZodEnum<["GREENHOUSE", "OPEN_FIELD"]>;
791
+ transport: z.ZodEnum<["WIFI", "LORA", "CELLULAR_DIRECT"]>;
792
+ gatewayId: z.ZodNullable<z.ZodString>;
793
+ gatewayName: z.ZodNullable<z.ZodString>;
767
794
  lastSeenAt: z.ZodNullable<z.ZodString>;
768
795
  bufferedReadingsCount: z.ZodNullable<z.ZodNumber>;
769
796
  bufferOverflow: z.ZodBoolean;
@@ -871,6 +898,10 @@ export declare const listDevicesResponseSchema: z.ZodObject<{
871
898
  } | undefined;
872
899
  gpioMap?: Record<string, number> | undefined;
873
900
  } | null;
901
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
902
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
903
+ gatewayId: string | null;
904
+ gatewayName: string | null;
874
905
  lastSeenAt: string | null;
875
906
  isOnline: boolean;
876
907
  }, {
@@ -898,6 +929,10 @@ export declare const listDevicesResponseSchema: z.ZodObject<{
898
929
  } | undefined;
899
930
  gpioMap?: Record<string, number> | undefined;
900
931
  } | null;
932
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
933
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
934
+ gatewayId: string | null;
935
+ gatewayName: string | null;
901
936
  lastSeenAt: string | null;
902
937
  isOnline: boolean;
903
938
  }>, "many">;
@@ -927,6 +962,10 @@ export declare const listDevicesResponseSchema: z.ZodObject<{
927
962
  } | undefined;
928
963
  gpioMap?: Record<string, number> | undefined;
929
964
  } | null;
965
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
966
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
967
+ gatewayId: string | null;
968
+ gatewayName: string | null;
930
969
  lastSeenAt: string | null;
931
970
  isOnline: boolean;
932
971
  }[];
@@ -956,6 +995,10 @@ export declare const listDevicesResponseSchema: z.ZodObject<{
956
995
  } | undefined;
957
996
  gpioMap?: Record<string, number> | undefined;
958
997
  } | null;
998
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
999
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
1000
+ gatewayId: string | null;
1001
+ gatewayName: string | null;
959
1002
  lastSeenAt: string | null;
960
1003
  isOnline: boolean;
961
1004
  }[];
@@ -1038,6 +1081,9 @@ export declare const updateDeviceRequestSchema: z.ZodObject<{
1038
1081
  } | undefined;
1039
1082
  gpioMap?: Record<string, number> | undefined;
1040
1083
  }>>;
1084
+ fieldType: z.ZodOptional<z.ZodEnum<["GREENHOUSE", "OPEN_FIELD"]>>;
1085
+ transport: z.ZodOptional<z.ZodEnum<["WIFI", "LORA", "CELLULAR_DIRECT"]>>;
1086
+ gatewayId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1041
1087
  }, "strip", z.ZodTypeAny, {
1042
1088
  name?: string | undefined;
1043
1089
  config?: {
@@ -1056,6 +1102,9 @@ export declare const updateDeviceRequestSchema: z.ZodObject<{
1056
1102
  } | undefined;
1057
1103
  gpioMap?: Record<string, number> | undefined;
1058
1104
  } | undefined;
1105
+ fieldType?: "GREENHOUSE" | "OPEN_FIELD" | undefined;
1106
+ transport?: "WIFI" | "LORA" | "CELLULAR_DIRECT" | undefined;
1107
+ gatewayId?: string | null | undefined;
1059
1108
  }, {
1060
1109
  name?: string | undefined;
1061
1110
  config?: {
@@ -1074,6 +1123,9 @@ export declare const updateDeviceRequestSchema: z.ZodObject<{
1074
1123
  } | undefined;
1075
1124
  gpioMap?: Record<string, number> | undefined;
1076
1125
  } | undefined;
1126
+ fieldType?: "GREENHOUSE" | "OPEN_FIELD" | undefined;
1127
+ transport?: "WIFI" | "LORA" | "CELLULAR_DIRECT" | undefined;
1128
+ gatewayId?: string | null | undefined;
1077
1129
  }>;
1078
1130
  export declare const updateDeviceResponseSchema: z.ZodObject<{
1079
1131
  device: z.ZodObject<{
@@ -1081,6 +1133,10 @@ export declare const updateDeviceResponseSchema: z.ZodObject<{
1081
1133
  name: z.ZodString;
1082
1134
  fieldId: z.ZodString;
1083
1135
  farmId: z.ZodString;
1136
+ fieldType: z.ZodEnum<["GREENHOUSE", "OPEN_FIELD"]>;
1137
+ transport: z.ZodEnum<["WIFI", "LORA", "CELLULAR_DIRECT"]>;
1138
+ gatewayId: z.ZodNullable<z.ZodString>;
1139
+ gatewayName: z.ZodNullable<z.ZodString>;
1084
1140
  lastSeenAt: z.ZodNullable<z.ZodString>;
1085
1141
  bufferedReadingsCount: z.ZodNullable<z.ZodNumber>;
1086
1142
  bufferOverflow: z.ZodBoolean;
@@ -1188,6 +1244,10 @@ export declare const updateDeviceResponseSchema: z.ZodObject<{
1188
1244
  } | undefined;
1189
1245
  gpioMap?: Record<string, number> | undefined;
1190
1246
  } | null;
1247
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
1248
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
1249
+ gatewayId: string | null;
1250
+ gatewayName: string | null;
1191
1251
  lastSeenAt: string | null;
1192
1252
  isOnline: boolean;
1193
1253
  }, {
@@ -1215,6 +1275,10 @@ export declare const updateDeviceResponseSchema: z.ZodObject<{
1215
1275
  } | undefined;
1216
1276
  gpioMap?: Record<string, number> | undefined;
1217
1277
  } | null;
1278
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
1279
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
1280
+ gatewayId: string | null;
1281
+ gatewayName: string | null;
1218
1282
  lastSeenAt: string | null;
1219
1283
  isOnline: boolean;
1220
1284
  }>;
@@ -1244,6 +1308,10 @@ export declare const updateDeviceResponseSchema: z.ZodObject<{
1244
1308
  } | undefined;
1245
1309
  gpioMap?: Record<string, number> | undefined;
1246
1310
  } | null;
1311
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
1312
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
1313
+ gatewayId: string | null;
1314
+ gatewayName: string | null;
1247
1315
  lastSeenAt: string | null;
1248
1316
  isOnline: boolean;
1249
1317
  };
@@ -1273,6 +1341,10 @@ export declare const updateDeviceResponseSchema: z.ZodObject<{
1273
1341
  } | undefined;
1274
1342
  gpioMap?: Record<string, number> | undefined;
1275
1343
  } | null;
1344
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
1345
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
1346
+ gatewayId: string | null;
1347
+ gatewayName: string | null;
1276
1348
  lastSeenAt: string | null;
1277
1349
  isOnline: boolean;
1278
1350
  };
@@ -1404,4 +1476,293 @@ export declare const actuatorCommandResponseSchema: z.ZodObject<{
1404
1476
  status: string;
1405
1477
  commandId: string;
1406
1478
  }>;
1479
+ export declare const fieldSummarySensorSchema: z.ZodObject<{
1480
+ id: z.ZodString;
1481
+ name: z.ZodString;
1482
+ type: z.ZodString;
1483
+ lastValue: z.ZodNullable<z.ZodNumber>;
1484
+ unit: z.ZodNullable<z.ZodString>;
1485
+ }, "strip", z.ZodTypeAny, {
1486
+ type: string;
1487
+ id: string;
1488
+ name: string;
1489
+ unit: string | null;
1490
+ lastValue: number | null;
1491
+ }, {
1492
+ type: string;
1493
+ id: string;
1494
+ name: string;
1495
+ unit: string | null;
1496
+ lastValue: number | null;
1497
+ }>;
1498
+ export declare const fieldSummaryResponseSchema: z.ZodObject<{
1499
+ fieldId: z.ZodString;
1500
+ fieldType: z.ZodNullable<z.ZodEnum<["GREENHOUSE", "OPEN_FIELD"]>>;
1501
+ devices: z.ZodArray<z.ZodObject<{
1502
+ id: z.ZodString;
1503
+ name: z.ZodString;
1504
+ fieldId: z.ZodString;
1505
+ farmId: z.ZodString;
1506
+ fieldType: z.ZodEnum<["GREENHOUSE", "OPEN_FIELD"]>;
1507
+ transport: z.ZodEnum<["WIFI", "LORA", "CELLULAR_DIRECT"]>;
1508
+ gatewayId: z.ZodNullable<z.ZodString>;
1509
+ gatewayName: z.ZodNullable<z.ZodString>;
1510
+ lastSeenAt: z.ZodNullable<z.ZodString>;
1511
+ bufferedReadingsCount: z.ZodNullable<z.ZodNumber>;
1512
+ bufferOverflow: z.ZodBoolean;
1513
+ firmwareVersion: z.ZodNullable<z.ZodString>;
1514
+ isOnline: z.ZodBoolean;
1515
+ config: z.ZodNullable<z.ZodObject<{
1516
+ heartbeatIntervalSec: z.ZodOptional<z.ZodNumber>;
1517
+ commandPollIntervalSec: z.ZodOptional<z.ZodNumber>;
1518
+ sensorIntervals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1519
+ pumpCalibration: z.ZodOptional<z.ZodObject<{
1520
+ fert_pump_a: z.ZodOptional<z.ZodObject<{
1521
+ mlPerSecond: z.ZodNumber;
1522
+ calibratedAt: z.ZodOptional<z.ZodString>;
1523
+ }, "strip", z.ZodTypeAny, {
1524
+ mlPerSecond: number;
1525
+ calibratedAt?: string | undefined;
1526
+ }, {
1527
+ mlPerSecond: number;
1528
+ calibratedAt?: string | undefined;
1529
+ }>>;
1530
+ fert_pump_b: z.ZodOptional<z.ZodObject<{
1531
+ mlPerSecond: z.ZodNumber;
1532
+ calibratedAt: z.ZodOptional<z.ZodString>;
1533
+ }, "strip", z.ZodTypeAny, {
1534
+ mlPerSecond: number;
1535
+ calibratedAt?: string | undefined;
1536
+ }, {
1537
+ mlPerSecond: number;
1538
+ calibratedAt?: string | undefined;
1539
+ }>>;
1540
+ }, "strip", z.ZodTypeAny, {
1541
+ fert_pump_a?: {
1542
+ mlPerSecond: number;
1543
+ calibratedAt?: string | undefined;
1544
+ } | undefined;
1545
+ fert_pump_b?: {
1546
+ mlPerSecond: number;
1547
+ calibratedAt?: string | undefined;
1548
+ } | undefined;
1549
+ }, {
1550
+ fert_pump_a?: {
1551
+ mlPerSecond: number;
1552
+ calibratedAt?: string | undefined;
1553
+ } | undefined;
1554
+ fert_pump_b?: {
1555
+ mlPerSecond: number;
1556
+ calibratedAt?: string | undefined;
1557
+ } | undefined;
1558
+ }>>;
1559
+ gpioMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1560
+ }, "strip", z.ZodTypeAny, {
1561
+ heartbeatIntervalSec?: number | undefined;
1562
+ commandPollIntervalSec?: number | undefined;
1563
+ sensorIntervals?: Record<string, number> | undefined;
1564
+ pumpCalibration?: {
1565
+ fert_pump_a?: {
1566
+ mlPerSecond: number;
1567
+ calibratedAt?: string | undefined;
1568
+ } | undefined;
1569
+ fert_pump_b?: {
1570
+ mlPerSecond: number;
1571
+ calibratedAt?: string | undefined;
1572
+ } | undefined;
1573
+ } | undefined;
1574
+ gpioMap?: Record<string, number> | undefined;
1575
+ }, {
1576
+ heartbeatIntervalSec?: number | undefined;
1577
+ commandPollIntervalSec?: number | undefined;
1578
+ sensorIntervals?: Record<string, number> | undefined;
1579
+ pumpCalibration?: {
1580
+ fert_pump_a?: {
1581
+ mlPerSecond: number;
1582
+ calibratedAt?: string | undefined;
1583
+ } | undefined;
1584
+ fert_pump_b?: {
1585
+ mlPerSecond: number;
1586
+ calibratedAt?: string | undefined;
1587
+ } | undefined;
1588
+ } | undefined;
1589
+ gpioMap?: Record<string, number> | undefined;
1590
+ }>>;
1591
+ createdAt: z.ZodString;
1592
+ }, "strip", z.ZodTypeAny, {
1593
+ id: string;
1594
+ createdAt: string;
1595
+ name: string;
1596
+ farmId: string;
1597
+ fieldId: string;
1598
+ firmwareVersion: string | null;
1599
+ bufferedReadingsCount: number | null;
1600
+ bufferOverflow: boolean;
1601
+ config: {
1602
+ heartbeatIntervalSec?: number | undefined;
1603
+ commandPollIntervalSec?: number | undefined;
1604
+ sensorIntervals?: Record<string, number> | undefined;
1605
+ pumpCalibration?: {
1606
+ fert_pump_a?: {
1607
+ mlPerSecond: number;
1608
+ calibratedAt?: string | undefined;
1609
+ } | undefined;
1610
+ fert_pump_b?: {
1611
+ mlPerSecond: number;
1612
+ calibratedAt?: string | undefined;
1613
+ } | undefined;
1614
+ } | undefined;
1615
+ gpioMap?: Record<string, number> | undefined;
1616
+ } | null;
1617
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
1618
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
1619
+ gatewayId: string | null;
1620
+ gatewayName: string | null;
1621
+ lastSeenAt: string | null;
1622
+ isOnline: boolean;
1623
+ }, {
1624
+ id: string;
1625
+ createdAt: string;
1626
+ name: string;
1627
+ farmId: string;
1628
+ fieldId: string;
1629
+ firmwareVersion: string | null;
1630
+ bufferedReadingsCount: number | null;
1631
+ bufferOverflow: boolean;
1632
+ config: {
1633
+ heartbeatIntervalSec?: number | undefined;
1634
+ commandPollIntervalSec?: number | undefined;
1635
+ sensorIntervals?: Record<string, number> | undefined;
1636
+ pumpCalibration?: {
1637
+ fert_pump_a?: {
1638
+ mlPerSecond: number;
1639
+ calibratedAt?: string | undefined;
1640
+ } | undefined;
1641
+ fert_pump_b?: {
1642
+ mlPerSecond: number;
1643
+ calibratedAt?: string | undefined;
1644
+ } | undefined;
1645
+ } | undefined;
1646
+ gpioMap?: Record<string, number> | undefined;
1647
+ } | null;
1648
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
1649
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
1650
+ gatewayId: string | null;
1651
+ gatewayName: string | null;
1652
+ lastSeenAt: string | null;
1653
+ isOnline: boolean;
1654
+ }>, "many">;
1655
+ actuatorCount: z.ZodNumber;
1656
+ openAlertCount: z.ZodNumber;
1657
+ hasCameras: z.ZodBoolean;
1658
+ sensors: z.ZodArray<z.ZodObject<{
1659
+ id: z.ZodString;
1660
+ name: z.ZodString;
1661
+ type: z.ZodString;
1662
+ lastValue: z.ZodNullable<z.ZodNumber>;
1663
+ unit: z.ZodNullable<z.ZodString>;
1664
+ }, "strip", z.ZodTypeAny, {
1665
+ type: string;
1666
+ id: string;
1667
+ name: string;
1668
+ unit: string | null;
1669
+ lastValue: number | null;
1670
+ }, {
1671
+ type: string;
1672
+ id: string;
1673
+ name: string;
1674
+ unit: string | null;
1675
+ lastValue: number | null;
1676
+ }>, "many">;
1677
+ }, "strip", z.ZodTypeAny, {
1678
+ fieldId: string;
1679
+ sensors: {
1680
+ type: string;
1681
+ id: string;
1682
+ name: string;
1683
+ unit: string | null;
1684
+ lastValue: number | null;
1685
+ }[];
1686
+ fieldType: "GREENHOUSE" | "OPEN_FIELD" | null;
1687
+ devices: {
1688
+ id: string;
1689
+ createdAt: string;
1690
+ name: string;
1691
+ farmId: string;
1692
+ fieldId: string;
1693
+ firmwareVersion: string | null;
1694
+ bufferedReadingsCount: number | null;
1695
+ bufferOverflow: boolean;
1696
+ config: {
1697
+ heartbeatIntervalSec?: number | undefined;
1698
+ commandPollIntervalSec?: number | undefined;
1699
+ sensorIntervals?: Record<string, number> | undefined;
1700
+ pumpCalibration?: {
1701
+ fert_pump_a?: {
1702
+ mlPerSecond: number;
1703
+ calibratedAt?: string | undefined;
1704
+ } | undefined;
1705
+ fert_pump_b?: {
1706
+ mlPerSecond: number;
1707
+ calibratedAt?: string | undefined;
1708
+ } | undefined;
1709
+ } | undefined;
1710
+ gpioMap?: Record<string, number> | undefined;
1711
+ } | null;
1712
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
1713
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
1714
+ gatewayId: string | null;
1715
+ gatewayName: string | null;
1716
+ lastSeenAt: string | null;
1717
+ isOnline: boolean;
1718
+ }[];
1719
+ actuatorCount: number;
1720
+ openAlertCount: number;
1721
+ hasCameras: boolean;
1722
+ }, {
1723
+ fieldId: string;
1724
+ sensors: {
1725
+ type: string;
1726
+ id: string;
1727
+ name: string;
1728
+ unit: string | null;
1729
+ lastValue: number | null;
1730
+ }[];
1731
+ fieldType: "GREENHOUSE" | "OPEN_FIELD" | null;
1732
+ devices: {
1733
+ id: string;
1734
+ createdAt: string;
1735
+ name: string;
1736
+ farmId: string;
1737
+ fieldId: string;
1738
+ firmwareVersion: string | null;
1739
+ bufferedReadingsCount: number | null;
1740
+ bufferOverflow: boolean;
1741
+ config: {
1742
+ heartbeatIntervalSec?: number | undefined;
1743
+ commandPollIntervalSec?: number | undefined;
1744
+ sensorIntervals?: Record<string, number> | undefined;
1745
+ pumpCalibration?: {
1746
+ fert_pump_a?: {
1747
+ mlPerSecond: number;
1748
+ calibratedAt?: string | undefined;
1749
+ } | undefined;
1750
+ fert_pump_b?: {
1751
+ mlPerSecond: number;
1752
+ calibratedAt?: string | undefined;
1753
+ } | undefined;
1754
+ } | undefined;
1755
+ gpioMap?: Record<string, number> | undefined;
1756
+ } | null;
1757
+ fieldType: "GREENHOUSE" | "OPEN_FIELD";
1758
+ transport: "WIFI" | "LORA" | "CELLULAR_DIRECT";
1759
+ gatewayId: string | null;
1760
+ gatewayName: string | null;
1761
+ lastSeenAt: string | null;
1762
+ isOnline: boolean;
1763
+ }[];
1764
+ actuatorCount: number;
1765
+ openAlertCount: number;
1766
+ hasCameras: boolean;
1767
+ }>;
1407
1768
  //# sourceMappingURL=device-gateway.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"device-gateway.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/device-gateway.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAC;AAEH,eAAO,MAAM,kBAAkB,sEAK7B,CAAC;AAEH,eAAO,MAAM,oBAAoB,sDAA8C,CAAC;AAEhF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;EASjC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW7B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGlC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;;;;;;;;;;;;;;;;;EAErC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;EAItC,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUzB,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;EAKvC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;EAGxC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;EAMnC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQrC,CAAC"}
@@ -3,6 +3,8 @@ export const deviceErrorSchema = z.object({
3
3
  message: z.string(),
4
4
  code: z.string(),
5
5
  });
6
+ export const fieldDeviceTypeSchema = z.enum(['GREENHOUSE', 'OPEN_FIELD']);
7
+ export const deviceTransportSchema = z.enum(['WIFI', 'LORA', 'CELLULAR_DIRECT']);
6
8
  export const actuatorTypeSchema = z.enum([
7
9
  'IRRIGATION_VALVE',
8
10
  'FERT_PUMP_A',
@@ -100,6 +102,9 @@ export const snapshotUploadResponseSchema = z.object({
100
102
  export const createDeviceRequestSchema = z.object({
101
103
  name: z.string().min(1).max(200),
102
104
  config: deviceConfigSchema.optional(),
105
+ fieldType: fieldDeviceTypeSchema.optional(),
106
+ transport: deviceTransportSchema.optional(),
107
+ gatewayId: z.string().uuid().nullable().optional(),
103
108
  });
104
109
  export const createDeviceResponseSchema = z.object({
105
110
  device: z.object({
@@ -116,6 +121,10 @@ export const deviceSummarySchema = z.object({
116
121
  name: z.string(),
117
122
  fieldId: z.string().uuid(),
118
123
  farmId: z.string().uuid(),
124
+ fieldType: fieldDeviceTypeSchema,
125
+ transport: deviceTransportSchema,
126
+ gatewayId: z.string().uuid().nullable(),
127
+ gatewayName: z.string().nullable(),
119
128
  lastSeenAt: z.string().datetime().nullable(),
120
129
  bufferedReadingsCount: z.number().int().nullable(),
121
130
  bufferOverflow: z.boolean(),
@@ -130,6 +139,9 @@ export const listDevicesResponseSchema = z.object({
130
139
  export const updateDeviceRequestSchema = z.object({
131
140
  name: z.string().min(1).max(200).optional(),
132
141
  config: deviceConfigSchema.optional(),
142
+ fieldType: fieldDeviceTypeSchema.optional(),
143
+ transport: deviceTransportSchema.optional(),
144
+ gatewayId: z.string().uuid().nullable().optional(),
133
145
  });
134
146
  export const updateDeviceResponseSchema = z.object({
135
147
  device: deviceSummarySchema,
@@ -163,3 +175,19 @@ export const actuatorCommandResponseSchema = z.object({
163
175
  commandId: z.string().uuid(),
164
176
  status: z.string(),
165
177
  });
178
+ export const fieldSummarySensorSchema = z.object({
179
+ id: z.string().uuid(),
180
+ name: z.string(),
181
+ type: z.string(),
182
+ lastValue: z.number().nullable(),
183
+ unit: z.string().nullable(),
184
+ });
185
+ export const fieldSummaryResponseSchema = z.object({
186
+ fieldId: z.string().uuid(),
187
+ fieldType: fieldDeviceTypeSchema.nullable(),
188
+ devices: z.array(deviceSummarySchema),
189
+ actuatorCount: z.number().int().nonnegative(),
190
+ openAlertCount: z.number().int().nonnegative(),
191
+ hasCameras: z.boolean(),
192
+ sensors: z.array(fieldSummarySensorSchema),
193
+ });