@deepintel-ltd/farmpro-contracts 1.0.2 → 1.0.4

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 (106) hide show
  1. package/dist/index.d.ts +43 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +84 -0
  4. package/dist/routes/analytics.routes.d.ts +754 -0
  5. package/dist/routes/analytics.routes.d.ts.map +1 -0
  6. package/dist/routes/analytics.routes.js +24 -0
  7. package/dist/routes/auth.routes.d.ts +3836 -0
  8. package/dist/routes/auth.routes.d.ts.map +1 -0
  9. package/dist/routes/auth.routes.js +158 -0
  10. package/dist/routes/categories.routes.d.ts +800 -0
  11. package/dist/routes/categories.routes.d.ts.map +1 -0
  12. package/dist/routes/categories.routes.js +120 -0
  13. package/dist/routes/documents.routes.d.ts +2476 -0
  14. package/dist/routes/documents.routes.d.ts.map +1 -0
  15. package/dist/routes/documents.routes.js +100 -0
  16. package/dist/routes/equipment.routes.d.ts +3617 -0
  17. package/dist/routes/equipment.routes.d.ts.map +1 -0
  18. package/dist/routes/equipment.routes.js +118 -0
  19. package/dist/routes/farms.routes.d.ts +2202 -0
  20. package/dist/routes/farms.routes.d.ts.map +1 -0
  21. package/dist/routes/farms.routes.js +111 -0
  22. package/dist/routes/fields.routes.d.ts +3479 -0
  23. package/dist/routes/fields.routes.d.ts.map +1 -0
  24. package/dist/routes/fields.routes.js +96 -0
  25. package/dist/routes/finance.routes.d.ts +6855 -0
  26. package/dist/routes/finance.routes.d.ts.map +1 -0
  27. package/dist/routes/finance.routes.js +259 -0
  28. package/dist/routes/harvest.routes.d.ts +2337 -0
  29. package/dist/routes/harvest.routes.d.ts.map +1 -0
  30. package/dist/routes/harvest.routes.js +99 -0
  31. package/dist/routes/index.d.ts +71 -0
  32. package/dist/routes/index.d.ts.map +1 -0
  33. package/dist/routes/index.js +45 -0
  34. package/dist/routes/inventory.routes.d.ts +2853 -0
  35. package/dist/routes/inventory.routes.d.ts.map +1 -0
  36. package/dist/routes/inventory.routes.js +121 -0
  37. package/dist/routes/soil-tests.routes.d.ts +3005 -0
  38. package/dist/routes/soil-tests.routes.d.ts.map +1 -0
  39. package/dist/routes/soil-tests.routes.js +98 -0
  40. package/dist/routes/suppliers.routes.d.ts +4190 -0
  41. package/dist/routes/suppliers.routes.d.ts.map +1 -0
  42. package/dist/routes/suppliers.routes.js +146 -0
  43. package/dist/routes/tasks.routes.d.ts +4248 -0
  44. package/dist/routes/tasks.routes.d.ts.map +1 -0
  45. package/dist/routes/tasks.routes.js +138 -0
  46. package/dist/routes/team.routes.d.ts +2210 -0
  47. package/dist/routes/team.routes.d.ts.map +1 -0
  48. package/dist/routes/team.routes.js +98 -0
  49. package/dist/routes/users.routes.d.ts +721 -0
  50. package/dist/routes/users.routes.d.ts.map +1 -0
  51. package/dist/routes/users.routes.js +35 -0
  52. package/dist/routes/weather.routes.d.ts +500 -0
  53. package/dist/routes/weather.routes.d.ts.map +1 -0
  54. package/dist/routes/weather.routes.js +23 -0
  55. package/dist/schemas/analytics.schemas.d.ts +1344 -0
  56. package/dist/schemas/analytics.schemas.d.ts.map +1 -0
  57. package/dist/schemas/analytics.schemas.js +73 -0
  58. package/dist/schemas/auth.schemas.d.ts +1093 -0
  59. package/dist/schemas/auth.schemas.d.ts.map +1 -0
  60. package/dist/schemas/auth.schemas.js +159 -0
  61. package/dist/schemas/categories.schemas.d.ts +471 -0
  62. package/dist/schemas/categories.schemas.d.ts.map +1 -0
  63. package/dist/schemas/categories.schemas.js +51 -0
  64. package/dist/schemas/common.schemas.d.ts +562 -0
  65. package/dist/schemas/common.schemas.d.ts.map +1 -0
  66. package/dist/schemas/common.schemas.js +122 -0
  67. package/dist/schemas/documents.schemas.d.ts +850 -0
  68. package/dist/schemas/documents.schemas.d.ts.map +1 -0
  69. package/dist/schemas/documents.schemas.js +75 -0
  70. package/dist/schemas/equipment.schemas.d.ts +1618 -0
  71. package/dist/schemas/equipment.schemas.d.ts.map +1 -0
  72. package/dist/schemas/equipment.schemas.js +125 -0
  73. package/dist/schemas/farms.schemas.d.ts +1171 -0
  74. package/dist/schemas/farms.schemas.d.ts.map +1 -0
  75. package/dist/schemas/farms.schemas.js +62 -0
  76. package/dist/schemas/fields.schemas.d.ts +2508 -0
  77. package/dist/schemas/fields.schemas.d.ts.map +1 -0
  78. package/dist/schemas/fields.schemas.js +125 -0
  79. package/dist/schemas/finance.schemas.d.ts +2869 -0
  80. package/dist/schemas/finance.schemas.d.ts.map +1 -0
  81. package/dist/schemas/finance.schemas.js +196 -0
  82. package/dist/schemas/harvest.schemas.d.ts +1051 -0
  83. package/dist/schemas/harvest.schemas.d.ts.map +1 -0
  84. package/dist/schemas/harvest.schemas.js +71 -0
  85. package/dist/schemas/inventory.schemas.d.ts +1138 -0
  86. package/dist/schemas/inventory.schemas.d.ts.map +1 -0
  87. package/dist/schemas/inventory.schemas.js +89 -0
  88. package/dist/schemas/soil-tests.schemas.d.ts +1885 -0
  89. package/dist/schemas/soil-tests.schemas.d.ts.map +1 -0
  90. package/dist/schemas/soil-tests.schemas.js +102 -0
  91. package/dist/schemas/suppliers.schemas.d.ts +1774 -0
  92. package/dist/schemas/suppliers.schemas.d.ts.map +1 -0
  93. package/dist/schemas/suppliers.schemas.js +121 -0
  94. package/dist/schemas/tasks.schemas.d.ts +1811 -0
  95. package/dist/schemas/tasks.schemas.d.ts.map +1 -0
  96. package/dist/schemas/tasks.schemas.js +124 -0
  97. package/dist/schemas/team.schemas.d.ts +583 -0
  98. package/dist/schemas/team.schemas.d.ts.map +1 -0
  99. package/dist/schemas/team.schemas.js +60 -0
  100. package/dist/schemas/users.schemas.d.ts +288 -0
  101. package/dist/schemas/users.schemas.d.ts.map +1 -0
  102. package/dist/schemas/users.schemas.js +32 -0
  103. package/dist/schemas/weather.schemas.d.ts +682 -0
  104. package/dist/schemas/weather.schemas.d.ts.map +1 -0
  105. package/dist/schemas/weather.schemas.js +49 -0
  106. package/package.json +1 -1
