@deepintel-ltd/farmpro-contracts 1.7.19 → 1.7.20
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 +16 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -0
- package/dist/routes/agents.routes.d.ts +6 -6
- package/dist/routes/cooperative.routes.d.ts +1327 -0
- package/dist/routes/cooperative.routes.d.ts.map +1 -0
- package/dist/routes/cooperative.routes.js +47 -0
- package/dist/routes/extension.routes.d.ts +2431 -0
- package/dist/routes/extension.routes.d.ts.map +1 -0
- package/dist/routes/extension.routes.js +75 -0
- package/dist/routes/farms.routes.d.ts +775 -0
- package/dist/routes/farms.routes.d.ts.map +1 -1
- package/dist/routes/farms.routes.js +15 -1
- package/dist/routes/field-monitoring.routes.d.ts +505 -0
- package/dist/routes/field-monitoring.routes.d.ts.map +1 -1
- package/dist/routes/field-monitoring.routes.js +23 -1
- package/dist/routes/fields.routes.d.ts +156 -155
- package/dist/routes/fields.routes.d.ts.map +1 -1
- 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/live-monitor.routes.d.ts +513 -0
- package/dist/routes/live-monitor.routes.d.ts.map +1 -0
- package/dist/routes/live-monitor.routes.js +81 -0
- package/dist/routes/livestock-map.routes.d.ts +4 -4
- package/dist/routes/monitoring-visualization.routes.d.ts +4 -4
- package/dist/routes/notifications.routes.d.ts +1350 -0
- package/dist/routes/notifications.routes.d.ts.map +1 -0
- package/dist/routes/notifications.routes.js +66 -0
- package/dist/routes/team-payments.routes.d.ts +9571 -0
- package/dist/routes/team-payments.routes.d.ts.map +1 -0
- package/dist/routes/team-payments.routes.js +262 -0
- package/dist/schemas/agents.schemas.d.ts +1 -0
- package/dist/schemas/agents.schemas.d.ts.map +1 -1
- package/dist/schemas/cooperative.schemas.d.ts +560 -0
- package/dist/schemas/cooperative.schemas.d.ts.map +1 -0
- package/dist/schemas/cooperative.schemas.js +71 -0
- package/dist/schemas/extension.schemas.d.ts +1204 -0
- package/dist/schemas/extension.schemas.d.ts.map +1 -0
- package/dist/schemas/extension.schemas.js +68 -0
- package/dist/schemas/farms.schemas.d.ts +591 -0
- package/dist/schemas/farms.schemas.d.ts.map +1 -1
- package/dist/schemas/farms.schemas.js +44 -0
- package/dist/schemas/field-monitoring.schemas.d.ts +276 -0
- package/dist/schemas/field-monitoring.schemas.d.ts.map +1 -1
- package/dist/schemas/field-monitoring.schemas.js +9 -0
- package/dist/schemas/field-observations.schemas.d.ts +1 -0
- package/dist/schemas/field-observations.schemas.d.ts.map +1 -1
- package/dist/schemas/fields.schemas.d.ts +188 -186
- package/dist/schemas/fields.schemas.d.ts.map +1 -1
- package/dist/schemas/fields.schemas.js +10 -2
- package/dist/schemas/live-monitor.schemas.d.ts +596 -0
- package/dist/schemas/live-monitor.schemas.d.ts.map +1 -0
- package/dist/schemas/live-monitor.schemas.js +107 -0
- package/dist/schemas/livestock-map.schemas.d.ts +10 -10
- package/dist/schemas/monitoring-visualization.schemas.d.ts +4 -4
- package/dist/schemas/notifications.schemas.d.ts +464 -0
- package/dist/schemas/notifications.schemas.d.ts.map +1 -0
- package/dist/schemas/notifications.schemas.js +40 -0
- package/dist/schemas/team-payments.schemas.d.ts +2604 -0
- package/dist/schemas/team-payments.schemas.d.ts.map +1 -0
- package/dist/schemas/team-payments.schemas.js +151 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.routes.d.ts","sourceRoot":"","sources":["../../src/routes/notifications.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkE9B,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { initContract } from '@ts-rest/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { notificationListResponseSchema, notificationResponseSchema, notificationTypeSchema, unreadCountResponseSchema, } from '../schemas/notifications.schemas';
|
|
4
|
+
import { jsonApiErrorResponseSchema, jsonApiSuccessResponseSchema, jsonApiPaginationQuerySchema, jsonApiSortQuerySchema, } from '../schemas/common.schemas';
|
|
5
|
+
const c = initContract();
|
|
6
|
+
export const notificationsRouter = c.router({
|
|
7
|
+
listFarmNotifications: {
|
|
8
|
+
method: 'GET',
|
|
9
|
+
path: '/farms/:farmId/notifications',
|
|
10
|
+
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
11
|
+
query: jsonApiPaginationQuerySchema
|
|
12
|
+
.merge(jsonApiSortQuerySchema)
|
|
13
|
+
.merge(z.object({
|
|
14
|
+
'filter[type]': notificationTypeSchema.optional(),
|
|
15
|
+
})),
|
|
16
|
+
responses: {
|
|
17
|
+
200: notificationListResponseSchema,
|
|
18
|
+
401: jsonApiErrorResponseSchema,
|
|
19
|
+
403: jsonApiErrorResponseSchema,
|
|
20
|
+
404: jsonApiErrorResponseSchema,
|
|
21
|
+
},
|
|
22
|
+
summary: 'List farm notifications',
|
|
23
|
+
description: 'Paginated notification feed for a farm, including stored notifications plus aggregated field alerts and pending payment approvals',
|
|
24
|
+
},
|
|
25
|
+
markNotificationRead: {
|
|
26
|
+
method: 'PATCH',
|
|
27
|
+
path: '/farms/:farmId/notifications/:id/read',
|
|
28
|
+
pathParams: z.object({
|
|
29
|
+
farmId: z.string().uuid(),
|
|
30
|
+
id: z.string().min(1),
|
|
31
|
+
}),
|
|
32
|
+
body: z.object({}).optional(),
|
|
33
|
+
responses: {
|
|
34
|
+
200: notificationResponseSchema,
|
|
35
|
+
401: jsonApiErrorResponseSchema,
|
|
36
|
+
403: jsonApiErrorResponseSchema,
|
|
37
|
+
404: jsonApiErrorResponseSchema,
|
|
38
|
+
},
|
|
39
|
+
summary: 'Mark notification as read',
|
|
40
|
+
description: 'Mark a stored notification or aggregated item (field_alert:{id}, vendor_payment:{id}) as read',
|
|
41
|
+
},
|
|
42
|
+
markAllNotificationsRead: {
|
|
43
|
+
method: 'POST',
|
|
44
|
+
path: '/farms/:farmId/notifications/mark-all-read',
|
|
45
|
+
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
46
|
+
body: z.object({}).optional(),
|
|
47
|
+
responses: {
|
|
48
|
+
200: jsonApiSuccessResponseSchema,
|
|
49
|
+
401: jsonApiErrorResponseSchema,
|
|
50
|
+
403: jsonApiErrorResponseSchema,
|
|
51
|
+
404: jsonApiErrorResponseSchema,
|
|
52
|
+
},
|
|
53
|
+
summary: 'Mark all farm notifications as read',
|
|
54
|
+
description: 'Mark all unread notifications for the current user on a farm as read',
|
|
55
|
+
},
|
|
56
|
+
getUnreadCount: {
|
|
57
|
+
method: 'GET',
|
|
58
|
+
path: '/user/notifications/unread-count',
|
|
59
|
+
responses: {
|
|
60
|
+
200: unreadCountResponseSchema,
|
|
61
|
+
401: jsonApiErrorResponseSchema,
|
|
62
|
+
},
|
|
63
|
+
summary: 'Get unread notification count',
|
|
64
|
+
description: 'Total unread notifications across all farms the user can access, including aggregated sources',
|
|
65
|
+
},
|
|
66
|
+
});
|