@deepintel-ltd/farmpro-contracts 1.5.11 → 1.5.13
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/agent-workflows.routes.d.ts +48 -42
- package/dist/routes/agent-workflows.routes.d.ts.map +1 -1
- package/dist/routes/agent-workflows.routes.js +17 -20
- package/dist/routes/agents.routes.d.ts +30 -17
- package/dist/routes/agents.routes.d.ts.map +1 -1
- package/dist/routes/agents.routes.js +32 -14
- package/dist/routes/field-observations.routes.d.ts +56 -48
- package/dist/routes/field-observations.routes.d.ts.map +1 -1
- package/dist/routes/finance.routes.d.ts +107 -2
- package/dist/routes/finance.routes.d.ts.map +1 -1
- package/dist/routes/finance.routes.js +2 -2
- package/dist/routes/soil-tests.routes.d.ts +688 -0
- package/dist/routes/soil-tests.routes.d.ts.map +1 -1
- package/dist/routes/soil-tests.routes.js +20 -0
- package/dist/routes/team.routes.d.ts +73 -3
- package/dist/routes/team.routes.d.ts.map +1 -1
- package/dist/routes/team.routes.js +2 -1
- package/dist/schemas/agents.schemas.d.ts +8 -0
- package/dist/schemas/agents.schemas.d.ts.map +1 -1
- package/dist/schemas/agents.schemas.js +3 -0
- package/dist/schemas/field-observations.schemas.d.ts +38 -24
- package/dist/schemas/field-observations.schemas.d.ts.map +1 -1
- package/dist/schemas/field-observations.schemas.js +9 -11
- package/dist/schemas/finance.schemas.d.ts +116 -0
- package/dist/schemas/finance.schemas.d.ts.map +1 -1
- package/dist/schemas/finance.schemas.js +11 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"soil-tests.routes.d.ts","sourceRoot":"","sources":["../../src/routes/soil-tests.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"soil-tests.routes.d.ts","sourceRoot":"","sources":["../../src/routes/soil-tests.routes.ts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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkH1B,CAAC"}
|
|
@@ -92,4 +92,24 @@ export const soilTestsRouter = c.router({
|
|
|
92
92
|
summary: 'Delete soil test',
|
|
93
93
|
description: 'Delete a soil test record',
|
|
94
94
|
},
|
|
95
|
+
// Upload soil sample file and extract data
|
|
96
|
+
uploadSoilSampleFile: {
|
|
97
|
+
method: 'POST',
|
|
98
|
+
path: '/farms/:farmId/soil-tests/upload-sample',
|
|
99
|
+
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
100
|
+
contentType: 'multipart/form-data',
|
|
101
|
+
body: z.object({
|
|
102
|
+
file: z.any(), // File type handled at runtime
|
|
103
|
+
fieldId: z.string().uuid(),
|
|
104
|
+
}),
|
|
105
|
+
responses: {
|
|
106
|
+
201: soilTestResponseSchema,
|
|
107
|
+
400: jsonApiErrorResponseSchema,
|
|
108
|
+
404: jsonApiErrorResponseSchema,
|
|
109
|
+
401: jsonApiErrorResponseSchema,
|
|
110
|
+
422: jsonApiErrorResponseSchema,
|
|
111
|
+
},
|
|
112
|
+
summary: 'Upload soil sample file',
|
|
113
|
+
description: 'Upload a PDF or DOCX soil sample file and automatically extract test results using AI',
|
|
114
|
+
},
|
|
95
115
|
});
|
|
@@ -2588,21 +2588,91 @@ export declare const teamRouter: {
|
|
|
2588
2588
|
farmId: string;
|
|
2589
2589
|
memberId: string;
|
|
2590
2590
|
}>;
|
|
2591
|
-
data: z.ZodOptional<z.ZodArray<z.
|
|
2591
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2592
|
+
type: z.ZodLiteral<string>;
|
|
2593
|
+
id: z.ZodString;
|
|
2594
|
+
attributes: z.ZodObject<{
|
|
2595
|
+
accessToken: z.ZodString;
|
|
2596
|
+
refreshToken: z.ZodString;
|
|
2597
|
+
expiresIn: z.ZodNumber;
|
|
2598
|
+
tokenType: z.ZodDefault<z.ZodLiteral<"Bearer">>;
|
|
2599
|
+
}, "strip", z.ZodTypeAny, {
|
|
2600
|
+
refreshToken: string;
|
|
2601
|
+
accessToken: string;
|
|
2602
|
+
expiresIn: number;
|
|
2603
|
+
tokenType: "Bearer";
|
|
2604
|
+
}, {
|
|
2605
|
+
refreshToken: string;
|
|
2606
|
+
accessToken: string;
|
|
2607
|
+
expiresIn: number;
|
|
2608
|
+
tokenType?: "Bearer" | undefined;
|
|
2609
|
+
}>;
|
|
2610
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2611
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2612
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2613
|
+
}, "strip", z.ZodTypeAny, {
|
|
2614
|
+
type: string;
|
|
2615
|
+
id: string;
|
|
2616
|
+
attributes: {
|
|
2617
|
+
refreshToken: string;
|
|
2618
|
+
accessToken: string;
|
|
2619
|
+
expiresIn: number;
|
|
2620
|
+
tokenType: "Bearer";
|
|
2621
|
+
};
|
|
2622
|
+
relationships?: Record<string, unknown> | undefined;
|
|
2623
|
+
links?: Record<string, string> | undefined;
|
|
2624
|
+
meta?: Record<string, unknown> | undefined;
|
|
2625
|
+
}, {
|
|
2626
|
+
type: string;
|
|
2627
|
+
id: string;
|
|
2628
|
+
attributes: {
|
|
2629
|
+
refreshToken: string;
|
|
2630
|
+
accessToken: string;
|
|
2631
|
+
expiresIn: number;
|
|
2632
|
+
tokenType?: "Bearer" | undefined;
|
|
2633
|
+
};
|
|
2634
|
+
relationships?: Record<string, unknown> | undefined;
|
|
2635
|
+
links?: Record<string, string> | undefined;
|
|
2636
|
+
meta?: Record<string, unknown> | undefined;
|
|
2637
|
+
}>, "many">>;
|
|
2592
2638
|
}, "strip", z.ZodTypeAny, {
|
|
2593
2639
|
meta: {
|
|
2594
2640
|
message: string;
|
|
2595
2641
|
farmId: string;
|
|
2596
2642
|
memberId: string;
|
|
2597
2643
|
};
|
|
2598
|
-
data?:
|
|
2644
|
+
data?: {
|
|
2645
|
+
type: string;
|
|
2646
|
+
id: string;
|
|
2647
|
+
attributes: {
|
|
2648
|
+
refreshToken: string;
|
|
2649
|
+
accessToken: string;
|
|
2650
|
+
expiresIn: number;
|
|
2651
|
+
tokenType: "Bearer";
|
|
2652
|
+
};
|
|
2653
|
+
relationships?: Record<string, unknown> | undefined;
|
|
2654
|
+
links?: Record<string, string> | undefined;
|
|
2655
|
+
meta?: Record<string, unknown> | undefined;
|
|
2656
|
+
}[] | undefined;
|
|
2599
2657
|
}, {
|
|
2600
2658
|
meta: {
|
|
2601
2659
|
message: string;
|
|
2602
2660
|
farmId: string;
|
|
2603
2661
|
memberId: string;
|
|
2604
2662
|
};
|
|
2605
|
-
data?:
|
|
2663
|
+
data?: {
|
|
2664
|
+
type: string;
|
|
2665
|
+
id: string;
|
|
2666
|
+
attributes: {
|
|
2667
|
+
refreshToken: string;
|
|
2668
|
+
accessToken: string;
|
|
2669
|
+
expiresIn: number;
|
|
2670
|
+
tokenType?: "Bearer" | undefined;
|
|
2671
|
+
};
|
|
2672
|
+
relationships?: Record<string, unknown> | undefined;
|
|
2673
|
+
links?: Record<string, string> | undefined;
|
|
2674
|
+
meta?: Record<string, unknown> | undefined;
|
|
2675
|
+
}[] | undefined;
|
|
2606
2676
|
}>;
|
|
2607
2677
|
400: z.ZodObject<{
|
|
2608
2678
|
errors: z.ZodArray<z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team.routes.d.ts","sourceRoot":"","sources":["../../src/routes/team.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"team.routes.d.ts","sourceRoot":"","sources":["../../src/routes/team.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+KrB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { initContract } from '@ts-rest/core';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { createTeamMemberSchema, updateTeamMemberSchema, teamMemberResponseSchema, teamMemberListResponseSchema, teamMemberRoleSchema, } from '../schemas/team.schemas';
|
|
4
4
|
import { jsonApiErrorResponseSchema, jsonApiSuccessResponseSchema, jsonApiPaginationQuerySchema, jsonApiSortQuerySchema, jsonApiIncludeQuerySchema, jsonApiFilterQuerySchema } from '../schemas/common.schemas';
|
|
5
|
+
import { authSessionResourceSchema } from '../schemas/auth.schemas';
|
|
5
6
|
const c = initContract();
|
|
6
7
|
export const teamRouter = c.router({
|
|
7
8
|
// List team members for a farm
|
|
@@ -134,7 +135,7 @@ export const teamRouter = c.router({
|
|
|
134
135
|
farmId: z.string().uuid(),
|
|
135
136
|
memberId: z.string().uuid(),
|
|
136
137
|
}),
|
|
137
|
-
data: z.array(
|
|
138
|
+
data: z.array(authSessionResourceSchema).optional(),
|
|
138
139
|
})),
|
|
139
140
|
400: jsonApiErrorResponseSchema,
|
|
140
141
|
401: jsonApiErrorResponseSchema,
|
|
@@ -26,6 +26,7 @@ export declare const toolCallResultSchema: z.ZodObject<{
|
|
|
26
26
|
export declare const chatRequestAttributesSchema: z.ZodObject<{
|
|
27
27
|
message: z.ZodString;
|
|
28
28
|
farmId: z.ZodOptional<z.ZodString>;
|
|
29
|
+
fieldId: z.ZodOptional<z.ZodString>;
|
|
29
30
|
conversationId: z.ZodOptional<z.ZodString>;
|
|
30
31
|
conversationHistory: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31
32
|
role: z.ZodEnum<["user", "assistant"]>;
|
|
@@ -40,6 +41,7 @@ export declare const chatRequestAttributesSchema: z.ZodObject<{
|
|
|
40
41
|
}, "strip", z.ZodTypeAny, {
|
|
41
42
|
message: string;
|
|
42
43
|
farmId?: string | undefined;
|
|
44
|
+
fieldId?: string | undefined;
|
|
43
45
|
conversationId?: string | undefined;
|
|
44
46
|
conversationHistory?: {
|
|
45
47
|
role: "user" | "assistant";
|
|
@@ -48,6 +50,7 @@ export declare const chatRequestAttributesSchema: z.ZodObject<{
|
|
|
48
50
|
}, {
|
|
49
51
|
message: string;
|
|
50
52
|
farmId?: string | undefined;
|
|
53
|
+
fieldId?: string | undefined;
|
|
51
54
|
conversationId?: string | undefined;
|
|
52
55
|
conversationHistory?: {
|
|
53
56
|
role: "user" | "assistant";
|
|
@@ -59,6 +62,7 @@ export declare const chatRequestSchema: z.ZodObject<{
|
|
|
59
62
|
attributes: z.ZodObject<{
|
|
60
63
|
message: z.ZodString;
|
|
61
64
|
farmId: z.ZodOptional<z.ZodString>;
|
|
65
|
+
fieldId: z.ZodOptional<z.ZodString>;
|
|
62
66
|
conversationId: z.ZodOptional<z.ZodString>;
|
|
63
67
|
conversationHistory: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
64
68
|
role: z.ZodEnum<["user", "assistant"]>;
|
|
@@ -73,6 +77,7 @@ export declare const chatRequestSchema: z.ZodObject<{
|
|
|
73
77
|
}, "strip", z.ZodTypeAny, {
|
|
74
78
|
message: string;
|
|
75
79
|
farmId?: string | undefined;
|
|
80
|
+
fieldId?: string | undefined;
|
|
76
81
|
conversationId?: string | undefined;
|
|
77
82
|
conversationHistory?: {
|
|
78
83
|
role: "user" | "assistant";
|
|
@@ -81,6 +86,7 @@ export declare const chatRequestSchema: z.ZodObject<{
|
|
|
81
86
|
}, {
|
|
82
87
|
message: string;
|
|
83
88
|
farmId?: string | undefined;
|
|
89
|
+
fieldId?: string | undefined;
|
|
84
90
|
conversationId?: string | undefined;
|
|
85
91
|
conversationHistory?: {
|
|
86
92
|
role: "user" | "assistant";
|
|
@@ -92,6 +98,7 @@ export declare const chatRequestSchema: z.ZodObject<{
|
|
|
92
98
|
attributes: {
|
|
93
99
|
message: string;
|
|
94
100
|
farmId?: string | undefined;
|
|
101
|
+
fieldId?: string | undefined;
|
|
95
102
|
conversationId?: string | undefined;
|
|
96
103
|
conversationHistory?: {
|
|
97
104
|
role: "user" | "assistant";
|
|
@@ -103,6 +110,7 @@ export declare const chatRequestSchema: z.ZodObject<{
|
|
|
103
110
|
attributes: {
|
|
104
111
|
message: string;
|
|
105
112
|
farmId?: string | undefined;
|
|
113
|
+
fieldId?: string | undefined;
|
|
106
114
|
conversationId?: string | undefined;
|
|
107
115
|
conversationHistory?: {
|
|
108
116
|
role: "user" | "assistant";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/agents.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AAGH,eAAO,MAAM,iBAAiB,kCAAgC,CAAC;AAG/D,eAAO,MAAM,yBAAyB;;;;;;;;;EAGpC,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAC;AAGH,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"agents.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/agents.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AAGH,eAAO,MAAM,iBAAiB,kCAAgC,CAAC;AAG/D,eAAO,MAAM,yBAAyB;;;;;;;;;EAGpC,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAC;AAGH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQtC,CAAC;AAGH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG5B,CAAC;AAGH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI5C,CAAC;AAGH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG3C,CAAC;AAGF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEnC,CAAC;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AA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAChG,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -19,8 +19,11 @@ export const toolCallResultSchema = z.object({
|
|
|
19
19
|
export const chatRequestAttributesSchema = z.object({
|
|
20
20
|
message: z.string().min(1).max(5000),
|
|
21
21
|
farmId: z.string().uuid().optional(),
|
|
22
|
+
fieldId: z.string().uuid().optional(), // Optional field ID for context
|
|
22
23
|
conversationId: z.string().uuid().optional(), // Continue existing conversation
|
|
23
24
|
conversationHistory: z.array(conversationMessageSchema).optional(),
|
|
25
|
+
// File upload support (for soil tests, documents, etc.)
|
|
26
|
+
// Note: File is handled separately in multipart/form-data
|
|
24
27
|
});
|
|
25
28
|
// Chat request input (JSON:API format)
|
|
26
29
|
export const chatRequestSchema = z.object({
|
|
@@ -2816,32 +2816,36 @@ export declare const observationListResponseSchema: z.ZodObject<{
|
|
|
2816
2816
|
}[] | undefined;
|
|
2817
2817
|
}>;
|
|
2818
2818
|
export declare const observationListQuerySchema: z.ZodObject<{
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2819
|
+
'page[number]': z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
2820
|
+
'page[size]': z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
2821
|
+
'filter[startDate]': z.ZodOptional<z.ZodString>;
|
|
2822
|
+
'filter[endDate]': z.ZodOptional<z.ZodString>;
|
|
2823
|
+
'filter[crop]': z.ZodOptional<z.ZodString>;
|
|
2824
|
+
} & {
|
|
2825
|
+
'filter[fieldId]': z.ZodOptional<z.ZodString>;
|
|
2826
|
+
'filter[status]': z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed"]>>;
|
|
2827
|
+
'filter[observationType]': z.ZodOptional<z.ZodString>;
|
|
2828
|
+
'filter[severity]': z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
|
|
2827
2829
|
}, "strip", z.ZodTypeAny, {
|
|
2828
|
-
|
|
2829
|
-
page
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
observationType?: string | undefined;
|
|
2830
|
+
'page[number]'?: number | undefined;
|
|
2831
|
+
'page[size]'?: number | undefined;
|
|
2832
|
+
'filter[startDate]'?: string | undefined;
|
|
2833
|
+
'filter[endDate]'?: string | undefined;
|
|
2834
|
+
'filter[status]'?: "pending" | "completed" | "failed" | "processing" | undefined;
|
|
2835
|
+
'filter[crop]'?: string | undefined;
|
|
2836
|
+
'filter[fieldId]'?: string | undefined;
|
|
2837
|
+
'filter[observationType]'?: string | undefined;
|
|
2838
|
+
'filter[severity]'?: "critical" | "low" | "medium" | "high" | undefined;
|
|
2836
2839
|
}, {
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2840
|
+
'page[number]'?: number | undefined;
|
|
2841
|
+
'page[size]'?: number | undefined;
|
|
2842
|
+
'filter[startDate]'?: string | undefined;
|
|
2843
|
+
'filter[endDate]'?: string | undefined;
|
|
2844
|
+
'filter[status]'?: "pending" | "completed" | "failed" | "processing" | undefined;
|
|
2845
|
+
'filter[crop]'?: string | undefined;
|
|
2846
|
+
'filter[fieldId]'?: string | undefined;
|
|
2847
|
+
'filter[observationType]'?: string | undefined;
|
|
2848
|
+
'filter[severity]'?: "critical" | "low" | "medium" | "high" | undefined;
|
|
2845
2849
|
}>;
|
|
2846
2850
|
export declare const observationStatsQuerySchema: z.ZodObject<{
|
|
2847
2851
|
startDate: z.ZodOptional<z.ZodString>;
|
|
@@ -2862,5 +2866,15 @@ export type UpdateObservationActionInput = z.infer<typeof updateObservationActio
|
|
|
2862
2866
|
export type ObservationResponse = z.infer<typeof observationResponseSchema>;
|
|
2863
2867
|
export type ObservationListResponse = z.infer<typeof observationListResponseSchema>;
|
|
2864
2868
|
export type ObservationListQuery = z.infer<typeof observationListQuerySchema>;
|
|
2869
|
+
export type ObservationListQueryInternal = {
|
|
2870
|
+
page: number;
|
|
2871
|
+
pageSize: number;
|
|
2872
|
+
fieldId?: string;
|
|
2873
|
+
status?: 'pending' | 'processing' | 'completed' | 'failed';
|
|
2874
|
+
observationType?: string;
|
|
2875
|
+
severity?: 'low' | 'medium' | 'high' | 'critical';
|
|
2876
|
+
startDate?: string;
|
|
2877
|
+
endDate?: string;
|
|
2878
|
+
};
|
|
2865
2879
|
export type ObservationStatsQuery = z.infer<typeof observationStatsQuerySchema>;
|
|
2866
2880
|
//# sourceMappingURL=field-observations.schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-observations.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/field-observations.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"field-observations.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/field-observations.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB;;GAEG;AAGH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsGd,CAAC;AAG3B,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8B5C,CAAC;AAGH,eAAO,MAAM,uCAAuC;;;;;;;;;;;;EAIlD,CAAC;AAGH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAG9E,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC3D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { timestampsSchema, createJsonApiResourceSchema, jsonApiSingleResponseSchema, jsonApiCollectionResponseSchema, } from './common.schemas';
|
|
2
|
+
import { timestampsSchema, createJsonApiResourceSchema, jsonApiSingleResponseSchema, jsonApiCollectionResponseSchema, jsonApiPaginationQuerySchema, jsonApiFilterQuerySchema, } from './common.schemas';
|
|
3
3
|
import { recommendationSchema } from './recommendations.schemas';
|
|
4
4
|
/**
|
|
5
5
|
* Field Observation schemas - JSON:API compliant
|
|
@@ -144,16 +144,14 @@ export const updateObservationActionInputSchema = createJsonApiResourceSchema('o
|
|
|
144
144
|
export const observationResponseSchema = jsonApiSingleResponseSchema(observationResourceSchema);
|
|
145
145
|
export const observationListResponseSchema = jsonApiCollectionResponseSchema(observationResourceSchema);
|
|
146
146
|
// Query schemas
|
|
147
|
-
export const observationListQuerySchema =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
pageSize: z.string().default('20'),
|
|
156
|
-
});
|
|
147
|
+
export const observationListQuerySchema = jsonApiPaginationQuerySchema
|
|
148
|
+
.merge(jsonApiFilterQuerySchema)
|
|
149
|
+
.merge(z.object({
|
|
150
|
+
'filter[fieldId]': z.string().uuid().optional(),
|
|
151
|
+
'filter[status]': z.enum(['pending', 'processing', 'completed', 'failed']).optional(),
|
|
152
|
+
'filter[observationType]': z.string().optional(),
|
|
153
|
+
'filter[severity]': z.enum(['low', 'medium', 'high', 'critical']).optional(),
|
|
154
|
+
}));
|
|
157
155
|
export const observationStatsQuerySchema = z.object({
|
|
158
156
|
startDate: z.string().datetime().optional(),
|
|
159
157
|
endDate: z.string().datetime().optional(),
|