@@ -0,0 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkH1B,CAAC"}
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.equipmentRouter = void 0;
4
+ const core_1 = require("@ts-rest/core");
5
+ const zod_1 = require("zod");
6
+ const equipment_schemas_1 = require("../schemas/equipment.schemas");
7
+ const common_schemas_1 = require("../schemas/common.schemas");
8
+ const c = (0, core_1.initContract)();
9
+ exports.equipmentRouter = c.router({
10
+ // List equipment for a farm
11
+ listEquipment: {
12
+ method: 'GET',
13
+ path: '/farms/:farmId/equipment',
14
+ pathParams: zod_1.z.object({ farmId: zod_1.z.string().uuid() }),
15
+ query: common_schemas_1.jsonApiPaginationQuerySchema
16
+ .merge(common_schemas_1.jsonApiSortQuerySchema)
17
+ .merge(common_schemas_1.jsonApiIncludeQuerySchema)
18
+ .merge(common_schemas_1.jsonApiFilterQuerySchema)
19
+ .merge(zod_1.z.object({
20
+ 'filter[type]': equipment_schemas_1.equipmentTypeSchema.optional(),
21
+ 'filter[status]': equipment_schemas_1.equipmentStatusSchema.optional(),
22
+ })),
23
+ responses: {
24
+ 200: equipment_schemas_1.equipmentListResponseSchema,
25
+ 404: common_schemas_1.jsonApiErrorResponseSchema,
26
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
27
+ },
28
+ summary: 'List equipment',
29
+ description: 'Get all equipment for a farm with optional filtering',
30
+ },
31
+ // Create equipment
32
+ createEquipment: {
33
+ method: 'POST',
34
+ path: '/farms/:farmId/equipment',
35
+ pathParams: zod_1.z.object({ farmId: zod_1.z.string().uuid() }),
36
+ body: zod_1.z.object({ data: equipment_schemas_1.createEquipmentSchema }),
37
+ responses: {
38
+ 201: equipment_schemas_1.equipmentResponseSchema,
39
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
40
+ 404: common_schemas_1.jsonApiErrorResponseSchema,
41
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
42
+ 422: common_schemas_1.jsonApiErrorResponseSchema,
43
+ },
44
+ summary: 'Create equipment',
45
+ description: 'Add new equipment to the farm',
46
+ },
47
+ // Get equipment by ID
48
+ getEquipment: {
49
+ method: 'GET',
50
+ path: '/farms/:farmId/equipment/:id',
51
+ pathParams: zod_1.z.object({
52
+ farmId: zod_1.z.string().uuid(),
53
+ id: zod_1.z.string().uuid(),
54
+ }),
55
+ query: common_schemas_1.jsonApiIncludeQuerySchema,
56
+ responses: {
57
+ 200: equipment_schemas_1.equipmentResponseSchema,
58
+ 404: common_schemas_1.jsonApiErrorResponseSchema,
59
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
60
+ },
61
+ summary: 'Get equipment by ID',
62
+ description: 'Get detailed information about equipment',
63
+ },
64
+ // Update equipment
65
+ updateEquipment: {
66
+ method: 'PATCH',
67
+ path: '/farms/:farmId/equipment/:id',
68
+ pathParams: zod_1.z.object({
69
+ farmId: zod_1.z.string().uuid(),
70
+ id: zod_1.z.string().uuid(),
71
+ }),
72
+ body: zod_1.z.object({ data: equipment_schemas_1.updateEquipmentSchema }),
73
+ responses: {
74
+ 200: equipment_schemas_1.equipmentResponseSchema,
75
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
76
+ 404: common_schemas_1.jsonApiErrorResponseSchema,
77
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
78
+ 422: common_schemas_1.jsonApiErrorResponseSchema,
79
+ },
80
+ summary: 'Update equipment',
81
+ description: 'Update equipment information',
82
+ },
83
+ // Delete equipment
84
+ deleteEquipment: {
85
+ method: 'DELETE',
86
+ path: '/farms/:farmId/equipment/:id',
87
+ pathParams: zod_1.z.object({
88
+ farmId: zod_1.z.string().uuid(),
89
+ id: zod_1.z.string().uuid(),
90
+ }),
91
+ responses: {
92
+ 204: common_schemas_1.jsonApiSuccessResponseSchema,
93
+ 404: common_schemas_1.jsonApiErrorResponseSchema,
94
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
95
+ },
96
+ summary: 'Delete equipment',
97
+ description: 'Delete equipment record',
98
+ },
99
+ // Add maintenance record
100
+ addMaintenanceRecord: {
101
+ method: 'POST',
102
+ path: '/farms/:farmId/equipment/:id/maintenance',
103
+ pathParams: zod_1.z.object({
104
+ farmId: zod_1.z.string().uuid(),
105
+ id: zod_1.z.string().uuid(),
106
+ }),
107
+ body: zod_1.z.object({ data: equipment_schemas_1.createMaintenanceRecordSchema }),
108
+ responses: {
109
+ 201: equipment_schemas_1.maintenanceRecordSchema,
110
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
111
+ 404: common_schemas_1.jsonApiErrorResponseSchema,
112
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
113
+ 422: common_schemas_1.jsonApiErrorResponseSchema,
114
+ },
115
+ summary: 'Add maintenance record',
116
+ description: 'Record maintenance performed on equipment',
117
+ },
118
+ });