@deepintel-ltd/farmpro-contracts 1.34.0 → 1.34.2

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crop-care.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/crop-care.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAWZ,CAAC;AAEjB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAMZ,CAAC;AAEjB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAUf,CAAC;AAEjB,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { z } from 'zod';
2
+ export const careStageSchema = z
3
+ .object({
4
+ id: z.string(),
5
+ label: z.string(),
6
+ railLabel: z.string(),
7
+ dayStart: z.number(),
8
+ dayEnd: z.number(),
9
+ summary: z.string(),
10
+ tasks: z.array(z.string()),
11
+ checks: z.array(z.string()),
12
+ })
13
+ .passthrough();
14
+ export const carePhaseSchema = z
15
+ .object({
16
+ dayZero: z.string(),
17
+ dayOrigin: z.union([z.literal(0), z.literal(1)]),
18
+ stages: z.array(careStageSchema),
19
+ })
20
+ .passthrough();
21
+ export const carePlanSchema = z
22
+ .object({
23
+ id: z.string(),
24
+ cropIds: z.array(z.string()),
25
+ depth: z.enum(['pepper', 'stage-card', 'generic']),
26
+ oneLineRule: z.string(),
27
+ source: z.string(),
28
+ seasonLengthDays: z.number(),
29
+ aliases: z.array(z.string()).optional(),
30
+ nursery: carePhaseSchema.optional(),
31
+ field: carePhaseSchema,
32
+ weekPlan: z
33
+ .object({
34
+ kind: z.string(),
35
+ stripLabel: z.string(),
36
+ note: z.string().optional(),
37
+ generator: z.string().optional(),
38
+ actions: z
39
+ .array(z
40
+ .object({
41
+ id: z.string(),
42
+ label: z.string(),
43
+ dayStart: z.number(),
44
+ dayEnd: z.number(),
45
+ detail: z.string(),
46
+ })
47
+ .passthrough())
48
+ .optional(),
49
+ })
50
+ .passthrough()
51
+ .optional(),
52
+ })
53
+ .passthrough();
54
+ export const resolvedCareSchema = z
55
+ .object({
56
+ origin: z.enum(['file', 'database', 'generic']),
57
+ plan: carePlanSchema,
58
+ phase: z.enum(['nursery', 'field']),
59
+ day: z.number().nullable(),
60
+ stage: careStageSchema,
61
+ needsDate: z.boolean(),
62
+ assumedTransplant: z.boolean().optional(),
63
+ })
64
+ .passthrough();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepintel-ltd/farmpro-contracts",
3
- "version": "1.34.0",
3
+ "version": "1.34.2",
4
4
  "description": "Type-safe API contracts for FarmPro API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",