@deepintel-ltd/farmpro-contracts 1.3.3 → 1.3.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.
@@ -0,0 +1,176 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Health status for individual services
4
+ */
5
+ export declare const serviceHealthSchema: z.ZodObject<{
6
+ status: z.ZodEnum<["healthy", "unhealthy", "degraded"]>;
7
+ message: z.ZodOptional<z.ZodString>;
8
+ responseTime: z.ZodOptional<z.ZodNumber>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ status: "healthy" | "unhealthy" | "degraded";
11
+ message?: string | undefined;
12
+ responseTime?: number | undefined;
13
+ }, {
14
+ status: "healthy" | "unhealthy" | "degraded";
15
+ message?: string | undefined;
16
+ responseTime?: number | undefined;
17
+ }>;
18
+ /**
19
+ * Overall health check response
20
+ */
21
+ export declare const healthCheckResponseSchema: z.ZodObject<{
22
+ status: z.ZodEnum<["healthy", "unhealthy", "degraded"]>;
23
+ timestamp: z.ZodString;
24
+ uptime: z.ZodNumber;
25
+ services: z.ZodObject<{
26
+ database: z.ZodObject<{
27
+ status: z.ZodEnum<["healthy", "unhealthy", "degraded"]>;
28
+ message: z.ZodOptional<z.ZodString>;
29
+ responseTime: z.ZodOptional<z.ZodNumber>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ status: "healthy" | "unhealthy" | "degraded";
32
+ message?: string | undefined;
33
+ responseTime?: number | undefined;
34
+ }, {
35
+ status: "healthy" | "unhealthy" | "degraded";
36
+ message?: string | undefined;
37
+ responseTime?: number | undefined;
38
+ }>;
39
+ redis: z.ZodObject<{
40
+ status: z.ZodEnum<["healthy", "unhealthy", "degraded"]>;
41
+ message: z.ZodOptional<z.ZodString>;
42
+ responseTime: z.ZodOptional<z.ZodNumber>;
43
+ }, "strip", z.ZodTypeAny, {
44
+ status: "healthy" | "unhealthy" | "degraded";
45
+ message?: string | undefined;
46
+ responseTime?: number | undefined;
47
+ }, {
48
+ status: "healthy" | "unhealthy" | "degraded";
49
+ message?: string | undefined;
50
+ responseTime?: number | undefined;
51
+ }>;
52
+ storage: z.ZodOptional<z.ZodObject<{
53
+ status: z.ZodEnum<["healthy", "unhealthy", "degraded"]>;
54
+ message: z.ZodOptional<z.ZodString>;
55
+ responseTime: z.ZodOptional<z.ZodNumber>;
56
+ }, "strip", z.ZodTypeAny, {
57
+ status: "healthy" | "unhealthy" | "degraded";
58
+ message?: string | undefined;
59
+ responseTime?: number | undefined;
60
+ }, {
61
+ status: "healthy" | "unhealthy" | "degraded";
62
+ message?: string | undefined;
63
+ responseTime?: number | undefined;
64
+ }>>;
65
+ timescale: z.ZodOptional<z.ZodObject<{
66
+ status: z.ZodEnum<["healthy", "unhealthy", "degraded"]>;
67
+ message: z.ZodOptional<z.ZodString>;
68
+ responseTime: z.ZodOptional<z.ZodNumber>;
69
+ }, "strip", z.ZodTypeAny, {
70
+ status: "healthy" | "unhealthy" | "degraded";
71
+ message?: string | undefined;
72
+ responseTime?: number | undefined;
73
+ }, {
74
+ status: "healthy" | "unhealthy" | "degraded";
75
+ message?: string | undefined;
76
+ responseTime?: number | undefined;
77
+ }>>;
78
+ }, "strip", z.ZodTypeAny, {
79
+ database: {
80
+ status: "healthy" | "unhealthy" | "degraded";
81
+ message?: string | undefined;
82
+ responseTime?: number | undefined;
83
+ };
84
+ redis: {
85
+ status: "healthy" | "unhealthy" | "degraded";
86
+ message?: string | undefined;
87
+ responseTime?: number | undefined;
88
+ };
89
+ storage?: {
90
+ status: "healthy" | "unhealthy" | "degraded";
91
+ message?: string | undefined;
92
+ responseTime?: number | undefined;
93
+ } | undefined;
94
+ timescale?: {
95
+ status: "healthy" | "unhealthy" | "degraded";
96
+ message?: string | undefined;
97
+ responseTime?: number | undefined;
98
+ } | undefined;
99
+ }, {
100
+ database: {
101
+ status: "healthy" | "unhealthy" | "degraded";
102
+ message?: string | undefined;
103
+ responseTime?: number | undefined;
104
+ };
105
+ redis: {
106
+ status: "healthy" | "unhealthy" | "degraded";
107
+ message?: string | undefined;
108
+ responseTime?: number | undefined;
109
+ };
110
+ storage?: {
111
+ status: "healthy" | "unhealthy" | "degraded";
112
+ message?: string | undefined;
113
+ responseTime?: number | undefined;
114
+ } | undefined;
115
+ timescale?: {
116
+ status: "healthy" | "unhealthy" | "degraded";
117
+ message?: string | undefined;
118
+ responseTime?: number | undefined;
119
+ } | undefined;
120
+ }>;
121
+ }, "strip", z.ZodTypeAny, {
122
+ status: "healthy" | "unhealthy" | "degraded";
123
+ timestamp: string;
124
+ uptime: number;
125
+ services: {
126
+ database: {
127
+ status: "healthy" | "unhealthy" | "degraded";
128
+ message?: string | undefined;
129
+ responseTime?: number | undefined;
130
+ };
131
+ redis: {
132
+ status: "healthy" | "unhealthy" | "degraded";
133
+ message?: string | undefined;
134
+ responseTime?: number | undefined;
135
+ };
136
+ storage?: {
137
+ status: "healthy" | "unhealthy" | "degraded";
138
+ message?: string | undefined;
139
+ responseTime?: number | undefined;
140
+ } | undefined;
141
+ timescale?: {
142
+ status: "healthy" | "unhealthy" | "degraded";
143
+ message?: string | undefined;
144
+ responseTime?: number | undefined;
145
+ } | undefined;
146
+ };
147
+ }, {
148
+ status: "healthy" | "unhealthy" | "degraded";
149
+ timestamp: string;
150
+ uptime: number;
151
+ services: {
152
+ database: {
153
+ status: "healthy" | "unhealthy" | "degraded";
154
+ message?: string | undefined;
155
+ responseTime?: number | undefined;
156
+ };
157
+ redis: {
158
+ status: "healthy" | "unhealthy" | "degraded";
159
+ message?: string | undefined;
160
+ responseTime?: number | undefined;
161
+ };
162
+ storage?: {
163
+ status: "healthy" | "unhealthy" | "degraded";
164
+ message?: string | undefined;
165
+ responseTime?: number | undefined;
166
+ } | undefined;
167
+ timescale?: {
168
+ status: "healthy" | "unhealthy" | "degraded";
169
+ message?: string | undefined;
170
+ responseTime?: number | undefined;
171
+ } | undefined;
172
+ };
173
+ }>;
174
+ export type ServiceHealth = z.infer<typeof serviceHealthSchema>;
175
+ export type HealthCheckResponse = z.infer<typeof healthCheckResponseSchema>;
176
+ //# sourceMappingURL=health.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/health.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUpC,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.healthCheckResponseSchema = exports.serviceHealthSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Health status for individual services
7
+ */
8
+ exports.serviceHealthSchema = zod_1.z.object({
9
+ status: zod_1.z.enum(['healthy', 'unhealthy', 'degraded']),
10
+ message: zod_1.z.string().optional(),
11
+ responseTime: zod_1.z.number().optional(), // in milliseconds
12
+ });
13
+ /**
14
+ * Overall health check response
15
+ */
16
+ exports.healthCheckResponseSchema = zod_1.z.object({
17
+ status: zod_1.z.enum(['healthy', 'unhealthy', 'degraded']),
18
+ timestamp: zod_1.z.string().datetime(),
19
+ uptime: zod_1.z.number(), // in seconds
20
+ services: zod_1.z.object({
21
+ database: exports.serviceHealthSchema,
22
+ redis: exports.serviceHealthSchema,
23
+ storage: exports.serviceHealthSchema.optional(),
24
+ timescale: exports.serviceHealthSchema.optional(),
25
+ }),
26
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepintel-ltd/farmpro-contracts",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Type-safe API contracts for FarmPro API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",