@deepintel-ltd/farmpro-contracts 1.7.19 → 1.7.20

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.
Files changed (63) hide show
  1. package/dist/index.d.ts +16 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +15 -0
  4. package/dist/routes/agents.routes.d.ts +6 -6
  5. package/dist/routes/cooperative.routes.d.ts +1327 -0
  6. package/dist/routes/cooperative.routes.d.ts.map +1 -0
  7. package/dist/routes/cooperative.routes.js +47 -0
  8. package/dist/routes/extension.routes.d.ts +2431 -0
  9. package/dist/routes/extension.routes.d.ts.map +1 -0
  10. package/dist/routes/extension.routes.js +75 -0
  11. package/dist/routes/farms.routes.d.ts +775 -0
  12. package/dist/routes/farms.routes.d.ts.map +1 -1
  13. package/dist/routes/farms.routes.js +15 -1
  14. package/dist/routes/field-monitoring.routes.d.ts +505 -0
  15. package/dist/routes/field-monitoring.routes.d.ts.map +1 -1
  16. package/dist/routes/field-monitoring.routes.js +23 -1
  17. package/dist/routes/fields.routes.d.ts +156 -155
  18. package/dist/routes/fields.routes.d.ts.map +1 -1
  19. package/dist/routes/index.d.ts +15 -0
  20. package/dist/routes/index.d.ts.map +1 -1
  21. package/dist/routes/index.js +10 -0
  22. package/dist/routes/live-monitor.routes.d.ts +513 -0
  23. package/dist/routes/live-monitor.routes.d.ts.map +1 -0
  24. package/dist/routes/live-monitor.routes.js +81 -0
  25. package/dist/routes/livestock-map.routes.d.ts +4 -4
  26. package/dist/routes/monitoring-visualization.routes.d.ts +4 -4
  27. package/dist/routes/notifications.routes.d.ts +1350 -0
  28. package/dist/routes/notifications.routes.d.ts.map +1 -0
  29. package/dist/routes/notifications.routes.js +66 -0
  30. package/dist/routes/team-payments.routes.d.ts +9571 -0
  31. package/dist/routes/team-payments.routes.d.ts.map +1 -0
  32. package/dist/routes/team-payments.routes.js +262 -0
  33. package/dist/schemas/agents.schemas.d.ts +1 -0
  34. package/dist/schemas/agents.schemas.d.ts.map +1 -1
  35. package/dist/schemas/cooperative.schemas.d.ts +560 -0
  36. package/dist/schemas/cooperative.schemas.d.ts.map +1 -0
  37. package/dist/schemas/cooperative.schemas.js +71 -0
  38. package/dist/schemas/extension.schemas.d.ts +1204 -0
  39. package/dist/schemas/extension.schemas.d.ts.map +1 -0
  40. package/dist/schemas/extension.schemas.js +68 -0
  41. package/dist/schemas/farms.schemas.d.ts +591 -0
  42. package/dist/schemas/farms.schemas.d.ts.map +1 -1
  43. package/dist/schemas/farms.schemas.js +44 -0
  44. package/dist/schemas/field-monitoring.schemas.d.ts +276 -0
  45. package/dist/schemas/field-monitoring.schemas.d.ts.map +1 -1
  46. package/dist/schemas/field-monitoring.schemas.js +9 -0
  47. package/dist/schemas/field-observations.schemas.d.ts +1 -0
  48. package/dist/schemas/field-observations.schemas.d.ts.map +1 -1
  49. package/dist/schemas/fields.schemas.d.ts +188 -186
  50. package/dist/schemas/fields.schemas.d.ts.map +1 -1
  51. package/dist/schemas/fields.schemas.js +10 -2
  52. package/dist/schemas/live-monitor.schemas.d.ts +596 -0
  53. package/dist/schemas/live-monitor.schemas.d.ts.map +1 -0
  54. package/dist/schemas/live-monitor.schemas.js +107 -0
  55. package/dist/schemas/livestock-map.schemas.d.ts +10 -10
  56. package/dist/schemas/monitoring-visualization.schemas.d.ts +4 -4
  57. package/dist/schemas/notifications.schemas.d.ts +464 -0
  58. package/dist/schemas/notifications.schemas.d.ts.map +1 -0
  59. package/dist/schemas/notifications.schemas.js +40 -0
  60. package/dist/schemas/team-payments.schemas.d.ts +2604 -0
  61. package/dist/schemas/team-payments.schemas.d.ts.map +1 -0
  62. package/dist/schemas/team-payments.schemas.js +151 -0
  63. package/package.json +1 -1
