@deepintel-ltd/farmpro-contracts 1.36.3 → 1.36.4
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 +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/routes/farm-fertilizers.routes.d.ts +1139 -0
- package/dist/routes/{fertilizer-stock.routes.d.ts.map → farm-fertilizers.routes.d.ts.map} +1 -1
- package/dist/routes/{fertilizer-stock.routes.js → farm-fertilizers.routes.js} +16 -9
- package/dist/routes/index.d.ts +3 -3
- package/dist/routes/index.js +2 -2
- package/dist/routes/integrations.routes.d.ts +4 -4
- package/dist/schemas/farm-fertilizers.schemas.d.ts +1174 -0
- package/dist/schemas/farm-fertilizers.schemas.d.ts.map +1 -0
- package/dist/schemas/{fertilizer-stock.schemas.js → farm-fertilizers.schemas.js} +60 -35
- package/dist/schemas/integrations.schemas.d.ts +6 -6
- package/package.json +1 -1
- package/dist/routes/fertilizer-stock.routes.d.ts +0 -868
- package/dist/schemas/fertilizer-stock.schemas.d.ts +0 -855
- package/dist/schemas/fertilizer-stock.schemas.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"farm-fertilizers.routes.d.ts","sourceRoot":"","sources":["../../src/routes/farm-fertilizers.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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izerBodySchema, farmFertilizerListSchema, farmFertilizerSchema,
|
|
3
|
+
import { createFarmFertilizerBodySchema, farmFertilizerListSchema, farmFertilizerSchema, fertilizerRequirementsResponseSchema, updateFarmFertilizerBodySchema, } from '../schemas/farm-fertilizers.schemas';
|
|
4
4
|
const c = initContract();
|
|
5
5
|
const message = z.object({ message: z.string() });
|
|
6
6
|
const farmParams = z.object({ farmId: z.string().min(1) });
|
|
7
7
|
/**
|
|
8
|
-
* The fertilizers a farm has on hand. Reading a bag photo is `POST /farms/:farmId/fertilizers/
|
|
9
|
-
* multipart upload (`photos`, one to four images) that returns a `
|
|
8
|
+
* The fertilizers a farm has on hand. Reading a bag photo is `POST /farms/:farmId/fertilizers/label-readings`, a
|
|
9
|
+
* multipart upload (`photos`, one to four images) that returns a `fertilizerLabelDraftSchema`; it sits outside this
|
|
10
10
|
* contract because ts-rest does not describe multipart bodies.
|
|
11
11
|
*/
|
|
12
|
-
export const
|
|
12
|
+
export const farmFertilizersRouter = c.router({
|
|
13
13
|
list: {
|
|
14
14
|
method: 'GET',
|
|
15
15
|
path: '/farms/:farmId/fertilizers',
|
|
@@ -37,12 +37,19 @@ export const fertilizerStockRouter = c.router({
|
|
|
37
37
|
method: 'DELETE',
|
|
38
38
|
path: '/farms/:farmId/fertilizers/:fertilizerId',
|
|
39
39
|
pathParams: z.object({ farmId: z.string().min(1), fertilizerId: z.string().min(1) }),
|
|
40
|
-
responses: {
|
|
40
|
+
responses: {
|
|
41
|
+
200: z.object({
|
|
42
|
+
success: z.literal(true),
|
|
43
|
+
/** True when the fertilizer's inventory item was kept because it has purchases or usage logged against it. */
|
|
44
|
+
stockHistoryKept: z.boolean(),
|
|
45
|
+
}),
|
|
46
|
+
404: message,
|
|
47
|
+
},
|
|
41
48
|
summary: 'Remove a fertilizer from the farm',
|
|
42
49
|
},
|
|
43
|
-
|
|
50
|
+
requirementsForField: {
|
|
44
51
|
method: 'GET',
|
|
45
|
-
path: '/farms/:farmId/fields/:fieldId/fertilizer-
|
|
52
|
+
path: '/farms/:farmId/fields/:fieldId/fertilizer-requirements',
|
|
46
53
|
pathParams: z.object({ farmId: z.string().min(1), fieldId: z.string().min(1) }),
|
|
47
54
|
query: z.object({
|
|
48
55
|
today: z
|
|
@@ -50,7 +57,7 @@ export const fertilizerStockRouter = c.router({
|
|
|
50
57
|
.regex(/^\d{4}-\d{2}-\d{2}/)
|
|
51
58
|
.optional(),
|
|
52
59
|
}),
|
|
53
|
-
responses: { 200:
|
|
54
|
-
summary: '
|
|
60
|
+
responses: { 200: fertilizerRequirementsResponseSchema, 404: message },
|
|
61
|
+
summary: 'What a field needs from each fertilizer: doses, farm-wide need, stock, purchase, and guidance',
|
|
55
62
|
},
|
|
56
63
|
});
|
package/dist/routes/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ import { measurementsRouter } from './measurements.routes';
|
|
|
44
44
|
import { cropProfilesRouter } from './crop-profile.routes';
|
|
45
45
|
import { cropCareRouter } from './crop-care.routes';
|
|
46
46
|
import { nutrientPlanRouter } from './nutrient-plan.routes';
|
|
47
|
-
import {
|
|
47
|
+
import { farmFertilizersRouter } from './farm-fertilizers.routes';
|
|
48
48
|
import { orchardPlanRouter } from './orchard-plan.routes';
|
|
49
49
|
import { irrigationRouter } from './irrigation.routes';
|
|
50
50
|
import { yieldPredictionRouter } from './yield-prediction.routes';
|
|
@@ -127,7 +127,7 @@ export interface ApiContractDefinition {
|
|
|
127
127
|
cropProfiles: typeof cropProfilesRouter;
|
|
128
128
|
cropCare: typeof cropCareRouter;
|
|
129
129
|
nutrientPlan: typeof nutrientPlanRouter;
|
|
130
|
-
|
|
130
|
+
farmFertilizers: typeof farmFertilizersRouter;
|
|
131
131
|
orchardPlan: typeof orchardPlanRouter;
|
|
132
132
|
irrigation: typeof irrigationRouter;
|
|
133
133
|
yieldPrediction: typeof yieldPredictionRouter;
|
|
@@ -218,7 +218,7 @@ export type MeasurementsEndpoints = ApiContractType['measurements'];
|
|
|
218
218
|
export type CropProfilesEndpoints = ApiContractType['cropProfiles'];
|
|
219
219
|
export type CropCareEndpoints = ApiContractType['cropCare'];
|
|
220
220
|
export type NutrientPlanEndpoints = ApiContractType['nutrientPlan'];
|
|
221
|
-
export type
|
|
221
|
+
export type FarmFertilizersEndpoints = ApiContractType['farmFertilizers'];
|
|
222
222
|
export type OrchardPlanEndpoints = ApiContractType['orchardPlan'];
|
|
223
223
|
export type IrrigationEndpoints = ApiContractType['irrigation'];
|
|
224
224
|
export type YieldPredictionEndpoints = ApiContractType['yieldPrediction'];
|
package/dist/routes/index.js
CHANGED
|
@@ -45,7 +45,7 @@ import { measurementsRouter } from './measurements.routes';
|
|
|
45
45
|
import { cropProfilesRouter } from './crop-profile.routes';
|
|
46
46
|
import { cropCareRouter } from './crop-care.routes';
|
|
47
47
|
import { nutrientPlanRouter } from './nutrient-plan.routes';
|
|
48
|
-
import {
|
|
48
|
+
import { farmFertilizersRouter } from './farm-fertilizers.routes';
|
|
49
49
|
import { orchardPlanRouter } from './orchard-plan.routes';
|
|
50
50
|
import { irrigationRouter } from './irrigation.routes';
|
|
51
51
|
import { yieldPredictionRouter } from './yield-prediction.routes';
|
|
@@ -130,7 +130,7 @@ export const apiContract = c.router({
|
|
|
130
130
|
cropProfiles: cropProfilesRouter,
|
|
131
131
|
cropCare: cropCareRouter,
|
|
132
132
|
nutrientPlan: nutrientPlanRouter,
|
|
133
|
-
|
|
133
|
+
farmFertilizers: farmFertilizersRouter,
|
|
134
134
|
orchardPlan: orchardPlanRouter,
|
|
135
135
|
irrigation: irrigationRouter,
|
|
136
136
|
yieldPrediction: yieldPredictionRouter,
|
|
@@ -1178,6 +1178,7 @@ export declare const integrationsRouter: {
|
|
|
1178
1178
|
source: string;
|
|
1179
1179
|
summary: string | null;
|
|
1180
1180
|
disease: string;
|
|
1181
|
+
guidance: string[];
|
|
1181
1182
|
species: string[];
|
|
1182
1183
|
admin1: string | null;
|
|
1183
1184
|
admin2: string | null;
|
|
@@ -1187,13 +1188,13 @@ export declare const integrationsRouter: {
|
|
|
1187
1188
|
sourceUrl: string | null;
|
|
1188
1189
|
diseaseKey: string;
|
|
1189
1190
|
notifiable: boolean;
|
|
1190
|
-
guidance: string[];
|
|
1191
1191
|
}, {
|
|
1192
1192
|
status: string;
|
|
1193
1193
|
id: string;
|
|
1194
1194
|
source: string;
|
|
1195
1195
|
summary: string | null;
|
|
1196
1196
|
disease: string;
|
|
1197
|
+
guidance: string[];
|
|
1197
1198
|
species: string[];
|
|
1198
1199
|
admin1: string | null;
|
|
1199
1200
|
admin2: string | null;
|
|
@@ -1203,7 +1204,6 @@ export declare const integrationsRouter: {
|
|
|
1203
1204
|
sourceUrl: string | null;
|
|
1204
1205
|
diseaseKey: string;
|
|
1205
1206
|
notifiable: boolean;
|
|
1206
|
-
guidance: string[];
|
|
1207
1207
|
}>, "many">;
|
|
1208
1208
|
}, "strip", z.ZodTypeAny, {
|
|
1209
1209
|
data: {
|
|
@@ -1212,6 +1212,7 @@ export declare const integrationsRouter: {
|
|
|
1212
1212
|
source: string;
|
|
1213
1213
|
summary: string | null;
|
|
1214
1214
|
disease: string;
|
|
1215
|
+
guidance: string[];
|
|
1215
1216
|
species: string[];
|
|
1216
1217
|
admin1: string | null;
|
|
1217
1218
|
admin2: string | null;
|
|
@@ -1221,7 +1222,6 @@ export declare const integrationsRouter: {
|
|
|
1221
1222
|
sourceUrl: string | null;
|
|
1222
1223
|
diseaseKey: string;
|
|
1223
1224
|
notifiable: boolean;
|
|
1224
|
-
guidance: string[];
|
|
1225
1225
|
}[];
|
|
1226
1226
|
}, {
|
|
1227
1227
|
data: {
|
|
@@ -1230,6 +1230,7 @@ export declare const integrationsRouter: {
|
|
|
1230
1230
|
source: string;
|
|
1231
1231
|
summary: string | null;
|
|
1232
1232
|
disease: string;
|
|
1233
|
+
guidance: string[];
|
|
1233
1234
|
species: string[];
|
|
1234
1235
|
admin1: string | null;
|
|
1235
1236
|
admin2: string | null;
|
|
@@ -1239,7 +1240,6 @@ export declare const integrationsRouter: {
|
|
|
1239
1240
|
sourceUrl: string | null;
|
|
1240
1241
|
diseaseKey: string;
|
|
1241
1242
|
notifiable: boolean;
|
|
1242
|
-
guidance: string[];
|
|
1243
1243
|
}[];
|
|
1244
1244
|
}>;
|
|
1245
1245
|
401: z.ZodObject<{
|