@deepintel-ltd/farmpro-contracts 1.7.20 → 1.8.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.
Files changed (37) hide show
  1. package/dist/index.d.ts +6 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +5 -0
  4. package/dist/routes/commodity-deals.routes.d.ts +2702 -0
  5. package/dist/routes/commodity-deals.routes.d.ts.map +1 -0
  6. package/dist/routes/commodity-deals.routes.js +83 -0
  7. package/dist/routes/device-gateway-admin.routes.d.ts +1135 -0
  8. package/dist/routes/device-gateway-admin.routes.d.ts.map +1 -0
  9. package/dist/routes/device-gateway-admin.routes.js +105 -0
  10. package/dist/routes/device-gateway.routes.d.ts +457 -0
  11. package/dist/routes/device-gateway.routes.d.ts.map +1 -0
  12. package/dist/routes/device-gateway.routes.js +63 -0
  13. package/dist/routes/index.d.ts +9 -0
  14. package/dist/routes/index.d.ts.map +1 -1
  15. package/dist/routes/index.js +6 -0
  16. package/dist/routes/invoices.routes.d.ts +49 -0
  17. package/dist/routes/invoices.routes.d.ts.map +1 -1
  18. package/dist/routes/organizations.routes.d.ts +49 -0
  19. package/dist/routes/organizations.routes.d.ts.map +1 -1
  20. package/dist/routes/waybills.routes.d.ts +42 -0
  21. package/dist/routes/waybills.routes.d.ts.map +1 -1
  22. package/dist/schemas/commodity-deals.schemas.d.ts +1109 -0
  23. package/dist/schemas/commodity-deals.schemas.d.ts.map +1 -0
  24. package/dist/schemas/commodity-deals.schemas.js +82 -0
  25. package/dist/schemas/device-gateway.schemas.d.ts +1407 -0
  26. package/dist/schemas/device-gateway.schemas.d.ts.map +1 -0
  27. package/dist/schemas/device-gateway.schemas.js +165 -0
  28. package/dist/schemas/invoices.schemas.d.ts +38 -0
  29. package/dist/schemas/invoices.schemas.d.ts.map +1 -1
  30. package/dist/schemas/invoices.schemas.js +2 -0
  31. package/dist/schemas/organizations.schemas.d.ts +38 -0
  32. package/dist/schemas/organizations.schemas.d.ts.map +1 -1
  33. package/dist/schemas/organizations.schemas.js +2 -0
  34. package/dist/schemas/waybills.schemas.d.ts +48 -0
  35. package/dist/schemas/waybills.schemas.d.ts.map +1 -1
  36. package/dist/schemas/waybills.schemas.js +3 -0
  37. package/package.json +1 -1
