@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.
Files changed (63) hide show
  1. package/dist/index.d.ts +16 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +15 -0
  4. package/dist/routes/agents.routes.d.ts +6 -6
  5. package/dist/routes/cooperative.routes.d.ts +1327 -0
  6. package/dist/routes/cooperative.routes.d.ts.map +1 -0
  7. package/dist/routes/cooperative.routes.js +47 -0
  8. package/dist/routes/extension.routes.d.ts +2431 -0
  9. package/dist/routes/extension.routes.d.ts.map +1 -0
  10. package/dist/routes/extension.routes.js +75 -0
  11. package/dist/routes/farms.routes.d.ts +775 -0
  12. package/dist/routes/farms.routes.d.ts.map +1 -1
  13. package/dist/routes/farms.routes.js +15 -1
  14. package/dist/routes/field-monitoring.routes.d.ts +505 -0
  15. package/dist/routes/field-monitoring.routes.d.ts.map +1 -1
  16. package/dist/routes/field-monitoring.routes.js +23 -1
  17. package/dist/routes/fields.routes.d.ts +156 -155
  18. package/dist/routes/fields.routes.d.ts.map +1 -1
  19. package/dist/routes/index.d.ts +15 -0
  20. package/dist/routes/index.d.ts.map +1 -1
  21. package/dist/routes/index.js +10 -0
  22. package/dist/routes/live-monitor.routes.d.ts +513 -0
  23. package/dist/routes/live-monitor.routes.d.ts.map +1 -0
  24. package/dist/routes/live-monitor.routes.js +81 -0
  25. package/dist/routes/livestock-map.routes.d.ts +4 -4
  26. package/dist/routes/monitoring-visualization.routes.d.ts +4 -4
  27. package/dist/routes/notifications.routes.d.ts +1350 -0
  28. package/dist/routes/notifications.routes.d.ts.map +1 -0
  29. package/dist/routes/notifications.routes.js +66 -0
  30. package/dist/routes/team-payments.routes.d.ts +9571 -0
  31. package/dist/routes/team-payments.routes.d.ts.map +1 -0
  32. package/dist/routes/team-payments.routes.js +262 -0
  33. package/dist/schemas/agents.schemas.d.ts +1 -0
  34. package/dist/schemas/agents.schemas.d.ts.map +1 -1
  35. package/dist/schemas/cooperative.schemas.d.ts +560 -0
  36. package/dist/schemas/cooperative.schemas.d.ts.map +1 -0
  37. package/dist/schemas/cooperative.schemas.js +71 -0
  38. package/dist/schemas/extension.schemas.d.ts +1204 -0
  39. package/dist/schemas/extension.schemas.d.ts.map +1 -0
  40. package/dist/schemas/extension.schemas.js +68 -0
  41. package/dist/schemas/farms.schemas.d.ts +591 -0
  42. package/dist/schemas/farms.schemas.d.ts.map +1 -1
  43. package/dist/schemas/farms.schemas.js +44 -0
  44. package/dist/schemas/field-monitoring.schemas.d.ts +276 -0
  45. package/dist/schemas/field-monitoring.schemas.d.ts.map +1 -1
  46. package/dist/schemas/field-monitoring.schemas.js +9 -0
  47. package/dist/schemas/field-observations.schemas.d.ts +1 -0
  48. package/dist/schemas/field-observations.schemas.d.ts.map +1 -1
  49. package/dist/schemas/fields.schemas.d.ts +188 -186
  50. package/dist/schemas/fields.schemas.d.ts.map +1 -1
  51. package/dist/schemas/fields.schemas.js +10 -2
  52. package/dist/schemas/live-monitor.schemas.d.ts +596 -0
  53. package/dist/schemas/live-monitor.schemas.d.ts.map +1 -0
  54. package/dist/schemas/live-monitor.schemas.js +107 -0
  55. package/dist/schemas/livestock-map.schemas.d.ts +10 -10
  56. package/dist/schemas/monitoring-visualization.schemas.d.ts +4 -4
  57. package/dist/schemas/notifications.schemas.d.ts +464 -0
  58. package/dist/schemas/notifications.schemas.d.ts.map +1 -0
  59. package/dist/schemas/notifications.schemas.js +40 -0
  60. package/dist/schemas/team-payments.schemas.d.ts +2604 -0
  61. package/dist/schemas/team-payments.schemas.d.ts.map +1 -0
  62. package/dist/schemas/team-payments.schemas.js +151 -0
  63. 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,eAA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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
+ });