@@ -0,0 +1,81 @@
1
+ import { initContract } from '@ts-rest/core';
2
+ import { z } from 'zod';
3
+ import { liveMonitorSummarySchema, liveMonitorCamerasResponseSchema, liveMonitorSensorsResponseSchema, liveMonitorEventsQuerySchema, liveMonitorEventsResponseSchema, cameraStreamTokenResponseSchema, captureSnapshotQuerySchema, captureSnapshotResponseSchema, liveMonitorErrorSchema, } from '../schemas/live-monitor.schemas';
4
+ const c = initContract();
5
+ export const liveMonitorRouter = c.router({
6
+ /**
7
+ * Aggregated live monitor dashboard summary for a farm
8
+ */
9
+ getSummary: {
10
+ method: 'GET',
11
+ path: '/farms/:farmId/live-monitor/summary',
12
+ responses: {
13
+ 200: liveMonitorSummarySchema,
14
+ 404: liveMonitorErrorSchema,
15
+ },
16
+ summary: 'Get live monitor summary for a farm',
17
+ },
18
+ /**
19
+ * List all cameras across every field in the farm
20
+ */
21
+ getCameras: {
22
+ method: 'GET',
23
+ path: '/farms/:farmId/live-monitor/cameras',
24
+ responses: {
25
+ 200: liveMonitorCamerasResponseSchema,
26
+ 404: liveMonitorErrorSchema,
27
+ },
28
+ summary: 'List all farm cameras for live monitor',
29
+ },
30
+ /**
31
+ * List all sensors across every field in the farm
32
+ */
33
+ getSensors: {
34
+ method: 'GET',
35
+ path: '/farms/:farmId/live-monitor/sensors',
36
+ responses: {
37
+ 200: liveMonitorSensorsResponseSchema,
38
+ 404: liveMonitorErrorSchema,
39
+ },
40
+ summary: 'List all farm sensors for live monitor',
41
+ },
42
+ /**
43
+ * Recent live events for the alert strip (alerts, motion, snapshots)
44
+ */
45
+ getEvents: {
46
+ method: 'GET',
47
+ path: '/farms/:farmId/live-monitor/events',
48
+ query: liveMonitorEventsQuerySchema,
49
+ responses: {
50
+ 200: liveMonitorEventsResponseSchema,
51
+ 404: liveMonitorErrorSchema,
52
+ },
53
+ summary: 'Get recent live monitor events for a farm',
54
+ },
55
+ /**
56
+ * Issue a short-lived signed token for camera stream access
57
+ */
58
+ getStreamToken: {
59
+ method: 'GET',
60
+ path: '/farms/:farmId/cameras/:cameraId/stream-token',
61
+ responses: {
62
+ 200: cameraStreamTokenResponseSchema,
63
+ 404: liveMonitorErrorSchema,
64
+ },
65
+ summary: 'Get time-limited stream access token for a camera',
66
+ },
67
+ /**
68
+ * Capture a manual snapshot from a camera (data-saver uses cached frame)
69
+ */
70
+ captureSnapshot: {
71
+ method: 'POST',
72
+ path: '/farms/:farmId/cameras/:cameraId/snapshots',
73
+ query: captureSnapshotQuerySchema,
74
+ body: z.object({}),
75
+ responses: {
76
+ 201: captureSnapshotResponseSchema,
77
+ 404: liveMonitorErrorSchema,
78
+ },
79
+ summary: 'Capture a manual camera snapshot',
80
+ },
81
+ });
@@ -284,13 +284,13 @@ export declare const livestockMapRouter: {
284
284
  lng: z.ZodNumber;
285
285
  timestamp: z.ZodString;
286
286
  }, "strip", z.ZodTypeAny, {
287
- timestamp: string;
288
287
  lat: number;
289
288
  lng: number;
290
- }, {
291
289
  timestamp: string;
290
+ }, {
292
291
  lat: number;
293
292
  lng: number;
293
+ timestamp: string;
294
294
  }>, "many">;
295
295
  dateRange: z.ZodObject<{
296
296
  start: z.ZodString;
@@ -309,9 +309,9 @@ export declare const livestockMapRouter: {
309
309
  };
310
310
  livestockId: string;
311
311
  points: {
312
- timestamp: string;
313
312
  lat: number;
314
313
  lng: number;
314
+ timestamp: string;
315
315
  }[];
316
316
  }, {
317
317
  dateRange: {
@@ -320,9 +320,9 @@ export declare const livestockMapRouter: {
320
320
  };
321
321
  livestockId: string;
322
322
  points: {
323
- timestamp: string;
324
323
  lat: number;
325
324
  lng: number;
325
+ timestamp: string;
326
326
  }[];
327
327
  }>, "many">;
328
328
  403: z.ZodObject<{
@@ -1748,13 +1748,13 @@ export declare const monitoringVisualizationRouter: {
1748
1748
  }, "strip", z.ZodTypeAny, {
1749
1749
  value: number;
1750
1750
  unit: string;
1751
- quality: "poor" | "fair" | "good" | null;
1752
1751
  readAt: string;
1752
+ quality: "poor" | "fair" | "good" | null;
1753
1753
  }, {
1754
1754
  value: number;
1755
1755
  unit: string;
1756
- quality: "poor" | "fair" | "good" | null;
1757
1756
  readAt: string;
1757
+ quality: "poor" | "fair" | "good" | null;
1758
1758
  }>, "many">;
1759
1759
  statistics: z.ZodObject<{
1760
1760
  min: z.ZodNumber;
@@ -1776,8 +1776,8 @@ export declare const monitoringVisualizationRouter: {
1776
1776
  readings: {
1777
1777
  value: number;
1778
1778
  unit: string;
1779
- quality: "poor" | "fair" | "good" | null;
1780
1779
  readAt: string;
1780
+ quality: "poor" | "fair" | "good" | null;
1781
1781
  }[];
1782
1782
  statistics: {
1783
1783
  min: number;
@@ -1790,8 +1790,8 @@ export declare const monitoringVisualizationRouter: {
1790
1790
  readings: {
1791
1791
  value: number;
1792
1792
  unit: string;
1793
- quality: "poor" | "fair" | "good" | null;
1794
1793
  readAt: string;
1794
+ quality: "poor" | "fair" | "good" | null;
1795
1795
  }[];
1796
1796
  statistics: {
1797
1797
  min: number;