@deepintel-ltd/farmpro-contracts 1.0.1 → 1.0.3
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/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +81 -0
- package/dist/routes/analytics.routes.d.ts +754 -0
- package/dist/routes/analytics.routes.d.ts.map +1 -0
- package/dist/routes/analytics.routes.js +24 -0
- package/dist/routes/auth.routes.d.ts +3836 -0
- package/dist/routes/auth.routes.d.ts.map +1 -0
- package/dist/routes/auth.routes.js +158 -0
- package/dist/routes/documents.routes.d.ts +2476 -0
- package/dist/routes/documents.routes.d.ts.map +1 -0
- package/dist/routes/documents.routes.js +100 -0
- package/dist/routes/equipment.routes.d.ts +3617 -0
- package/dist/routes/equipment.routes.d.ts.map +1 -0
- package/dist/routes/equipment.routes.js +118 -0
- package/dist/routes/farms.routes.d.ts +2202 -0
- package/dist/routes/farms.routes.d.ts.map +1 -0
- package/dist/routes/farms.routes.js +111 -0
- package/dist/routes/fields.routes.d.ts +3389 -0
- package/dist/routes/fields.routes.d.ts.map +1 -0
- package/dist/routes/fields.routes.js +95 -0
- package/dist/routes/finance.routes.d.ts +6855 -0
- package/dist/routes/finance.routes.d.ts.map +1 -0
- package/dist/routes/finance.routes.js +259 -0
- package/dist/routes/harvest.routes.d.ts +2337 -0
- package/dist/routes/harvest.routes.d.ts.map +1 -0
- package/dist/routes/harvest.routes.js +99 -0
- package/dist/routes/index.d.ts +68 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +43 -0
- package/dist/routes/inventory.routes.d.ts +2853 -0
- package/dist/routes/inventory.routes.d.ts.map +1 -0
- package/dist/routes/inventory.routes.js +121 -0
- package/dist/routes/soil-tests.routes.d.ts +3005 -0
- package/dist/routes/soil-tests.routes.d.ts.map +1 -0
- package/dist/routes/soil-tests.routes.js +98 -0
- package/dist/routes/suppliers.routes.d.ts +4190 -0
- package/dist/routes/suppliers.routes.d.ts.map +1 -0
- package/dist/routes/suppliers.routes.js +146 -0
- package/dist/routes/tasks.routes.d.ts +4192 -0
- package/dist/routes/tasks.routes.d.ts.map +1 -0
- package/dist/routes/tasks.routes.js +138 -0
- package/dist/routes/team.routes.d.ts +2210 -0
- package/dist/routes/team.routes.d.ts.map +1 -0
- package/dist/routes/team.routes.js +98 -0
- package/dist/routes/users.routes.d.ts +721 -0
- package/dist/routes/users.routes.d.ts.map +1 -0
- package/dist/routes/users.routes.js +35 -0
- package/dist/routes/weather.routes.d.ts +500 -0
- package/dist/routes/weather.routes.d.ts.map +1 -0
- package/dist/routes/weather.routes.js +23 -0
- package/dist/schemas/analytics.schemas.d.ts +1344 -0
- package/dist/schemas/analytics.schemas.d.ts.map +1 -0
- package/dist/schemas/analytics.schemas.js +73 -0
- package/dist/schemas/auth.schemas.d.ts +1093 -0
- package/dist/schemas/auth.schemas.d.ts.map +1 -0
- package/dist/schemas/auth.schemas.js +159 -0
- package/dist/schemas/common.schemas.d.ts +562 -0
- package/dist/schemas/common.schemas.d.ts.map +1 -0
- package/dist/schemas/common.schemas.js +122 -0
- package/dist/schemas/documents.schemas.d.ts +850 -0
- package/dist/schemas/documents.schemas.d.ts.map +1 -0
- package/dist/schemas/documents.schemas.js +75 -0
- package/dist/schemas/equipment.schemas.d.ts +1618 -0
- package/dist/schemas/equipment.schemas.d.ts.map +1 -0
- package/dist/schemas/equipment.schemas.js +125 -0
- package/dist/schemas/farms.schemas.d.ts +1171 -0
- package/dist/schemas/farms.schemas.d.ts.map +1 -0
- package/dist/schemas/farms.schemas.js +62 -0
- package/dist/schemas/fields.schemas.d.ts +2508 -0
- package/dist/schemas/fields.schemas.d.ts.map +1 -0
- package/dist/schemas/fields.schemas.js +125 -0
- package/dist/schemas/finance.schemas.d.ts +2869 -0
- package/dist/schemas/finance.schemas.d.ts.map +1 -0
- package/dist/schemas/finance.schemas.js +196 -0
- package/dist/schemas/harvest.schemas.d.ts +1051 -0
- package/dist/schemas/harvest.schemas.d.ts.map +1 -0
- package/dist/schemas/harvest.schemas.js +71 -0
- package/dist/schemas/inventory.schemas.d.ts +1138 -0
- package/dist/schemas/inventory.schemas.d.ts.map +1 -0
- package/dist/schemas/inventory.schemas.js +89 -0
- package/dist/schemas/soil-tests.schemas.d.ts +1885 -0
- package/dist/schemas/soil-tests.schemas.d.ts.map +1 -0
- package/dist/schemas/soil-tests.schemas.js +102 -0
- package/dist/schemas/suppliers.schemas.d.ts +1774 -0
- package/dist/schemas/suppliers.schemas.d.ts.map +1 -0
- package/dist/schemas/suppliers.schemas.js +121 -0
- package/dist/schemas/tasks.schemas.d.ts +1761 -0
- package/dist/schemas/tasks.schemas.d.ts.map +1 -0
- package/dist/schemas/tasks.schemas.js +121 -0
- package/dist/schemas/team.schemas.d.ts +583 -0
- package/dist/schemas/team.schemas.d.ts.map +1 -0
- package/dist/schemas/team.schemas.js +60 -0
- package/dist/schemas/users.schemas.d.ts +288 -0
- package/dist/schemas/users.schemas.d.ts.map +1 -0
- package/dist/schemas/users.schemas.js +32 -0
- package/dist/schemas/weather.schemas.d.ts +682 -0
- package/dist/schemas/weather.schemas.d.ts.map +1 -0
- package/dist/schemas/weather.schemas.js +49 -0
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.weatherResponseSchema = exports.weatherResourceSchema = exports.weatherAttributesSchema = exports.weatherAlertSchema = exports.weatherForecastSchema = exports.currentWeatherSchema = exports.weatherAlertSeveritySchema = exports.weatherAlertTypeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_schemas_1 = require("./common.schemas");
|
|
6
|
+
/**
|
|
7
|
+
* Weather schemas - JSON:API compliant
|
|
8
|
+
*/
|
|
9
|
+
// Weather alert type enum
|
|
10
|
+
exports.weatherAlertTypeSchema = zod_1.z.enum(['drought', 'heavy-rain', 'frost', 'optimal', 'wind']);
|
|
11
|
+
// Weather alert severity enum
|
|
12
|
+
exports.weatherAlertSeveritySchema = zod_1.z.enum(['high', 'medium', 'low']);
|
|
13
|
+
// Current weather
|
|
14
|
+
exports.currentWeatherSchema = zod_1.z.object({
|
|
15
|
+
temp: zod_1.z.number(),
|
|
16
|
+
condition: zod_1.z.string(), // e.g., "Sunny", "Partly Cloudy"
|
|
17
|
+
icon: zod_1.z.string().url().optional(),
|
|
18
|
+
rainfall: zod_1.z.number().nonnegative().optional(), // mm of rainfall
|
|
19
|
+
humidity: zod_1.z.number().min(0).max(100).optional(), // percentage
|
|
20
|
+
});
|
|
21
|
+
// Weather forecast
|
|
22
|
+
exports.weatherForecastSchema = zod_1.z.object({
|
|
23
|
+
day: zod_1.z.string(), // e.g., "Today", "Tomorrow", "Sat"
|
|
24
|
+
temp: zod_1.z.number(),
|
|
25
|
+
rain: zod_1.z.number().min(0).max(100).optional(), // percentage chance
|
|
26
|
+
rainfall: zod_1.z.number().nonnegative().optional(), // mm of rainfall
|
|
27
|
+
condition: zod_1.z.string().optional(),
|
|
28
|
+
});
|
|
29
|
+
// Weather alert
|
|
30
|
+
exports.weatherAlertSchema = zod_1.z.object({
|
|
31
|
+
id: zod_1.z.string().uuid(),
|
|
32
|
+
type: exports.weatherAlertTypeSchema,
|
|
33
|
+
severity: exports.weatherAlertSeveritySchema,
|
|
34
|
+
message: zod_1.z.string(),
|
|
35
|
+
fieldId: zod_1.z.string().uuid().nullable().optional(), // Field-specific alerts
|
|
36
|
+
date: zod_1.z.string().datetime(),
|
|
37
|
+
recommendation: zod_1.z.string().optional(),
|
|
38
|
+
});
|
|
39
|
+
// Weather attributes schema (for JSON:API attributes object)
|
|
40
|
+
exports.weatherAttributesSchema = zod_1.z.object({
|
|
41
|
+
farmId: zod_1.z.string().uuid(),
|
|
42
|
+
current: exports.currentWeatherSchema,
|
|
43
|
+
forecast: zod_1.z.array(exports.weatherForecastSchema),
|
|
44
|
+
alerts: zod_1.z.array(exports.weatherAlertSchema).optional(),
|
|
45
|
+
});
|
|
46
|
+
// Weather resource (JSON:API resource object)
|
|
47
|
+
exports.weatherResourceSchema = (0, common_schemas_1.createJsonApiResourceSchema)('weather', exports.weatherAttributesSchema);
|
|
48
|
+
// Weather response (JSON:API format)
|
|
49
|
+
exports.weatherResponseSchema = (0, common_schemas_1.jsonApiSingleResponseSchema)(exports.weatherResourceSchema);
|