@deepintel-ltd/farmpro-contracts 1.16.7 → 1.16.9
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.
- package/dist/routes/agents.routes.d.ts +6 -6
- package/dist/routes/field-monitoring.routes.d.ts +2 -2
- package/dist/routes/field-observations.routes.d.ts +40 -40
- package/dist/routes/finance.routes.d.ts +159 -6
- package/dist/routes/finance.routes.d.ts.map +1 -1
- package/dist/routes/livestock-groups.routes.d.ts +24 -24
- package/dist/routes/market-intelligence.routes.d.ts +8 -8
- package/dist/routes/monitoring-visualization.routes.d.ts +5 -2
- package/dist/routes/monitoring-visualization.routes.d.ts.map +1 -1
- package/dist/routes/team-payments.routes.d.ts +36 -36
- package/dist/routes/weather.routes.d.ts +64 -0
- package/dist/routes/weather.routes.d.ts.map +1 -1
- package/dist/schemas/agents.schemas.d.ts +6 -6
- package/dist/schemas/field-monitoring.schemas.d.ts +2 -2
- package/dist/schemas/field-observations.schemas.d.ts +34 -34
- package/dist/schemas/finance.schemas.d.ts +153 -0
- package/dist/schemas/finance.schemas.d.ts.map +1 -1
- package/dist/schemas/finance.schemas.js +23 -0
- package/dist/schemas/livestock-groups.schemas.d.ts +24 -24
- package/dist/schemas/monitoring-visualization.schemas.d.ts +4 -0
- package/dist/schemas/monitoring-visualization.schemas.d.ts.map +1 -1
- package/dist/schemas/monitoring-visualization.schemas.js +2 -0
- package/dist/schemas/team-payments.schemas.d.ts +30 -30
- package/dist/schemas/weather.schemas.d.ts +191 -0
- package/dist/schemas/weather.schemas.d.ts.map +1 -1
- package/dist/schemas/weather.schemas.js +22 -3
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export declare const currentWeatherSchema: z.ZodObject<{
|
|
|
8
8
|
temp: z.ZodNumber;
|
|
9
9
|
condition: z.ZodString;
|
|
10
10
|
icon: z.ZodOptional<z.ZodString>;
|
|
11
|
+
/** Last 1 hour precip (mm) — not "rain today". */
|
|
11
12
|
rainfall: z.ZodOptional<z.ZodNumber>;
|
|
12
13
|
humidity: z.ZodOptional<z.ZodNumber>;
|
|
13
14
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -26,7 +27,9 @@ export declare const currentWeatherSchema: z.ZodObject<{
|
|
|
26
27
|
export declare const weatherForecastSchema: z.ZodObject<{
|
|
27
28
|
day: z.ZodString;
|
|
28
29
|
temp: z.ZodNumber;
|
|
30
|
+
/** Probability of precipitation (0–100). Not rainfall amount. */
|
|
29
31
|
rain: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
/** Expected daily rainfall volume (mm). */
|
|
30
33
|
rainfall: z.ZodOptional<z.ZodNumber>;
|
|
31
34
|
condition: z.ZodOptional<z.ZodString>;
|
|
32
35
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -192,12 +195,26 @@ export declare const weatherAlertSchema: z.ZodObject<{
|
|
|
192
195
|
fieldId?: string | null | undefined;
|
|
193
196
|
recommendation?: string | undefined;
|
|
194
197
|
}>;
|
|
198
|
+
export declare const weatherProvenanceSchema: z.ZodObject<{
|
|
199
|
+
provider: z.ZodString;
|
|
200
|
+
location: z.ZodString;
|
|
201
|
+
updatedAt: z.ZodString;
|
|
202
|
+
}, "strip", z.ZodTypeAny, {
|
|
203
|
+
updatedAt: string;
|
|
204
|
+
location: string;
|
|
205
|
+
provider: string;
|
|
206
|
+
}, {
|
|
207
|
+
updatedAt: string;
|
|
208
|
+
location: string;
|
|
209
|
+
provider: string;
|
|
210
|
+
}>;
|
|
195
211
|
export declare const weatherAttributesSchema: z.ZodObject<{
|
|
196
212
|
farmId: z.ZodString;
|
|
197
213
|
current: z.ZodObject<{
|
|
198
214
|
temp: z.ZodNumber;
|
|
199
215
|
condition: z.ZodString;
|
|
200
216
|
icon: z.ZodOptional<z.ZodString>;
|
|
217
|
+
/** Last 1 hour precip (mm) — not "rain today". */
|
|
201
218
|
rainfall: z.ZodOptional<z.ZodNumber>;
|
|
202
219
|
humidity: z.ZodOptional<z.ZodNumber>;
|
|
203
220
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -216,7 +233,9 @@ export declare const weatherAttributesSchema: z.ZodObject<{
|
|
|
216
233
|
forecast: z.ZodArray<z.ZodObject<{
|
|
217
234
|
day: z.ZodString;
|
|
218
235
|
temp: z.ZodNumber;
|
|
236
|
+
/** Probability of precipitation (0–100). Not rainfall amount. */
|
|
219
237
|
rain: z.ZodOptional<z.ZodNumber>;
|
|
238
|
+
/** Expected daily rainfall volume (mm). */
|
|
220
239
|
rainfall: z.ZodOptional<z.ZodNumber>;
|
|
221
240
|
condition: z.ZodOptional<z.ZodString>;
|
|
222
241
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -382,6 +401,29 @@ export declare const weatherAttributesSchema: z.ZodObject<{
|
|
|
382
401
|
fieldId?: string | null | undefined;
|
|
383
402
|
recommendation?: string | undefined;
|
|
384
403
|
}>, "many">>;
|
|
404
|
+
/**
|
|
405
|
+
* Best-effort observed precip for local today (mm).
|
|
406
|
+
* One Call hourly is mostly forward-looking, so this is often only the current 1h bucket
|
|
407
|
+
* when past hours are unavailable. Omitted when unknown — never invent 0.
|
|
408
|
+
*/
|
|
409
|
+
rainTodayMM: z.ZodOptional<z.ZodNumber>;
|
|
410
|
+
/** Last 1h precip (mm). Same as current.rainfall; explicit for irrigate decisions. */
|
|
411
|
+
rainLast1hMM: z.ZodOptional<z.ZodNumber>;
|
|
412
|
+
/** Forecast expected rain for calendar today (mm) — forecast[0].rainfall. */
|
|
413
|
+
expectedTodayRainMM: z.ZodOptional<z.ZodNumber>;
|
|
414
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
415
|
+
provider: z.ZodString;
|
|
416
|
+
location: z.ZodString;
|
|
417
|
+
updatedAt: z.ZodString;
|
|
418
|
+
}, "strip", z.ZodTypeAny, {
|
|
419
|
+
updatedAt: string;
|
|
420
|
+
location: string;
|
|
421
|
+
provider: string;
|
|
422
|
+
}, {
|
|
423
|
+
updatedAt: string;
|
|
424
|
+
location: string;
|
|
425
|
+
provider: string;
|
|
426
|
+
}>>;
|
|
385
427
|
}, "strip", z.ZodTypeAny, {
|
|
386
428
|
current: {
|
|
387
429
|
temp: number;
|
|
@@ -429,6 +471,14 @@ export declare const weatherAttributesSchema: z.ZodObject<{
|
|
|
429
471
|
fieldId?: string | null | undefined;
|
|
430
472
|
recommendation?: string | undefined;
|
|
431
473
|
}[] | undefined;
|
|
474
|
+
rainTodayMM?: number | undefined;
|
|
475
|
+
rainLast1hMM?: number | undefined;
|
|
476
|
+
expectedTodayRainMM?: number | undefined;
|
|
477
|
+
provenance?: {
|
|
478
|
+
updatedAt: string;
|
|
479
|
+
location: string;
|
|
480
|
+
provider: string;
|
|
481
|
+
} | undefined;
|
|
432
482
|
}, {
|
|
433
483
|
current: {
|
|
434
484
|
temp: number;
|
|
@@ -476,6 +526,14 @@ export declare const weatherAttributesSchema: z.ZodObject<{
|
|
|
476
526
|
fieldId?: string | null | undefined;
|
|
477
527
|
recommendation?: string | undefined;
|
|
478
528
|
}[] | undefined;
|
|
529
|
+
rainTodayMM?: number | undefined;
|
|
530
|
+
rainLast1hMM?: number | undefined;
|
|
531
|
+
expectedTodayRainMM?: number | undefined;
|
|
532
|
+
provenance?: {
|
|
533
|
+
updatedAt: string;
|
|
534
|
+
location: string;
|
|
535
|
+
provider: string;
|
|
536
|
+
} | undefined;
|
|
479
537
|
}>;
|
|
480
538
|
export declare const plannerRiskLevelSchema: z.ZodEnum<["low", "medium", "high"]>;
|
|
481
539
|
export declare const plannerActivityScoreSchema: z.ZodObject<{
|
|
@@ -1162,6 +1220,7 @@ export declare const weatherResourceSchema: z.ZodObject<{
|
|
|
1162
1220
|
temp: z.ZodNumber;
|
|
1163
1221
|
condition: z.ZodString;
|
|
1164
1222
|
icon: z.ZodOptional<z.ZodString>;
|
|
1223
|
+
/** Last 1 hour precip (mm) — not "rain today". */
|
|
1165
1224
|
rainfall: z.ZodOptional<z.ZodNumber>;
|
|
1166
1225
|
humidity: z.ZodOptional<z.ZodNumber>;
|
|
1167
1226
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1180,7 +1239,9 @@ export declare const weatherResourceSchema: z.ZodObject<{
|
|
|
1180
1239
|
forecast: z.ZodArray<z.ZodObject<{
|
|
1181
1240
|
day: z.ZodString;
|
|
1182
1241
|
temp: z.ZodNumber;
|
|
1242
|
+
/** Probability of precipitation (0–100). Not rainfall amount. */
|
|
1183
1243
|
rain: z.ZodOptional<z.ZodNumber>;
|
|
1244
|
+
/** Expected daily rainfall volume (mm). */
|
|
1184
1245
|
rainfall: z.ZodOptional<z.ZodNumber>;
|
|
1185
1246
|
condition: z.ZodOptional<z.ZodString>;
|
|
1186
1247
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1346,6 +1407,29 @@ export declare const weatherResourceSchema: z.ZodObject<{
|
|
|
1346
1407
|
fieldId?: string | null | undefined;
|
|
1347
1408
|
recommendation?: string | undefined;
|
|
1348
1409
|
}>, "many">>;
|
|
1410
|
+
/**
|
|
1411
|
+
* Best-effort observed precip for local today (mm).
|
|
1412
|
+
* One Call hourly is mostly forward-looking, so this is often only the current 1h bucket
|
|
1413
|
+
* when past hours are unavailable. Omitted when unknown — never invent 0.
|
|
1414
|
+
*/
|
|
1415
|
+
rainTodayMM: z.ZodOptional<z.ZodNumber>;
|
|
1416
|
+
/** Last 1h precip (mm). Same as current.rainfall; explicit for irrigate decisions. */
|
|
1417
|
+
rainLast1hMM: z.ZodOptional<z.ZodNumber>;
|
|
1418
|
+
/** Forecast expected rain for calendar today (mm) — forecast[0].rainfall. */
|
|
1419
|
+
expectedTodayRainMM: z.ZodOptional<z.ZodNumber>;
|
|
1420
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
1421
|
+
provider: z.ZodString;
|
|
1422
|
+
location: z.ZodString;
|
|
1423
|
+
updatedAt: z.ZodString;
|
|
1424
|
+
}, "strip", z.ZodTypeAny, {
|
|
1425
|
+
updatedAt: string;
|
|
1426
|
+
location: string;
|
|
1427
|
+
provider: string;
|
|
1428
|
+
}, {
|
|
1429
|
+
updatedAt: string;
|
|
1430
|
+
location: string;
|
|
1431
|
+
provider: string;
|
|
1432
|
+
}>>;
|
|
1349
1433
|
}, "strip", z.ZodTypeAny, {
|
|
1350
1434
|
current: {
|
|
1351
1435
|
temp: number;
|
|
@@ -1393,6 +1477,14 @@ export declare const weatherResourceSchema: z.ZodObject<{
|
|
|
1393
1477
|
fieldId?: string | null | undefined;
|
|
1394
1478
|
recommendation?: string | undefined;
|
|
1395
1479
|
}[] | undefined;
|
|
1480
|
+
rainTodayMM?: number | undefined;
|
|
1481
|
+
rainLast1hMM?: number | undefined;
|
|
1482
|
+
expectedTodayRainMM?: number | undefined;
|
|
1483
|
+
provenance?: {
|
|
1484
|
+
updatedAt: string;
|
|
1485
|
+
location: string;
|
|
1486
|
+
provider: string;
|
|
1487
|
+
} | undefined;
|
|
1396
1488
|
}, {
|
|
1397
1489
|
current: {
|
|
1398
1490
|
temp: number;
|
|
@@ -1440,6 +1532,14 @@ export declare const weatherResourceSchema: z.ZodObject<{
|
|
|
1440
1532
|
fieldId?: string | null | undefined;
|
|
1441
1533
|
recommendation?: string | undefined;
|
|
1442
1534
|
}[] | undefined;
|
|
1535
|
+
rainTodayMM?: number | undefined;
|
|
1536
|
+
rainLast1hMM?: number | undefined;
|
|
1537
|
+
expectedTodayRainMM?: number | undefined;
|
|
1538
|
+
provenance?: {
|
|
1539
|
+
updatedAt: string;
|
|
1540
|
+
location: string;
|
|
1541
|
+
provider: string;
|
|
1542
|
+
} | undefined;
|
|
1443
1543
|
}>;
|
|
1444
1544
|
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1445
1545
|
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -1494,6 +1594,14 @@ export declare const weatherResourceSchema: z.ZodObject<{
|
|
|
1494
1594
|
fieldId?: string | null | undefined;
|
|
1495
1595
|
recommendation?: string | undefined;
|
|
1496
1596
|
}[] | undefined;
|
|
1597
|
+
rainTodayMM?: number | undefined;
|
|
1598
|
+
rainLast1hMM?: number | undefined;
|
|
1599
|
+
expectedTodayRainMM?: number | undefined;
|
|
1600
|
+
provenance?: {
|
|
1601
|
+
updatedAt: string;
|
|
1602
|
+
location: string;
|
|
1603
|
+
provider: string;
|
|
1604
|
+
} | undefined;
|
|
1497
1605
|
};
|
|
1498
1606
|
relationships?: Record<string, unknown> | undefined;
|
|
1499
1607
|
links?: Record<string, string> | undefined;
|
|
@@ -1548,6 +1656,14 @@ export declare const weatherResourceSchema: z.ZodObject<{
|
|
|
1548
1656
|
fieldId?: string | null | undefined;
|
|
1549
1657
|
recommendation?: string | undefined;
|
|
1550
1658
|
}[] | undefined;
|
|
1659
|
+
rainTodayMM?: number | undefined;
|
|
1660
|
+
rainLast1hMM?: number | undefined;
|
|
1661
|
+
expectedTodayRainMM?: number | undefined;
|
|
1662
|
+
provenance?: {
|
|
1663
|
+
updatedAt: string;
|
|
1664
|
+
location: string;
|
|
1665
|
+
provider: string;
|
|
1666
|
+
} | undefined;
|
|
1551
1667
|
};
|
|
1552
1668
|
relationships?: Record<string, unknown> | undefined;
|
|
1553
1669
|
links?: Record<string, string> | undefined;
|
|
@@ -1563,6 +1679,7 @@ export declare const weatherResponseSchema: z.ZodObject<{
|
|
|
1563
1679
|
temp: z.ZodNumber;
|
|
1564
1680
|
condition: z.ZodString;
|
|
1565
1681
|
icon: z.ZodOptional<z.ZodString>;
|
|
1682
|
+
/** Last 1 hour precip (mm) — not "rain today". */
|
|
1566
1683
|
rainfall: z.ZodOptional<z.ZodNumber>;
|
|
1567
1684
|
humidity: z.ZodOptional<z.ZodNumber>;
|
|
1568
1685
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1581,7 +1698,9 @@ export declare const weatherResponseSchema: z.ZodObject<{
|
|
|
1581
1698
|
forecast: z.ZodArray<z.ZodObject<{
|
|
1582
1699
|
day: z.ZodString;
|
|
1583
1700
|
temp: z.ZodNumber;
|
|
1701
|
+
/** Probability of precipitation (0–100). Not rainfall amount. */
|
|
1584
1702
|
rain: z.ZodOptional<z.ZodNumber>;
|
|
1703
|
+
/** Expected daily rainfall volume (mm). */
|
|
1585
1704
|
rainfall: z.ZodOptional<z.ZodNumber>;
|
|
1586
1705
|
condition: z.ZodOptional<z.ZodString>;
|
|
1587
1706
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1747,6 +1866,29 @@ export declare const weatherResponseSchema: z.ZodObject<{
|
|
|
1747
1866
|
fieldId?: string | null | undefined;
|
|
1748
1867
|
recommendation?: string | undefined;
|
|
1749
1868
|
}>, "many">>;
|
|
1869
|
+
/**
|
|
1870
|
+
* Best-effort observed precip for local today (mm).
|
|
1871
|
+
* One Call hourly is mostly forward-looking, so this is often only the current 1h bucket
|
|
1872
|
+
* when past hours are unavailable. Omitted when unknown — never invent 0.
|
|
1873
|
+
*/
|
|
1874
|
+
rainTodayMM: z.ZodOptional<z.ZodNumber>;
|
|
1875
|
+
/** Last 1h precip (mm). Same as current.rainfall; explicit for irrigate decisions. */
|
|
1876
|
+
rainLast1hMM: z.ZodOptional<z.ZodNumber>;
|
|
1877
|
+
/** Forecast expected rain for calendar today (mm) — forecast[0].rainfall. */
|
|
1878
|
+
expectedTodayRainMM: z.ZodOptional<z.ZodNumber>;
|
|
1879
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
1880
|
+
provider: z.ZodString;
|
|
1881
|
+
location: z.ZodString;
|
|
1882
|
+
updatedAt: z.ZodString;
|
|
1883
|
+
}, "strip", z.ZodTypeAny, {
|
|
1884
|
+
updatedAt: string;
|
|
1885
|
+
location: string;
|
|
1886
|
+
provider: string;
|
|
1887
|
+
}, {
|
|
1888
|
+
updatedAt: string;
|
|
1889
|
+
location: string;
|
|
1890
|
+
provider: string;
|
|
1891
|
+
}>>;
|
|
1750
1892
|
}, "strip", z.ZodTypeAny, {
|
|
1751
1893
|
current: {
|
|
1752
1894
|
temp: number;
|
|
@@ -1794,6 +1936,14 @@ export declare const weatherResponseSchema: z.ZodObject<{
|
|
|
1794
1936
|
fieldId?: string | null | undefined;
|
|
1795
1937
|
recommendation?: string | undefined;
|
|
1796
1938
|
}[] | undefined;
|
|
1939
|
+
rainTodayMM?: number | undefined;
|
|
1940
|
+
rainLast1hMM?: number | undefined;
|
|
1941
|
+
expectedTodayRainMM?: number | undefined;
|
|
1942
|
+
provenance?: {
|
|
1943
|
+
updatedAt: string;
|
|
1944
|
+
location: string;
|
|
1945
|
+
provider: string;
|
|
1946
|
+
} | undefined;
|
|
1797
1947
|
}, {
|
|
1798
1948
|
current: {
|
|
1799
1949
|
temp: number;
|
|
@@ -1841,6 +1991,14 @@ export declare const weatherResponseSchema: z.ZodObject<{
|
|
|
1841
1991
|
fieldId?: string | null | undefined;
|
|
1842
1992
|
recommendation?: string | undefined;
|
|
1843
1993
|
}[] | undefined;
|
|
1994
|
+
rainTodayMM?: number | undefined;
|
|
1995
|
+
rainLast1hMM?: number | undefined;
|
|
1996
|
+
expectedTodayRainMM?: number | undefined;
|
|
1997
|
+
provenance?: {
|
|
1998
|
+
updatedAt: string;
|
|
1999
|
+
location: string;
|
|
2000
|
+
provider: string;
|
|
2001
|
+
} | undefined;
|
|
1844
2002
|
}>;
|
|
1845
2003
|
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1846
2004
|
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -1895,6 +2053,14 @@ export declare const weatherResponseSchema: z.ZodObject<{
|
|
|
1895
2053
|
fieldId?: string | null | undefined;
|
|
1896
2054
|
recommendation?: string | undefined;
|
|
1897
2055
|
}[] | undefined;
|
|
2056
|
+
rainTodayMM?: number | undefined;
|
|
2057
|
+
rainLast1hMM?: number | undefined;
|
|
2058
|
+
expectedTodayRainMM?: number | undefined;
|
|
2059
|
+
provenance?: {
|
|
2060
|
+
updatedAt: string;
|
|
2061
|
+
location: string;
|
|
2062
|
+
provider: string;
|
|
2063
|
+
} | undefined;
|
|
1898
2064
|
};
|
|
1899
2065
|
relationships?: Record<string, unknown> | undefined;
|
|
1900
2066
|
links?: Record<string, string> | undefined;
|
|
@@ -1949,6 +2115,14 @@ export declare const weatherResponseSchema: z.ZodObject<{
|
|
|
1949
2115
|
fieldId?: string | null | undefined;
|
|
1950
2116
|
recommendation?: string | undefined;
|
|
1951
2117
|
}[] | undefined;
|
|
2118
|
+
rainTodayMM?: number | undefined;
|
|
2119
|
+
rainLast1hMM?: number | undefined;
|
|
2120
|
+
expectedTodayRainMM?: number | undefined;
|
|
2121
|
+
provenance?: {
|
|
2122
|
+
updatedAt: string;
|
|
2123
|
+
location: string;
|
|
2124
|
+
provider: string;
|
|
2125
|
+
} | undefined;
|
|
1952
2126
|
};
|
|
1953
2127
|
relationships?: Record<string, unknown> | undefined;
|
|
1954
2128
|
links?: Record<string, string> | undefined;
|
|
@@ -2029,6 +2203,14 @@ export declare const weatherResponseSchema: z.ZodObject<{
|
|
|
2029
2203
|
fieldId?: string | null | undefined;
|
|
2030
2204
|
recommendation?: string | undefined;
|
|
2031
2205
|
}[] | undefined;
|
|
2206
|
+
rainTodayMM?: number | undefined;
|
|
2207
|
+
rainLast1hMM?: number | undefined;
|
|
2208
|
+
expectedTodayRainMM?: number | undefined;
|
|
2209
|
+
provenance?: {
|
|
2210
|
+
updatedAt: string;
|
|
2211
|
+
location: string;
|
|
2212
|
+
provider: string;
|
|
2213
|
+
} | undefined;
|
|
2032
2214
|
};
|
|
2033
2215
|
relationships?: Record<string, unknown> | undefined;
|
|
2034
2216
|
links?: Record<string, string> | undefined;
|
|
@@ -2095,6 +2277,14 @@ export declare const weatherResponseSchema: z.ZodObject<{
|
|
|
2095
2277
|
fieldId?: string | null | undefined;
|
|
2096
2278
|
recommendation?: string | undefined;
|
|
2097
2279
|
}[] | undefined;
|
|
2280
|
+
rainTodayMM?: number | undefined;
|
|
2281
|
+
rainLast1hMM?: number | undefined;
|
|
2282
|
+
expectedTodayRainMM?: number | undefined;
|
|
2283
|
+
provenance?: {
|
|
2284
|
+
updatedAt: string;
|
|
2285
|
+
location: string;
|
|
2286
|
+
provider: string;
|
|
2287
|
+
} | undefined;
|
|
2098
2288
|
};
|
|
2099
2289
|
relationships?: Record<string, unknown> | undefined;
|
|
2100
2290
|
links?: Record<string, string> | undefined;
|
|
@@ -2116,6 +2306,7 @@ export type WeatherAlertSeverity = z.infer<typeof weatherAlertSeveritySchema>;
|
|
|
2116
2306
|
export type CurrentWeather = z.infer<typeof currentWeatherSchema>;
|
|
2117
2307
|
export type WeatherForecast = z.infer<typeof weatherForecastSchema>;
|
|
2118
2308
|
export type WeatherAlert = z.infer<typeof weatherAlertSchema>;
|
|
2309
|
+
export type WeatherProvenance = z.infer<typeof weatherProvenanceSchema>;
|
|
2119
2310
|
export type WeatherAttributes = z.infer<typeof weatherAttributesSchema>;
|
|
2120
2311
|
export type WeatherResource = z.infer<typeof weatherResourceSchema>;
|
|
2121
2312
|
export type WeatherResponse = z.infer<typeof weatherResponseSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weather.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/weather.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AAGH,eAAO,MAAM,sBAAsB,kEAAgE,CAAC;AAGpG,eAAO,MAAM,0BAA0B,sCAAoC,CAAC;AAG5E,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"weather.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/weather.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AAGH,eAAO,MAAM,sBAAsB,kEAAgE,CAAC;AAGpG,eAAO,MAAM,0BAA0B,sCAAoC,CAAC;AAG5E,eAAO,MAAM,oBAAoB;;;;IAI/B,kDAAkD;;;;;;;;;;;;;;;EAGlD,CAAC;AAGH,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E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
|
|
@@ -13,15 +13,18 @@ export const currentWeatherSchema = z.object({
|
|
|
13
13
|
temp: z.number(),
|
|
14
14
|
condition: z.string(), // e.g., "Sunny", "Partly Cloudy"
|
|
15
15
|
icon: z.string().url().optional(),
|
|
16
|
-
|
|
16
|
+
/** Last 1 hour precip (mm) — not "rain today". */
|
|
17
|
+
rainfall: z.number().nonnegative().optional(),
|
|
17
18
|
humidity: z.number().min(0).max(100).optional(), // percentage
|
|
18
19
|
});
|
|
19
20
|
// Weather forecast
|
|
20
21
|
export const weatherForecastSchema = z.object({
|
|
21
22
|
day: z.string(), // e.g., "Today", "Tomorrow", "Sat"
|
|
22
23
|
temp: z.number(),
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
/** Probability of precipitation (0–100). Not rainfall amount. */
|
|
25
|
+
rain: z.number().min(0).max(100).optional(),
|
|
26
|
+
/** Expected daily rainfall volume (mm). */
|
|
27
|
+
rainfall: z.number().nonnegative().optional(),
|
|
25
28
|
condition: z.string().optional(),
|
|
26
29
|
});
|
|
27
30
|
// Weather alert
|
|
@@ -36,12 +39,28 @@ export const weatherAlertSchema = z.object({
|
|
|
36
39
|
recommendation: z.string().optional(),
|
|
37
40
|
recommendations: z.array(recommendationSchema).optional(),
|
|
38
41
|
});
|
|
42
|
+
export const weatherProvenanceSchema = z.object({
|
|
43
|
+
provider: z.string(),
|
|
44
|
+
location: z.string(),
|
|
45
|
+
updatedAt: z.string().datetime(),
|
|
46
|
+
});
|
|
39
47
|
// Weather attributes schema (for JSON:API attributes object)
|
|
40
48
|
export const weatherAttributesSchema = z.object({
|
|
41
49
|
farmId: z.string().uuid(),
|
|
42
50
|
current: currentWeatherSchema,
|
|
43
51
|
forecast: z.array(weatherForecastSchema),
|
|
44
52
|
alerts: z.array(weatherAlertSchema).optional(),
|
|
53
|
+
/**
|
|
54
|
+
* Best-effort observed precip for local today (mm).
|
|
55
|
+
* One Call hourly is mostly forward-looking, so this is often only the current 1h bucket
|
|
56
|
+
* when past hours are unavailable. Omitted when unknown — never invent 0.
|
|
57
|
+
*/
|
|
58
|
+
rainTodayMM: z.number().nonnegative().optional(),
|
|
59
|
+
/** Last 1h precip (mm). Same as current.rainfall; explicit for irrigate decisions. */
|
|
60
|
+
rainLast1hMM: z.number().nonnegative().optional(),
|
|
61
|
+
/** Forecast expected rain for calendar today (mm) — forecast[0].rainfall. */
|
|
62
|
+
expectedTodayRainMM: z.number().nonnegative().optional(),
|
|
63
|
+
provenance: weatherProvenanceSchema.optional(),
|
|
45
64
|
});
|
|
46
65
|
export const plannerRiskLevelSchema = z.enum(['low', 'medium', 'high']);
|
|
47
66
|
export const plannerActivityScoreSchema = z.object({
|