@checkstack/anomaly-backend 0.2.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,307 @@
1
+ {
2
+ "id": "2a524ace-106d-41ef-8c0b-459bf249dc56",
3
+ "prevId": "9d7f7e5f-e844-43fb-b70c-3f137e0e6fd8",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.anomalies": {
8
+ "name": "anomalies",
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
+ "system_id": {
19
+ "name": "system_id",
20
+ "type": "text",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "configuration_id": {
25
+ "name": "configuration_id",
26
+ "type": "uuid",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "field_path": {
31
+ "name": "field_path",
32
+ "type": "text",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ },
36
+ "state": {
37
+ "name": "state",
38
+ "type": "anomaly_state",
39
+ "typeSchema": "public",
40
+ "primaryKey": false,
41
+ "notNull": true
42
+ },
43
+ "direction": {
44
+ "name": "direction",
45
+ "type": "anomaly_direction",
46
+ "typeSchema": "public",
47
+ "primaryKey": false,
48
+ "notNull": true
49
+ },
50
+ "baseline_value": {
51
+ "name": "baseline_value",
52
+ "type": "double precision",
53
+ "primaryKey": false,
54
+ "notNull": false
55
+ },
56
+ "baseline_std_dev": {
57
+ "name": "baseline_std_dev",
58
+ "type": "double precision",
59
+ "primaryKey": false,
60
+ "notNull": false
61
+ },
62
+ "observed_value": {
63
+ "name": "observed_value",
64
+ "type": "text",
65
+ "primaryKey": false,
66
+ "notNull": true
67
+ },
68
+ "deviation": {
69
+ "name": "deviation",
70
+ "type": "double precision",
71
+ "primaryKey": false,
72
+ "notNull": true
73
+ },
74
+ "suspicious_run_count": {
75
+ "name": "suspicious_run_count",
76
+ "type": "integer",
77
+ "primaryKey": false,
78
+ "notNull": true,
79
+ "default": 0
80
+ },
81
+ "confirmation_threshold": {
82
+ "name": "confirmation_threshold",
83
+ "type": "integer",
84
+ "primaryKey": false,
85
+ "notNull": true
86
+ },
87
+ "started_at": {
88
+ "name": "started_at",
89
+ "type": "timestamp",
90
+ "primaryKey": false,
91
+ "notNull": true,
92
+ "default": "now()"
93
+ },
94
+ "confirmed_at": {
95
+ "name": "confirmed_at",
96
+ "type": "timestamp",
97
+ "primaryKey": false,
98
+ "notNull": false
99
+ },
100
+ "recovered_at": {
101
+ "name": "recovered_at",
102
+ "type": "timestamp",
103
+ "primaryKey": false,
104
+ "notNull": false
105
+ },
106
+ "metadata": {
107
+ "name": "metadata",
108
+ "type": "jsonb",
109
+ "primaryKey": false,
110
+ "notNull": false
111
+ }
112
+ },
113
+ "indexes": {},
114
+ "foreignKeys": {},
115
+ "compositePrimaryKeys": {},
116
+ "uniqueConstraints": {},
117
+ "policies": {},
118
+ "checkConstraints": {},
119
+ "isRLSEnabled": false
120
+ },
121
+ "public.anomaly_assignments": {
122
+ "name": "anomaly_assignments",
123
+ "schema": "",
124
+ "columns": {
125
+ "system_id": {
126
+ "name": "system_id",
127
+ "type": "text",
128
+ "primaryKey": false,
129
+ "notNull": true
130
+ },
131
+ "configuration_id": {
132
+ "name": "configuration_id",
133
+ "type": "uuid",
134
+ "primaryKey": false,
135
+ "notNull": true
136
+ },
137
+ "config": {
138
+ "name": "config",
139
+ "type": "jsonb",
140
+ "primaryKey": false,
141
+ "notNull": true
142
+ }
143
+ },
144
+ "indexes": {},
145
+ "foreignKeys": {},
146
+ "compositePrimaryKeys": {},
147
+ "uniqueConstraints": {
148
+ "anomaly_assignments_pk": {
149
+ "name": "anomaly_assignments_pk",
150
+ "nullsNotDistinct": false,
151
+ "columns": [
152
+ "system_id",
153
+ "configuration_id"
154
+ ]
155
+ }
156
+ },
157
+ "policies": {},
158
+ "checkConstraints": {},
159
+ "isRLSEnabled": false
160
+ },
161
+ "public.anomaly_baselines": {
162
+ "name": "anomaly_baselines",
163
+ "schema": "",
164
+ "columns": {
165
+ "id": {
166
+ "name": "id",
167
+ "type": "uuid",
168
+ "primaryKey": true,
169
+ "notNull": true,
170
+ "default": "gen_random_uuid()"
171
+ },
172
+ "system_id": {
173
+ "name": "system_id",
174
+ "type": "text",
175
+ "primaryKey": false,
176
+ "notNull": true
177
+ },
178
+ "configuration_id": {
179
+ "name": "configuration_id",
180
+ "type": "uuid",
181
+ "primaryKey": false,
182
+ "notNull": true
183
+ },
184
+ "field_path": {
185
+ "name": "field_path",
186
+ "type": "text",
187
+ "primaryKey": false,
188
+ "notNull": true
189
+ },
190
+ "mean": {
191
+ "name": "mean",
192
+ "type": "double precision",
193
+ "primaryKey": false,
194
+ "notNull": true
195
+ },
196
+ "std_dev": {
197
+ "name": "std_dev",
198
+ "type": "double precision",
199
+ "primaryKey": false,
200
+ "notNull": true
201
+ },
202
+ "trend_slope": {
203
+ "name": "trend_slope",
204
+ "type": "double precision",
205
+ "primaryKey": false,
206
+ "notNull": true
207
+ },
208
+ "sample_count": {
209
+ "name": "sample_count",
210
+ "type": "integer",
211
+ "primaryKey": false,
212
+ "notNull": true
213
+ },
214
+ "computed_at": {
215
+ "name": "computed_at",
216
+ "type": "timestamp",
217
+ "primaryKey": false,
218
+ "notNull": true
219
+ },
220
+ "dominant_value": {
221
+ "name": "dominant_value",
222
+ "type": "text",
223
+ "primaryKey": false,
224
+ "notNull": false
225
+ },
226
+ "dominant_ratio": {
227
+ "name": "dominant_ratio",
228
+ "type": "double precision",
229
+ "primaryKey": false,
230
+ "notNull": false
231
+ }
232
+ },
233
+ "indexes": {},
234
+ "foreignKeys": {},
235
+ "compositePrimaryKeys": {},
236
+ "uniqueConstraints": {
237
+ "anomaly_baselines_unique_path": {
238
+ "name": "anomaly_baselines_unique_path",
239
+ "nullsNotDistinct": false,
240
+ "columns": [
241
+ "system_id",
242
+ "configuration_id",
243
+ "field_path"
244
+ ]
245
+ }
246
+ },
247
+ "policies": {},
248
+ "checkConstraints": {},
249
+ "isRLSEnabled": false
250
+ },
251
+ "public.anomaly_configurations": {
252
+ "name": "anomaly_configurations",
253
+ "schema": "",
254
+ "columns": {
255
+ "configuration_id": {
256
+ "name": "configuration_id",
257
+ "type": "uuid",
258
+ "primaryKey": true,
259
+ "notNull": true
260
+ },
261
+ "config": {
262
+ "name": "config",
263
+ "type": "jsonb",
264
+ "primaryKey": false,
265
+ "notNull": true
266
+ }
267
+ },
268
+ "indexes": {},
269
+ "foreignKeys": {},
270
+ "compositePrimaryKeys": {},
271
+ "uniqueConstraints": {},
272
+ "policies": {},
273
+ "checkConstraints": {},
274
+ "isRLSEnabled": false
275
+ }
276
+ },
277
+ "enums": {
278
+ "public.anomaly_direction": {
279
+ "name": "anomaly_direction",
280
+ "schema": "public",
281
+ "values": [
282
+ "above",
283
+ "below",
284
+ "changed"
285
+ ]
286
+ },
287
+ "public.anomaly_state": {
288
+ "name": "anomaly_state",
289
+ "schema": "public",
290
+ "values": [
291
+ "suspicious",
292
+ "anomaly",
293
+ "recovered"
294
+ ]
295
+ }
296
+ },
297
+ "schemas": {},
298
+ "sequences": {},
299
+ "roles": {},
300
+ "policies": {},
301
+ "views": {},
302
+ "_meta": {
303
+ "columns": {},
304
+ "schemas": {},
305
+ "tables": {}
306
+ }
307
+ }
@@ -0,0 +1,323 @@
1
+ {
2
+ "id": "ba98dce1-b88e-41d5-aa8d-730ba5e94805",
3
+ "prevId": "2a524ace-106d-41ef-8c0b-459bf249dc56",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.anomalies": {
8
+ "name": "anomalies",
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
+ "system_id": {
19
+ "name": "system_id",
20
+ "type": "text",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "configuration_id": {
25
+ "name": "configuration_id",
26
+ "type": "uuid",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "field_path": {
31
+ "name": "field_path",
32
+ "type": "text",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ },
36
+ "kind": {
37
+ "name": "kind",
38
+ "type": "anomaly_kind",
39
+ "typeSchema": "public",
40
+ "primaryKey": false,
41
+ "notNull": true,
42
+ "default": "'spike'"
43
+ },
44
+ "state": {
45
+ "name": "state",
46
+ "type": "anomaly_state",
47
+ "typeSchema": "public",
48
+ "primaryKey": false,
49
+ "notNull": true
50
+ },
51
+ "direction": {
52
+ "name": "direction",
53
+ "type": "anomaly_direction",
54
+ "typeSchema": "public",
55
+ "primaryKey": false,
56
+ "notNull": true
57
+ },
58
+ "baseline_value": {
59
+ "name": "baseline_value",
60
+ "type": "double precision",
61
+ "primaryKey": false,
62
+ "notNull": false
63
+ },
64
+ "baseline_std_dev": {
65
+ "name": "baseline_std_dev",
66
+ "type": "double precision",
67
+ "primaryKey": false,
68
+ "notNull": false
69
+ },
70
+ "observed_value": {
71
+ "name": "observed_value",
72
+ "type": "text",
73
+ "primaryKey": false,
74
+ "notNull": true
75
+ },
76
+ "deviation": {
77
+ "name": "deviation",
78
+ "type": "double precision",
79
+ "primaryKey": false,
80
+ "notNull": true
81
+ },
82
+ "suspicious_run_count": {
83
+ "name": "suspicious_run_count",
84
+ "type": "integer",
85
+ "primaryKey": false,
86
+ "notNull": true,
87
+ "default": 0
88
+ },
89
+ "confirmation_threshold": {
90
+ "name": "confirmation_threshold",
91
+ "type": "integer",
92
+ "primaryKey": false,
93
+ "notNull": true
94
+ },
95
+ "started_at": {
96
+ "name": "started_at",
97
+ "type": "timestamp",
98
+ "primaryKey": false,
99
+ "notNull": true,
100
+ "default": "now()"
101
+ },
102
+ "confirmed_at": {
103
+ "name": "confirmed_at",
104
+ "type": "timestamp",
105
+ "primaryKey": false,
106
+ "notNull": false
107
+ },
108
+ "recovered_at": {
109
+ "name": "recovered_at",
110
+ "type": "timestamp",
111
+ "primaryKey": false,
112
+ "notNull": false
113
+ },
114
+ "metadata": {
115
+ "name": "metadata",
116
+ "type": "jsonb",
117
+ "primaryKey": false,
118
+ "notNull": false
119
+ }
120
+ },
121
+ "indexes": {},
122
+ "foreignKeys": {},
123
+ "compositePrimaryKeys": {},
124
+ "uniqueConstraints": {},
125
+ "policies": {},
126
+ "checkConstraints": {},
127
+ "isRLSEnabled": false
128
+ },
129
+ "public.anomaly_assignments": {
130
+ "name": "anomaly_assignments",
131
+ "schema": "",
132
+ "columns": {
133
+ "system_id": {
134
+ "name": "system_id",
135
+ "type": "text",
136
+ "primaryKey": false,
137
+ "notNull": true
138
+ },
139
+ "configuration_id": {
140
+ "name": "configuration_id",
141
+ "type": "uuid",
142
+ "primaryKey": false,
143
+ "notNull": true
144
+ },
145
+ "config": {
146
+ "name": "config",
147
+ "type": "jsonb",
148
+ "primaryKey": false,
149
+ "notNull": true
150
+ }
151
+ },
152
+ "indexes": {},
153
+ "foreignKeys": {},
154
+ "compositePrimaryKeys": {},
155
+ "uniqueConstraints": {
156
+ "anomaly_assignments_pk": {
157
+ "name": "anomaly_assignments_pk",
158
+ "nullsNotDistinct": false,
159
+ "columns": [
160
+ "system_id",
161
+ "configuration_id"
162
+ ]
163
+ }
164
+ },
165
+ "policies": {},
166
+ "checkConstraints": {},
167
+ "isRLSEnabled": false
168
+ },
169
+ "public.anomaly_baselines": {
170
+ "name": "anomaly_baselines",
171
+ "schema": "",
172
+ "columns": {
173
+ "id": {
174
+ "name": "id",
175
+ "type": "uuid",
176
+ "primaryKey": true,
177
+ "notNull": true,
178
+ "default": "gen_random_uuid()"
179
+ },
180
+ "system_id": {
181
+ "name": "system_id",
182
+ "type": "text",
183
+ "primaryKey": false,
184
+ "notNull": true
185
+ },
186
+ "configuration_id": {
187
+ "name": "configuration_id",
188
+ "type": "uuid",
189
+ "primaryKey": false,
190
+ "notNull": true
191
+ },
192
+ "field_path": {
193
+ "name": "field_path",
194
+ "type": "text",
195
+ "primaryKey": false,
196
+ "notNull": true
197
+ },
198
+ "mean": {
199
+ "name": "mean",
200
+ "type": "double precision",
201
+ "primaryKey": false,
202
+ "notNull": true
203
+ },
204
+ "std_dev": {
205
+ "name": "std_dev",
206
+ "type": "double precision",
207
+ "primaryKey": false,
208
+ "notNull": true
209
+ },
210
+ "trend_slope": {
211
+ "name": "trend_slope",
212
+ "type": "double precision",
213
+ "primaryKey": false,
214
+ "notNull": true
215
+ },
216
+ "sample_count": {
217
+ "name": "sample_count",
218
+ "type": "integer",
219
+ "primaryKey": false,
220
+ "notNull": true
221
+ },
222
+ "computed_at": {
223
+ "name": "computed_at",
224
+ "type": "timestamp",
225
+ "primaryKey": false,
226
+ "notNull": true
227
+ },
228
+ "dominant_value": {
229
+ "name": "dominant_value",
230
+ "type": "text",
231
+ "primaryKey": false,
232
+ "notNull": false
233
+ },
234
+ "dominant_ratio": {
235
+ "name": "dominant_ratio",
236
+ "type": "double precision",
237
+ "primaryKey": false,
238
+ "notNull": false
239
+ }
240
+ },
241
+ "indexes": {},
242
+ "foreignKeys": {},
243
+ "compositePrimaryKeys": {},
244
+ "uniqueConstraints": {
245
+ "anomaly_baselines_unique_path": {
246
+ "name": "anomaly_baselines_unique_path",
247
+ "nullsNotDistinct": false,
248
+ "columns": [
249
+ "system_id",
250
+ "configuration_id",
251
+ "field_path"
252
+ ]
253
+ }
254
+ },
255
+ "policies": {},
256
+ "checkConstraints": {},
257
+ "isRLSEnabled": false
258
+ },
259
+ "public.anomaly_configurations": {
260
+ "name": "anomaly_configurations",
261
+ "schema": "",
262
+ "columns": {
263
+ "configuration_id": {
264
+ "name": "configuration_id",
265
+ "type": "uuid",
266
+ "primaryKey": true,
267
+ "notNull": true
268
+ },
269
+ "config": {
270
+ "name": "config",
271
+ "type": "jsonb",
272
+ "primaryKey": false,
273
+ "notNull": true
274
+ }
275
+ },
276
+ "indexes": {},
277
+ "foreignKeys": {},
278
+ "compositePrimaryKeys": {},
279
+ "uniqueConstraints": {},
280
+ "policies": {},
281
+ "checkConstraints": {},
282
+ "isRLSEnabled": false
283
+ }
284
+ },
285
+ "enums": {
286
+ "public.anomaly_direction": {
287
+ "name": "anomaly_direction",
288
+ "schema": "public",
289
+ "values": [
290
+ "above",
291
+ "below",
292
+ "changed"
293
+ ]
294
+ },
295
+ "public.anomaly_kind": {
296
+ "name": "anomaly_kind",
297
+ "schema": "public",
298
+ "values": [
299
+ "spike",
300
+ "drift"
301
+ ]
302
+ },
303
+ "public.anomaly_state": {
304
+ "name": "anomaly_state",
305
+ "schema": "public",
306
+ "values": [
307
+ "suspicious",
308
+ "anomaly",
309
+ "recovered"
310
+ ]
311
+ }
312
+ },
313
+ "schemas": {},
314
+ "sequences": {},
315
+ "roles": {},
316
+ "policies": {},
317
+ "views": {},
318
+ "_meta": {
319
+ "columns": {},
320
+ "schemas": {},
321
+ "tables": {}
322
+ }
323
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "version": "7",
3
+ "dialect": "postgresql",
4
+ "entries": [
5
+ {
6
+ "idx": 0,
7
+ "version": "7",
8
+ "when": 1777409421663,
9
+ "tag": "0000_soft_amphibian",
10
+ "breakpoints": true
11
+ },
12
+ {
13
+ "idx": 1,
14
+ "version": "7",
15
+ "when": 1777409813544,
16
+ "tag": "0001_warm_spyke",
17
+ "breakpoints": true
18
+ },
19
+ {
20
+ "idx": 2,
21
+ "version": "7",
22
+ "when": 1777413373117,
23
+ "tag": "0002_peaceful_krista_starr",
24
+ "breakpoints": true
25
+ },
26
+ {
27
+ "idx": 3,
28
+ "version": "7",
29
+ "when": 1777459740891,
30
+ "tag": "0003_easy_maginty",
31
+ "breakpoints": true
32
+ }
33
+ ]
34
+ }
@@ -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
+ });