@checkstack/healthcheck-backend 0.0.2

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,401 @@
1
+ {
2
+ "id": "18e326cb-700a-4c6e-bc15-43335c6bb035",
3
+ "prevId": "065ad01c-dad9-40ea-b099-1959e1e25e93",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.health_check_aggregates": {
8
+ "name": "health_check_aggregates",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "configuration_id": {
19
+ "name": "configuration_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "system_id": {
25
+ "name": "system_id",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "bucket_start": {
31
+ "name": "bucket_start",
32
+ "type": "timestamp",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ },
36
+ "bucket_size": {
37
+ "name": "bucket_size",
38
+ "type": "bucket_size",
39
+ "typeSchema": "public",
40
+ "primaryKey": false,
41
+ "notNull": true
42
+ },
43
+ "run_count": {
44
+ "name": "run_count",
45
+ "type": "integer",
46
+ "primaryKey": false,
47
+ "notNull": true
48
+ },
49
+ "healthy_count": {
50
+ "name": "healthy_count",
51
+ "type": "integer",
52
+ "primaryKey": false,
53
+ "notNull": true
54
+ },
55
+ "degraded_count": {
56
+ "name": "degraded_count",
57
+ "type": "integer",
58
+ "primaryKey": false,
59
+ "notNull": true
60
+ },
61
+ "unhealthy_count": {
62
+ "name": "unhealthy_count",
63
+ "type": "integer",
64
+ "primaryKey": false,
65
+ "notNull": true
66
+ },
67
+ "avg_latency_ms": {
68
+ "name": "avg_latency_ms",
69
+ "type": "integer",
70
+ "primaryKey": false,
71
+ "notNull": false
72
+ },
73
+ "min_latency_ms": {
74
+ "name": "min_latency_ms",
75
+ "type": "integer",
76
+ "primaryKey": false,
77
+ "notNull": false
78
+ },
79
+ "max_latency_ms": {
80
+ "name": "max_latency_ms",
81
+ "type": "integer",
82
+ "primaryKey": false,
83
+ "notNull": false
84
+ },
85
+ "p95_latency_ms": {
86
+ "name": "p95_latency_ms",
87
+ "type": "integer",
88
+ "primaryKey": false,
89
+ "notNull": false
90
+ },
91
+ "aggregated_result": {
92
+ "name": "aggregated_result",
93
+ "type": "jsonb",
94
+ "primaryKey": false,
95
+ "notNull": false
96
+ }
97
+ },
98
+ "indexes": {
99
+ "health_check_aggregates_bucket_unique": {
100
+ "name": "health_check_aggregates_bucket_unique",
101
+ "columns": [
102
+ {
103
+ "expression": "configuration_id",
104
+ "isExpression": false,
105
+ "asc": true,
106
+ "nulls": "last"
107
+ },
108
+ {
109
+ "expression": "system_id",
110
+ "isExpression": false,
111
+ "asc": true,
112
+ "nulls": "last"
113
+ },
114
+ {
115
+ "expression": "bucket_start",
116
+ "isExpression": false,
117
+ "asc": true,
118
+ "nulls": "last"
119
+ },
120
+ {
121
+ "expression": "bucket_size",
122
+ "isExpression": false,
123
+ "asc": true,
124
+ "nulls": "last"
125
+ }
126
+ ],
127
+ "isUnique": true,
128
+ "concurrently": false,
129
+ "method": "btree",
130
+ "with": {}
131
+ }
132
+ },
133
+ "foreignKeys": {
134
+ "health_check_aggregates_configuration_id_health_check_configurations_id_fk": {
135
+ "name": "health_check_aggregates_configuration_id_health_check_configurations_id_fk",
136
+ "tableFrom": "health_check_aggregates",
137
+ "tableTo": "health_check_configurations",
138
+ "columnsFrom": [
139
+ "configuration_id"
140
+ ],
141
+ "columnsTo": [
142
+ "id"
143
+ ],
144
+ "onDelete": "cascade",
145
+ "onUpdate": "no action"
146
+ }
147
+ },
148
+ "compositePrimaryKeys": {},
149
+ "uniqueConstraints": {},
150
+ "policies": {},
151
+ "checkConstraints": {},
152
+ "isRLSEnabled": false
153
+ },
154
+ "public.health_check_configurations": {
155
+ "name": "health_check_configurations",
156
+ "schema": "",
157
+ "columns": {
158
+ "id": {
159
+ "name": "id",
160
+ "type": "uuid",
161
+ "primaryKey": true,
162
+ "notNull": true,
163
+ "default": "gen_random_uuid()"
164
+ },
165
+ "name": {
166
+ "name": "name",
167
+ "type": "text",
168
+ "primaryKey": false,
169
+ "notNull": true
170
+ },
171
+ "strategy_id": {
172
+ "name": "strategy_id",
173
+ "type": "text",
174
+ "primaryKey": false,
175
+ "notNull": true
176
+ },
177
+ "config": {
178
+ "name": "config",
179
+ "type": "jsonb",
180
+ "primaryKey": false,
181
+ "notNull": true
182
+ },
183
+ "interval_seconds": {
184
+ "name": "interval_seconds",
185
+ "type": "integer",
186
+ "primaryKey": false,
187
+ "notNull": true
188
+ },
189
+ "is_template": {
190
+ "name": "is_template",
191
+ "type": "boolean",
192
+ "primaryKey": false,
193
+ "notNull": false,
194
+ "default": false
195
+ },
196
+ "created_at": {
197
+ "name": "created_at",
198
+ "type": "timestamp",
199
+ "primaryKey": false,
200
+ "notNull": true,
201
+ "default": "now()"
202
+ },
203
+ "updated_at": {
204
+ "name": "updated_at",
205
+ "type": "timestamp",
206
+ "primaryKey": false,
207
+ "notNull": true,
208
+ "default": "now()"
209
+ }
210
+ },
211
+ "indexes": {},
212
+ "foreignKeys": {},
213
+ "compositePrimaryKeys": {},
214
+ "uniqueConstraints": {},
215
+ "policies": {},
216
+ "checkConstraints": {},
217
+ "isRLSEnabled": false
218
+ },
219
+ "public.health_check_runs": {
220
+ "name": "health_check_runs",
221
+ "schema": "",
222
+ "columns": {
223
+ "id": {
224
+ "name": "id",
225
+ "type": "uuid",
226
+ "primaryKey": true,
227
+ "notNull": true,
228
+ "default": "gen_random_uuid()"
229
+ },
230
+ "configuration_id": {
231
+ "name": "configuration_id",
232
+ "type": "uuid",
233
+ "primaryKey": false,
234
+ "notNull": true
235
+ },
236
+ "system_id": {
237
+ "name": "system_id",
238
+ "type": "text",
239
+ "primaryKey": false,
240
+ "notNull": true
241
+ },
242
+ "status": {
243
+ "name": "status",
244
+ "type": "health_check_status",
245
+ "typeSchema": "public",
246
+ "primaryKey": false,
247
+ "notNull": true
248
+ },
249
+ "latency_ms": {
250
+ "name": "latency_ms",
251
+ "type": "integer",
252
+ "primaryKey": false,
253
+ "notNull": false
254
+ },
255
+ "result": {
256
+ "name": "result",
257
+ "type": "jsonb",
258
+ "primaryKey": false,
259
+ "notNull": false
260
+ },
261
+ "timestamp": {
262
+ "name": "timestamp",
263
+ "type": "timestamp",
264
+ "primaryKey": false,
265
+ "notNull": true,
266
+ "default": "now()"
267
+ }
268
+ },
269
+ "indexes": {},
270
+ "foreignKeys": {
271
+ "health_check_runs_configuration_id_health_check_configurations_id_fk": {
272
+ "name": "health_check_runs_configuration_id_health_check_configurations_id_fk",
273
+ "tableFrom": "health_check_runs",
274
+ "tableTo": "health_check_configurations",
275
+ "columnsFrom": [
276
+ "configuration_id"
277
+ ],
278
+ "columnsTo": [
279
+ "id"
280
+ ],
281
+ "onDelete": "cascade",
282
+ "onUpdate": "no action"
283
+ }
284
+ },
285
+ "compositePrimaryKeys": {},
286
+ "uniqueConstraints": {},
287
+ "policies": {},
288
+ "checkConstraints": {},
289
+ "isRLSEnabled": false
290
+ },
291
+ "public.system_health_checks": {
292
+ "name": "system_health_checks",
293
+ "schema": "",
294
+ "columns": {
295
+ "system_id": {
296
+ "name": "system_id",
297
+ "type": "text",
298
+ "primaryKey": false,
299
+ "notNull": true
300
+ },
301
+ "configuration_id": {
302
+ "name": "configuration_id",
303
+ "type": "uuid",
304
+ "primaryKey": false,
305
+ "notNull": true
306
+ },
307
+ "enabled": {
308
+ "name": "enabled",
309
+ "type": "boolean",
310
+ "primaryKey": false,
311
+ "notNull": true,
312
+ "default": true
313
+ },
314
+ "state_thresholds": {
315
+ "name": "state_thresholds",
316
+ "type": "jsonb",
317
+ "primaryKey": false,
318
+ "notNull": false
319
+ },
320
+ "retention_config": {
321
+ "name": "retention_config",
322
+ "type": "jsonb",
323
+ "primaryKey": false,
324
+ "notNull": false
325
+ },
326
+ "created_at": {
327
+ "name": "created_at",
328
+ "type": "timestamp",
329
+ "primaryKey": false,
330
+ "notNull": true,
331
+ "default": "now()"
332
+ },
333
+ "updated_at": {
334
+ "name": "updated_at",
335
+ "type": "timestamp",
336
+ "primaryKey": false,
337
+ "notNull": true,
338
+ "default": "now()"
339
+ }
340
+ },
341
+ "indexes": {},
342
+ "foreignKeys": {
343
+ "system_health_checks_configuration_id_health_check_configurations_id_fk": {
344
+ "name": "system_health_checks_configuration_id_health_check_configurations_id_fk",
345
+ "tableFrom": "system_health_checks",
346
+ "tableTo": "health_check_configurations",
347
+ "columnsFrom": [
348
+ "configuration_id"
349
+ ],
350
+ "columnsTo": [
351
+ "id"
352
+ ],
353
+ "onDelete": "cascade",
354
+ "onUpdate": "no action"
355
+ }
356
+ },
357
+ "compositePrimaryKeys": {
358
+ "system_health_checks_system_id_configuration_id_pk": {
359
+ "name": "system_health_checks_system_id_configuration_id_pk",
360
+ "columns": [
361
+ "system_id",
362
+ "configuration_id"
363
+ ]
364
+ }
365
+ },
366
+ "uniqueConstraints": {},
367
+ "policies": {},
368
+ "checkConstraints": {},
369
+ "isRLSEnabled": false
370
+ }
371
+ },
372
+ "enums": {
373
+ "public.bucket_size": {
374
+ "name": "bucket_size",
375
+ "schema": "public",
376
+ "values": [
377
+ "hourly",
378
+ "daily"
379
+ ]
380
+ },
381
+ "public.health_check_status": {
382
+ "name": "health_check_status",
383
+ "schema": "public",
384
+ "values": [
385
+ "healthy",
386
+ "unhealthy",
387
+ "degraded"
388
+ ]
389
+ }
390
+ },
391
+ "schemas": {},
392
+ "sequences": {},
393
+ "roles": {},
394
+ "policies": {},
395
+ "views": {},
396
+ "_meta": {
397
+ "columns": {},
398
+ "schemas": {},
399
+ "tables": {}
400
+ }
401
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "version": "7",
3
+ "dialect": "postgresql",
4
+ "entries": [
5
+ {
6
+ "idx": 0,
7
+ "version": "7",
8
+ "when": 1767319092901,
9
+ "tag": "0000_stormy_slayback",
10
+ "breakpoints": true
11
+ },
12
+ {
13
+ "idx": 1,
14
+ "version": "7",
15
+ "when": 1767530046443,
16
+ "tag": "0001_thin_shotgun",
17
+ "breakpoints": true
18
+ },
19
+ {
20
+ "idx": 2,
21
+ "version": "7",
22
+ "when": 1767533607325,
23
+ "tag": "0002_closed_lucky_pierre",
24
+ "breakpoints": true
25
+ },
26
+ {
27
+ "idx": 3,
28
+ "version": "7",
29
+ "when": 1767534811256,
30
+ "tag": "0003_powerful_rage",
31
+ "breakpoints": true
32
+ },
33
+ {
34
+ "idx": 4,
35
+ "version": "7",
36
+ "when": 1767535021581,
37
+ "tag": "0004_short_ezekiel",
38
+ "breakpoints": true
39
+ },
40
+ {
41
+ "idx": 5,
42
+ "version": "7",
43
+ "when": 1767538124052,
44
+ "tag": "0005_glossy_longshot",
45
+ "breakpoints": true
46
+ }
47
+ ]
48
+ }
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from "drizzle-kit";
2
+
3
+ export default defineConfig({
4
+ schema: "./src/schema.ts",
5
+ out: "./drizzle",
6
+ dialect: "postgresql",
7
+ });
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@checkstack/healthcheck-backend",
3
+ "version": "0.0.2",
4
+ "type": "module",
5
+ "main": "src/index.ts",
6
+ "scripts": {
7
+ "typecheck": "tsc --noEmit",
8
+ "generate": "drizzle-kit generate",
9
+ "lint": "bun run lint:code",
10
+ "lint:code": "eslint . --max-warnings 0"
11
+ },
12
+ "dependencies": {
13
+ "@checkstack/backend-api": "workspace:*",
14
+ "@checkstack/catalog-backend": "workspace:*",
15
+ "@checkstack/catalog-common": "workspace:*",
16
+ "@checkstack/healthcheck-common": "workspace:*",
17
+ "@checkstack/integration-backend": "workspace:*",
18
+ "@checkstack/queue-api": "workspace:*",
19
+ "@checkstack/signal-common": "workspace:*",
20
+ "@checkstack/command-backend": "workspace:*",
21
+ "@hono/zod-validator": "^0.7.6",
22
+ "drizzle-orm": "^0.45.1",
23
+ "hono": "^4.0.0",
24
+ "zod": "^4.2.1",
25
+ "@checkstack/common": "workspace:*"
26
+ },
27
+ "devDependencies": {
28
+ "@checkstack/drizzle-helper": "workspace:*",
29
+ "@checkstack/scripts": "workspace:*",
30
+ "@checkstack/test-utils-backend": "workspace:*",
31
+ "@checkstack/tsconfig": "workspace:*",
32
+ "@orpc/server": "^1.13.2",
33
+ "@types/bun": "^1.0.0",
34
+ "drizzle-kit": "^0.31.8",
35
+ "typescript": "^5.0.0"
36
+ }
37
+ }