@deepintel-ltd/farmpro-contracts 1.7.6 → 1.7.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/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/routes/crop-profile.routes.d.ts +556 -0
- package/dist/routes/crop-profile.routes.d.ts.map +1 -0
- package/dist/routes/crop-profile.routes.js +55 -0
- package/dist/routes/geofences.routes.d.ts +1913 -0
- package/dist/routes/geofences.routes.d.ts.map +1 -0
- package/dist/routes/geofences.routes.js +105 -0
- package/dist/routes/index.d.ts +15 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +10 -0
- package/dist/routes/livestock-map.routes.d.ts +1319 -0
- package/dist/routes/livestock-map.routes.d.ts.map +1 -0
- package/dist/routes/livestock-map.routes.js +83 -0
- package/dist/routes/measurements.routes.d.ts +1081 -0
- package/dist/routes/measurements.routes.d.ts.map +1 -0
- package/dist/routes/measurements.routes.js +69 -0
- package/dist/routes/monitoring-visualization.routes.d.ts +1637 -0
- package/dist/routes/monitoring-visualization.routes.d.ts.map +1 -1
- package/dist/routes/monitoring-visualization.routes.js +153 -0
- package/dist/routes/prescription-maps.routes.d.ts +3092 -0
- package/dist/routes/prescription-maps.routes.d.ts.map +1 -0
- package/dist/routes/prescription-maps.routes.js +143 -0
- package/dist/schemas/crop-profile.schemas.d.ts +724 -0
- package/dist/schemas/crop-profile.schemas.d.ts.map +1 -0
- package/dist/schemas/crop-profile.schemas.js +84 -0
- package/dist/schemas/geofences.schemas.d.ts +358 -0
- package/dist/schemas/geofences.schemas.d.ts.map +1 -0
- package/dist/schemas/geofences.schemas.js +44 -0
- package/dist/schemas/livestock-map.schemas.d.ts +328 -0
- package/dist/schemas/livestock-map.schemas.d.ts.map +1 -0
- package/dist/schemas/livestock-map.schemas.js +52 -0
- package/dist/schemas/measurements.schemas.d.ts +234 -0
- package/dist/schemas/measurements.schemas.d.ts.map +1 -0
- package/dist/schemas/measurements.schemas.js +57 -0
- package/dist/schemas/monitoring-visualization.schemas.d.ts +1703 -0
- package/dist/schemas/monitoring-visualization.schemas.d.ts.map +1 -1
- package/dist/schemas/monitoring-visualization.schemas.js +338 -0
- package/dist/schemas/prescription-maps.schemas.d.ts +974 -0
- package/dist/schemas/prescription-maps.schemas.d.ts.map +1 -0
- package/dist/schemas/prescription-maps.schemas.js +132 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prescription-maps.routes.d.ts","sourceRoot":"","sources":["../../src/routes/prescription-maps.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2IjC,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { initContract } from '@ts-rest/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { prescriptionMapListResponseSchema, prescriptionMapSingleResponseSchema, createPrescriptionMapBodySchema, updatePrescriptionStatusBodySchema, generateZonesRequestSchema, zoneStatsResponseSchema, exportRequestSchema, exportResponseSchema, exportListResponseSchema, } from '../schemas/prescription-maps.schemas';
|
|
4
|
+
import { jsonApiErrorResponseSchema } from '../schemas/common.schemas';
|
|
5
|
+
const c = initContract();
|
|
6
|
+
export const prescriptionMapsRouter = c.router({
|
|
7
|
+
// ==========================================================================
|
|
8
|
+
// Existing Endpoints
|
|
9
|
+
// ==========================================================================
|
|
10
|
+
list: {
|
|
11
|
+
method: 'GET',
|
|
12
|
+
path: '/farms/:farmId/fields/:fieldId/prescription-maps',
|
|
13
|
+
pathParams: z.object({
|
|
14
|
+
farmId: z.string().uuid(),
|
|
15
|
+
fieldId: z.string().uuid(),
|
|
16
|
+
}),
|
|
17
|
+
responses: {
|
|
18
|
+
200: prescriptionMapListResponseSchema,
|
|
19
|
+
403: jsonApiErrorResponseSchema,
|
|
20
|
+
404: jsonApiErrorResponseSchema,
|
|
21
|
+
},
|
|
22
|
+
summary: 'List prescription maps for a field',
|
|
23
|
+
},
|
|
24
|
+
getOne: {
|
|
25
|
+
method: 'GET',
|
|
26
|
+
path: '/farms/:farmId/fields/:fieldId/prescription-maps/:prescriptionId',
|
|
27
|
+
pathParams: z.object({
|
|
28
|
+
farmId: z.string().uuid(),
|
|
29
|
+
fieldId: z.string().uuid(),
|
|
30
|
+
prescriptionId: z.string().uuid(),
|
|
31
|
+
}),
|
|
32
|
+
responses: {
|
|
33
|
+
200: prescriptionMapSingleResponseSchema,
|
|
34
|
+
403: jsonApiErrorResponseSchema,
|
|
35
|
+
404: jsonApiErrorResponseSchema,
|
|
36
|
+
},
|
|
37
|
+
summary: 'Get prescription map by ID',
|
|
38
|
+
},
|
|
39
|
+
create: {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
path: '/farms/:farmId/fields/:fieldId/prescription-maps',
|
|
42
|
+
pathParams: z.object({
|
|
43
|
+
farmId: z.string().uuid(),
|
|
44
|
+
fieldId: z.string().uuid(),
|
|
45
|
+
}),
|
|
46
|
+
body: createPrescriptionMapBodySchema,
|
|
47
|
+
responses: {
|
|
48
|
+
201: prescriptionMapSingleResponseSchema,
|
|
49
|
+
400: jsonApiErrorResponseSchema,
|
|
50
|
+
403: jsonApiErrorResponseSchema,
|
|
51
|
+
404: jsonApiErrorResponseSchema,
|
|
52
|
+
},
|
|
53
|
+
summary: 'Create prescription map',
|
|
54
|
+
},
|
|
55
|
+
updateStatus: {
|
|
56
|
+
method: 'PATCH',
|
|
57
|
+
path: '/farms/:farmId/fields/:fieldId/prescription-maps/:prescriptionId/status',
|
|
58
|
+
pathParams: z.object({
|
|
59
|
+
farmId: z.string().uuid(),
|
|
60
|
+
fieldId: z.string().uuid(),
|
|
61
|
+
prescriptionId: z.string().uuid(),
|
|
62
|
+
}),
|
|
63
|
+
body: updatePrescriptionStatusBodySchema,
|
|
64
|
+
responses: {
|
|
65
|
+
204: z.object({}),
|
|
66
|
+
400: jsonApiErrorResponseSchema,
|
|
67
|
+
403: jsonApiErrorResponseSchema,
|
|
68
|
+
404: jsonApiErrorResponseSchema,
|
|
69
|
+
},
|
|
70
|
+
summary: 'Update prescription map status',
|
|
71
|
+
},
|
|
72
|
+
// ==========================================================================
|
|
73
|
+
// Zone Generation Endpoints
|
|
74
|
+
// ==========================================================================
|
|
75
|
+
generateZones: {
|
|
76
|
+
method: 'POST',
|
|
77
|
+
path: '/farms/:farmId/fields/:fieldId/prescription-maps/generate-zones',
|
|
78
|
+
pathParams: z.object({
|
|
79
|
+
farmId: z.string().uuid(),
|
|
80
|
+
fieldId: z.string().uuid(),
|
|
81
|
+
}),
|
|
82
|
+
body: generateZonesRequestSchema,
|
|
83
|
+
responses: {
|
|
84
|
+
201: prescriptionMapSingleResponseSchema,
|
|
85
|
+
400: jsonApiErrorResponseSchema,
|
|
86
|
+
403: jsonApiErrorResponseSchema,
|
|
87
|
+
404: jsonApiErrorResponseSchema,
|
|
88
|
+
500: jsonApiErrorResponseSchema,
|
|
89
|
+
},
|
|
90
|
+
summary: 'Generate management zones from data layers',
|
|
91
|
+
},
|
|
92
|
+
getZoneStats: {
|
|
93
|
+
method: 'GET',
|
|
94
|
+
path: '/farms/:farmId/fields/:fieldId/prescription-maps/:prescriptionId/zone-stats',
|
|
95
|
+
pathParams: z.object({
|
|
96
|
+
farmId: z.string().uuid(),
|
|
97
|
+
fieldId: z.string().uuid(),
|
|
98
|
+
prescriptionId: z.string().uuid(),
|
|
99
|
+
}),
|
|
100
|
+
responses: {
|
|
101
|
+
200: zoneStatsResponseSchema,
|
|
102
|
+
403: jsonApiErrorResponseSchema,
|
|
103
|
+
404: jsonApiErrorResponseSchema,
|
|
104
|
+
},
|
|
105
|
+
summary: 'Get zone statistics for prescription map',
|
|
106
|
+
},
|
|
107
|
+
// ==========================================================================
|
|
108
|
+
// Export Endpoints
|
|
109
|
+
// ==========================================================================
|
|
110
|
+
exportPrescription: {
|
|
111
|
+
method: 'POST',
|
|
112
|
+
path: '/farms/:farmId/fields/:fieldId/prescription-maps/:prescriptionId/export',
|
|
113
|
+
pathParams: z.object({
|
|
114
|
+
farmId: z.string().uuid(),
|
|
115
|
+
fieldId: z.string().uuid(),
|
|
116
|
+
prescriptionId: z.string().uuid(),
|
|
117
|
+
}),
|
|
118
|
+
body: exportRequestSchema,
|
|
119
|
+
responses: {
|
|
120
|
+
200: exportResponseSchema,
|
|
121
|
+
400: jsonApiErrorResponseSchema,
|
|
122
|
+
403: jsonApiErrorResponseSchema,
|
|
123
|
+
404: jsonApiErrorResponseSchema,
|
|
124
|
+
500: jsonApiErrorResponseSchema,
|
|
125
|
+
},
|
|
126
|
+
summary: 'Export prescription map to file format',
|
|
127
|
+
},
|
|
128
|
+
listExports: {
|
|
129
|
+
method: 'GET',
|
|
130
|
+
path: '/farms/:farmId/fields/:fieldId/prescription-maps/:prescriptionId/exports',
|
|
131
|
+
pathParams: z.object({
|
|
132
|
+
farmId: z.string().uuid(),
|
|
133
|
+
fieldId: z.string().uuid(),
|
|
134
|
+
prescriptionId: z.string().uuid(),
|
|
135
|
+
}),
|
|
136
|
+
responses: {
|
|
137
|
+
200: exportListResponseSchema,
|
|
138
|
+
403: jsonApiErrorResponseSchema,
|
|
139
|
+
404: jsonApiErrorResponseSchema,
|
|
140
|
+
},
|
|
141
|
+
summary: 'List all exports for a prescription map',
|
|
142
|
+
},
|
|
143
|
+
});
|