@deepintel-ltd/farmpro-contracts 1.3.3 → 1.4.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"documents.routes.d.ts","sourceRoot":"","sources":["../../src/routes/documents.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkF3B,CAAC"}
@@ -29,6 +29,41 @@ exports.documentsRouter = c.router({
29
29
  summary: 'List documents',
30
30
  description: 'Get all documents for a farm with optional filtering',
31
31
  },
32
+ // Upload document file (standalone - returns fileUrl)
33
+ uploadDocumentFile: {
34
+ method: 'POST',
35
+ path: '/farms/:farmId/documents/upload',
36
+ contentType: 'multipart/form-data',
37
+ pathParams: zod_1.z.object({ farmId: zod_1.z.string().uuid() }),
38
+ body: c.type(),
39
+ responses: {
40
+ 200: documents_schemas_1.uploadedFileResponseSchema,
41
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
42
+ 404: common_schemas_1.jsonApiErrorResponseSchema,
43
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
44
+ },
45
+ summary: 'Upload document file',
46
+ description: 'Upload a file and get back the file URL in JSON:API format',
47
+ },
48
+ // Upload file to existing document
49
+ uploadFileToDocument: {
50
+ method: 'POST',
51
+ path: '/farms/:farmId/documents/:id/upload',
52
+ contentType: 'multipart/form-data',
53
+ pathParams: zod_1.z.object({
54
+ farmId: zod_1.z.string().uuid(),
55
+ id: zod_1.z.string().uuid(),
56
+ }),
57
+ body: c.type(),
58
+ responses: {
59
+ 200: documents_schemas_1.documentResponseSchema,
60
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
61
+ 404: common_schemas_1.jsonApiErrorResponseSchema,
62
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
63
+ },
64
+ summary: 'Upload file to existing document',
65
+ description: 'Upload a file to an existing document record and update it with the file URL',
66
+ },
32
67
  // Create document
33
68
  createDocument: {
34
69
  method: 'POST',
@@ -0,0 +1,317 @@
1
+ export declare const healthRouter: {
2
+ check: {
3
+ summary: "Health check endpoint";
4
+ description: "Check the health status of the API and its dependencies (database, Redis, storage)";
5
+ method: "GET";
6
+ path: "/health";
7
+ responses: {
8
+ 200: import("zod").ZodObject<{
9
+ status: import("zod").ZodEnum<["healthy", "unhealthy", "degraded"]>;
10
+ timestamp: import("zod").ZodString;
11
+ uptime: import("zod").ZodNumber;
12
+ services: import("zod").ZodObject<{
13
+ database: import("zod").ZodObject<{
14
+ status: import("zod").ZodEnum<["healthy", "unhealthy", "degraded"]>;
15
+ message: import("zod").ZodOptional<import("zod").ZodString>;
16
+ responseTime: import("zod").ZodOptional<import("zod").ZodNumber>;
17
+ }, "strip", import("zod").ZodTypeAny, {
18
+ status: "healthy" | "unhealthy" | "degraded";
19
+ message?: string | undefined;
20
+ responseTime?: number | undefined;
21
+ }, {
22
+ status: "healthy" | "unhealthy" | "degraded";
23
+ message?: string | undefined;
24
+ responseTime?: number | undefined;
25
+ }>;
26
+ redis: import("zod").ZodObject<{
27
+ status: import("zod").ZodEnum<["healthy", "unhealthy", "degraded"]>;
28
+ message: import("zod").ZodOptional<import("zod").ZodString>;
29
+ responseTime: import("zod").ZodOptional<import("zod").ZodNumber>;
30
+ }, "strip", import("zod").ZodTypeAny, {
31
+ status: "healthy" | "unhealthy" | "degraded";
32
+ message?: string | undefined;
33
+ responseTime?: number | undefined;
34
+ }, {
35
+ status: "healthy" | "unhealthy" | "degraded";
36
+ message?: string | undefined;
37
+ responseTime?: number | undefined;
38
+ }>;
39
+ storage: import("zod").ZodOptional<import("zod").ZodObject<{
40
+ status: import("zod").ZodEnum<["healthy", "unhealthy", "degraded"]>;
41
+ message: import("zod").ZodOptional<import("zod").ZodString>;
42
+ responseTime: import("zod").ZodOptional<import("zod").ZodNumber>;
43
+ }, "strip", import("zod").ZodTypeAny, {
44
+ status: "healthy" | "unhealthy" | "degraded";
45
+ message?: string | undefined;
46
+ responseTime?: number | undefined;
47
+ }, {
48
+ status: "healthy" | "unhealthy" | "degraded";
49
+ message?: string | undefined;
50
+ responseTime?: number | undefined;
51
+ }>>;
52
+ timescale: import("zod").ZodOptional<import("zod").ZodObject<{
53
+ status: import("zod").ZodEnum<["healthy", "unhealthy", "degraded"]>;
54
+ message: import("zod").ZodOptional<import("zod").ZodString>;
55
+ responseTime: import("zod").ZodOptional<import("zod").ZodNumber>;
56
+ }, "strip", import("zod").ZodTypeAny, {
57
+ status: "healthy" | "unhealthy" | "degraded";
58
+ message?: string | undefined;
59
+ responseTime?: number | undefined;
60
+ }, {
61
+ status: "healthy" | "unhealthy" | "degraded";
62
+ message?: string | undefined;
63
+ responseTime?: number | undefined;
64
+ }>>;
65
+ }, "strip", import("zod").ZodTypeAny, {
66
+ database: {
67
+ status: "healthy" | "unhealthy" | "degraded";
68
+ message?: string | undefined;
69
+ responseTime?: number | undefined;
70
+ };
71
+ redis: {
72
+ status: "healthy" | "unhealthy" | "degraded";
73
+ message?: string | undefined;
74
+ responseTime?: number | undefined;
75
+ };
76
+ storage?: {
77
+ status: "healthy" | "unhealthy" | "degraded";
78
+ message?: string | undefined;
79
+ responseTime?: number | undefined;
80
+ } | undefined;
81
+ timescale?: {
82
+ status: "healthy" | "unhealthy" | "degraded";
83
+ message?: string | undefined;
84
+ responseTime?: number | undefined;
85
+ } | undefined;
86
+ }, {
87
+ database: {
88
+ status: "healthy" | "unhealthy" | "degraded";
89
+ message?: string | undefined;
90
+ responseTime?: number | undefined;
91
+ };
92
+ redis: {
93
+ status: "healthy" | "unhealthy" | "degraded";
94
+ message?: string | undefined;
95
+ responseTime?: number | undefined;
96
+ };
97
+ storage?: {
98
+ status: "healthy" | "unhealthy" | "degraded";
99
+ message?: string | undefined;
100
+ responseTime?: number | undefined;
101
+ } | undefined;
102
+ timescale?: {
103
+ status: "healthy" | "unhealthy" | "degraded";
104
+ message?: string | undefined;
105
+ responseTime?: number | undefined;
106
+ } | undefined;
107
+ }>;
108
+ }, "strip", import("zod").ZodTypeAny, {
109
+ status: "healthy" | "unhealthy" | "degraded";
110
+ timestamp: string;
111
+ uptime: number;
112
+ services: {
113
+ database: {
114
+ status: "healthy" | "unhealthy" | "degraded";
115
+ message?: string | undefined;
116
+ responseTime?: number | undefined;
117
+ };
118
+ redis: {
119
+ status: "healthy" | "unhealthy" | "degraded";
120
+ message?: string | undefined;
121
+ responseTime?: number | undefined;
122
+ };
123
+ storage?: {
124
+ status: "healthy" | "unhealthy" | "degraded";
125
+ message?: string | undefined;
126
+ responseTime?: number | undefined;
127
+ } | undefined;
128
+ timescale?: {
129
+ status: "healthy" | "unhealthy" | "degraded";
130
+ message?: string | undefined;
131
+ responseTime?: number | undefined;
132
+ } | undefined;
133
+ };
134
+ }, {
135
+ status: "healthy" | "unhealthy" | "degraded";
136
+ timestamp: string;
137
+ uptime: number;
138
+ services: {
139
+ database: {
140
+ status: "healthy" | "unhealthy" | "degraded";
141
+ message?: string | undefined;
142
+ responseTime?: number | undefined;
143
+ };
144
+ redis: {
145
+ status: "healthy" | "unhealthy" | "degraded";
146
+ message?: string | undefined;
147
+ responseTime?: number | undefined;
148
+ };
149
+ storage?: {
150
+ status: "healthy" | "unhealthy" | "degraded";
151
+ message?: string | undefined;
152
+ responseTime?: number | undefined;
153
+ } | undefined;
154
+ timescale?: {
155
+ status: "healthy" | "unhealthy" | "degraded";
156
+ message?: string | undefined;
157
+ responseTime?: number | undefined;
158
+ } | undefined;
159
+ };
160
+ }>;
161
+ 503: import("zod").ZodObject<{
162
+ status: import("zod").ZodEnum<["healthy", "unhealthy", "degraded"]>;
163
+ timestamp: import("zod").ZodString;
164
+ uptime: import("zod").ZodNumber;
165
+ services: import("zod").ZodObject<{
166
+ database: import("zod").ZodObject<{
167
+ status: import("zod").ZodEnum<["healthy", "unhealthy", "degraded"]>;
168
+ message: import("zod").ZodOptional<import("zod").ZodString>;
169
+ responseTime: import("zod").ZodOptional<import("zod").ZodNumber>;
170
+ }, "strip", import("zod").ZodTypeAny, {
171
+ status: "healthy" | "unhealthy" | "degraded";
172
+ message?: string | undefined;
173
+ responseTime?: number | undefined;
174
+ }, {
175
+ status: "healthy" | "unhealthy" | "degraded";
176
+ message?: string | undefined;
177
+ responseTime?: number | undefined;
178
+ }>;
179
+ redis: import("zod").ZodObject<{
180
+ status: import("zod").ZodEnum<["healthy", "unhealthy", "degraded"]>;
181
+ message: import("zod").ZodOptional<import("zod").ZodString>;
182
+ responseTime: import("zod").ZodOptional<import("zod").ZodNumber>;
183
+ }, "strip", import("zod").ZodTypeAny, {
184
+ status: "healthy" | "unhealthy" | "degraded";
185
+ message?: string | undefined;
186
+ responseTime?: number | undefined;
187
+ }, {
188
+ status: "healthy" | "unhealthy" | "degraded";
189
+ message?: string | undefined;
190
+ responseTime?: number | undefined;
191
+ }>;
192
+ storage: import("zod").ZodOptional<import("zod").ZodObject<{
193
+ status: import("zod").ZodEnum<["healthy", "unhealthy", "degraded"]>;
194
+ message: import("zod").ZodOptional<import("zod").ZodString>;
195
+ responseTime: import("zod").ZodOptional<import("zod").ZodNumber>;
196
+ }, "strip", import("zod").ZodTypeAny, {
197
+ status: "healthy" | "unhealthy" | "degraded";
198
+ message?: string | undefined;
199
+ responseTime?: number | undefined;
200
+ }, {
201
+ status: "healthy" | "unhealthy" | "degraded";
202
+ message?: string | undefined;
203
+ responseTime?: number | undefined;
204
+ }>>;
205
+ timescale: import("zod").ZodOptional<import("zod").ZodObject<{
206
+ status: import("zod").ZodEnum<["healthy", "unhealthy", "degraded"]>;
207
+ message: import("zod").ZodOptional<import("zod").ZodString>;
208
+ responseTime: import("zod").ZodOptional<import("zod").ZodNumber>;
209
+ }, "strip", import("zod").ZodTypeAny, {
210
+ status: "healthy" | "unhealthy" | "degraded";
211
+ message?: string | undefined;
212
+ responseTime?: number | undefined;
213
+ }, {
214
+ status: "healthy" | "unhealthy" | "degraded";
215
+ message?: string | undefined;
216
+ responseTime?: number | undefined;
217
+ }>>;
218
+ }, "strip", import("zod").ZodTypeAny, {
219
+ database: {
220
+ status: "healthy" | "unhealthy" | "degraded";
221
+ message?: string | undefined;
222
+ responseTime?: number | undefined;
223
+ };
224
+ redis: {
225
+ status: "healthy" | "unhealthy" | "degraded";
226
+ message?: string | undefined;
227
+ responseTime?: number | undefined;
228
+ };
229
+ storage?: {
230
+ status: "healthy" | "unhealthy" | "degraded";
231
+ message?: string | undefined;
232
+ responseTime?: number | undefined;
233
+ } | undefined;
234
+ timescale?: {
235
+ status: "healthy" | "unhealthy" | "degraded";
236
+ message?: string | undefined;
237
+ responseTime?: number | undefined;
238
+ } | undefined;
239
+ }, {
240
+ database: {
241
+ status: "healthy" | "unhealthy" | "degraded";
242
+ message?: string | undefined;
243
+ responseTime?: number | undefined;
244
+ };
245
+ redis: {
246
+ status: "healthy" | "unhealthy" | "degraded";
247
+ message?: string | undefined;
248
+ responseTime?: number | undefined;
249
+ };
250
+ storage?: {
251
+ status: "healthy" | "unhealthy" | "degraded";
252
+ message?: string | undefined;
253
+ responseTime?: number | undefined;
254
+ } | undefined;
255
+ timescale?: {
256
+ status: "healthy" | "unhealthy" | "degraded";
257
+ message?: string | undefined;
258
+ responseTime?: number | undefined;
259
+ } | undefined;
260
+ }>;
261
+ }, "strip", import("zod").ZodTypeAny, {
262
+ status: "healthy" | "unhealthy" | "degraded";
263
+ timestamp: string;
264
+ uptime: number;
265
+ services: {
266
+ database: {
267
+ status: "healthy" | "unhealthy" | "degraded";
268
+ message?: string | undefined;
269
+ responseTime?: number | undefined;
270
+ };
271
+ redis: {
272
+ status: "healthy" | "unhealthy" | "degraded";
273
+ message?: string | undefined;
274
+ responseTime?: number | undefined;
275
+ };
276
+ storage?: {
277
+ status: "healthy" | "unhealthy" | "degraded";
278
+ message?: string | undefined;
279
+ responseTime?: number | undefined;
280
+ } | undefined;
281
+ timescale?: {
282
+ status: "healthy" | "unhealthy" | "degraded";
283
+ message?: string | undefined;
284
+ responseTime?: number | undefined;
285
+ } | undefined;
286
+ };
287
+ }, {
288
+ status: "healthy" | "unhealthy" | "degraded";
289
+ timestamp: string;
290
+ uptime: number;
291
+ services: {
292
+ database: {
293
+ status: "healthy" | "unhealthy" | "degraded";
294
+ message?: string | undefined;
295
+ responseTime?: number | undefined;
296
+ };
297
+ redis: {
298
+ status: "healthy" | "unhealthy" | "degraded";
299
+ message?: string | undefined;
300
+ responseTime?: number | undefined;
301
+ };
302
+ storage?: {
303
+ status: "healthy" | "unhealthy" | "degraded";
304
+ message?: string | undefined;
305
+ responseTime?: number | undefined;
306
+ } | undefined;
307
+ timescale?: {
308
+ status: "healthy" | "unhealthy" | "degraded";
309
+ message?: string | undefined;
310
+ responseTime?: number | undefined;
311
+ } | undefined;
312
+ };
313
+ }>;
314
+ };
315
+ };
316
+ };
317
+ //# sourceMappingURL=health.routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.routes.d.ts","sourceRoot":"","sources":["../../src/routes/health.routes.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWvB,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.healthRouter = void 0;
4
+ const core_1 = require("@ts-rest/core");
5
+ const health_schemas_1 = require("../schemas/health.schemas");
6
+ const c = (0, core_1.initContract)();
7
+ exports.healthRouter = c.router({
8
+ check: {
9
+ method: 'GET',
10
+ path: '/health',
11
+ responses: {
12
+ 200: health_schemas_1.healthCheckResponseSchema,
13
+ 503: health_schemas_1.healthCheckResponseSchema, // Service unavailable
14
+ },
15
+ summary: 'Health check endpoint',
16
+ description: 'Check the health status of the API and its dependencies (database, Redis, storage)',
17
+ },
18
+ });
@@ -19,6 +19,7 @@ import { agentWorkflowsRouter } from './agent-workflows.routes';
19
19
  import { fieldMonitoringRouter } from './field-monitoring.routes';
20
20
  import { fieldObservationsRouter } from './field-observations.routes';
21
21
  import { adminRouter } from './admin.routes';
22
+ import { healthRouter } from './health.routes';
22
23
  /**
23
24
  * Explicit interface definition for the API contract.
24
25
  * This avoids TypeScript's type serialization limit when combining many routers
@@ -46,6 +47,7 @@ export interface ApiContractDefinition {
46
47
  fieldMonitoring: typeof fieldMonitoringRouter;
47
48
  fieldObservations: typeof fieldObservationsRouter;
48
49
  admin: typeof adminRouter;
50
+ health: typeof healthRouter;
49
51
  }
50
52
  /**
51
53
  * Main API contract combining all routers
@@ -83,4 +85,5 @@ export type AgentWorkflowsEndpoints = ApiContractType['agentWorkflows'];
83
85
  export type FieldMonitoringEndpoints = ApiContractType['fieldMonitoring'];
84
86
  export type FieldObservationsEndpoints = ApiContractType['fieldObservations'];
85
87
  export type AdminEndpoints = ApiContractType['admin'];
88
+ export type HealthEndpoints = ApiContractType['health'];
86
89
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAA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AChE,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;AACxD,MAAM,MAAM,uBAAuB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;AACxE,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAC1E,MAAM,MAAM,0BAA0B,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;AAC9E,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AACtD,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC"}
@@ -23,6 +23,7 @@ const agent_workflows_routes_1 = require("./agent-workflows.routes");
23
23
  const field_monitoring_routes_1 = require("./field-monitoring.routes");
24
24
  const field_observations_routes_1 = require("./field-observations.routes");
25
25
  const admin_routes_1 = require("./admin.routes");
26
+ const health_routes_1 = require("./health.routes");
26
27
  const c = (0, core_1.initContract)();
27
28
  /**
28
29
  * Main API contract combining all routers
@@ -52,4 +53,5 @@ exports.apiContract = c.router({
52
53
  fieldMonitoring: field_monitoring_routes_1.fieldMonitoringRouter,
53
54
  fieldObservations: field_observations_routes_1.fieldObservationsRouter,
54
55
  admin: admin_routes_1.adminRouter,
56
+ health: health_routes_1.healthRouter,
55
57
  });