@@ -0,0 +1,1135 @@
1
+ import { z } from 'zod';
2
+ export declare const deviceGatewayAdminRouter: {
3
+ createDevice: {
4
+ pathParams: z.ZodObject<{
5
+ farmId: z.ZodString;
6
+ fieldId: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ farmId: string;
9
+ fieldId: string;
10
+ }, {
11
+ farmId: string;
12
+ fieldId: string;
13
+ }>;
14
+ summary: "Register a greenhouse edge device and generate API key";
15
+ method: "POST";
16
+ body: z.ZodObject<{
17
+ name: z.ZodString;
18
+ config: z.ZodOptional<z.ZodObject<{
19
+ heartbeatIntervalSec: z.ZodOptional<z.ZodNumber>;
20
+ commandPollIntervalSec: z.ZodOptional<z.ZodNumber>;
21
+ sensorIntervals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
22
+ pumpCalibration: z.ZodOptional<z.ZodObject<{
23
+ fert_pump_a: z.ZodOptional<z.ZodObject<{
24
+ mlPerSecond: z.ZodNumber;
25
+ calibratedAt: z.ZodOptional<z.ZodString>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ mlPerSecond: number;
28
+ calibratedAt?: string | undefined;
29
+ }, {
30
+ mlPerSecond: number;
31
+ calibratedAt?: string | undefined;
32
+ }>>;
33
+ fert_pump_b: z.ZodOptional<z.ZodObject<{
34
+ mlPerSecond: z.ZodNumber;
35
+ calibratedAt: z.ZodOptional<z.ZodString>;
36
+ }, "strip", z.ZodTypeAny, {
37
+ mlPerSecond: number;
38
+ calibratedAt?: string | undefined;
39
+ }, {
40
+ mlPerSecond: number;
41
+ calibratedAt?: string | undefined;
42
+ }>>;
43
+ }, "strip", z.ZodTypeAny, {
44
+ fert_pump_a?: {
45
+ mlPerSecond: number;
46
+ calibratedAt?: string | undefined;
47
+ } | undefined;
48
+ fert_pump_b?: {
49
+ mlPerSecond: number;
50
+ calibratedAt?: string | undefined;
51
+ } | undefined;
52
+ }, {
53
+ fert_pump_a?: {
54
+ mlPerSecond: number;
55
+ calibratedAt?: string | undefined;
56
+ } | undefined;
57
+ fert_pump_b?: {
58
+ mlPerSecond: number;
59
+ calibratedAt?: string | undefined;
60
+ } | undefined;
61
+ }>>;
62
+ gpioMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ heartbeatIntervalSec?: number | undefined;
65
+ commandPollIntervalSec?: number | undefined;
66
+ sensorIntervals?: Record<string, number> | undefined;
67
+ pumpCalibration?: {
68
+ fert_pump_a?: {
69
+ mlPerSecond: number;
70
+ calibratedAt?: string | undefined;
71
+ } | undefined;
72
+ fert_pump_b?: {
73
+ mlPerSecond: number;
74
+ calibratedAt?: string | undefined;
75
+ } | undefined;
76
+ } | undefined;
77
+ gpioMap?: Record<string, number> | undefined;
78
+ }, {
79
+ heartbeatIntervalSec?: number | undefined;
80
+ commandPollIntervalSec?: number | undefined;
81
+ sensorIntervals?: Record<string, number> | undefined;
82
+ pumpCalibration?: {
83
+ fert_pump_a?: {
84
+ mlPerSecond: number;
85
+ calibratedAt?: string | undefined;
86
+ } | undefined;
87
+ fert_pump_b?: {
88
+ mlPerSecond: number;
89
+ calibratedAt?: string | undefined;
90
+ } | undefined;
91
+ } | undefined;
92
+ gpioMap?: Record<string, number> | undefined;
93
+ }>>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ name: string;
96
+ config?: {
97
+ heartbeatIntervalSec?: number | undefined;
98
+ commandPollIntervalSec?: number | undefined;
99
+ sensorIntervals?: Record<string, number> | undefined;
100
+ pumpCalibration?: {
101
+ fert_pump_a?: {
102
+ mlPerSecond: number;
103
+ calibratedAt?: string | undefined;
104
+ } | undefined;
105
+ fert_pump_b?: {
106
+ mlPerSecond: number;
107
+ calibratedAt?: string | undefined;
108
+ } | undefined;
109
+ } | undefined;
110
+ gpioMap?: Record<string, number> | undefined;
111
+ } | undefined;
112
+ }, {
113
+ name: string;
114
+ config?: {
115
+ heartbeatIntervalSec?: number | undefined;
116
+ commandPollIntervalSec?: number | undefined;
117
+ sensorIntervals?: Record<string, number> | undefined;
118
+ pumpCalibration?: {
119
+ fert_pump_a?: {
120
+ mlPerSecond: number;
121
+ calibratedAt?: string | undefined;
122
+ } | undefined;
123
+ fert_pump_b?: {
124
+ mlPerSecond: number;
125
+ calibratedAt?: string | undefined;
126
+ } | undefined;
127
+ } | undefined;
128
+ gpioMap?: Record<string, number> | undefined;
129
+ } | undefined;
130
+ }>;
131
+ path: "/farms/:farmId/fields/:fieldId/devices";
132
+ responses: {
133
+ 201: z.ZodObject<{
134
+ device: z.ZodObject<{
135
+ id: z.ZodString;
136
+ name: z.ZodString;
137
+ fieldId: z.ZodString;
138
+ farmId: z.ZodString;
139
+ createdAt: z.ZodString;
140
+ }, "strip", z.ZodTypeAny, {
141
+ id: string;
142
+ createdAt: string;
143
+ name: string;
144
+ farmId: string;
145
+ fieldId: string;
146
+ }, {
147
+ id: string;
148
+ createdAt: string;
149
+ name: string;
150
+ farmId: string;
151
+ fieldId: string;
152
+ }>;
153
+ apiKey: z.ZodString;
154
+ }, "strip", z.ZodTypeAny, {
155
+ device: {
156
+ id: string;
157
+ createdAt: string;
158
+ name: string;
159
+ farmId: string;
160
+ fieldId: string;
161
+ };
162
+ apiKey: string;
163
+ }, {
164
+ device: {
165
+ id: string;
166
+ createdAt: string;
167
+ name: string;
168
+ farmId: string;
169
+ fieldId: string;
170
+ };
171
+ apiKey: string;
172
+ }>;
173
+ 401: z.ZodObject<{
174
+ message: z.ZodString;
175
+ code: z.ZodString;
176
+ }, "strip", z.ZodTypeAny, {
177
+ code: string;
178
+ message: string;
179
+ }, {
180
+ code: string;
181
+ message: string;
182
+ }>;
183
+ 403: z.ZodObject<{
184
+ message: z.ZodString;
185
+ code: z.ZodString;
186
+ }, "strip", z.ZodTypeAny, {
187
+ code: string;
188
+ message: string;
189
+ }, {
190
+ code: string;
191
+ message: string;
192
+ }>;
193
+ 404: z.ZodObject<{
194
+ message: z.ZodString;
195
+ code: z.ZodString;
196
+ }, "strip", z.ZodTypeAny, {
197
+ code: string;
198
+ message: string;
199
+ }, {
200
+ code: string;
201
+ message: string;
202
+ }>;
203
+ };
204
+ };
205
+ listDevices: {
206
+ pathParams: z.ZodObject<{
207
+ farmId: z.ZodString;
208
+ fieldId: z.ZodString;
209
+ }, "strip", z.ZodTypeAny, {
210
+ farmId: string;
211
+ fieldId: string;
212
+ }, {
213
+ farmId: string;
214
+ fieldId: string;
215
+ }>;
216
+ summary: "List greenhouse devices for a field";
217
+ method: "GET";
218
+ path: "/farms/:farmId/fields/:fieldId/devices";
219
+ responses: {
220
+ 200: z.ZodObject<{
221
+ devices: z.ZodArray<z.ZodObject<{
222
+ id: z.ZodString;
223
+ name: z.ZodString;
224
+ fieldId: z.ZodString;
225
+ farmId: z.ZodString;
226
+ lastSeenAt: z.ZodNullable<z.ZodString>;
227
+ bufferedReadingsCount: z.ZodNullable<z.ZodNumber>;
228
+ bufferOverflow: z.ZodBoolean;
229
+ firmwareVersion: z.ZodNullable<z.ZodString>;
230
+ isOnline: z.ZodBoolean;
231
+ config: z.ZodNullable<z.ZodObject<{
232
+ heartbeatIntervalSec: z.ZodOptional<z.ZodNumber>;
233
+ commandPollIntervalSec: z.ZodOptional<z.ZodNumber>;
234
+ sensorIntervals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
235
+ pumpCalibration: z.ZodOptional<z.ZodObject<{
236
+ fert_pump_a: z.ZodOptional<z.ZodObject<{
237
+ mlPerSecond: z.ZodNumber;
238
+ calibratedAt: z.ZodOptional<z.ZodString>;
239
+ }, "strip", z.ZodTypeAny, {
240
+ mlPerSecond: number;
241
+ calibratedAt?: string | undefined;
242
+ }, {
243
+ mlPerSecond: number;
244
+ calibratedAt?: string | undefined;
245
+ }>>;
246
+ fert_pump_b: z.ZodOptional<z.ZodObject<{
247
+ mlPerSecond: z.ZodNumber;
248
+ calibratedAt: z.ZodOptional<z.ZodString>;
249
+ }, "strip", z.ZodTypeAny, {
250
+ mlPerSecond: number;
251
+ calibratedAt?: string | undefined;
252
+ }, {
253
+ mlPerSecond: number;
254
+ calibratedAt?: string | undefined;
255
+ }>>;
256
+ }, "strip", z.ZodTypeAny, {
257
+ fert_pump_a?: {
258
+ mlPerSecond: number;
259
+ calibratedAt?: string | undefined;
260
+ } | undefined;
261
+ fert_pump_b?: {
262
+ mlPerSecond: number;
263
+ calibratedAt?: string | undefined;
264
+ } | undefined;
265
+ }, {
266
+ fert_pump_a?: {
267
+ mlPerSecond: number;
268
+ calibratedAt?: string | undefined;
269
+ } | undefined;
270
+ fert_pump_b?: {
271
+ mlPerSecond: number;
272
+ calibratedAt?: string | undefined;
273
+ } | undefined;
274
+ }>>;
275
+ gpioMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
276
+ }, "strip", z.ZodTypeAny, {
277
+ heartbeatIntervalSec?: number | undefined;
278
+ commandPollIntervalSec?: number | undefined;
279
+ sensorIntervals?: Record<string, number> | undefined;
280
+ pumpCalibration?: {
281
+ fert_pump_a?: {
282
+ mlPerSecond: number;
283
+ calibratedAt?: string | undefined;
284
+ } | undefined;
285
+ fert_pump_b?: {
286
+ mlPerSecond: number;
287
+ calibratedAt?: string | undefined;
288
+ } | undefined;
289
+ } | undefined;
290
+ gpioMap?: Record<string, number> | undefined;
291
+ }, {
292
+ heartbeatIntervalSec?: number | undefined;
293
+ commandPollIntervalSec?: number | undefined;
294
+ sensorIntervals?: Record<string, number> | undefined;
295
+ pumpCalibration?: {
296
+ fert_pump_a?: {
297
+ mlPerSecond: number;
298
+ calibratedAt?: string | undefined;
299
+ } | undefined;
300
+ fert_pump_b?: {
301
+ mlPerSecond: number;
302
+ calibratedAt?: string | undefined;
303
+ } | undefined;
304
+ } | undefined;
305
+ gpioMap?: Record<string, number> | undefined;
306
+ }>>;
307
+ createdAt: z.ZodString;
308
+ }, "strip", z.ZodTypeAny, {
309
+ id: string;
310
+ createdAt: string;
311
+ name: string;
312
+ farmId: string;
313
+ fieldId: string;
314
+ firmwareVersion: string | null;
315
+ bufferedReadingsCount: number | null;
316
+ bufferOverflow: boolean;
317
+ config: {
318
+ heartbeatIntervalSec?: number | undefined;
319
+ commandPollIntervalSec?: number | undefined;
320
+ sensorIntervals?: Record<string, number> | undefined;
321
+ pumpCalibration?: {
322
+ fert_pump_a?: {
323
+ mlPerSecond: number;
324
+ calibratedAt?: string | undefined;
325
+ } | undefined;
326
+ fert_pump_b?: {
327
+ mlPerSecond: number;
328
+ calibratedAt?: string | undefined;
329
+ } | undefined;
330
+ } | undefined;
331
+ gpioMap?: Record<string, number> | undefined;
332
+ } | null;
333
+ lastSeenAt: string | null;
334
+ isOnline: boolean;
335
+ }, {
336
+ id: string;
337
+ createdAt: string;
338
+ name: string;
339
+ farmId: string;
340
+ fieldId: string;
341
+ firmwareVersion: string | null;
342
+ bufferedReadingsCount: number | null;
343
+ bufferOverflow: boolean;
344
+ config: {
345
+ heartbeatIntervalSec?: number | undefined;
346
+ commandPollIntervalSec?: number | undefined;
347
+ sensorIntervals?: Record<string, number> | undefined;
348
+ pumpCalibration?: {
349
+ fert_pump_a?: {
350
+ mlPerSecond: number;
351
+ calibratedAt?: string | undefined;
352
+ } | undefined;
353
+ fert_pump_b?: {
354
+ mlPerSecond: number;
355
+ calibratedAt?: string | undefined;
356
+ } | undefined;
357
+ } | undefined;
358
+ gpioMap?: Record<string, number> | undefined;
359
+ } | null;
360
+ lastSeenAt: string | null;
361
+ isOnline: boolean;
362
+ }>, "many">;
363
+ }, "strip", z.ZodTypeAny, {
364
+ devices: {
365
+ id: string;
366
+ createdAt: string;
367
+ name: string;
368
+ farmId: string;
369
+ fieldId: string;
370
+ firmwareVersion: string | null;
371
+ bufferedReadingsCount: number | null;
372
+ bufferOverflow: boolean;
373
+ config: {
374
+ heartbeatIntervalSec?: number | undefined;
375
+ commandPollIntervalSec?: number | undefined;
376
+ sensorIntervals?: Record<string, number> | undefined;
377
+ pumpCalibration?: {
378
+ fert_pump_a?: {
379
+ mlPerSecond: number;
380
+ calibratedAt?: string | undefined;
381
+ } | undefined;
382
+ fert_pump_b?: {
383
+ mlPerSecond: number;
384
+ calibratedAt?: string | undefined;
385
+ } | undefined;
386
+ } | undefined;
387
+ gpioMap?: Record<string, number> | undefined;
388
+ } | null;
389
+ lastSeenAt: string | null;
390
+ isOnline: boolean;
391
+ }[];
392
+ }, {
393
+ devices: {
394
+ id: string;
395
+ createdAt: string;
396
+ name: string;
397
+ farmId: string;
398
+ fieldId: string;
399
+ firmwareVersion: string | null;
400
+ bufferedReadingsCount: number | null;
401
+ bufferOverflow: boolean;
402
+ config: {
403
+ heartbeatIntervalSec?: number | undefined;
404
+ commandPollIntervalSec?: number | undefined;
405
+ sensorIntervals?: Record<string, number> | undefined;
406
+ pumpCalibration?: {
407
+ fert_pump_a?: {
408
+ mlPerSecond: number;
409
+ calibratedAt?: string | undefined;
410
+ } | undefined;
411
+ fert_pump_b?: {
412
+ mlPerSecond: number;
413
+ calibratedAt?: string | undefined;
414
+ } | undefined;
415
+ } | undefined;
416
+ gpioMap?: Record<string, number> | undefined;
417
+ } | null;
418
+ lastSeenAt: string | null;
419
+ isOnline: boolean;
420
+ }[];
421
+ }>;
422
+ 401: z.ZodObject<{
423
+ message: z.ZodString;
424
+ code: z.ZodString;
425
+ }, "strip", z.ZodTypeAny, {
426
+ code: string;
427
+ message: string;
428
+ }, {
429
+ code: string;
430
+ message: string;
431
+ }>;
432
+ 403: z.ZodObject<{
433
+ message: z.ZodString;
434
+ code: z.ZodString;
435
+ }, "strip", z.ZodTypeAny, {
436
+ code: string;
437
+ message: string;
438
+ }, {
439
+ code: string;
440
+ message: string;
441
+ }>;
442
+ 404: z.ZodObject<{
443
+ message: z.ZodString;
444
+ code: z.ZodString;
445
+ }, "strip", z.ZodTypeAny, {
446
+ code: string;
447
+ message: string;
448
+ }, {
449
+ code: string;
450
+ message: string;
451
+ }>;
452
+ };
453
+ };
454
+ updateDevice: {
455
+ pathParams: z.ZodObject<{
456
+ farmId: z.ZodString;
457
+ fieldId: z.ZodString;
458
+ deviceId: z.ZodString;
459
+ }, "strip", z.ZodTypeAny, {
460
+ farmId: string;
461
+ fieldId: string;
462
+ deviceId: string;
463
+ }, {
464
+ farmId: string;
465
+ fieldId: string;
466
+ deviceId: string;
467
+ }>;
468
+ summary: "Update device config including pump calibration";
469
+ method: "PATCH";
470
+ body: z.ZodObject<{
471
+ name: z.ZodOptional<z.ZodString>;
472
+ config: z.ZodOptional<z.ZodObject<{
473
+ heartbeatIntervalSec: z.ZodOptional<z.ZodNumber>;
474
+ commandPollIntervalSec: z.ZodOptional<z.ZodNumber>;
475
+ sensorIntervals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
476
+ pumpCalibration: z.ZodOptional<z.ZodObject<{
477
+ fert_pump_a: z.ZodOptional<z.ZodObject<{
478
+ mlPerSecond: z.ZodNumber;
479
+ calibratedAt: z.ZodOptional<z.ZodString>;
480
+ }, "strip", z.ZodTypeAny, {
481
+ mlPerSecond: number;
482
+ calibratedAt?: string | undefined;
483
+ }, {
484
+ mlPerSecond: number;
485
+ calibratedAt?: string | undefined;
486
+ }>>;
487
+ fert_pump_b: z.ZodOptional<z.ZodObject<{
488
+ mlPerSecond: z.ZodNumber;
489
+ calibratedAt: z.ZodOptional<z.ZodString>;
490
+ }, "strip", z.ZodTypeAny, {
491
+ mlPerSecond: number;
492
+ calibratedAt?: string | undefined;
493
+ }, {
494
+ mlPerSecond: number;
495
+ calibratedAt?: string | undefined;
496
+ }>>;
497
+ }, "strip", z.ZodTypeAny, {
498
+ fert_pump_a?: {
499
+ mlPerSecond: number;
500
+ calibratedAt?: string | undefined;
501
+ } | undefined;
502
+ fert_pump_b?: {
503
+ mlPerSecond: number;
504
+ calibratedAt?: string | undefined;
505
+ } | undefined;
506
+ }, {
507
+ fert_pump_a?: {
508
+ mlPerSecond: number;
509
+ calibratedAt?: string | undefined;
510
+ } | undefined;
511
+ fert_pump_b?: {
512
+ mlPerSecond: number;
513
+ calibratedAt?: string | undefined;
514
+ } | undefined;
515
+ }>>;
516
+ gpioMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
517
+ }, "strip", z.ZodTypeAny, {
518
+ heartbeatIntervalSec?: number | undefined;
519
+ commandPollIntervalSec?: number | undefined;
520
+ sensorIntervals?: Record<string, number> | undefined;
521
+ pumpCalibration?: {
522
+ fert_pump_a?: {
523
+ mlPerSecond: number;
524
+ calibratedAt?: string | undefined;
525
+ } | undefined;
526
+ fert_pump_b?: {
527
+ mlPerSecond: number;
528
+ calibratedAt?: string | undefined;
529
+ } | undefined;
530
+ } | undefined;
531
+ gpioMap?: Record<string, number> | undefined;
532
+ }, {
533
+ heartbeatIntervalSec?: number | undefined;
534
+ commandPollIntervalSec?: number | undefined;
535
+ sensorIntervals?: Record<string, number> | undefined;
536
+ pumpCalibration?: {
537
+ fert_pump_a?: {
538
+ mlPerSecond: number;
539
+ calibratedAt?: string | undefined;
540
+ } | undefined;
541
+ fert_pump_b?: {
542
+ mlPerSecond: number;
543
+ calibratedAt?: string | undefined;
544
+ } | undefined;
545
+ } | undefined;
546
+ gpioMap?: Record<string, number> | undefined;
547
+ }>>;
548
+ }, "strip", z.ZodTypeAny, {
549
+ name?: string | undefined;
550
+ config?: {
551
+ heartbeatIntervalSec?: number | undefined;
552
+ commandPollIntervalSec?: number | undefined;
553
+ sensorIntervals?: Record<string, number> | undefined;
554
+ pumpCalibration?: {
555
+ fert_pump_a?: {
556
+ mlPerSecond: number;
557
+ calibratedAt?: string | undefined;
558
+ } | undefined;
559
+ fert_pump_b?: {
560
+ mlPerSecond: number;
561
+ calibratedAt?: string | undefined;
562
+ } | undefined;
563
+ } | undefined;
564
+ gpioMap?: Record<string, number> | undefined;
565
+ } | undefined;
566
+ }, {
567
+ name?: string | undefined;
568
+ config?: {
569
+ heartbeatIntervalSec?: number | undefined;
570
+ commandPollIntervalSec?: number | undefined;
571
+ sensorIntervals?: Record<string, number> | undefined;
572
+ pumpCalibration?: {
573
+ fert_pump_a?: {
574
+ mlPerSecond: number;
575
+ calibratedAt?: string | undefined;
576
+ } | undefined;
577
+ fert_pump_b?: {
578
+ mlPerSecond: number;
579
+ calibratedAt?: string | undefined;
580
+ } | undefined;
581
+ } | undefined;
582
+ gpioMap?: Record<string, number> | undefined;
583
+ } | undefined;
584
+ }>;
585
+ path: "/farms/:farmId/fields/:fieldId/devices/:deviceId";
586
+ responses: {
587
+ 200: z.ZodObject<{
588
+ device: z.ZodObject<{
589
+ id: z.ZodString;
590
+ name: z.ZodString;
591
+ fieldId: z.ZodString;
592
+ farmId: z.ZodString;
593
+ lastSeenAt: z.ZodNullable<z.ZodString>;
594
+ bufferedReadingsCount: z.ZodNullable<z.ZodNumber>;
595
+ bufferOverflow: z.ZodBoolean;
596
+ firmwareVersion: z.ZodNullable<z.ZodString>;
597
+ isOnline: z.ZodBoolean;
598
+ config: z.ZodNullable<z.ZodObject<{
599
+ heartbeatIntervalSec: z.ZodOptional<z.ZodNumber>;
600
+ commandPollIntervalSec: z.ZodOptional<z.ZodNumber>;
601
+ sensorIntervals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
602
+ pumpCalibration: z.ZodOptional<z.ZodObject<{
603
+ fert_pump_a: z.ZodOptional<z.ZodObject<{
604
+ mlPerSecond: z.ZodNumber;
605
+ calibratedAt: z.ZodOptional<z.ZodString>;
606
+ }, "strip", z.ZodTypeAny, {
607
+ mlPerSecond: number;
608
+ calibratedAt?: string | undefined;
609
+ }, {
610
+ mlPerSecond: number;
611
+ calibratedAt?: string | undefined;
612
+ }>>;
613
+ fert_pump_b: z.ZodOptional<z.ZodObject<{
614
+ mlPerSecond: z.ZodNumber;
615
+ calibratedAt: z.ZodOptional<z.ZodString>;
616
+ }, "strip", z.ZodTypeAny, {
617
+ mlPerSecond: number;
618
+ calibratedAt?: string | undefined;
619
+ }, {
620
+ mlPerSecond: number;
621
+ calibratedAt?: string | undefined;
622
+ }>>;
623
+ }, "strip", z.ZodTypeAny, {
624
+ fert_pump_a?: {
625
+ mlPerSecond: number;
626
+ calibratedAt?: string | undefined;
627
+ } | undefined;
628
+ fert_pump_b?: {
629
+ mlPerSecond: number;
630
+ calibratedAt?: string | undefined;
631
+ } | undefined;
632
+ }, {
633
+ fert_pump_a?: {
634
+ mlPerSecond: number;
635
+ calibratedAt?: string | undefined;
636
+ } | undefined;
637
+ fert_pump_b?: {
638
+ mlPerSecond: number;
639
+ calibratedAt?: string | undefined;
640
+ } | undefined;
641
+ }>>;
642
+ gpioMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
643
+ }, "strip", z.ZodTypeAny, {
644
+ heartbeatIntervalSec?: number | undefined;
645
+ commandPollIntervalSec?: number | undefined;
646
+ sensorIntervals?: Record<string, number> | undefined;
647
+ pumpCalibration?: {
648
+ fert_pump_a?: {
649
+ mlPerSecond: number;
650
+ calibratedAt?: string | undefined;
651
+ } | undefined;
652
+ fert_pump_b?: {
653
+ mlPerSecond: number;
654
+ calibratedAt?: string | undefined;
655
+ } | undefined;
656
+ } | undefined;
657
+ gpioMap?: Record<string, number> | undefined;
658
+ }, {
659
+ heartbeatIntervalSec?: number | undefined;
660
+ commandPollIntervalSec?: number | undefined;
661
+ sensorIntervals?: Record<string, number> | undefined;
662
+ pumpCalibration?: {
663
+ fert_pump_a?: {
664
+ mlPerSecond: number;
665
+ calibratedAt?: string | undefined;
666
+ } | undefined;
667
+ fert_pump_b?: {
668
+ mlPerSecond: number;
669
+ calibratedAt?: string | undefined;
670
+ } | undefined;
671
+ } | undefined;
672
+ gpioMap?: Record<string, number> | undefined;
673
+ }>>;
674
+ createdAt: z.ZodString;
675
+ }, "strip", z.ZodTypeAny, {
676
+ id: string;
677
+ createdAt: string;
678
+ name: string;
679
+ farmId: string;
680
+ fieldId: string;
681
+ firmwareVersion: string | null;
682
+ bufferedReadingsCount: number | null;
683
+ bufferOverflow: boolean;
684
+ config: {
685
+ heartbeatIntervalSec?: number | undefined;
686
+ commandPollIntervalSec?: number | undefined;
687
+ sensorIntervals?: Record<string, number> | undefined;
688
+ pumpCalibration?: {
689
+ fert_pump_a?: {
690
+ mlPerSecond: number;
691
+ calibratedAt?: string | undefined;
692
+ } | undefined;
693
+ fert_pump_b?: {
694
+ mlPerSecond: number;
695
+ calibratedAt?: string | undefined;
696
+ } | undefined;
697
+ } | undefined;
698
+ gpioMap?: Record<string, number> | undefined;
699
+ } | null;
700
+ lastSeenAt: string | null;
701
+ isOnline: boolean;
702
+ }, {
703
+ id: string;
704
+ createdAt: string;
705
+ name: string;
706
+ farmId: string;
707
+ fieldId: string;
708
+ firmwareVersion: string | null;
709
+ bufferedReadingsCount: number | null;
710
+ bufferOverflow: boolean;
711
+ config: {
712
+ heartbeatIntervalSec?: number | undefined;
713
+ commandPollIntervalSec?: number | undefined;
714
+ sensorIntervals?: Record<string, number> | undefined;
715
+ pumpCalibration?: {
716
+ fert_pump_a?: {
717
+ mlPerSecond: number;
718
+ calibratedAt?: string | undefined;
719
+ } | undefined;
720
+ fert_pump_b?: {
721
+ mlPerSecond: number;
722
+ calibratedAt?: string | undefined;
723
+ } | undefined;
724
+ } | undefined;
725
+ gpioMap?: Record<string, number> | undefined;
726
+ } | null;
727
+ lastSeenAt: string | null;
728
+ isOnline: boolean;
729
+ }>;
730
+ }, "strip", z.ZodTypeAny, {
731
+ device: {
732
+ id: string;
733
+ createdAt: string;
734
+ name: string;
735
+ farmId: string;
736
+ fieldId: string;
737
+ firmwareVersion: string | null;
738
+ bufferedReadingsCount: number | null;
739
+ bufferOverflow: boolean;
740
+ config: {
741
+ heartbeatIntervalSec?: number | undefined;
742
+ commandPollIntervalSec?: number | undefined;
743
+ sensorIntervals?: Record<string, number> | undefined;
744
+ pumpCalibration?: {
745
+ fert_pump_a?: {
746
+ mlPerSecond: number;
747
+ calibratedAt?: string | undefined;
748
+ } | undefined;
749
+ fert_pump_b?: {
750
+ mlPerSecond: number;
751
+ calibratedAt?: string | undefined;
752
+ } | undefined;
753
+ } | undefined;
754
+ gpioMap?: Record<string, number> | undefined;
755
+ } | null;
756
+ lastSeenAt: string | null;
757
+ isOnline: boolean;
758
+ };
759
+ }, {
760
+ device: {
761
+ id: string;
762
+ createdAt: string;
763
+ name: string;
764
+ farmId: string;
765
+ fieldId: string;
766
+ firmwareVersion: string | null;
767
+ bufferedReadingsCount: number | null;
768
+ bufferOverflow: boolean;
769
+ config: {
770
+ heartbeatIntervalSec?: number | undefined;
771
+ commandPollIntervalSec?: number | undefined;
772
+ sensorIntervals?: Record<string, number> | undefined;
773
+ pumpCalibration?: {
774
+ fert_pump_a?: {
775
+ mlPerSecond: number;
776
+ calibratedAt?: string | undefined;
777
+ } | undefined;
778
+ fert_pump_b?: {
779
+ mlPerSecond: number;
780
+ calibratedAt?: string | undefined;
781
+ } | undefined;
782
+ } | undefined;
783
+ gpioMap?: Record<string, number> | undefined;
784
+ } | null;
785
+ lastSeenAt: string | null;
786
+ isOnline: boolean;
787
+ };
788
+ }>;
789
+ 401: z.ZodObject<{
790
+ message: z.ZodString;
791
+ code: z.ZodString;
792
+ }, "strip", z.ZodTypeAny, {
793
+ code: string;
794
+ message: string;
795
+ }, {
796
+ code: string;
797
+ message: string;
798
+ }>;
799
+ 403: z.ZodObject<{
800
+ message: z.ZodString;
801
+ code: z.ZodString;
802
+ }, "strip", z.ZodTypeAny, {
803
+ code: string;
804
+ message: string;
805
+ }, {
806
+ code: string;
807
+ message: string;
808
+ }>;
809
+ 404: z.ZodObject<{
810
+ message: z.ZodString;
811
+ code: z.ZodString;
812
+ }, "strip", z.ZodTypeAny, {
813
+ code: string;
814
+ message: string;
815
+ }, {
816
+ code: string;
817
+ message: string;
818
+ }>;
819
+ };
820
+ };
821
+ createActuator: {
822
+ pathParams: z.ZodObject<{
823
+ farmId: z.ZodString;
824
+ fieldId: z.ZodString;
825
+ deviceId: z.ZodString;
826
+ }, "strip", z.ZodTypeAny, {
827
+ farmId: string;
828
+ fieldId: string;
829
+ deviceId: string;
830
+ }, {
831
+ farmId: string;
832
+ fieldId: string;
833
+ deviceId: string;
834
+ }>;
835
+ summary: "Register an actuator on a greenhouse device";
836
+ method: "POST";
837
+ body: z.ZodObject<{
838
+ type: z.ZodEnum<["IRRIGATION_VALVE", "FERT_PUMP_A", "FERT_PUMP_B", "FAN"]>;
839
+ name: z.ZodString;
840
+ gpioPin: z.ZodOptional<z.ZodNumber>;
841
+ }, "strip", z.ZodTypeAny, {
842
+ type: "IRRIGATION_VALVE" | "FERT_PUMP_A" | "FERT_PUMP_B" | "FAN";
843
+ name: string;
844
+ gpioPin?: number | undefined;
845
+ }, {
846
+ type: "IRRIGATION_VALVE" | "FERT_PUMP_A" | "FERT_PUMP_B" | "FAN";
847
+ name: string;
848
+ gpioPin?: number | undefined;
849
+ }>;
850
+ path: "/farms/:farmId/fields/:fieldId/devices/:deviceId/actuators";
851
+ responses: {
852
+ 201: z.ZodObject<{
853
+ actuator: z.ZodObject<{
854
+ id: z.ZodString;
855
+ deviceId: z.ZodString;
856
+ fieldId: z.ZodString;
857
+ farmId: z.ZodString;
858
+ type: z.ZodEnum<["IRRIGATION_VALVE", "FERT_PUMP_A", "FERT_PUMP_B", "FAN"]>;
859
+ name: z.ZodString;
860
+ gpioPin: z.ZodNullable<z.ZodNumber>;
861
+ status: z.ZodString;
862
+ lastCommandAt: z.ZodNullable<z.ZodString>;
863
+ }, "strip", z.ZodTypeAny, {
864
+ type: "IRRIGATION_VALVE" | "FERT_PUMP_A" | "FERT_PUMP_B" | "FAN";
865
+ status: string;
866
+ id: string;
867
+ name: string;
868
+ farmId: string;
869
+ fieldId: string;
870
+ deviceId: string;
871
+ gpioPin: number | null;
872
+ lastCommandAt: string | null;
873
+ }, {
874
+ type: "IRRIGATION_VALVE" | "FERT_PUMP_A" | "FERT_PUMP_B" | "FAN";
875
+ status: string;
876
+ id: string;
877
+ name: string;
878
+ farmId: string;
879
+ fieldId: string;
880
+ deviceId: string;
881
+ gpioPin: number | null;
882
+ lastCommandAt: string | null;
883
+ }>;
884
+ }, "strip", z.ZodTypeAny, {
885
+ actuator: {
886
+ type: "IRRIGATION_VALVE" | "FERT_PUMP_A" | "FERT_PUMP_B" | "FAN";
887
+ status: string;
888
+ id: string;
889
+ name: string;
890
+ farmId: string;
891
+ fieldId: string;
892
+ deviceId: string;
893
+ gpioPin: number | null;
894
+ lastCommandAt: string | null;
895
+ };
896
+ }, {
897
+ actuator: {
898
+ type: "IRRIGATION_VALVE" | "FERT_PUMP_A" | "FERT_PUMP_B" | "FAN";
899
+ status: string;
900
+ id: string;
901
+ name: string;
902
+ farmId: string;
903
+ fieldId: string;
904
+ deviceId: string;
905
+ gpioPin: number | null;
906
+ lastCommandAt: string | null;
907
+ };
908
+ }>;
909
+ 401: z.ZodObject<{
910
+ message: z.ZodString;
911
+ code: z.ZodString;
912
+ }, "strip", z.ZodTypeAny, {
913
+ code: string;
914
+ message: string;
915
+ }, {
916
+ code: string;
917
+ message: string;
918
+ }>;
919
+ 403: z.ZodObject<{
920
+ message: z.ZodString;
921
+ code: z.ZodString;
922
+ }, "strip", z.ZodTypeAny, {
923
+ code: string;
924
+ message: string;
925
+ }, {
926
+ code: string;
927
+ message: string;
928
+ }>;
929
+ 404: z.ZodObject<{
930
+ message: z.ZodString;
931
+ code: z.ZodString;
932
+ }, "strip", z.ZodTypeAny, {
933
+ code: string;
934
+ message: string;
935
+ }, {
936
+ code: string;
937
+ message: string;
938
+ }>;
939
+ };
940
+ };
941
+ listActuators: {
942
+ pathParams: z.ZodObject<{
943
+ farmId: z.ZodString;
944
+ fieldId: z.ZodString;
945
+ deviceId: z.ZodString;
946
+ }, "strip", z.ZodTypeAny, {
947
+ farmId: string;
948
+ fieldId: string;
949
+ deviceId: string;
950
+ }, {
951
+ farmId: string;
952
+ fieldId: string;
953
+ deviceId: string;
954
+ }>;
955
+ summary: "List actuators for a greenhouse device";
956
+ method: "GET";
957
+ path: "/farms/:farmId/fields/:fieldId/devices/:deviceId/actuators";
958
+ responses: {
959
+ 200: z.ZodObject<{
960
+ actuators: z.ZodArray<z.ZodObject<{
961
+ id: z.ZodString;
962
+ deviceId: z.ZodString;
963
+ fieldId: z.ZodString;
964
+ farmId: z.ZodString;
965
+ type: z.ZodEnum<["IRRIGATION_VALVE", "FERT_PUMP_A", "FERT_PUMP_B", "FAN"]>;
966
+ name: z.ZodString;
967
+ gpioPin: z.ZodNullable<z.ZodNumber>;
968
+ status: z.ZodString;
969
+ lastCommandAt: z.ZodNullable<z.ZodString>;
970
+ }, "strip", z.ZodTypeAny, {
971
+ type: "IRRIGATION_VALVE" | "FERT_PUMP_A" | "FERT_PUMP_B" | "FAN";
972
+ status: string;
973
+ id: string;
974
+ name: string;
975
+ farmId: string;
976
+ fieldId: string;
977
+ deviceId: string;
978
+ gpioPin: number | null;
979
+ lastCommandAt: string | null;
980
+ }, {
981
+ type: "IRRIGATION_VALVE" | "FERT_PUMP_A" | "FERT_PUMP_B" | "FAN";
982
+ status: string;
983
+ id: string;
984
+ name: string;
985
+ farmId: string;
986
+ fieldId: string;
987
+ deviceId: string;
988
+ gpioPin: number | null;
989
+ lastCommandAt: string | null;
990
+ }>, "many">;
991
+ }, "strip", z.ZodTypeAny, {
992
+ actuators: {
993
+ type: "IRRIGATION_VALVE" | "FERT_PUMP_A" | "FERT_PUMP_B" | "FAN";
994
+ status: string;
995
+ id: string;
996
+ name: string;
997
+ farmId: string;
998
+ fieldId: string;
999
+ deviceId: string;
1000
+ gpioPin: number | null;
1001
+ lastCommandAt: string | null;
1002
+ }[];
1003
+ }, {
1004
+ actuators: {
1005
+ type: "IRRIGATION_VALVE" | "FERT_PUMP_A" | "FERT_PUMP_B" | "FAN";
1006
+ status: string;
1007
+ id: string;
1008
+ name: string;
1009
+ farmId: string;
1010
+ fieldId: string;
1011
+ deviceId: string;
1012
+ gpioPin: number | null;
1013
+ lastCommandAt: string | null;
1014
+ }[];
1015
+ }>;
1016
+ 401: z.ZodObject<{
1017
+ message: z.ZodString;
1018
+ code: z.ZodString;
1019
+ }, "strip", z.ZodTypeAny, {
1020
+ code: string;
1021
+ message: string;
1022
+ }, {
1023
+ code: string;
1024
+ message: string;
1025
+ }>;
1026
+ 403: z.ZodObject<{
1027
+ message: z.ZodString;
1028
+ code: z.ZodString;
1029
+ }, "strip", z.ZodTypeAny, {
1030
+ code: string;
1031
+ message: string;
1032
+ }, {
1033
+ code: string;
1034
+ message: string;
1035
+ }>;
1036
+ 404: z.ZodObject<{
1037
+ message: z.ZodString;
1038
+ code: z.ZodString;
1039
+ }, "strip", z.ZodTypeAny, {
1040
+ code: string;
1041
+ message: string;
1042
+ }, {
1043
+ code: string;
1044
+ message: string;
1045
+ }>;
1046
+ };
1047
+ };
1048
+ sendActuatorCommand: {
1049
+ pathParams: z.ZodObject<{
1050
+ farmId: z.ZodString;
1051
+ fieldId: z.ZodString;
1052
+ actuatorId: z.ZodString;
1053
+ }, "strip", z.ZodTypeAny, {
1054
+ farmId: string;
1055
+ fieldId: string;
1056
+ actuatorId: string;
1057
+ }, {
1058
+ farmId: string;
1059
+ fieldId: string;
1060
+ actuatorId: string;
1061
+ }>;
1062
+ summary: "Queue a manual actuator command (Run now)";
1063
+ method: "POST";
1064
+ body: z.ZodObject<{
1065
+ command: z.ZodEnum<["ON", "OFF", "PULSE"]>;
1066
+ durationSec: z.ZodOptional<z.ZodNumber>;
1067
+ source: z.ZodDefault<z.ZodEnum<["manual", "schedule", "rule"]>>;
1068
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1069
+ }, "strip", z.ZodTypeAny, {
1070
+ source: "manual" | "schedule" | "rule";
1071
+ command: "ON" | "OFF" | "PULSE";
1072
+ metadata?: Record<string, unknown> | undefined;
1073
+ durationSec?: number | undefined;
1074
+ }, {
1075
+ command: "ON" | "OFF" | "PULSE";
1076
+ source?: "manual" | "schedule" | "rule" | undefined;
1077
+ metadata?: Record<string, unknown> | undefined;
1078
+ durationSec?: number | undefined;
1079
+ }>;
1080
+ path: "/farms/:farmId/fields/:fieldId/actuators/:actuatorId/command";
1081
+ responses: {
1082
+ 201: z.ZodObject<{
1083
+ commandId: z.ZodString;
1084
+ status: z.ZodString;
1085
+ }, "strip", z.ZodTypeAny, {
1086
+ status: string;
1087
+ commandId: string;
1088
+ }, {
1089
+ status: string;
1090
+ commandId: string;
1091
+ }>;
1092
+ 401: z.ZodObject<{
1093
+ message: z.ZodString;
1094
+ code: z.ZodString;
1095
+ }, "strip", z.ZodTypeAny, {
1096
+ code: string;
1097
+ message: string;
1098
+ }, {
1099
+ code: string;
1100
+ message: string;
1101
+ }>;
1102
+ 403: z.ZodObject<{
1103
+ message: z.ZodString;
1104
+ code: z.ZodString;
1105
+ }, "strip", z.ZodTypeAny, {
1106
+ code: string;
1107
+ message: string;
1108
+ }, {
1109
+ code: string;
1110
+ message: string;
1111
+ }>;
1112
+ 404: z.ZodObject<{
1113
+ message: z.ZodString;
1114
+ code: z.ZodString;
1115
+ }, "strip", z.ZodTypeAny, {
1116
+ code: string;
1117
+ message: string;
1118
+ }, {
1119
+ code: string;
1120
+ message: string;
1121
+ }>;
1122
+ 422: z.ZodObject<{
1123
+ message: z.ZodString;
1124
+ code: z.ZodString;
1125
+ }, "strip", z.ZodTypeAny, {
1126
+ code: string;
1127
+ message: string;
1128
+ }, {
1129
+ code: string;
1130
+ message: string;
1131
+ }>;
1132
+ };
1133
+ };
1134
+ };
1135
+ //# sourceMappingURL=device-gateway-admin.routes.d.ts.map