@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,464 @@
1
+ import { z } from 'zod';
2
+ export declare const notificationTypeSchema: z.ZodEnum<["field_alert", "weather", "task", "payment", "system", "subscription", "team", "camera"]>;
3
+ export declare const notificationSourceSchema: z.ZodEnum<["notification", "field_alert", "vendor_payment"]>;
4
+ export declare const notificationAttributesSchema: z.ZodObject<{
5
+ userId: z.ZodString;
6
+ farmId: z.ZodNullable<z.ZodString>;
7
+ type: z.ZodEnum<["field_alert", "weather", "task", "payment", "system", "subscription", "team", "camera"]>;
8
+ title: z.ZodString;
9
+ body: z.ZodString;
10
+ readAt: z.ZodNullable<z.ZodString>;
11
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
12
+ source: z.ZodEnum<["notification", "field_alert", "vendor_payment"]>;
13
+ createdAt: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
16
+ title: string;
17
+ source: "field_alert" | "notification" | "vendor_payment";
18
+ createdAt: string;
19
+ metadata: Record<string, unknown> | null;
20
+ body: string;
21
+ farmId: string | null;
22
+ userId: string;
23
+ readAt: string | null;
24
+ }, {
25
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
26
+ title: string;
27
+ source: "field_alert" | "notification" | "vendor_payment";
28
+ createdAt: string;
29
+ metadata: Record<string, unknown> | null;
30
+ body: string;
31
+ farmId: string | null;
32
+ userId: string;
33
+ readAt: string | null;
34
+ }>;
35
+ export declare const notificationResourceSchema: z.ZodObject<{
36
+ type: z.ZodLiteral<string>;
37
+ id: z.ZodString;
38
+ attributes: z.ZodObject<{
39
+ userId: z.ZodString;
40
+ farmId: z.ZodNullable<z.ZodString>;
41
+ type: z.ZodEnum<["field_alert", "weather", "task", "payment", "system", "subscription", "team", "camera"]>;
42
+ title: z.ZodString;
43
+ body: z.ZodString;
44
+ readAt: z.ZodNullable<z.ZodString>;
45
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
46
+ source: z.ZodEnum<["notification", "field_alert", "vendor_payment"]>;
47
+ createdAt: z.ZodString;
48
+ }, "strip", z.ZodTypeAny, {
49
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
50
+ title: string;
51
+ source: "field_alert" | "notification" | "vendor_payment";
52
+ createdAt: string;
53
+ metadata: Record<string, unknown> | null;
54
+ body: string;
55
+ farmId: string | null;
56
+ userId: string;
57
+ readAt: string | null;
58
+ }, {
59
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
60
+ title: string;
61
+ source: "field_alert" | "notification" | "vendor_payment";
62
+ createdAt: string;
63
+ metadata: Record<string, unknown> | null;
64
+ body: string;
65
+ farmId: string | null;
66
+ userId: string;
67
+ readAt: string | null;
68
+ }>;
69
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
70
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
71
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ type: string;
74
+ id: string;
75
+ attributes: {
76
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
77
+ title: string;
78
+ source: "field_alert" | "notification" | "vendor_payment";
79
+ createdAt: string;
80
+ metadata: Record<string, unknown> | null;
81
+ body: string;
82
+ farmId: string | null;
83
+ userId: string;
84
+ readAt: string | null;
85
+ };
86
+ relationships?: Record<string, unknown> | undefined;
87
+ links?: Record<string, string> | undefined;
88
+ meta?: Record<string, unknown> | undefined;
89
+ }, {
90
+ type: string;
91
+ id: string;
92
+ attributes: {
93
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
94
+ title: string;
95
+ source: "field_alert" | "notification" | "vendor_payment";
96
+ createdAt: string;
97
+ metadata: Record<string, unknown> | null;
98
+ body: string;
99
+ farmId: string | null;
100
+ userId: string;
101
+ readAt: string | null;
102
+ };
103
+ relationships?: Record<string, unknown> | undefined;
104
+ links?: Record<string, string> | undefined;
105
+ meta?: Record<string, unknown> | undefined;
106
+ }>;
107
+ export declare const notificationResponseSchema: z.ZodObject<{
108
+ data: z.ZodObject<{
109
+ type: z.ZodLiteral<string>;
110
+ id: z.ZodString;
111
+ attributes: z.ZodObject<{
112
+ userId: z.ZodString;
113
+ farmId: z.ZodNullable<z.ZodString>;
114
+ type: z.ZodEnum<["field_alert", "weather", "task", "payment", "system", "subscription", "team", "camera"]>;
115
+ title: z.ZodString;
116
+ body: z.ZodString;
117
+ readAt: z.ZodNullable<z.ZodString>;
118
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
119
+ source: z.ZodEnum<["notification", "field_alert", "vendor_payment"]>;
120
+ createdAt: z.ZodString;
121
+ }, "strip", z.ZodTypeAny, {
122
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
123
+ title: string;
124
+ source: "field_alert" | "notification" | "vendor_payment";
125
+ createdAt: string;
126
+ metadata: Record<string, unknown> | null;
127
+ body: string;
128
+ farmId: string | null;
129
+ userId: string;
130
+ readAt: string | null;
131
+ }, {
132
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
133
+ title: string;
134
+ source: "field_alert" | "notification" | "vendor_payment";
135
+ createdAt: string;
136
+ metadata: Record<string, unknown> | null;
137
+ body: string;
138
+ farmId: string | null;
139
+ userId: string;
140
+ readAt: string | null;
141
+ }>;
142
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
143
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
144
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
145
+ }, "strip", z.ZodTypeAny, {
146
+ type: string;
147
+ id: string;
148
+ attributes: {
149
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
150
+ title: string;
151
+ source: "field_alert" | "notification" | "vendor_payment";
152
+ createdAt: string;
153
+ metadata: Record<string, unknown> | null;
154
+ body: string;
155
+ farmId: string | null;
156
+ userId: string;
157
+ readAt: string | null;
158
+ };
159
+ relationships?: Record<string, unknown> | undefined;
160
+ links?: Record<string, string> | undefined;
161
+ meta?: Record<string, unknown> | undefined;
162
+ }, {
163
+ type: string;
164
+ id: string;
165
+ attributes: {
166
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
167
+ title: string;
168
+ source: "field_alert" | "notification" | "vendor_payment";
169
+ createdAt: string;
170
+ metadata: Record<string, unknown> | null;
171
+ body: string;
172
+ farmId: string | null;
173
+ userId: string;
174
+ readAt: string | null;
175
+ };
176
+ relationships?: Record<string, unknown> | undefined;
177
+ links?: Record<string, string> | undefined;
178
+ meta?: Record<string, unknown> | undefined;
179
+ }>;
180
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
181
+ type: z.ZodString;
182
+ id: z.ZodString;
183
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
184
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
185
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
186
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
187
+ }, "strip", z.ZodTypeAny, {
188
+ type: string;
189
+ id: string;
190
+ attributes?: Record<string, unknown> | undefined;
191
+ relationships?: Record<string, unknown> | undefined;
192
+ links?: Record<string, string> | undefined;
193
+ meta?: Record<string, unknown> | undefined;
194
+ }, {
195
+ type: string;
196
+ id: string;
197
+ attributes?: Record<string, unknown> | undefined;
198
+ relationships?: Record<string, unknown> | undefined;
199
+ links?: Record<string, string> | undefined;
200
+ meta?: Record<string, unknown> | undefined;
201
+ }>, "many">>;
202
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
203
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
204
+ }, "strip", z.ZodTypeAny, {
205
+ data: {
206
+ type: string;
207
+ id: string;
208
+ attributes: {
209
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
210
+ title: string;
211
+ source: "field_alert" | "notification" | "vendor_payment";
212
+ createdAt: string;
213
+ metadata: Record<string, unknown> | null;
214
+ body: string;
215
+ farmId: string | null;
216
+ userId: string;
217
+ readAt: string | null;
218
+ };
219
+ relationships?: Record<string, unknown> | undefined;
220
+ links?: Record<string, string> | undefined;
221
+ meta?: Record<string, unknown> | undefined;
222
+ };
223
+ links?: Record<string, string> | undefined;
224
+ meta?: Record<string, unknown> | undefined;
225
+ included?: {
226
+ type: string;
227
+ id: string;
228
+ attributes?: Record<string, unknown> | undefined;
229
+ relationships?: Record<string, unknown> | undefined;
230
+ links?: Record<string, string> | undefined;
231
+ meta?: Record<string, unknown> | undefined;
232
+ }[] | undefined;
233
+ }, {
234
+ data: {
235
+ type: string;
236
+ id: string;
237
+ attributes: {
238
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
239
+ title: string;
240
+ source: "field_alert" | "notification" | "vendor_payment";
241
+ createdAt: string;
242
+ metadata: Record<string, unknown> | null;
243
+ body: string;
244
+ farmId: string | null;
245
+ userId: string;
246
+ readAt: string | null;
247
+ };
248
+ relationships?: Record<string, unknown> | undefined;
249
+ links?: Record<string, string> | undefined;
250
+ meta?: Record<string, unknown> | undefined;
251
+ };
252
+ links?: Record<string, string> | undefined;
253
+ meta?: Record<string, unknown> | undefined;
254
+ included?: {
255
+ type: string;
256
+ id: string;
257
+ attributes?: Record<string, unknown> | undefined;
258
+ relationships?: Record<string, unknown> | undefined;
259
+ links?: Record<string, string> | undefined;
260
+ meta?: Record<string, unknown> | undefined;
261
+ }[] | undefined;
262
+ }>;
263
+ export declare const notificationListResponseSchema: z.ZodObject<{
264
+ data: z.ZodArray<z.ZodObject<{
265
+ type: z.ZodLiteral<string>;
266
+ id: z.ZodString;
267
+ attributes: z.ZodObject<{
268
+ userId: z.ZodString;
269
+ farmId: z.ZodNullable<z.ZodString>;
270
+ type: z.ZodEnum<["field_alert", "weather", "task", "payment", "system", "subscription", "team", "camera"]>;
271
+ title: z.ZodString;
272
+ body: z.ZodString;
273
+ readAt: z.ZodNullable<z.ZodString>;
274
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
275
+ source: z.ZodEnum<["notification", "field_alert", "vendor_payment"]>;
276
+ createdAt: z.ZodString;
277
+ }, "strip", z.ZodTypeAny, {
278
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
279
+ title: string;
280
+ source: "field_alert" | "notification" | "vendor_payment";
281
+ createdAt: string;
282
+ metadata: Record<string, unknown> | null;
283
+ body: string;
284
+ farmId: string | null;
285
+ userId: string;
286
+ readAt: string | null;
287
+ }, {
288
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
289
+ title: string;
290
+ source: "field_alert" | "notification" | "vendor_payment";
291
+ createdAt: string;
292
+ metadata: Record<string, unknown> | null;
293
+ body: string;
294
+ farmId: string | null;
295
+ userId: string;
296
+ readAt: string | null;
297
+ }>;
298
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
299
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
300
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
301
+ }, "strip", z.ZodTypeAny, {
302
+ type: string;
303
+ id: string;
304
+ attributes: {
305
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
306
+ title: string;
307
+ source: "field_alert" | "notification" | "vendor_payment";
308
+ createdAt: string;
309
+ metadata: Record<string, unknown> | null;
310
+ body: string;
311
+ farmId: string | null;
312
+ userId: string;
313
+ readAt: string | null;
314
+ };
315
+ relationships?: Record<string, unknown> | undefined;
316
+ links?: Record<string, string> | undefined;
317
+ meta?: Record<string, unknown> | undefined;
318
+ }, {
319
+ type: string;
320
+ id: string;
321
+ attributes: {
322
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
323
+ title: string;
324
+ source: "field_alert" | "notification" | "vendor_payment";
325
+ createdAt: string;
326
+ metadata: Record<string, unknown> | null;
327
+ body: string;
328
+ farmId: string | null;
329
+ userId: string;
330
+ readAt: string | null;
331
+ };
332
+ relationships?: Record<string, unknown> | undefined;
333
+ links?: Record<string, string> | undefined;
334
+ meta?: Record<string, unknown> | undefined;
335
+ }>, "many">;
336
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
337
+ type: z.ZodString;
338
+ id: z.ZodString;
339
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
340
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
341
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
342
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
343
+ }, "strip", z.ZodTypeAny, {
344
+ type: string;
345
+ id: string;
346
+ attributes?: Record<string, unknown> | undefined;
347
+ relationships?: Record<string, unknown> | undefined;
348
+ links?: Record<string, string> | undefined;
349
+ meta?: Record<string, unknown> | undefined;
350
+ }, {
351
+ type: string;
352
+ id: string;
353
+ attributes?: Record<string, unknown> | undefined;
354
+ relationships?: Record<string, unknown> | undefined;
355
+ links?: Record<string, string> | undefined;
356
+ meta?: Record<string, unknown> | undefined;
357
+ }>, "many">>;
358
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
359
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
360
+ }, "strip", z.ZodTypeAny, {
361
+ data: {
362
+ type: string;
363
+ id: string;
364
+ attributes: {
365
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
366
+ title: string;
367
+ source: "field_alert" | "notification" | "vendor_payment";
368
+ createdAt: string;
369
+ metadata: Record<string, unknown> | null;
370
+ body: string;
371
+ farmId: string | null;
372
+ userId: string;
373
+ readAt: string | null;
374
+ };
375
+ relationships?: Record<string, unknown> | undefined;
376
+ links?: Record<string, string> | undefined;
377
+ meta?: Record<string, unknown> | undefined;
378
+ }[];
379
+ links?: Record<string, string> | undefined;
380
+ meta?: Record<string, unknown> | undefined;
381
+ included?: {
382
+ type: string;
383
+ id: string;
384
+ attributes?: Record<string, unknown> | undefined;
385
+ relationships?: Record<string, unknown> | undefined;
386
+ links?: Record<string, string> | undefined;
387
+ meta?: Record<string, unknown> | undefined;
388
+ }[] | undefined;
389
+ }, {
390
+ data: {
391
+ type: string;
392
+ id: string;
393
+ attributes: {
394
+ type: "team" | "weather" | "field_alert" | "task" | "payment" | "system" | "subscription" | "camera";
395
+ title: string;
396
+ source: "field_alert" | "notification" | "vendor_payment";
397
+ createdAt: string;
398
+ metadata: Record<string, unknown> | null;
399
+ body: string;
400
+ farmId: string | null;
401
+ userId: string;
402
+ readAt: string | null;
403
+ };
404
+ relationships?: Record<string, unknown> | undefined;
405
+ links?: Record<string, string> | undefined;
406
+ meta?: Record<string, unknown> | undefined;
407
+ }[];
408
+ links?: Record<string, string> | undefined;
409
+ meta?: Record<string, unknown> | undefined;
410
+ included?: {
411
+ type: string;
412
+ id: string;
413
+ attributes?: Record<string, unknown> | undefined;
414
+ relationships?: Record<string, unknown> | undefined;
415
+ links?: Record<string, string> | undefined;
416
+ meta?: Record<string, unknown> | undefined;
417
+ }[] | undefined;
418
+ }>;
419
+ export declare const unreadCountResponseSchema: z.ZodObject<{
420
+ data: z.ZodObject<{
421
+ type: z.ZodLiteral<"notification-unread-count">;
422
+ id: z.ZodString;
423
+ attributes: z.ZodObject<{
424
+ count: z.ZodNumber;
425
+ }, "strip", z.ZodTypeAny, {
426
+ count: number;
427
+ }, {
428
+ count: number;
429
+ }>;
430
+ }, "strip", z.ZodTypeAny, {
431
+ type: "notification-unread-count";
432
+ id: string;
433
+ attributes: {
434
+ count: number;
435
+ };
436
+ }, {
437
+ type: "notification-unread-count";
438
+ id: string;
439
+ attributes: {
440
+ count: number;
441
+ };
442
+ }>;
443
+ }, "strip", z.ZodTypeAny, {
444
+ data: {
445
+ type: "notification-unread-count";
446
+ id: string;
447
+ attributes: {
448
+ count: number;
449
+ };
450
+ };
451
+ }, {
452
+ data: {
453
+ type: "notification-unread-count";
454
+ id: string;
455
+ attributes: {
456
+ count: number;
457
+ };
458
+ };
459
+ }>;
460
+ export type NotificationType = z.infer<typeof notificationTypeSchema>;
461
+ export type NotificationAttributes = z.infer<typeof notificationAttributesSchema>;
462
+ export type NotificationListResponse = z.infer<typeof notificationListResponseSchema>;
463
+ export type UnreadCountResponse = z.infer<typeof unreadCountResponseSchema>;
464
+ //# sourceMappingURL=notifications.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/notifications.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,sBAAsB,sGASjC,CAAC;AAEH,eAAO,MAAM,wBAAwB,8DAInC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUvC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEtC,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE1C,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQpC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { z } from 'zod';
2
+ import { createJsonApiResourceSchema, jsonApiSingleResponseSchema, jsonApiCollectionResponseSchema, } from './common.schemas';
3
+ export const notificationTypeSchema = z.enum([
4
+ 'field_alert',
5
+ 'weather',
6
+ 'task',
7
+ 'payment',
8
+ 'system',
9
+ 'subscription',
10
+ 'team',
11
+ 'camera',
12
+ ]);
13
+ export const notificationSourceSchema = z.enum([
14
+ 'notification',
15
+ 'field_alert',
16
+ 'vendor_payment',
17
+ ]);
18
+ export const notificationAttributesSchema = z.object({
19
+ userId: z.string().uuid(),
20
+ farmId: z.string().uuid().nullable(),
21
+ type: notificationTypeSchema,
22
+ title: z.string(),
23
+ body: z.string(),
24
+ readAt: z.string().datetime().nullable(),
25
+ metadata: z.record(z.unknown()).nullable(),
26
+ source: notificationSourceSchema,
27
+ createdAt: z.string().datetime(),
28
+ });
29
+ export const notificationResourceSchema = createJsonApiResourceSchema('notifications', notificationAttributesSchema);
30
+ export const notificationResponseSchema = jsonApiSingleResponseSchema(notificationResourceSchema);
31
+ export const notificationListResponseSchema = jsonApiCollectionResponseSchema(notificationResourceSchema);
32
+ export const unreadCountResponseSchema = z.object({
33
+ data: z.object({
34
+ type: z.literal('notification-unread-count'),
35
+ id: z.string(),
36
+ attributes: z.object({
37
+ count: z.number().int().nonnegative(),
38
+ }),
39
+ }),
40
+ });