@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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+JrB,CAAC"}
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.authRouter = void 0;
4
+ const core_1 = require("@ts-rest/core");
5
+ const zod_1 = require("zod");
6
+ const auth_schemas_1 = require("../schemas/auth.schemas");
7
+ const common_schemas_1 = require("../schemas/common.schemas");
8
+ const c = (0, core_1.initContract)();
9
+ exports.authRouter = c.router({
10
+ // Login with email/password
11
+ login: {
12
+ method: 'POST',
13
+ path: '/auth/login',
14
+ body: zod_1.z.object({ data: auth_schemas_1.loginSchema }),
15
+ responses: {
16
+ 200: auth_schemas_1.authResponseSchema,
17
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
18
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
19
+ 422: common_schemas_1.jsonApiErrorResponseSchema,
20
+ },
21
+ summary: 'Login with email and password',
22
+ description: 'Authenticate user with email and password, returns user data and tokens',
23
+ },
24
+ // Signup/Register
25
+ signup: {
26
+ method: 'POST',
27
+ path: '/auth/signup',
28
+ body: zod_1.z.object({ data: auth_schemas_1.signupSchema }),
29
+ responses: {
30
+ 201: auth_schemas_1.authResponseSchema,
31
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
32
+ 409: common_schemas_1.jsonApiErrorResponseSchema,
33
+ 422: common_schemas_1.jsonApiErrorResponseSchema,
34
+ },
35
+ summary: 'Register new user',
36
+ description: 'Create a new user account with email and password',
37
+ },
38
+ // Google OAuth - Initiate
39
+ googleAuthInitiate: {
40
+ method: 'POST',
41
+ path: '/auth/google/initiate',
42
+ body: zod_1.z.object({ data: auth_schemas_1.googleAuthInitiateSchema }),
43
+ responses: {
44
+ 200: auth_schemas_1.googleAuthInitiateResponseSchema,
45
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
46
+ 422: common_schemas_1.jsonApiErrorResponseSchema,
47
+ },
48
+ summary: 'Initiate Google OAuth flow',
49
+ description: 'Get Google OAuth authorization URL and state token',
50
+ },
51
+ // Google OAuth - Callback
52
+ googleAuthCallback: {
53
+ method: 'POST',
54
+ path: '/auth/google/callback',
55
+ body: zod_1.z.object({ data: auth_schemas_1.googleAuthCallbackSchema }),
56
+ responses: {
57
+ 200: auth_schemas_1.authResponseSchema,
58
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
59
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
60
+ 422: common_schemas_1.jsonApiErrorResponseSchema,
61
+ },
62
+ summary: 'Handle Google OAuth callback',
63
+ description: 'Exchange Google OAuth code for access and refresh tokens',
64
+ },
65
+ // Refresh token
66
+ refreshToken: {
67
+ method: 'POST',
68
+ path: '/auth/refresh',
69
+ body: zod_1.z.object({ data: auth_schemas_1.refreshTokenSchema }),
70
+ responses: {
71
+ 200: auth_schemas_1.refreshTokenResponseSchema,
72
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
73
+ 422: common_schemas_1.jsonApiErrorResponseSchema,
74
+ },
75
+ summary: 'Refresh access token',
76
+ description: 'Get a new access token using a valid refresh token',
77
+ },
78
+ // Logout
79
+ logout: {
80
+ method: 'POST',
81
+ path: '/auth/logout',
82
+ body: zod_1.z.object({ data: auth_schemas_1.logoutSchema }),
83
+ responses: {
84
+ 200: auth_schemas_1.logoutResponseSchema,
85
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
86
+ },
87
+ summary: 'Logout user',
88
+ description: 'Invalidate user session and optionally refresh token',
89
+ },
90
+ // Request password reset
91
+ requestPasswordReset: {
92
+ method: 'POST',
93
+ path: '/auth/password/reset-request',
94
+ body: zod_1.z.object({ data: auth_schemas_1.requestPasswordResetSchema }),
95
+ responses: {
96
+ 200: auth_schemas_1.passwordResetResponseSchema,
97
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
98
+ 422: common_schemas_1.jsonApiErrorResponseSchema,
99
+ },
100
+ summary: 'Request password reset',
101
+ description: 'Send password reset email to user',
102
+ },
103
+ // Reset password
104
+ resetPassword: {
105
+ method: 'POST',
106
+ path: '/auth/password/reset',
107
+ body: zod_1.z.object({ data: auth_schemas_1.resetPasswordSchema }),
108
+ responses: {
109
+ 200: auth_schemas_1.passwordResetResponseSchema,
110
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
111
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
112
+ 422: common_schemas_1.jsonApiErrorResponseSchema,
113
+ },
114
+ summary: 'Reset password',
115
+ description: 'Reset password using token from email',
116
+ },
117
+ // Change password (authenticated)
118
+ changePassword: {
119
+ method: 'POST',
120
+ path: '/auth/password/change',
121
+ body: zod_1.z.object({ data: auth_schemas_1.changePasswordSchema }),
122
+ responses: {
123
+ 200: auth_schemas_1.passwordResetResponseSchema,
124
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
125
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
126
+ 422: common_schemas_1.jsonApiErrorResponseSchema,
127
+ },
128
+ summary: 'Change password',
129
+ description: 'Change password for authenticated user',
130
+ },
131
+ // Verify email
132
+ verifyEmail: {
133
+ method: 'POST',
134
+ path: '/auth/email/verify',
135
+ body: zod_1.z.object({ data: auth_schemas_1.verifyEmailSchema }),
136
+ responses: {
137
+ 200: auth_schemas_1.emailVerificationResponseSchema,
138
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
139
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
140
+ 422: common_schemas_1.jsonApiErrorResponseSchema,
141
+ },
142
+ summary: 'Verify email address',
143
+ description: 'Verify email address using token from email',
144
+ },
145
+ // Resend verification email
146
+ resendVerification: {
147
+ method: 'POST',
148
+ path: '/auth/email/resend-verification',
149
+ body: zod_1.z.object({ data: auth_schemas_1.resendVerificationSchema }),
150
+ responses: {
151
+ 200: auth_schemas_1.emailVerificationResponseSchema,
152
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
153
+ 422: common_schemas_1.jsonApiErrorResponseSchema,
154
+ },
155
+ summary: 'Resend verification email',
156
+ description: 'Resend email verification link',
157
+ },
158
+ });