@deepintel-ltd/farmpro-contracts 1.8.0 → 1.9.0

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.
@@ -0,0 +1,232 @@
1
+ import { z } from 'zod';
2
+ export declare const farmGatewayErrorSchema: z.ZodObject<{
3
+ message: z.ZodString;
4
+ code: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ code: string;
7
+ message: string;
8
+ }, {
9
+ code: string;
10
+ message: string;
11
+ }>;
12
+ export declare const createFarmGatewayRequestSchema: z.ZodObject<{
13
+ name: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ name: string;
16
+ }, {
17
+ name: string;
18
+ }>;
19
+ export declare const createFarmGatewayResponseSchema: z.ZodObject<{
20
+ gateway: z.ZodObject<{
21
+ id: z.ZodString;
22
+ name: z.ZodString;
23
+ farmId: z.ZodString;
24
+ createdAt: z.ZodString;
25
+ }, "strip", z.ZodTypeAny, {
26
+ id: string;
27
+ createdAt: string;
28
+ name: string;
29
+ farmId: string;
30
+ }, {
31
+ id: string;
32
+ createdAt: string;
33
+ name: string;
34
+ farmId: string;
35
+ }>;
36
+ apiKey: z.ZodString;
37
+ }, "strip", z.ZodTypeAny, {
38
+ gateway: {
39
+ id: string;
40
+ createdAt: string;
41
+ name: string;
42
+ farmId: string;
43
+ };
44
+ apiKey: string;
45
+ }, {
46
+ gateway: {
47
+ id: string;
48
+ createdAt: string;
49
+ name: string;
50
+ farmId: string;
51
+ };
52
+ apiKey: string;
53
+ }>;
54
+ export declare const farmGatewaySummarySchema: z.ZodObject<{
55
+ id: z.ZodString;
56
+ name: z.ZodString;
57
+ farmId: z.ZodString;
58
+ lastSeenAt: z.ZodNullable<z.ZodString>;
59
+ firmwareVersion: z.ZodNullable<z.ZodString>;
60
+ isOnline: z.ZodBoolean;
61
+ deviceCount: z.ZodNumber;
62
+ onlineDeviceCount: z.ZodNumber;
63
+ createdAt: z.ZodString;
64
+ }, "strip", z.ZodTypeAny, {
65
+ id: string;
66
+ createdAt: string;
67
+ name: string;
68
+ farmId: string;
69
+ firmwareVersion: string | null;
70
+ lastSeenAt: string | null;
71
+ isOnline: boolean;
72
+ deviceCount: number;
73
+ onlineDeviceCount: number;
74
+ }, {
75
+ id: string;
76
+ createdAt: string;
77
+ name: string;
78
+ farmId: string;
79
+ firmwareVersion: string | null;
80
+ lastSeenAt: string | null;
81
+ isOnline: boolean;
82
+ deviceCount: number;
83
+ onlineDeviceCount: number;
84
+ }>;
85
+ export declare const listFarmGatewaysResponseSchema: z.ZodObject<{
86
+ gateways: z.ZodArray<z.ZodObject<{
87
+ id: z.ZodString;
88
+ name: z.ZodString;
89
+ farmId: z.ZodString;
90
+ lastSeenAt: z.ZodNullable<z.ZodString>;
91
+ firmwareVersion: z.ZodNullable<z.ZodString>;
92
+ isOnline: z.ZodBoolean;
93
+ deviceCount: z.ZodNumber;
94
+ onlineDeviceCount: z.ZodNumber;
95
+ createdAt: z.ZodString;
96
+ }, "strip", z.ZodTypeAny, {
97
+ id: string;
98
+ createdAt: string;
99
+ name: string;
100
+ farmId: string;
101
+ firmwareVersion: string | null;
102
+ lastSeenAt: string | null;
103
+ isOnline: boolean;
104
+ deviceCount: number;
105
+ onlineDeviceCount: number;
106
+ }, {
107
+ id: string;
108
+ createdAt: string;
109
+ name: string;
110
+ farmId: string;
111
+ firmwareVersion: string | null;
112
+ lastSeenAt: string | null;
113
+ isOnline: boolean;
114
+ deviceCount: number;
115
+ onlineDeviceCount: number;
116
+ }>, "many">;
117
+ }, "strip", z.ZodTypeAny, {
118
+ gateways: {
119
+ id: string;
120
+ createdAt: string;
121
+ name: string;
122
+ farmId: string;
123
+ firmwareVersion: string | null;
124
+ lastSeenAt: string | null;
125
+ isOnline: boolean;
126
+ deviceCount: number;
127
+ onlineDeviceCount: number;
128
+ }[];
129
+ }, {
130
+ gateways: {
131
+ id: string;
132
+ createdAt: string;
133
+ name: string;
134
+ farmId: string;
135
+ firmwareVersion: string | null;
136
+ lastSeenAt: string | null;
137
+ isOnline: boolean;
138
+ deviceCount: number;
139
+ onlineDeviceCount: number;
140
+ }[];
141
+ }>;
142
+ export declare const updateFarmGatewayRequestSchema: z.ZodObject<{
143
+ name: z.ZodString;
144
+ }, "strip", z.ZodTypeAny, {
145
+ name: string;
146
+ }, {
147
+ name: string;
148
+ }>;
149
+ export declare const updateFarmGatewayResponseSchema: z.ZodObject<{
150
+ gateway: z.ZodObject<{
151
+ id: z.ZodString;
152
+ name: z.ZodString;
153
+ farmId: z.ZodString;
154
+ lastSeenAt: z.ZodNullable<z.ZodString>;
155
+ firmwareVersion: z.ZodNullable<z.ZodString>;
156
+ isOnline: z.ZodBoolean;
157
+ deviceCount: z.ZodNumber;
158
+ onlineDeviceCount: z.ZodNumber;
159
+ createdAt: z.ZodString;
160
+ }, "strip", z.ZodTypeAny, {
161
+ id: string;
162
+ createdAt: string;
163
+ name: string;
164
+ farmId: string;
165
+ firmwareVersion: string | null;
166
+ lastSeenAt: string | null;
167
+ isOnline: boolean;
168
+ deviceCount: number;
169
+ onlineDeviceCount: number;
170
+ }, {
171
+ id: string;
172
+ createdAt: string;
173
+ name: string;
174
+ farmId: string;
175
+ firmwareVersion: string | null;
176
+ lastSeenAt: string | null;
177
+ isOnline: boolean;
178
+ deviceCount: number;
179
+ onlineDeviceCount: number;
180
+ }>;
181
+ }, "strip", z.ZodTypeAny, {
182
+ gateway: {
183
+ id: string;
184
+ createdAt: string;
185
+ name: string;
186
+ farmId: string;
187
+ firmwareVersion: string | null;
188
+ lastSeenAt: string | null;
189
+ isOnline: boolean;
190
+ deviceCount: number;
191
+ onlineDeviceCount: number;
192
+ };
193
+ }, {
194
+ gateway: {
195
+ id: string;
196
+ createdAt: string;
197
+ name: string;
198
+ farmId: string;
199
+ firmwareVersion: string | null;
200
+ lastSeenAt: string | null;
201
+ isOnline: boolean;
202
+ deviceCount: number;
203
+ onlineDeviceCount: number;
204
+ };
205
+ }>;
206
+ export declare const gatewayHeartbeatRequestSchema: z.ZodObject<{
207
+ gatewayId: z.ZodString;
208
+ firmwareVersion: z.ZodOptional<z.ZodString>;
209
+ relayedDeviceCount: z.ZodOptional<z.ZodNumber>;
210
+ wanConnected: z.ZodOptional<z.ZodBoolean>;
211
+ }, "strip", z.ZodTypeAny, {
212
+ gatewayId: string;
213
+ firmwareVersion?: string | undefined;
214
+ relayedDeviceCount?: number | undefined;
215
+ wanConnected?: boolean | undefined;
216
+ }, {
217
+ gatewayId: string;
218
+ firmwareVersion?: string | undefined;
219
+ relayedDeviceCount?: number | undefined;
220
+ wanConnected?: boolean | undefined;
221
+ }>;
222
+ export declare const gatewayHeartbeatResponseSchema: z.ZodObject<{
223
+ serverTime: z.ZodString;
224
+ farmId: z.ZodString;
225
+ }, "strip", z.ZodTypeAny, {
226
+ farmId: string;
227
+ serverTime: string;
228
+ }, {
229
+ farmId: string;
230
+ serverTime: string;
231
+ }>;
232
+ //# sourceMappingURL=farm-gateway.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"farm-gateway.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/farm-gateway.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,sBAAsB;;;;;;;;;EAAoB,CAAC;AAExD,eAAO,MAAM,8BAA8B;;;;;;EAEzC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ1C,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUnC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEzC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;EAEzC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE1C,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;EAKxC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;EAGzC,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { z } from 'zod';
2
+ import { deviceErrorSchema } from './device-gateway.schemas';
3
+ export const farmGatewayErrorSchema = deviceErrorSchema;
4
+ export const createFarmGatewayRequestSchema = z.object({
5
+ name: z.string().min(1).max(200),
6
+ });
7
+ export const createFarmGatewayResponseSchema = z.object({
8
+ gateway: z.object({
9
+ id: z.string().uuid(),
10
+ name: z.string(),
11
+ farmId: z.string().uuid(),
12
+ createdAt: z.string().datetime(),
13
+ }),
14
+ apiKey: z.string(),
15
+ });
16
+ export const farmGatewaySummarySchema = z.object({
17
+ id: z.string().uuid(),
18
+ name: z.string(),
19
+ farmId: z.string().uuid(),
20
+ lastSeenAt: z.string().datetime().nullable(),
21
+ firmwareVersion: z.string().nullable(),
22
+ isOnline: z.boolean(),
23
+ deviceCount: z.number().int().nonnegative(),
24
+ onlineDeviceCount: z.number().int().nonnegative(),
25
+ createdAt: z.string().datetime(),
26
+ });
27
+ export const listFarmGatewaysResponseSchema = z.object({
28
+ gateways: z.array(farmGatewaySummarySchema),
29
+ });
30
+ export const updateFarmGatewayRequestSchema = z.object({
31
+ name: z.string().min(1).max(200),
32
+ });
33
+ export const updateFarmGatewayResponseSchema = z.object({
34
+ gateway: farmGatewaySummarySchema,
35
+ });
36
+ export const gatewayHeartbeatRequestSchema = z.object({
37
+ gatewayId: z.string().uuid(),
38
+ firmwareVersion: z.string().max(50).optional(),
39
+ relayedDeviceCount: z.number().int().nonnegative().optional(),
40
+ wanConnected: z.boolean().optional(),
41
+ });
42
+ export const gatewayHeartbeatResponseSchema = z.object({
43
+ serverTime: z.string().datetime(),
44
+ farmId: z.string().uuid(),
45
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepintel-ltd/farmpro-contracts",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Type-safe API contracts for FarmPro API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",