@synoikia/core 0.7.0 → 0.8.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.
Files changed (78) hide show
  1. package/dist/app.d.ts +2 -0
  2. package/dist/app.js +2 -0
  3. package/dist/app.js.map +1 -1
  4. package/dist/approvals/service.d.ts +2 -0
  5. package/dist/approvals/service.js +1 -0
  6. package/dist/approvals/service.js.map +1 -1
  7. package/dist/auth/mcp-auth.d.ts +5 -0
  8. package/dist/auth/mcp-auth.js +73 -33
  9. package/dist/auth/mcp-auth.js.map +1 -1
  10. package/dist/auth/mcp-tokens.d.ts +7 -3
  11. package/dist/auth/mcp-tokens.js +15 -4
  12. package/dist/auth/mcp-tokens.js.map +1 -1
  13. package/dist/auth/oauth.d.ts +3 -1
  14. package/dist/auth/oauth.js +2 -1
  15. package/dist/auth/oauth.js.map +1 -1
  16. package/dist/auth/oidc.js +3 -2
  17. package/dist/auth/oidc.js.map +1 -1
  18. package/dist/auth/roles.d.ts +43 -0
  19. package/dist/auth/roles.js +164 -0
  20. package/dist/auth/roles.js.map +1 -0
  21. package/dist/auth/users.d.ts +26 -1
  22. package/dist/auth/users.js +109 -12
  23. package/dist/auth/users.js.map +1 -1
  24. package/dist/catalog/groups.js +2 -1
  25. package/dist/catalog/groups.js.map +1 -1
  26. package/dist/catalog/role-levels.d.ts +67 -0
  27. package/dist/catalog/role-levels.js +297 -0
  28. package/dist/catalog/role-levels.js.map +1 -0
  29. package/dist/catalog/rules.d.ts +33 -9
  30. package/dist/catalog/rules.js +51 -25
  31. package/dist/catalog/rules.js.map +1 -1
  32. package/dist/db/schema.d.ts +566 -0
  33. package/dist/db/schema.js +64 -0
  34. package/dist/db/schema.js.map +1 -1
  35. package/dist/errors.d.ts +5 -2
  36. package/dist/errors.js +5 -0
  37. package/dist/errors.js.map +1 -1
  38. package/dist/gate/access.d.ts +23 -2
  39. package/dist/gate/access.js +31 -3
  40. package/dist/gate/access.js.map +1 -1
  41. package/dist/gate/pipeline.js +10 -1
  42. package/dist/gate/pipeline.js.map +1 -1
  43. package/dist/gate/preapproval.d.ts +2 -0
  44. package/dist/gate/preapproval.js +16 -3
  45. package/dist/gate/preapproval.js.map +1 -1
  46. package/dist/http/admin/auth.d.ts +4 -0
  47. package/dist/http/admin/auth.js +34 -3
  48. package/dist/http/admin/auth.js.map +1 -1
  49. package/dist/http/admin/me.d.ts +6 -0
  50. package/dist/http/admin/me.js +189 -0
  51. package/dist/http/admin/me.js.map +1 -0
  52. package/dist/http/admin/roles.d.ts +5 -0
  53. package/dist/http/admin/roles.js +45 -0
  54. package/dist/http/admin/roles.js.map +1 -0
  55. package/dist/http/admin/system.js +9 -6
  56. package/dist/http/admin/system.js.map +1 -1
  57. package/dist/http/admin-app.js +13 -2
  58. package/dist/http/admin-app.js.map +1 -1
  59. package/dist/http/common.d.ts +1 -1
  60. package/dist/http/mcp/approval-routes.js +7 -0
  61. package/dist/http/mcp/approval-routes.js.map +1 -1
  62. package/dist/http/mcp/endpoint.js +3 -3
  63. package/dist/http/mcp/endpoint.js.map +1 -1
  64. package/dist/http/mcp/oauth-routes.js +8 -3
  65. package/dist/http/mcp/oauth-routes.js.map +1 -1
  66. package/dist/runtime/index.js +20 -8
  67. package/dist/runtime/index.js.map +1 -1
  68. package/dist/settings.d.ts +2 -0
  69. package/dist/settings.js +4 -0
  70. package/dist/settings.js.map +1 -1
  71. package/dist/testing/index.js +2 -1
  72. package/dist/testing/index.js.map +1 -1
  73. package/drizzle/0013_user_roles.sql +63 -0
  74. package/drizzle/0014_user_registration_source.sql +1 -0
  75. package/drizzle/meta/0013_snapshot.json +2833 -0
  76. package/drizzle/meta/0014_snapshot.json +2840 -0
  77. package/drizzle/meta/_journal.json +14 -0
  78. package/package.json +3 -3
@@ -0,0 +1,2840 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "407249ba-7e78-476b-a57a-9385e3b0b902",
5
+ "prevId": "b547efeb-ff4e-4380-a421-1f5185654ff6",
6
+ "tables": {
7
+ "approval_links": {
8
+ "name": "approval_links",
9
+ "columns": {
10
+ "token_hash": {
11
+ "name": "token_hash",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "approval_id": {
18
+ "name": "approval_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "action": {
25
+ "name": "action",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "expires_at": {
32
+ "name": "expires_at",
33
+ "type": "integer",
34
+ "primaryKey": false,
35
+ "notNull": true,
36
+ "autoincrement": false
37
+ },
38
+ "used_at": {
39
+ "name": "used_at",
40
+ "type": "integer",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ }
45
+ },
46
+ "indexes": {},
47
+ "foreignKeys": {
48
+ "approval_links_approval_id_pending_approvals_id_fk": {
49
+ "name": "approval_links_approval_id_pending_approvals_id_fk",
50
+ "tableFrom": "approval_links",
51
+ "tableTo": "pending_approvals",
52
+ "columnsFrom": [
53
+ "approval_id"
54
+ ],
55
+ "columnsTo": [
56
+ "id"
57
+ ],
58
+ "onDelete": "cascade",
59
+ "onUpdate": "no action"
60
+ }
61
+ },
62
+ "compositePrimaryKeys": {},
63
+ "uniqueConstraints": {},
64
+ "checkConstraints": {}
65
+ },
66
+ "audit_log": {
67
+ "name": "audit_log",
68
+ "columns": {
69
+ "id": {
70
+ "name": "id",
71
+ "type": "integer",
72
+ "primaryKey": true,
73
+ "notNull": true,
74
+ "autoincrement": true
75
+ },
76
+ "at": {
77
+ "name": "at",
78
+ "type": "integer",
79
+ "primaryKey": false,
80
+ "notNull": true,
81
+ "autoincrement": false
82
+ },
83
+ "kind": {
84
+ "name": "kind",
85
+ "type": "text",
86
+ "primaryKey": false,
87
+ "notNull": true,
88
+ "autoincrement": false
89
+ },
90
+ "instance_id": {
91
+ "name": "instance_id",
92
+ "type": "text",
93
+ "primaryKey": false,
94
+ "notNull": false,
95
+ "autoincrement": false
96
+ },
97
+ "operation_key": {
98
+ "name": "operation_key",
99
+ "type": "text",
100
+ "primaryKey": false,
101
+ "notNull": false,
102
+ "autoincrement": false
103
+ },
104
+ "classification": {
105
+ "name": "classification",
106
+ "type": "text",
107
+ "primaryKey": false,
108
+ "notNull": false,
109
+ "autoincrement": false
110
+ },
111
+ "decision": {
112
+ "name": "decision",
113
+ "type": "text",
114
+ "primaryKey": false,
115
+ "notNull": false,
116
+ "autoincrement": false
117
+ },
118
+ "actor_kind": {
119
+ "name": "actor_kind",
120
+ "type": "text",
121
+ "primaryKey": false,
122
+ "notNull": true,
123
+ "autoincrement": false
124
+ },
125
+ "actor_id": {
126
+ "name": "actor_id",
127
+ "type": "text",
128
+ "primaryKey": false,
129
+ "notNull": false,
130
+ "autoincrement": false
131
+ },
132
+ "decided_by": {
133
+ "name": "decided_by",
134
+ "type": "text",
135
+ "primaryKey": false,
136
+ "notNull": false,
137
+ "autoincrement": false
138
+ },
139
+ "decided_via": {
140
+ "name": "decided_via",
141
+ "type": "text",
142
+ "primaryKey": false,
143
+ "notNull": false,
144
+ "autoincrement": false
145
+ },
146
+ "params": {
147
+ "name": "params",
148
+ "type": "text",
149
+ "primaryKey": false,
150
+ "notNull": false,
151
+ "autoincrement": false
152
+ },
153
+ "resolved_targets": {
154
+ "name": "resolved_targets",
155
+ "type": "text",
156
+ "primaryKey": false,
157
+ "notNull": false,
158
+ "autoincrement": false
159
+ },
160
+ "result_status": {
161
+ "name": "result_status",
162
+ "type": "text",
163
+ "primaryKey": false,
164
+ "notNull": false,
165
+ "autoincrement": false
166
+ },
167
+ "duration_ms": {
168
+ "name": "duration_ms",
169
+ "type": "integer",
170
+ "primaryKey": false,
171
+ "notNull": false,
172
+ "autoincrement": false
173
+ },
174
+ "detail": {
175
+ "name": "detail",
176
+ "type": "text",
177
+ "primaryKey": false,
178
+ "notNull": false,
179
+ "autoincrement": false
180
+ }
181
+ },
182
+ "indexes": {
183
+ "audit_at_idx": {
184
+ "name": "audit_at_idx",
185
+ "columns": [
186
+ "at"
187
+ ],
188
+ "isUnique": false
189
+ },
190
+ "audit_instance_at_idx": {
191
+ "name": "audit_instance_at_idx",
192
+ "columns": [
193
+ "instance_id",
194
+ "at"
195
+ ],
196
+ "isUnique": false
197
+ }
198
+ },
199
+ "foreignKeys": {},
200
+ "compositePrimaryKeys": {},
201
+ "uniqueConstraints": {},
202
+ "checkConstraints": {}
203
+ },
204
+ "guides": {
205
+ "name": "guides",
206
+ "columns": {
207
+ "id": {
208
+ "name": "id",
209
+ "type": "text",
210
+ "primaryKey": true,
211
+ "notNull": true,
212
+ "autoincrement": false
213
+ },
214
+ "instance_id": {
215
+ "name": "instance_id",
216
+ "type": "text",
217
+ "primaryKey": false,
218
+ "notNull": true,
219
+ "autoincrement": false
220
+ },
221
+ "operation_id": {
222
+ "name": "operation_id",
223
+ "type": "text",
224
+ "primaryKey": false,
225
+ "notNull": true,
226
+ "autoincrement": false
227
+ },
228
+ "version": {
229
+ "name": "version",
230
+ "type": "text",
231
+ "primaryKey": false,
232
+ "notNull": true,
233
+ "autoincrement": false
234
+ },
235
+ "content": {
236
+ "name": "content",
237
+ "type": "text",
238
+ "primaryKey": false,
239
+ "notNull": true,
240
+ "autoincrement": false
241
+ },
242
+ "fetched_at": {
243
+ "name": "fetched_at",
244
+ "type": "integer",
245
+ "primaryKey": false,
246
+ "notNull": true,
247
+ "autoincrement": false
248
+ }
249
+ },
250
+ "indexes": {},
251
+ "foreignKeys": {
252
+ "guides_instance_id_plugin_instances_id_fk": {
253
+ "name": "guides_instance_id_plugin_instances_id_fk",
254
+ "tableFrom": "guides",
255
+ "tableTo": "plugin_instances",
256
+ "columnsFrom": [
257
+ "instance_id"
258
+ ],
259
+ "columnsTo": [
260
+ "id"
261
+ ],
262
+ "onDelete": "cascade",
263
+ "onUpdate": "no action"
264
+ },
265
+ "guides_operation_id_operations_id_fk": {
266
+ "name": "guides_operation_id_operations_id_fk",
267
+ "tableFrom": "guides",
268
+ "tableTo": "operations",
269
+ "columnsFrom": [
270
+ "operation_id"
271
+ ],
272
+ "columnsTo": [
273
+ "id"
274
+ ],
275
+ "onDelete": "cascade",
276
+ "onUpdate": "no action"
277
+ }
278
+ },
279
+ "compositePrimaryKeys": {},
280
+ "uniqueConstraints": {},
281
+ "checkConstraints": {}
282
+ },
283
+ "mcp_tokens": {
284
+ "name": "mcp_tokens",
285
+ "columns": {
286
+ "id": {
287
+ "name": "id",
288
+ "type": "text",
289
+ "primaryKey": true,
290
+ "notNull": true,
291
+ "autoincrement": false
292
+ },
293
+ "name": {
294
+ "name": "name",
295
+ "type": "text",
296
+ "primaryKey": false,
297
+ "notNull": true,
298
+ "autoincrement": false
299
+ },
300
+ "token_hash": {
301
+ "name": "token_hash",
302
+ "type": "text",
303
+ "primaryKey": false,
304
+ "notNull": true,
305
+ "autoincrement": false
306
+ },
307
+ "scope": {
308
+ "name": "scope",
309
+ "type": "text",
310
+ "primaryKey": false,
311
+ "notNull": true,
312
+ "autoincrement": false
313
+ },
314
+ "access": {
315
+ "name": "access",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": true,
319
+ "autoincrement": false,
320
+ "default": "'read'"
321
+ },
322
+ "created_by": {
323
+ "name": "created_by",
324
+ "type": "text",
325
+ "primaryKey": false,
326
+ "notNull": false,
327
+ "autoincrement": false
328
+ },
329
+ "created_at": {
330
+ "name": "created_at",
331
+ "type": "integer",
332
+ "primaryKey": false,
333
+ "notNull": true,
334
+ "autoincrement": false,
335
+ "default": "(unixepoch() * 1000)"
336
+ },
337
+ "expires_at": {
338
+ "name": "expires_at",
339
+ "type": "integer",
340
+ "primaryKey": false,
341
+ "notNull": false,
342
+ "autoincrement": false
343
+ },
344
+ "last_used_at": {
345
+ "name": "last_used_at",
346
+ "type": "integer",
347
+ "primaryKey": false,
348
+ "notNull": false,
349
+ "autoincrement": false
350
+ },
351
+ "revoked_at": {
352
+ "name": "revoked_at",
353
+ "type": "integer",
354
+ "primaryKey": false,
355
+ "notNull": false,
356
+ "autoincrement": false
357
+ }
358
+ },
359
+ "indexes": {
360
+ "mcp_tokens_token_hash_unique": {
361
+ "name": "mcp_tokens_token_hash_unique",
362
+ "columns": [
363
+ "token_hash"
364
+ ],
365
+ "isUnique": true
366
+ }
367
+ },
368
+ "foreignKeys": {
369
+ "mcp_tokens_created_by_users_id_fk": {
370
+ "name": "mcp_tokens_created_by_users_id_fk",
371
+ "tableFrom": "mcp_tokens",
372
+ "tableTo": "users",
373
+ "columnsFrom": [
374
+ "created_by"
375
+ ],
376
+ "columnsTo": [
377
+ "id"
378
+ ],
379
+ "onDelete": "no action",
380
+ "onUpdate": "no action"
381
+ }
382
+ },
383
+ "compositePrimaryKeys": {},
384
+ "uniqueConstraints": {},
385
+ "checkConstraints": {}
386
+ },
387
+ "notifier_channels": {
388
+ "name": "notifier_channels",
389
+ "columns": {
390
+ "id": {
391
+ "name": "id",
392
+ "type": "text",
393
+ "primaryKey": true,
394
+ "notNull": true,
395
+ "autoincrement": false
396
+ },
397
+ "kind": {
398
+ "name": "kind",
399
+ "type": "text",
400
+ "primaryKey": false,
401
+ "notNull": true,
402
+ "autoincrement": false
403
+ },
404
+ "name": {
405
+ "name": "name",
406
+ "type": "text",
407
+ "primaryKey": false,
408
+ "notNull": true,
409
+ "autoincrement": false
410
+ },
411
+ "config": {
412
+ "name": "config",
413
+ "type": "text",
414
+ "primaryKey": false,
415
+ "notNull": true,
416
+ "autoincrement": false
417
+ },
418
+ "secrets_enc": {
419
+ "name": "secrets_enc",
420
+ "type": "blob",
421
+ "primaryKey": false,
422
+ "notNull": false,
423
+ "autoincrement": false
424
+ },
425
+ "events": {
426
+ "name": "events",
427
+ "type": "text",
428
+ "primaryKey": false,
429
+ "notNull": true,
430
+ "autoincrement": false
431
+ },
432
+ "instance_filter": {
433
+ "name": "instance_filter",
434
+ "type": "text",
435
+ "primaryKey": false,
436
+ "notNull": false,
437
+ "autoincrement": false
438
+ },
439
+ "enabled": {
440
+ "name": "enabled",
441
+ "type": "integer",
442
+ "primaryKey": false,
443
+ "notNull": true,
444
+ "autoincrement": false,
445
+ "default": true
446
+ },
447
+ "last_sent_at": {
448
+ "name": "last_sent_at",
449
+ "type": "integer",
450
+ "primaryKey": false,
451
+ "notNull": false,
452
+ "autoincrement": false
453
+ },
454
+ "last_error": {
455
+ "name": "last_error",
456
+ "type": "text",
457
+ "primaryKey": false,
458
+ "notNull": false,
459
+ "autoincrement": false
460
+ }
461
+ },
462
+ "indexes": {},
463
+ "foreignKeys": {},
464
+ "compositePrimaryKeys": {},
465
+ "uniqueConstraints": {},
466
+ "checkConstraints": {}
467
+ },
468
+ "oauth_clients": {
469
+ "name": "oauth_clients",
470
+ "columns": {
471
+ "id": {
472
+ "name": "id",
473
+ "type": "text",
474
+ "primaryKey": true,
475
+ "notNull": true,
476
+ "autoincrement": false
477
+ },
478
+ "client_id": {
479
+ "name": "client_id",
480
+ "type": "text",
481
+ "primaryKey": false,
482
+ "notNull": true,
483
+ "autoincrement": false
484
+ },
485
+ "client_secret_hash": {
486
+ "name": "client_secret_hash",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": false,
490
+ "autoincrement": false
491
+ },
492
+ "name": {
493
+ "name": "name",
494
+ "type": "text",
495
+ "primaryKey": false,
496
+ "notNull": true,
497
+ "autoincrement": false
498
+ },
499
+ "redirect_uris": {
500
+ "name": "redirect_uris",
501
+ "type": "text",
502
+ "primaryKey": false,
503
+ "notNull": true,
504
+ "autoincrement": false
505
+ },
506
+ "registered_via": {
507
+ "name": "registered_via",
508
+ "type": "text",
509
+ "primaryKey": false,
510
+ "notNull": true,
511
+ "autoincrement": false
512
+ },
513
+ "created_at": {
514
+ "name": "created_at",
515
+ "type": "integer",
516
+ "primaryKey": false,
517
+ "notNull": true,
518
+ "autoincrement": false,
519
+ "default": "(unixepoch() * 1000)"
520
+ },
521
+ "revoked_at": {
522
+ "name": "revoked_at",
523
+ "type": "integer",
524
+ "primaryKey": false,
525
+ "notNull": false,
526
+ "autoincrement": false
527
+ }
528
+ },
529
+ "indexes": {
530
+ "oauth_clients_client_id_unique": {
531
+ "name": "oauth_clients_client_id_unique",
532
+ "columns": [
533
+ "client_id"
534
+ ],
535
+ "isUnique": true
536
+ }
537
+ },
538
+ "foreignKeys": {},
539
+ "compositePrimaryKeys": {},
540
+ "uniqueConstraints": {},
541
+ "checkConstraints": {}
542
+ },
543
+ "oauth_codes": {
544
+ "name": "oauth_codes",
545
+ "columns": {
546
+ "code_hash": {
547
+ "name": "code_hash",
548
+ "type": "text",
549
+ "primaryKey": true,
550
+ "notNull": true,
551
+ "autoincrement": false
552
+ },
553
+ "grant_id": {
554
+ "name": "grant_id",
555
+ "type": "text",
556
+ "primaryKey": false,
557
+ "notNull": true,
558
+ "autoincrement": false
559
+ },
560
+ "code_challenge": {
561
+ "name": "code_challenge",
562
+ "type": "text",
563
+ "primaryKey": false,
564
+ "notNull": true,
565
+ "autoincrement": false
566
+ },
567
+ "redirect_uri": {
568
+ "name": "redirect_uri",
569
+ "type": "text",
570
+ "primaryKey": false,
571
+ "notNull": true,
572
+ "autoincrement": false
573
+ },
574
+ "resources": {
575
+ "name": "resources",
576
+ "type": "text",
577
+ "primaryKey": false,
578
+ "notNull": true,
579
+ "autoincrement": false
580
+ },
581
+ "expires_at": {
582
+ "name": "expires_at",
583
+ "type": "integer",
584
+ "primaryKey": false,
585
+ "notNull": true,
586
+ "autoincrement": false
587
+ },
588
+ "used_at": {
589
+ "name": "used_at",
590
+ "type": "integer",
591
+ "primaryKey": false,
592
+ "notNull": false,
593
+ "autoincrement": false
594
+ }
595
+ },
596
+ "indexes": {},
597
+ "foreignKeys": {
598
+ "oauth_codes_grant_id_oauth_grants_id_fk": {
599
+ "name": "oauth_codes_grant_id_oauth_grants_id_fk",
600
+ "tableFrom": "oauth_codes",
601
+ "tableTo": "oauth_grants",
602
+ "columnsFrom": [
603
+ "grant_id"
604
+ ],
605
+ "columnsTo": [
606
+ "id"
607
+ ],
608
+ "onDelete": "cascade",
609
+ "onUpdate": "no action"
610
+ }
611
+ },
612
+ "compositePrimaryKeys": {},
613
+ "uniqueConstraints": {},
614
+ "checkConstraints": {}
615
+ },
616
+ "oauth_grants": {
617
+ "name": "oauth_grants",
618
+ "columns": {
619
+ "id": {
620
+ "name": "id",
621
+ "type": "text",
622
+ "primaryKey": true,
623
+ "notNull": true,
624
+ "autoincrement": false
625
+ },
626
+ "client_id": {
627
+ "name": "client_id",
628
+ "type": "text",
629
+ "primaryKey": false,
630
+ "notNull": true,
631
+ "autoincrement": false
632
+ },
633
+ "user_id": {
634
+ "name": "user_id",
635
+ "type": "text",
636
+ "primaryKey": false,
637
+ "notNull": true,
638
+ "autoincrement": false
639
+ },
640
+ "resources": {
641
+ "name": "resources",
642
+ "type": "text",
643
+ "primaryKey": false,
644
+ "notNull": true,
645
+ "autoincrement": false
646
+ },
647
+ "instance_ids": {
648
+ "name": "instance_ids",
649
+ "type": "text",
650
+ "primaryKey": false,
651
+ "notNull": false,
652
+ "autoincrement": false
653
+ },
654
+ "access": {
655
+ "name": "access",
656
+ "type": "text",
657
+ "primaryKey": false,
658
+ "notNull": true,
659
+ "autoincrement": false,
660
+ "default": "'read'"
661
+ },
662
+ "created_at": {
663
+ "name": "created_at",
664
+ "type": "integer",
665
+ "primaryKey": false,
666
+ "notNull": true,
667
+ "autoincrement": false,
668
+ "default": "(unixepoch() * 1000)"
669
+ },
670
+ "revoked_at": {
671
+ "name": "revoked_at",
672
+ "type": "integer",
673
+ "primaryKey": false,
674
+ "notNull": false,
675
+ "autoincrement": false
676
+ }
677
+ },
678
+ "indexes": {},
679
+ "foreignKeys": {
680
+ "oauth_grants_client_id_oauth_clients_id_fk": {
681
+ "name": "oauth_grants_client_id_oauth_clients_id_fk",
682
+ "tableFrom": "oauth_grants",
683
+ "tableTo": "oauth_clients",
684
+ "columnsFrom": [
685
+ "client_id"
686
+ ],
687
+ "columnsTo": [
688
+ "id"
689
+ ],
690
+ "onDelete": "cascade",
691
+ "onUpdate": "no action"
692
+ },
693
+ "oauth_grants_user_id_users_id_fk": {
694
+ "name": "oauth_grants_user_id_users_id_fk",
695
+ "tableFrom": "oauth_grants",
696
+ "tableTo": "users",
697
+ "columnsFrom": [
698
+ "user_id"
699
+ ],
700
+ "columnsTo": [
701
+ "id"
702
+ ],
703
+ "onDelete": "cascade",
704
+ "onUpdate": "no action"
705
+ }
706
+ },
707
+ "compositePrimaryKeys": {},
708
+ "uniqueConstraints": {},
709
+ "checkConstraints": {}
710
+ },
711
+ "oauth_tokens": {
712
+ "name": "oauth_tokens",
713
+ "columns": {
714
+ "token_hash": {
715
+ "name": "token_hash",
716
+ "type": "text",
717
+ "primaryKey": true,
718
+ "notNull": true,
719
+ "autoincrement": false
720
+ },
721
+ "grant_id": {
722
+ "name": "grant_id",
723
+ "type": "text",
724
+ "primaryKey": false,
725
+ "notNull": true,
726
+ "autoincrement": false
727
+ },
728
+ "kind": {
729
+ "name": "kind",
730
+ "type": "text",
731
+ "primaryKey": false,
732
+ "notNull": true,
733
+ "autoincrement": false
734
+ },
735
+ "family_id": {
736
+ "name": "family_id",
737
+ "type": "text",
738
+ "primaryKey": false,
739
+ "notNull": true,
740
+ "autoincrement": false
741
+ },
742
+ "resources": {
743
+ "name": "resources",
744
+ "type": "text",
745
+ "primaryKey": false,
746
+ "notNull": true,
747
+ "autoincrement": false
748
+ },
749
+ "expires_at": {
750
+ "name": "expires_at",
751
+ "type": "integer",
752
+ "primaryKey": false,
753
+ "notNull": true,
754
+ "autoincrement": false
755
+ },
756
+ "revoked_at": {
757
+ "name": "revoked_at",
758
+ "type": "integer",
759
+ "primaryKey": false,
760
+ "notNull": false,
761
+ "autoincrement": false
762
+ }
763
+ },
764
+ "indexes": {},
765
+ "foreignKeys": {
766
+ "oauth_tokens_grant_id_oauth_grants_id_fk": {
767
+ "name": "oauth_tokens_grant_id_oauth_grants_id_fk",
768
+ "tableFrom": "oauth_tokens",
769
+ "tableTo": "oauth_grants",
770
+ "columnsFrom": [
771
+ "grant_id"
772
+ ],
773
+ "columnsTo": [
774
+ "id"
775
+ ],
776
+ "onDelete": "cascade",
777
+ "onUpdate": "no action"
778
+ }
779
+ },
780
+ "compositePrimaryKeys": {},
781
+ "uniqueConstraints": {},
782
+ "checkConstraints": {}
783
+ },
784
+ "oidc_config": {
785
+ "name": "oidc_config",
786
+ "columns": {
787
+ "id": {
788
+ "name": "id",
789
+ "type": "integer",
790
+ "primaryKey": true,
791
+ "notNull": true,
792
+ "autoincrement": false
793
+ },
794
+ "issuer": {
795
+ "name": "issuer",
796
+ "type": "text",
797
+ "primaryKey": false,
798
+ "notNull": true,
799
+ "autoincrement": false
800
+ },
801
+ "client_id": {
802
+ "name": "client_id",
803
+ "type": "text",
804
+ "primaryKey": false,
805
+ "notNull": true,
806
+ "autoincrement": false
807
+ },
808
+ "client_secret_enc": {
809
+ "name": "client_secret_enc",
810
+ "type": "blob",
811
+ "primaryKey": false,
812
+ "notNull": false,
813
+ "autoincrement": false
814
+ },
815
+ "scopes": {
816
+ "name": "scopes",
817
+ "type": "text",
818
+ "primaryKey": false,
819
+ "notNull": true,
820
+ "autoincrement": false,
821
+ "default": "'openid email profile'"
822
+ },
823
+ "allow_policy": {
824
+ "name": "allow_policy",
825
+ "type": "text",
826
+ "primaryKey": false,
827
+ "notNull": false,
828
+ "autoincrement": false
829
+ },
830
+ "auto_provision": {
831
+ "name": "auto_provision",
832
+ "type": "integer",
833
+ "primaryKey": false,
834
+ "notNull": true,
835
+ "autoincrement": false,
836
+ "default": false
837
+ },
838
+ "enabled": {
839
+ "name": "enabled",
840
+ "type": "integer",
841
+ "primaryKey": false,
842
+ "notNull": true,
843
+ "autoincrement": false,
844
+ "default": false
845
+ }
846
+ },
847
+ "indexes": {},
848
+ "foreignKeys": {},
849
+ "compositePrimaryKeys": {},
850
+ "uniqueConstraints": {},
851
+ "checkConstraints": {}
852
+ },
853
+ "operation_group_aliases": {
854
+ "name": "operation_group_aliases",
855
+ "columns": {
856
+ "instance_id": {
857
+ "name": "instance_id",
858
+ "type": "text",
859
+ "primaryKey": false,
860
+ "notNull": true,
861
+ "autoincrement": false
862
+ },
863
+ "plugin_group": {
864
+ "name": "plugin_group",
865
+ "type": "text",
866
+ "primaryKey": false,
867
+ "notNull": true,
868
+ "autoincrement": false
869
+ },
870
+ "group_key": {
871
+ "name": "group_key",
872
+ "type": "text",
873
+ "primaryKey": false,
874
+ "notNull": true,
875
+ "autoincrement": false
876
+ }
877
+ },
878
+ "indexes": {
879
+ "operation_group_aliases_idx": {
880
+ "name": "operation_group_aliases_idx",
881
+ "columns": [
882
+ "instance_id",
883
+ "plugin_group"
884
+ ],
885
+ "isUnique": true
886
+ }
887
+ },
888
+ "foreignKeys": {
889
+ "operation_group_aliases_instance_id_plugin_instances_id_fk": {
890
+ "name": "operation_group_aliases_instance_id_plugin_instances_id_fk",
891
+ "tableFrom": "operation_group_aliases",
892
+ "tableTo": "plugin_instances",
893
+ "columnsFrom": [
894
+ "instance_id"
895
+ ],
896
+ "columnsTo": [
897
+ "id"
898
+ ],
899
+ "onDelete": "cascade",
900
+ "onUpdate": "no action"
901
+ }
902
+ },
903
+ "compositePrimaryKeys": {},
904
+ "uniqueConstraints": {},
905
+ "checkConstraints": {}
906
+ },
907
+ "operation_groups": {
908
+ "name": "operation_groups",
909
+ "columns": {
910
+ "id": {
911
+ "name": "id",
912
+ "type": "text",
913
+ "primaryKey": true,
914
+ "notNull": true,
915
+ "autoincrement": false
916
+ },
917
+ "instance_id": {
918
+ "name": "instance_id",
919
+ "type": "text",
920
+ "primaryKey": false,
921
+ "notNull": true,
922
+ "autoincrement": false
923
+ },
924
+ "key": {
925
+ "name": "key",
926
+ "type": "text",
927
+ "primaryKey": false,
928
+ "notNull": true,
929
+ "autoincrement": false
930
+ },
931
+ "label": {
932
+ "name": "label",
933
+ "type": "text",
934
+ "primaryKey": false,
935
+ "notNull": true,
936
+ "autoincrement": false
937
+ },
938
+ "level": {
939
+ "name": "level",
940
+ "type": "text",
941
+ "primaryKey": false,
942
+ "notNull": true,
943
+ "autoincrement": false,
944
+ "default": "'read'"
945
+ },
946
+ "level_changed_at": {
947
+ "name": "level_changed_at",
948
+ "type": "integer",
949
+ "primaryKey": false,
950
+ "notNull": false,
951
+ "autoincrement": false
952
+ },
953
+ "level_changed_by": {
954
+ "name": "level_changed_by",
955
+ "type": "text",
956
+ "primaryKey": false,
957
+ "notNull": false,
958
+ "autoincrement": false
959
+ },
960
+ "first_seen_at": {
961
+ "name": "first_seen_at",
962
+ "type": "integer",
963
+ "primaryKey": false,
964
+ "notNull": true,
965
+ "autoincrement": false
966
+ },
967
+ "stale": {
968
+ "name": "stale",
969
+ "type": "integer",
970
+ "primaryKey": false,
971
+ "notNull": true,
972
+ "autoincrement": false,
973
+ "default": false
974
+ }
975
+ },
976
+ "indexes": {
977
+ "operation_groups_instance_key_idx": {
978
+ "name": "operation_groups_instance_key_idx",
979
+ "columns": [
980
+ "instance_id",
981
+ "key"
982
+ ],
983
+ "isUnique": true
984
+ }
985
+ },
986
+ "foreignKeys": {
987
+ "operation_groups_instance_id_plugin_instances_id_fk": {
988
+ "name": "operation_groups_instance_id_plugin_instances_id_fk",
989
+ "tableFrom": "operation_groups",
990
+ "tableTo": "plugin_instances",
991
+ "columnsFrom": [
992
+ "instance_id"
993
+ ],
994
+ "columnsTo": [
995
+ "id"
996
+ ],
997
+ "onDelete": "cascade",
998
+ "onUpdate": "no action"
999
+ },
1000
+ "operation_groups_level_changed_by_users_id_fk": {
1001
+ "name": "operation_groups_level_changed_by_users_id_fk",
1002
+ "tableFrom": "operation_groups",
1003
+ "tableTo": "users",
1004
+ "columnsFrom": [
1005
+ "level_changed_by"
1006
+ ],
1007
+ "columnsTo": [
1008
+ "id"
1009
+ ],
1010
+ "onDelete": "no action",
1011
+ "onUpdate": "no action"
1012
+ }
1013
+ },
1014
+ "compositePrimaryKeys": {},
1015
+ "uniqueConstraints": {},
1016
+ "checkConstraints": {}
1017
+ },
1018
+ "operations": {
1019
+ "name": "operations",
1020
+ "columns": {
1021
+ "id": {
1022
+ "name": "id",
1023
+ "type": "text",
1024
+ "primaryKey": true,
1025
+ "notNull": true,
1026
+ "autoincrement": false
1027
+ },
1028
+ "instance_id": {
1029
+ "name": "instance_id",
1030
+ "type": "text",
1031
+ "primaryKey": false,
1032
+ "notNull": true,
1033
+ "autoincrement": false
1034
+ },
1035
+ "key": {
1036
+ "name": "key",
1037
+ "type": "text",
1038
+ "primaryKey": false,
1039
+ "notNull": true,
1040
+ "autoincrement": false
1041
+ },
1042
+ "display_name": {
1043
+ "name": "display_name",
1044
+ "type": "text",
1045
+ "primaryKey": false,
1046
+ "notNull": false,
1047
+ "autoincrement": false
1048
+ },
1049
+ "kind": {
1050
+ "name": "kind",
1051
+ "type": "text",
1052
+ "primaryKey": false,
1053
+ "notNull": true,
1054
+ "autoincrement": false
1055
+ },
1056
+ "plugin_group": {
1057
+ "name": "plugin_group",
1058
+ "type": "text",
1059
+ "primaryKey": false,
1060
+ "notNull": true,
1061
+ "autoincrement": false
1062
+ },
1063
+ "group_id": {
1064
+ "name": "group_id",
1065
+ "type": "text",
1066
+ "primaryKey": false,
1067
+ "notNull": true,
1068
+ "autoincrement": false
1069
+ },
1070
+ "tag": {
1071
+ "name": "tag",
1072
+ "type": "text",
1073
+ "primaryKey": false,
1074
+ "notNull": false,
1075
+ "autoincrement": false
1076
+ },
1077
+ "classification": {
1078
+ "name": "classification",
1079
+ "type": "text",
1080
+ "primaryKey": false,
1081
+ "notNull": true,
1082
+ "autoincrement": false
1083
+ },
1084
+ "classification_source": {
1085
+ "name": "classification_source",
1086
+ "type": "text",
1087
+ "primaryKey": false,
1088
+ "notNull": true,
1089
+ "autoincrement": false
1090
+ },
1091
+ "inferred_classification": {
1092
+ "name": "inferred_classification",
1093
+ "type": "text",
1094
+ "primaryKey": false,
1095
+ "notNull": true,
1096
+ "autoincrement": false
1097
+ },
1098
+ "inferred_reason": {
1099
+ "name": "inferred_reason",
1100
+ "type": "text",
1101
+ "primaryKey": false,
1102
+ "notNull": true,
1103
+ "autoincrement": false
1104
+ },
1105
+ "locked": {
1106
+ "name": "locked",
1107
+ "type": "integer",
1108
+ "primaryKey": false,
1109
+ "notNull": true,
1110
+ "autoincrement": false,
1111
+ "default": false
1112
+ },
1113
+ "level_override": {
1114
+ "name": "level_override",
1115
+ "type": "text",
1116
+ "primaryKey": false,
1117
+ "notNull": false,
1118
+ "autoincrement": false
1119
+ },
1120
+ "write_acknowledged": {
1121
+ "name": "write_acknowledged",
1122
+ "type": "integer",
1123
+ "primaryKey": false,
1124
+ "notNull": true,
1125
+ "autoincrement": false,
1126
+ "default": false
1127
+ },
1128
+ "acknowledged_at": {
1129
+ "name": "acknowledged_at",
1130
+ "type": "integer",
1131
+ "primaryKey": false,
1132
+ "notNull": false,
1133
+ "autoincrement": false
1134
+ },
1135
+ "acknowledged_by": {
1136
+ "name": "acknowledged_by",
1137
+ "type": "text",
1138
+ "primaryKey": false,
1139
+ "notNull": false,
1140
+ "autoincrement": false
1141
+ },
1142
+ "typed_confirmation": {
1143
+ "name": "typed_confirmation",
1144
+ "type": "integer",
1145
+ "primaryKey": false,
1146
+ "notNull": true,
1147
+ "autoincrement": false,
1148
+ "default": false
1149
+ },
1150
+ "attestation_required": {
1151
+ "name": "attestation_required",
1152
+ "type": "integer",
1153
+ "primaryKey": false,
1154
+ "notNull": true,
1155
+ "autoincrement": false,
1156
+ "default": false
1157
+ },
1158
+ "attestation_waived": {
1159
+ "name": "attestation_waived",
1160
+ "type": "integer",
1161
+ "primaryKey": false,
1162
+ "notNull": true,
1163
+ "autoincrement": false,
1164
+ "default": false
1165
+ },
1166
+ "needs_review": {
1167
+ "name": "needs_review",
1168
+ "type": "integer",
1169
+ "primaryKey": false,
1170
+ "notNull": true,
1171
+ "autoincrement": false,
1172
+ "default": false
1173
+ },
1174
+ "match_profile": {
1175
+ "name": "match_profile",
1176
+ "type": "text",
1177
+ "primaryKey": false,
1178
+ "notNull": false,
1179
+ "autoincrement": false
1180
+ },
1181
+ "params_schema": {
1182
+ "name": "params_schema",
1183
+ "type": "text",
1184
+ "primaryKey": false,
1185
+ "notNull": false,
1186
+ "autoincrement": false
1187
+ },
1188
+ "sensitive_params": {
1189
+ "name": "sensitive_params",
1190
+ "type": "text",
1191
+ "primaryKey": false,
1192
+ "notNull": false,
1193
+ "autoincrement": false
1194
+ },
1195
+ "sensitive_result": {
1196
+ "name": "sensitive_result",
1197
+ "type": "text",
1198
+ "primaryKey": false,
1199
+ "notNull": false,
1200
+ "autoincrement": false
1201
+ },
1202
+ "docs": {
1203
+ "name": "docs",
1204
+ "type": "text",
1205
+ "primaryKey": false,
1206
+ "notNull": false,
1207
+ "autoincrement": false
1208
+ },
1209
+ "first_seen_at": {
1210
+ "name": "first_seen_at",
1211
+ "type": "integer",
1212
+ "primaryKey": false,
1213
+ "notNull": true,
1214
+ "autoincrement": false
1215
+ },
1216
+ "last_seen_at": {
1217
+ "name": "last_seen_at",
1218
+ "type": "integer",
1219
+ "primaryKey": false,
1220
+ "notNull": true,
1221
+ "autoincrement": false
1222
+ },
1223
+ "stale": {
1224
+ "name": "stale",
1225
+ "type": "integer",
1226
+ "primaryKey": false,
1227
+ "notNull": true,
1228
+ "autoincrement": false,
1229
+ "default": false
1230
+ }
1231
+ },
1232
+ "indexes": {
1233
+ "operations_instance_key_idx": {
1234
+ "name": "operations_instance_key_idx",
1235
+ "columns": [
1236
+ "instance_id",
1237
+ "key"
1238
+ ],
1239
+ "isUnique": true
1240
+ },
1241
+ "operations_group_idx": {
1242
+ "name": "operations_group_idx",
1243
+ "columns": [
1244
+ "group_id"
1245
+ ],
1246
+ "isUnique": false
1247
+ }
1248
+ },
1249
+ "foreignKeys": {
1250
+ "operations_instance_id_plugin_instances_id_fk": {
1251
+ "name": "operations_instance_id_plugin_instances_id_fk",
1252
+ "tableFrom": "operations",
1253
+ "tableTo": "plugin_instances",
1254
+ "columnsFrom": [
1255
+ "instance_id"
1256
+ ],
1257
+ "columnsTo": [
1258
+ "id"
1259
+ ],
1260
+ "onDelete": "cascade",
1261
+ "onUpdate": "no action"
1262
+ },
1263
+ "operations_group_id_operation_groups_id_fk": {
1264
+ "name": "operations_group_id_operation_groups_id_fk",
1265
+ "tableFrom": "operations",
1266
+ "tableTo": "operation_groups",
1267
+ "columnsFrom": [
1268
+ "group_id"
1269
+ ],
1270
+ "columnsTo": [
1271
+ "id"
1272
+ ],
1273
+ "onDelete": "no action",
1274
+ "onUpdate": "no action"
1275
+ },
1276
+ "operations_acknowledged_by_users_id_fk": {
1277
+ "name": "operations_acknowledged_by_users_id_fk",
1278
+ "tableFrom": "operations",
1279
+ "tableTo": "users",
1280
+ "columnsFrom": [
1281
+ "acknowledged_by"
1282
+ ],
1283
+ "columnsTo": [
1284
+ "id"
1285
+ ],
1286
+ "onDelete": "no action",
1287
+ "onUpdate": "no action"
1288
+ }
1289
+ },
1290
+ "compositePrimaryKeys": {},
1291
+ "uniqueConstraints": {},
1292
+ "checkConstraints": {}
1293
+ },
1294
+ "pending_approvals": {
1295
+ "name": "pending_approvals",
1296
+ "columns": {
1297
+ "id": {
1298
+ "name": "id",
1299
+ "type": "text",
1300
+ "primaryKey": true,
1301
+ "notNull": true,
1302
+ "autoincrement": false
1303
+ },
1304
+ "instance_id": {
1305
+ "name": "instance_id",
1306
+ "type": "text",
1307
+ "primaryKey": false,
1308
+ "notNull": true,
1309
+ "autoincrement": false
1310
+ },
1311
+ "operation_id": {
1312
+ "name": "operation_id",
1313
+ "type": "text",
1314
+ "primaryKey": false,
1315
+ "notNull": true,
1316
+ "autoincrement": false
1317
+ },
1318
+ "params_display": {
1319
+ "name": "params_display",
1320
+ "type": "text",
1321
+ "primaryKey": false,
1322
+ "notNull": false,
1323
+ "autoincrement": false
1324
+ },
1325
+ "params_hash": {
1326
+ "name": "params_hash",
1327
+ "type": "text",
1328
+ "primaryKey": false,
1329
+ "notNull": true,
1330
+ "autoincrement": false
1331
+ },
1332
+ "resolved_targets": {
1333
+ "name": "resolved_targets",
1334
+ "type": "text",
1335
+ "primaryKey": false,
1336
+ "notNull": false,
1337
+ "autoincrement": false
1338
+ },
1339
+ "summary": {
1340
+ "name": "summary",
1341
+ "type": "text",
1342
+ "primaryKey": false,
1343
+ "notNull": true,
1344
+ "autoincrement": false
1345
+ },
1346
+ "confirm_literal": {
1347
+ "name": "confirm_literal",
1348
+ "type": "text",
1349
+ "primaryKey": false,
1350
+ "notNull": false,
1351
+ "autoincrement": false
1352
+ },
1353
+ "diff": {
1354
+ "name": "diff",
1355
+ "type": "text",
1356
+ "primaryKey": false,
1357
+ "notNull": false,
1358
+ "autoincrement": false
1359
+ },
1360
+ "expected_hash": {
1361
+ "name": "expected_hash",
1362
+ "type": "text",
1363
+ "primaryKey": false,
1364
+ "notNull": false,
1365
+ "autoincrement": false
1366
+ },
1367
+ "client_kind": {
1368
+ "name": "client_kind",
1369
+ "type": "text",
1370
+ "primaryKey": false,
1371
+ "notNull": false,
1372
+ "autoincrement": false
1373
+ },
1374
+ "client_id": {
1375
+ "name": "client_id",
1376
+ "type": "text",
1377
+ "primaryKey": false,
1378
+ "notNull": false,
1379
+ "autoincrement": false
1380
+ },
1381
+ "mcp_session_id": {
1382
+ "name": "mcp_session_id",
1383
+ "type": "text",
1384
+ "primaryKey": false,
1385
+ "notNull": false,
1386
+ "autoincrement": false
1387
+ },
1388
+ "requested_at": {
1389
+ "name": "requested_at",
1390
+ "type": "integer",
1391
+ "primaryKey": false,
1392
+ "notNull": true,
1393
+ "autoincrement": false
1394
+ },
1395
+ "expires_at": {
1396
+ "name": "expires_at",
1397
+ "type": "integer",
1398
+ "primaryKey": false,
1399
+ "notNull": true,
1400
+ "autoincrement": false
1401
+ },
1402
+ "status": {
1403
+ "name": "status",
1404
+ "type": "text",
1405
+ "primaryKey": false,
1406
+ "notNull": true,
1407
+ "autoincrement": false,
1408
+ "default": "'pending'"
1409
+ },
1410
+ "decided_by": {
1411
+ "name": "decided_by",
1412
+ "type": "text",
1413
+ "primaryKey": false,
1414
+ "notNull": false,
1415
+ "autoincrement": false
1416
+ },
1417
+ "decided_via": {
1418
+ "name": "decided_via",
1419
+ "type": "text",
1420
+ "primaryKey": false,
1421
+ "notNull": false,
1422
+ "autoincrement": false
1423
+ },
1424
+ "decided_at": {
1425
+ "name": "decided_at",
1426
+ "type": "integer",
1427
+ "primaryKey": false,
1428
+ "notNull": false,
1429
+ "autoincrement": false
1430
+ },
1431
+ "owner_user_id": {
1432
+ "name": "owner_user_id",
1433
+ "type": "text",
1434
+ "primaryKey": false,
1435
+ "notNull": false,
1436
+ "autoincrement": false
1437
+ }
1438
+ },
1439
+ "indexes": {},
1440
+ "foreignKeys": {
1441
+ "pending_approvals_instance_id_plugin_instances_id_fk": {
1442
+ "name": "pending_approvals_instance_id_plugin_instances_id_fk",
1443
+ "tableFrom": "pending_approvals",
1444
+ "tableTo": "plugin_instances",
1445
+ "columnsFrom": [
1446
+ "instance_id"
1447
+ ],
1448
+ "columnsTo": [
1449
+ "id"
1450
+ ],
1451
+ "onDelete": "no action",
1452
+ "onUpdate": "no action"
1453
+ },
1454
+ "pending_approvals_operation_id_operations_id_fk": {
1455
+ "name": "pending_approvals_operation_id_operations_id_fk",
1456
+ "tableFrom": "pending_approvals",
1457
+ "tableTo": "operations",
1458
+ "columnsFrom": [
1459
+ "operation_id"
1460
+ ],
1461
+ "columnsTo": [
1462
+ "id"
1463
+ ],
1464
+ "onDelete": "no action",
1465
+ "onUpdate": "no action"
1466
+ },
1467
+ "pending_approvals_owner_user_id_users_id_fk": {
1468
+ "name": "pending_approvals_owner_user_id_users_id_fk",
1469
+ "tableFrom": "pending_approvals",
1470
+ "tableTo": "users",
1471
+ "columnsFrom": [
1472
+ "owner_user_id"
1473
+ ],
1474
+ "columnsTo": [
1475
+ "id"
1476
+ ],
1477
+ "onDelete": "no action",
1478
+ "onUpdate": "no action"
1479
+ }
1480
+ },
1481
+ "compositePrimaryKeys": {},
1482
+ "uniqueConstraints": {},
1483
+ "checkConstraints": {}
1484
+ },
1485
+ "plugin_instances": {
1486
+ "name": "plugin_instances",
1487
+ "columns": {
1488
+ "id": {
1489
+ "name": "id",
1490
+ "type": "text",
1491
+ "primaryKey": true,
1492
+ "notNull": true,
1493
+ "autoincrement": false
1494
+ },
1495
+ "plugin_id": {
1496
+ "name": "plugin_id",
1497
+ "type": "text",
1498
+ "primaryKey": false,
1499
+ "notNull": true,
1500
+ "autoincrement": false
1501
+ },
1502
+ "slug": {
1503
+ "name": "slug",
1504
+ "type": "text",
1505
+ "primaryKey": false,
1506
+ "notNull": true,
1507
+ "autoincrement": false
1508
+ },
1509
+ "display_name": {
1510
+ "name": "display_name",
1511
+ "type": "text",
1512
+ "primaryKey": false,
1513
+ "notNull": true,
1514
+ "autoincrement": false
1515
+ },
1516
+ "enabled": {
1517
+ "name": "enabled",
1518
+ "type": "integer",
1519
+ "primaryKey": false,
1520
+ "notNull": true,
1521
+ "autoincrement": false,
1522
+ "default": true
1523
+ },
1524
+ "config": {
1525
+ "name": "config",
1526
+ "type": "text",
1527
+ "primaryKey": false,
1528
+ "notNull": true,
1529
+ "autoincrement": false,
1530
+ "default": "'{}'"
1531
+ },
1532
+ "secrets_enc": {
1533
+ "name": "secrets_enc",
1534
+ "type": "blob",
1535
+ "primaryKey": false,
1536
+ "notNull": false,
1537
+ "autoincrement": false
1538
+ },
1539
+ "auth_mode": {
1540
+ "name": "auth_mode",
1541
+ "type": "text",
1542
+ "primaryKey": false,
1543
+ "notNull": false,
1544
+ "autoincrement": false
1545
+ },
1546
+ "settings": {
1547
+ "name": "settings",
1548
+ "type": "text",
1549
+ "primaryKey": false,
1550
+ "notNull": true,
1551
+ "autoincrement": false,
1552
+ "default": "'{}'"
1553
+ },
1554
+ "status": {
1555
+ "name": "status",
1556
+ "type": "text",
1557
+ "primaryKey": false,
1558
+ "notNull": true,
1559
+ "autoincrement": false,
1560
+ "default": "'stopped'"
1561
+ },
1562
+ "status_error": {
1563
+ "name": "status_error",
1564
+ "type": "text",
1565
+ "primaryKey": false,
1566
+ "notNull": false,
1567
+ "autoincrement": false
1568
+ },
1569
+ "upstream_version": {
1570
+ "name": "upstream_version",
1571
+ "type": "text",
1572
+ "primaryKey": false,
1573
+ "notNull": false,
1574
+ "autoincrement": false
1575
+ },
1576
+ "source_ref": {
1577
+ "name": "source_ref",
1578
+ "type": "text",
1579
+ "primaryKey": false,
1580
+ "notNull": false,
1581
+ "autoincrement": false
1582
+ },
1583
+ "last_synced_at": {
1584
+ "name": "last_synced_at",
1585
+ "type": "integer",
1586
+ "primaryKey": false,
1587
+ "notNull": false,
1588
+ "autoincrement": false
1589
+ },
1590
+ "last_sync_status": {
1591
+ "name": "last_sync_status",
1592
+ "type": "text",
1593
+ "primaryKey": false,
1594
+ "notNull": false,
1595
+ "autoincrement": false
1596
+ },
1597
+ "catalog_plugin_version": {
1598
+ "name": "catalog_plugin_version",
1599
+ "type": "text",
1600
+ "primaryKey": false,
1601
+ "notNull": false,
1602
+ "autoincrement": false
1603
+ },
1604
+ "created_at": {
1605
+ "name": "created_at",
1606
+ "type": "integer",
1607
+ "primaryKey": false,
1608
+ "notNull": true,
1609
+ "autoincrement": false,
1610
+ "default": "(unixepoch() * 1000)"
1611
+ }
1612
+ },
1613
+ "indexes": {
1614
+ "plugin_instances_slug_unique": {
1615
+ "name": "plugin_instances_slug_unique",
1616
+ "columns": [
1617
+ "slug"
1618
+ ],
1619
+ "isUnique": true
1620
+ }
1621
+ },
1622
+ "foreignKeys": {
1623
+ "plugin_instances_plugin_id_plugins_id_fk": {
1624
+ "name": "plugin_instances_plugin_id_plugins_id_fk",
1625
+ "tableFrom": "plugin_instances",
1626
+ "tableTo": "plugins",
1627
+ "columnsFrom": [
1628
+ "plugin_id"
1629
+ ],
1630
+ "columnsTo": [
1631
+ "id"
1632
+ ],
1633
+ "onDelete": "no action",
1634
+ "onUpdate": "no action"
1635
+ }
1636
+ },
1637
+ "compositePrimaryKeys": {},
1638
+ "uniqueConstraints": {},
1639
+ "checkConstraints": {}
1640
+ },
1641
+ "plugin_repos": {
1642
+ "name": "plugin_repos",
1643
+ "columns": {
1644
+ "id": {
1645
+ "name": "id",
1646
+ "type": "text",
1647
+ "primaryKey": true,
1648
+ "notNull": true,
1649
+ "autoincrement": false
1650
+ },
1651
+ "url": {
1652
+ "name": "url",
1653
+ "type": "text",
1654
+ "primaryKey": false,
1655
+ "notNull": true,
1656
+ "autoincrement": false
1657
+ },
1658
+ "name": {
1659
+ "name": "name",
1660
+ "type": "text",
1661
+ "primaryKey": false,
1662
+ "notNull": false,
1663
+ "autoincrement": false
1664
+ },
1665
+ "signing_mode": {
1666
+ "name": "signing_mode",
1667
+ "type": "text",
1668
+ "primaryKey": false,
1669
+ "notNull": true,
1670
+ "autoincrement": false
1671
+ },
1672
+ "public_key": {
1673
+ "name": "public_key",
1674
+ "type": "text",
1675
+ "primaryKey": false,
1676
+ "notNull": false,
1677
+ "autoincrement": false
1678
+ },
1679
+ "key_fingerprint": {
1680
+ "name": "key_fingerprint",
1681
+ "type": "text",
1682
+ "primaryKey": false,
1683
+ "notNull": false,
1684
+ "autoincrement": false
1685
+ },
1686
+ "key_status": {
1687
+ "name": "key_status",
1688
+ "type": "text",
1689
+ "primaryKey": false,
1690
+ "notNull": true,
1691
+ "autoincrement": false,
1692
+ "default": "'ok'"
1693
+ },
1694
+ "index_cache": {
1695
+ "name": "index_cache",
1696
+ "type": "text",
1697
+ "primaryKey": false,
1698
+ "notNull": false,
1699
+ "autoincrement": false
1700
+ },
1701
+ "last_fetched_at": {
1702
+ "name": "last_fetched_at",
1703
+ "type": "integer",
1704
+ "primaryKey": false,
1705
+ "notNull": false,
1706
+ "autoincrement": false
1707
+ },
1708
+ "last_fetch_error": {
1709
+ "name": "last_fetch_error",
1710
+ "type": "text",
1711
+ "primaryKey": false,
1712
+ "notNull": false,
1713
+ "autoincrement": false
1714
+ }
1715
+ },
1716
+ "indexes": {
1717
+ "plugin_repos_url_unique": {
1718
+ "name": "plugin_repos_url_unique",
1719
+ "columns": [
1720
+ "url"
1721
+ ],
1722
+ "isUnique": true
1723
+ }
1724
+ },
1725
+ "foreignKeys": {},
1726
+ "compositePrimaryKeys": {},
1727
+ "uniqueConstraints": {},
1728
+ "checkConstraints": {}
1729
+ },
1730
+ "plugins": {
1731
+ "name": "plugins",
1732
+ "columns": {
1733
+ "id": {
1734
+ "name": "id",
1735
+ "type": "text",
1736
+ "primaryKey": true,
1737
+ "notNull": true,
1738
+ "autoincrement": false
1739
+ },
1740
+ "plugin_id": {
1741
+ "name": "plugin_id",
1742
+ "type": "text",
1743
+ "primaryKey": false,
1744
+ "notNull": true,
1745
+ "autoincrement": false
1746
+ },
1747
+ "version": {
1748
+ "name": "version",
1749
+ "type": "text",
1750
+ "primaryKey": false,
1751
+ "notNull": true,
1752
+ "autoincrement": false
1753
+ },
1754
+ "repo_id": {
1755
+ "name": "repo_id",
1756
+ "type": "text",
1757
+ "primaryKey": false,
1758
+ "notNull": false,
1759
+ "autoincrement": false
1760
+ },
1761
+ "path": {
1762
+ "name": "path",
1763
+ "type": "text",
1764
+ "primaryKey": false,
1765
+ "notNull": true,
1766
+ "autoincrement": false
1767
+ },
1768
+ "sha256": {
1769
+ "name": "sha256",
1770
+ "type": "text",
1771
+ "primaryKey": false,
1772
+ "notNull": false,
1773
+ "autoincrement": false
1774
+ },
1775
+ "signature_verified": {
1776
+ "name": "signature_verified",
1777
+ "type": "integer",
1778
+ "primaryKey": false,
1779
+ "notNull": true,
1780
+ "autoincrement": false,
1781
+ "default": false
1782
+ },
1783
+ "manifest": {
1784
+ "name": "manifest",
1785
+ "type": "text",
1786
+ "primaryKey": false,
1787
+ "notNull": true,
1788
+ "autoincrement": false
1789
+ },
1790
+ "status": {
1791
+ "name": "status",
1792
+ "type": "text",
1793
+ "primaryKey": false,
1794
+ "notNull": true,
1795
+ "autoincrement": false
1796
+ },
1797
+ "status_error": {
1798
+ "name": "status_error",
1799
+ "type": "text",
1800
+ "primaryKey": false,
1801
+ "notNull": false,
1802
+ "autoincrement": false
1803
+ },
1804
+ "enabled": {
1805
+ "name": "enabled",
1806
+ "type": "integer",
1807
+ "primaryKey": false,
1808
+ "notNull": true,
1809
+ "autoincrement": false,
1810
+ "default": false
1811
+ },
1812
+ "created_at": {
1813
+ "name": "created_at",
1814
+ "type": "integer",
1815
+ "primaryKey": false,
1816
+ "notNull": true,
1817
+ "autoincrement": false,
1818
+ "default": "(unixepoch() * 1000)"
1819
+ }
1820
+ },
1821
+ "indexes": {
1822
+ "plugins_plugin_id_unique": {
1823
+ "name": "plugins_plugin_id_unique",
1824
+ "columns": [
1825
+ "plugin_id"
1826
+ ],
1827
+ "isUnique": true
1828
+ }
1829
+ },
1830
+ "foreignKeys": {
1831
+ "plugins_repo_id_plugin_repos_id_fk": {
1832
+ "name": "plugins_repo_id_plugin_repos_id_fk",
1833
+ "tableFrom": "plugins",
1834
+ "tableTo": "plugin_repos",
1835
+ "columnsFrom": [
1836
+ "repo_id"
1837
+ ],
1838
+ "columnsTo": [
1839
+ "id"
1840
+ ],
1841
+ "onDelete": "no action",
1842
+ "onUpdate": "no action"
1843
+ }
1844
+ },
1845
+ "compositePrimaryKeys": {},
1846
+ "uniqueConstraints": {},
1847
+ "checkConstraints": {}
1848
+ },
1849
+ "pre_approval_hits": {
1850
+ "name": "pre_approval_hits",
1851
+ "columns": {
1852
+ "id": {
1853
+ "name": "id",
1854
+ "type": "integer",
1855
+ "primaryKey": true,
1856
+ "notNull": true,
1857
+ "autoincrement": true
1858
+ },
1859
+ "rule_id": {
1860
+ "name": "rule_id",
1861
+ "type": "text",
1862
+ "primaryKey": false,
1863
+ "notNull": true,
1864
+ "autoincrement": false
1865
+ },
1866
+ "occurred_at": {
1867
+ "name": "occurred_at",
1868
+ "type": "integer",
1869
+ "primaryKey": false,
1870
+ "notNull": true,
1871
+ "autoincrement": false
1872
+ }
1873
+ },
1874
+ "indexes": {
1875
+ "hits_rule_time_idx": {
1876
+ "name": "hits_rule_time_idx",
1877
+ "columns": [
1878
+ "rule_id",
1879
+ "occurred_at"
1880
+ ],
1881
+ "isUnique": false
1882
+ }
1883
+ },
1884
+ "foreignKeys": {
1885
+ "pre_approval_hits_rule_id_pre_approval_rules_id_fk": {
1886
+ "name": "pre_approval_hits_rule_id_pre_approval_rules_id_fk",
1887
+ "tableFrom": "pre_approval_hits",
1888
+ "tableTo": "pre_approval_rules",
1889
+ "columnsFrom": [
1890
+ "rule_id"
1891
+ ],
1892
+ "columnsTo": [
1893
+ "id"
1894
+ ],
1895
+ "onDelete": "cascade",
1896
+ "onUpdate": "no action"
1897
+ }
1898
+ },
1899
+ "compositePrimaryKeys": {},
1900
+ "uniqueConstraints": {},
1901
+ "checkConstraints": {}
1902
+ },
1903
+ "pre_approval_rules": {
1904
+ "name": "pre_approval_rules",
1905
+ "columns": {
1906
+ "id": {
1907
+ "name": "id",
1908
+ "type": "text",
1909
+ "primaryKey": true,
1910
+ "notNull": true,
1911
+ "autoincrement": false
1912
+ },
1913
+ "instance_id": {
1914
+ "name": "instance_id",
1915
+ "type": "text",
1916
+ "primaryKey": false,
1917
+ "notNull": true,
1918
+ "autoincrement": false
1919
+ },
1920
+ "operation_id": {
1921
+ "name": "operation_id",
1922
+ "type": "text",
1923
+ "primaryKey": false,
1924
+ "notNull": true,
1925
+ "autoincrement": false
1926
+ },
1927
+ "match": {
1928
+ "name": "match",
1929
+ "type": "text",
1930
+ "primaryKey": false,
1931
+ "notNull": true,
1932
+ "autoincrement": false,
1933
+ "default": "'[]'"
1934
+ },
1935
+ "rate_limit": {
1936
+ "name": "rate_limit",
1937
+ "type": "integer",
1938
+ "primaryKey": false,
1939
+ "notNull": false,
1940
+ "autoincrement": false
1941
+ },
1942
+ "window_seconds": {
1943
+ "name": "window_seconds",
1944
+ "type": "integer",
1945
+ "primaryKey": false,
1946
+ "notNull": false,
1947
+ "autoincrement": false
1948
+ },
1949
+ "expires_at": {
1950
+ "name": "expires_at",
1951
+ "type": "integer",
1952
+ "primaryKey": false,
1953
+ "notNull": false,
1954
+ "autoincrement": false
1955
+ },
1956
+ "reason": {
1957
+ "name": "reason",
1958
+ "type": "text",
1959
+ "primaryKey": false,
1960
+ "notNull": true,
1961
+ "autoincrement": false
1962
+ },
1963
+ "enabled": {
1964
+ "name": "enabled",
1965
+ "type": "integer",
1966
+ "primaryKey": false,
1967
+ "notNull": true,
1968
+ "autoincrement": false,
1969
+ "default": true
1970
+ },
1971
+ "created_by": {
1972
+ "name": "created_by",
1973
+ "type": "text",
1974
+ "primaryKey": false,
1975
+ "notNull": false,
1976
+ "autoincrement": false
1977
+ },
1978
+ "owner_user_id": {
1979
+ "name": "owner_user_id",
1980
+ "type": "text",
1981
+ "primaryKey": false,
1982
+ "notNull": false,
1983
+ "autoincrement": false
1984
+ },
1985
+ "created_at": {
1986
+ "name": "created_at",
1987
+ "type": "integer",
1988
+ "primaryKey": false,
1989
+ "notNull": true,
1990
+ "autoincrement": false,
1991
+ "default": "(unixepoch() * 1000)"
1992
+ },
1993
+ "updated_at": {
1994
+ "name": "updated_at",
1995
+ "type": "integer",
1996
+ "primaryKey": false,
1997
+ "notNull": false,
1998
+ "autoincrement": false
1999
+ },
2000
+ "last_triggered_at": {
2001
+ "name": "last_triggered_at",
2002
+ "type": "integer",
2003
+ "primaryKey": false,
2004
+ "notNull": false,
2005
+ "autoincrement": false
2006
+ },
2007
+ "strict_miss_at": {
2008
+ "name": "strict_miss_at",
2009
+ "type": "integer",
2010
+ "primaryKey": false,
2011
+ "notNull": false,
2012
+ "autoincrement": false
2013
+ }
2014
+ },
2015
+ "indexes": {},
2016
+ "foreignKeys": {
2017
+ "pre_approval_rules_instance_id_plugin_instances_id_fk": {
2018
+ "name": "pre_approval_rules_instance_id_plugin_instances_id_fk",
2019
+ "tableFrom": "pre_approval_rules",
2020
+ "tableTo": "plugin_instances",
2021
+ "columnsFrom": [
2022
+ "instance_id"
2023
+ ],
2024
+ "columnsTo": [
2025
+ "id"
2026
+ ],
2027
+ "onDelete": "cascade",
2028
+ "onUpdate": "no action"
2029
+ },
2030
+ "pre_approval_rules_operation_id_operations_id_fk": {
2031
+ "name": "pre_approval_rules_operation_id_operations_id_fk",
2032
+ "tableFrom": "pre_approval_rules",
2033
+ "tableTo": "operations",
2034
+ "columnsFrom": [
2035
+ "operation_id"
2036
+ ],
2037
+ "columnsTo": [
2038
+ "id"
2039
+ ],
2040
+ "onDelete": "no action",
2041
+ "onUpdate": "no action"
2042
+ },
2043
+ "pre_approval_rules_created_by_users_id_fk": {
2044
+ "name": "pre_approval_rules_created_by_users_id_fk",
2045
+ "tableFrom": "pre_approval_rules",
2046
+ "tableTo": "users",
2047
+ "columnsFrom": [
2048
+ "created_by"
2049
+ ],
2050
+ "columnsTo": [
2051
+ "id"
2052
+ ],
2053
+ "onDelete": "no action",
2054
+ "onUpdate": "no action"
2055
+ },
2056
+ "pre_approval_rules_owner_user_id_users_id_fk": {
2057
+ "name": "pre_approval_rules_owner_user_id_users_id_fk",
2058
+ "tableFrom": "pre_approval_rules",
2059
+ "tableTo": "users",
2060
+ "columnsFrom": [
2061
+ "owner_user_id"
2062
+ ],
2063
+ "columnsTo": [
2064
+ "id"
2065
+ ],
2066
+ "onDelete": "no action",
2067
+ "onUpdate": "no action"
2068
+ }
2069
+ },
2070
+ "compositePrimaryKeys": {},
2071
+ "uniqueConstraints": {},
2072
+ "checkConstraints": {}
2073
+ },
2074
+ "registry_entries": {
2075
+ "name": "registry_entries",
2076
+ "columns": {
2077
+ "id": {
2078
+ "name": "id",
2079
+ "type": "text",
2080
+ "primaryKey": true,
2081
+ "notNull": true,
2082
+ "autoincrement": false
2083
+ },
2084
+ "instance_id": {
2085
+ "name": "instance_id",
2086
+ "type": "text",
2087
+ "primaryKey": false,
2088
+ "notNull": true,
2089
+ "autoincrement": false
2090
+ },
2091
+ "kind": {
2092
+ "name": "kind",
2093
+ "type": "text",
2094
+ "primaryKey": false,
2095
+ "notNull": true,
2096
+ "autoincrement": false
2097
+ },
2098
+ "ext_id": {
2099
+ "name": "ext_id",
2100
+ "type": "text",
2101
+ "primaryKey": false,
2102
+ "notNull": true,
2103
+ "autoincrement": false
2104
+ },
2105
+ "name": {
2106
+ "name": "name",
2107
+ "type": "text",
2108
+ "primaryKey": false,
2109
+ "notNull": true,
2110
+ "autoincrement": false
2111
+ },
2112
+ "parent_ext_id": {
2113
+ "name": "parent_ext_id",
2114
+ "type": "text",
2115
+ "primaryKey": false,
2116
+ "notNull": false,
2117
+ "autoincrement": false
2118
+ },
2119
+ "scopes": {
2120
+ "name": "scopes",
2121
+ "type": "text",
2122
+ "primaryKey": false,
2123
+ "notNull": false,
2124
+ "autoincrement": false
2125
+ },
2126
+ "attrs": {
2127
+ "name": "attrs",
2128
+ "type": "text",
2129
+ "primaryKey": false,
2130
+ "notNull": false,
2131
+ "autoincrement": false
2132
+ },
2133
+ "stale": {
2134
+ "name": "stale",
2135
+ "type": "integer",
2136
+ "primaryKey": false,
2137
+ "notNull": true,
2138
+ "autoincrement": false,
2139
+ "default": false
2140
+ },
2141
+ "last_synced_at": {
2142
+ "name": "last_synced_at",
2143
+ "type": "integer",
2144
+ "primaryKey": false,
2145
+ "notNull": true,
2146
+ "autoincrement": false
2147
+ }
2148
+ },
2149
+ "indexes": {
2150
+ "registry_instance_kind_ext_idx": {
2151
+ "name": "registry_instance_kind_ext_idx",
2152
+ "columns": [
2153
+ "instance_id",
2154
+ "kind",
2155
+ "ext_id"
2156
+ ],
2157
+ "isUnique": true
2158
+ }
2159
+ },
2160
+ "foreignKeys": {
2161
+ "registry_entries_instance_id_plugin_instances_id_fk": {
2162
+ "name": "registry_entries_instance_id_plugin_instances_id_fk",
2163
+ "tableFrom": "registry_entries",
2164
+ "tableTo": "plugin_instances",
2165
+ "columnsFrom": [
2166
+ "instance_id"
2167
+ ],
2168
+ "columnsTo": [
2169
+ "id"
2170
+ ],
2171
+ "onDelete": "cascade",
2172
+ "onUpdate": "no action"
2173
+ }
2174
+ },
2175
+ "compositePrimaryKeys": {},
2176
+ "uniqueConstraints": {},
2177
+ "checkConstraints": {}
2178
+ },
2179
+ "role_instances": {
2180
+ "name": "role_instances",
2181
+ "columns": {
2182
+ "role_id": {
2183
+ "name": "role_id",
2184
+ "type": "text",
2185
+ "primaryKey": false,
2186
+ "notNull": true,
2187
+ "autoincrement": false
2188
+ },
2189
+ "instance_id": {
2190
+ "name": "instance_id",
2191
+ "type": "text",
2192
+ "primaryKey": false,
2193
+ "notNull": true,
2194
+ "autoincrement": false
2195
+ }
2196
+ },
2197
+ "indexes": {
2198
+ "role_instances_idx": {
2199
+ "name": "role_instances_idx",
2200
+ "columns": [
2201
+ "role_id",
2202
+ "instance_id"
2203
+ ],
2204
+ "isUnique": true
2205
+ }
2206
+ },
2207
+ "foreignKeys": {
2208
+ "role_instances_role_id_roles_id_fk": {
2209
+ "name": "role_instances_role_id_roles_id_fk",
2210
+ "tableFrom": "role_instances",
2211
+ "tableTo": "roles",
2212
+ "columnsFrom": [
2213
+ "role_id"
2214
+ ],
2215
+ "columnsTo": [
2216
+ "id"
2217
+ ],
2218
+ "onDelete": "cascade",
2219
+ "onUpdate": "no action"
2220
+ },
2221
+ "role_instances_instance_id_plugin_instances_id_fk": {
2222
+ "name": "role_instances_instance_id_plugin_instances_id_fk",
2223
+ "tableFrom": "role_instances",
2224
+ "tableTo": "plugin_instances",
2225
+ "columnsFrom": [
2226
+ "instance_id"
2227
+ ],
2228
+ "columnsTo": [
2229
+ "id"
2230
+ ],
2231
+ "onDelete": "cascade",
2232
+ "onUpdate": "no action"
2233
+ }
2234
+ },
2235
+ "compositePrimaryKeys": {},
2236
+ "uniqueConstraints": {},
2237
+ "checkConstraints": {}
2238
+ },
2239
+ "role_levels": {
2240
+ "name": "role_levels",
2241
+ "columns": {
2242
+ "id": {
2243
+ "name": "id",
2244
+ "type": "text",
2245
+ "primaryKey": true,
2246
+ "notNull": true,
2247
+ "autoincrement": false
2248
+ },
2249
+ "role_id": {
2250
+ "name": "role_id",
2251
+ "type": "text",
2252
+ "primaryKey": false,
2253
+ "notNull": true,
2254
+ "autoincrement": false
2255
+ },
2256
+ "instance_id": {
2257
+ "name": "instance_id",
2258
+ "type": "text",
2259
+ "primaryKey": false,
2260
+ "notNull": true,
2261
+ "autoincrement": false
2262
+ },
2263
+ "group_id": {
2264
+ "name": "group_id",
2265
+ "type": "text",
2266
+ "primaryKey": false,
2267
+ "notNull": false,
2268
+ "autoincrement": false
2269
+ },
2270
+ "operation_id": {
2271
+ "name": "operation_id",
2272
+ "type": "text",
2273
+ "primaryKey": false,
2274
+ "notNull": false,
2275
+ "autoincrement": false
2276
+ },
2277
+ "level": {
2278
+ "name": "level",
2279
+ "type": "text",
2280
+ "primaryKey": false,
2281
+ "notNull": true,
2282
+ "autoincrement": false
2283
+ },
2284
+ "changed_at": {
2285
+ "name": "changed_at",
2286
+ "type": "integer",
2287
+ "primaryKey": false,
2288
+ "notNull": false,
2289
+ "autoincrement": false
2290
+ },
2291
+ "changed_by": {
2292
+ "name": "changed_by",
2293
+ "type": "text",
2294
+ "primaryKey": false,
2295
+ "notNull": false,
2296
+ "autoincrement": false
2297
+ }
2298
+ },
2299
+ "indexes": {
2300
+ "role_levels_group_idx": {
2301
+ "name": "role_levels_group_idx",
2302
+ "columns": [
2303
+ "role_id",
2304
+ "group_id"
2305
+ ],
2306
+ "isUnique": true
2307
+ },
2308
+ "role_levels_op_idx": {
2309
+ "name": "role_levels_op_idx",
2310
+ "columns": [
2311
+ "role_id",
2312
+ "operation_id"
2313
+ ],
2314
+ "isUnique": true
2315
+ }
2316
+ },
2317
+ "foreignKeys": {
2318
+ "role_levels_role_id_roles_id_fk": {
2319
+ "name": "role_levels_role_id_roles_id_fk",
2320
+ "tableFrom": "role_levels",
2321
+ "tableTo": "roles",
2322
+ "columnsFrom": [
2323
+ "role_id"
2324
+ ],
2325
+ "columnsTo": [
2326
+ "id"
2327
+ ],
2328
+ "onDelete": "cascade",
2329
+ "onUpdate": "no action"
2330
+ },
2331
+ "role_levels_instance_id_plugin_instances_id_fk": {
2332
+ "name": "role_levels_instance_id_plugin_instances_id_fk",
2333
+ "tableFrom": "role_levels",
2334
+ "tableTo": "plugin_instances",
2335
+ "columnsFrom": [
2336
+ "instance_id"
2337
+ ],
2338
+ "columnsTo": [
2339
+ "id"
2340
+ ],
2341
+ "onDelete": "cascade",
2342
+ "onUpdate": "no action"
2343
+ },
2344
+ "role_levels_group_id_operation_groups_id_fk": {
2345
+ "name": "role_levels_group_id_operation_groups_id_fk",
2346
+ "tableFrom": "role_levels",
2347
+ "tableTo": "operation_groups",
2348
+ "columnsFrom": [
2349
+ "group_id"
2350
+ ],
2351
+ "columnsTo": [
2352
+ "id"
2353
+ ],
2354
+ "onDelete": "cascade",
2355
+ "onUpdate": "no action"
2356
+ },
2357
+ "role_levels_operation_id_operations_id_fk": {
2358
+ "name": "role_levels_operation_id_operations_id_fk",
2359
+ "tableFrom": "role_levels",
2360
+ "tableTo": "operations",
2361
+ "columnsFrom": [
2362
+ "operation_id"
2363
+ ],
2364
+ "columnsTo": [
2365
+ "id"
2366
+ ],
2367
+ "onDelete": "cascade",
2368
+ "onUpdate": "no action"
2369
+ },
2370
+ "role_levels_changed_by_users_id_fk": {
2371
+ "name": "role_levels_changed_by_users_id_fk",
2372
+ "tableFrom": "role_levels",
2373
+ "tableTo": "users",
2374
+ "columnsFrom": [
2375
+ "changed_by"
2376
+ ],
2377
+ "columnsTo": [
2378
+ "id"
2379
+ ],
2380
+ "onDelete": "set null",
2381
+ "onUpdate": "no action"
2382
+ }
2383
+ },
2384
+ "compositePrimaryKeys": {},
2385
+ "uniqueConstraints": {},
2386
+ "checkConstraints": {}
2387
+ },
2388
+ "roles": {
2389
+ "name": "roles",
2390
+ "columns": {
2391
+ "id": {
2392
+ "name": "id",
2393
+ "type": "text",
2394
+ "primaryKey": true,
2395
+ "notNull": true,
2396
+ "autoincrement": false
2397
+ },
2398
+ "name": {
2399
+ "name": "name",
2400
+ "type": "text",
2401
+ "primaryKey": false,
2402
+ "notNull": true,
2403
+ "autoincrement": false
2404
+ },
2405
+ "built_in": {
2406
+ "name": "built_in",
2407
+ "type": "integer",
2408
+ "primaryKey": false,
2409
+ "notNull": true,
2410
+ "autoincrement": false,
2411
+ "default": false
2412
+ },
2413
+ "can_set_own_levels": {
2414
+ "name": "can_set_own_levels",
2415
+ "type": "integer",
2416
+ "primaryKey": false,
2417
+ "notNull": true,
2418
+ "autoincrement": false,
2419
+ "default": false
2420
+ },
2421
+ "can_manage_own_rules": {
2422
+ "name": "can_manage_own_rules",
2423
+ "type": "integer",
2424
+ "primaryKey": false,
2425
+ "notNull": true,
2426
+ "autoincrement": false,
2427
+ "default": false
2428
+ },
2429
+ "can_see_status": {
2430
+ "name": "can_see_status",
2431
+ "type": "integer",
2432
+ "primaryKey": false,
2433
+ "notNull": true,
2434
+ "autoincrement": false,
2435
+ "default": false
2436
+ },
2437
+ "created_at": {
2438
+ "name": "created_at",
2439
+ "type": "integer",
2440
+ "primaryKey": false,
2441
+ "notNull": true,
2442
+ "autoincrement": false,
2443
+ "default": "(unixepoch() * 1000)"
2444
+ },
2445
+ "updated_at": {
2446
+ "name": "updated_at",
2447
+ "type": "integer",
2448
+ "primaryKey": false,
2449
+ "notNull": false,
2450
+ "autoincrement": false
2451
+ }
2452
+ },
2453
+ "indexes": {
2454
+ "roles_name_unique": {
2455
+ "name": "roles_name_unique",
2456
+ "columns": [
2457
+ "name"
2458
+ ],
2459
+ "isUnique": true
2460
+ }
2461
+ },
2462
+ "foreignKeys": {},
2463
+ "compositePrimaryKeys": {},
2464
+ "uniqueConstraints": {},
2465
+ "checkConstraints": {}
2466
+ },
2467
+ "sessions": {
2468
+ "name": "sessions",
2469
+ "columns": {
2470
+ "id_hash": {
2471
+ "name": "id_hash",
2472
+ "type": "text",
2473
+ "primaryKey": true,
2474
+ "notNull": true,
2475
+ "autoincrement": false
2476
+ },
2477
+ "user_id": {
2478
+ "name": "user_id",
2479
+ "type": "text",
2480
+ "primaryKey": false,
2481
+ "notNull": true,
2482
+ "autoincrement": false
2483
+ },
2484
+ "kind": {
2485
+ "name": "kind",
2486
+ "type": "text",
2487
+ "primaryKey": false,
2488
+ "notNull": true,
2489
+ "autoincrement": false
2490
+ },
2491
+ "created_at": {
2492
+ "name": "created_at",
2493
+ "type": "integer",
2494
+ "primaryKey": false,
2495
+ "notNull": true,
2496
+ "autoincrement": false,
2497
+ "default": "(unixepoch() * 1000)"
2498
+ },
2499
+ "last_seen_at": {
2500
+ "name": "last_seen_at",
2501
+ "type": "integer",
2502
+ "primaryKey": false,
2503
+ "notNull": true,
2504
+ "autoincrement": false
2505
+ },
2506
+ "expires_at": {
2507
+ "name": "expires_at",
2508
+ "type": "integer",
2509
+ "primaryKey": false,
2510
+ "notNull": true,
2511
+ "autoincrement": false
2512
+ },
2513
+ "ip": {
2514
+ "name": "ip",
2515
+ "type": "text",
2516
+ "primaryKey": false,
2517
+ "notNull": false,
2518
+ "autoincrement": false
2519
+ },
2520
+ "user_agent": {
2521
+ "name": "user_agent",
2522
+ "type": "text",
2523
+ "primaryKey": false,
2524
+ "notNull": false,
2525
+ "autoincrement": false
2526
+ }
2527
+ },
2528
+ "indexes": {
2529
+ "sessions_user_idx": {
2530
+ "name": "sessions_user_idx",
2531
+ "columns": [
2532
+ "user_id"
2533
+ ],
2534
+ "isUnique": false
2535
+ }
2536
+ },
2537
+ "foreignKeys": {
2538
+ "sessions_user_id_users_id_fk": {
2539
+ "name": "sessions_user_id_users_id_fk",
2540
+ "tableFrom": "sessions",
2541
+ "tableTo": "users",
2542
+ "columnsFrom": [
2543
+ "user_id"
2544
+ ],
2545
+ "columnsTo": [
2546
+ "id"
2547
+ ],
2548
+ "onDelete": "cascade",
2549
+ "onUpdate": "no action"
2550
+ }
2551
+ },
2552
+ "compositePrimaryKeys": {},
2553
+ "uniqueConstraints": {},
2554
+ "checkConstraints": {}
2555
+ },
2556
+ "settings": {
2557
+ "name": "settings",
2558
+ "columns": {
2559
+ "key": {
2560
+ "name": "key",
2561
+ "type": "text",
2562
+ "primaryKey": true,
2563
+ "notNull": true,
2564
+ "autoincrement": false
2565
+ },
2566
+ "value": {
2567
+ "name": "value",
2568
+ "type": "text",
2569
+ "primaryKey": false,
2570
+ "notNull": true,
2571
+ "autoincrement": false
2572
+ }
2573
+ },
2574
+ "indexes": {},
2575
+ "foreignKeys": {},
2576
+ "compositePrimaryKeys": {},
2577
+ "uniqueConstraints": {},
2578
+ "checkConstraints": {}
2579
+ },
2580
+ "user_levels": {
2581
+ "name": "user_levels",
2582
+ "columns": {
2583
+ "id": {
2584
+ "name": "id",
2585
+ "type": "text",
2586
+ "primaryKey": true,
2587
+ "notNull": true,
2588
+ "autoincrement": false
2589
+ },
2590
+ "user_id": {
2591
+ "name": "user_id",
2592
+ "type": "text",
2593
+ "primaryKey": false,
2594
+ "notNull": true,
2595
+ "autoincrement": false
2596
+ },
2597
+ "instance_id": {
2598
+ "name": "instance_id",
2599
+ "type": "text",
2600
+ "primaryKey": false,
2601
+ "notNull": true,
2602
+ "autoincrement": false
2603
+ },
2604
+ "group_id": {
2605
+ "name": "group_id",
2606
+ "type": "text",
2607
+ "primaryKey": false,
2608
+ "notNull": false,
2609
+ "autoincrement": false
2610
+ },
2611
+ "operation_id": {
2612
+ "name": "operation_id",
2613
+ "type": "text",
2614
+ "primaryKey": false,
2615
+ "notNull": false,
2616
+ "autoincrement": false
2617
+ },
2618
+ "level": {
2619
+ "name": "level",
2620
+ "type": "text",
2621
+ "primaryKey": false,
2622
+ "notNull": true,
2623
+ "autoincrement": false
2624
+ },
2625
+ "changed_at": {
2626
+ "name": "changed_at",
2627
+ "type": "integer",
2628
+ "primaryKey": false,
2629
+ "notNull": false,
2630
+ "autoincrement": false
2631
+ }
2632
+ },
2633
+ "indexes": {
2634
+ "user_levels_group_idx": {
2635
+ "name": "user_levels_group_idx",
2636
+ "columns": [
2637
+ "user_id",
2638
+ "group_id"
2639
+ ],
2640
+ "isUnique": true
2641
+ },
2642
+ "user_levels_op_idx": {
2643
+ "name": "user_levels_op_idx",
2644
+ "columns": [
2645
+ "user_id",
2646
+ "operation_id"
2647
+ ],
2648
+ "isUnique": true
2649
+ }
2650
+ },
2651
+ "foreignKeys": {
2652
+ "user_levels_user_id_users_id_fk": {
2653
+ "name": "user_levels_user_id_users_id_fk",
2654
+ "tableFrom": "user_levels",
2655
+ "tableTo": "users",
2656
+ "columnsFrom": [
2657
+ "user_id"
2658
+ ],
2659
+ "columnsTo": [
2660
+ "id"
2661
+ ],
2662
+ "onDelete": "cascade",
2663
+ "onUpdate": "no action"
2664
+ },
2665
+ "user_levels_instance_id_plugin_instances_id_fk": {
2666
+ "name": "user_levels_instance_id_plugin_instances_id_fk",
2667
+ "tableFrom": "user_levels",
2668
+ "tableTo": "plugin_instances",
2669
+ "columnsFrom": [
2670
+ "instance_id"
2671
+ ],
2672
+ "columnsTo": [
2673
+ "id"
2674
+ ],
2675
+ "onDelete": "cascade",
2676
+ "onUpdate": "no action"
2677
+ },
2678
+ "user_levels_group_id_operation_groups_id_fk": {
2679
+ "name": "user_levels_group_id_operation_groups_id_fk",
2680
+ "tableFrom": "user_levels",
2681
+ "tableTo": "operation_groups",
2682
+ "columnsFrom": [
2683
+ "group_id"
2684
+ ],
2685
+ "columnsTo": [
2686
+ "id"
2687
+ ],
2688
+ "onDelete": "cascade",
2689
+ "onUpdate": "no action"
2690
+ },
2691
+ "user_levels_operation_id_operations_id_fk": {
2692
+ "name": "user_levels_operation_id_operations_id_fk",
2693
+ "tableFrom": "user_levels",
2694
+ "tableTo": "operations",
2695
+ "columnsFrom": [
2696
+ "operation_id"
2697
+ ],
2698
+ "columnsTo": [
2699
+ "id"
2700
+ ],
2701
+ "onDelete": "cascade",
2702
+ "onUpdate": "no action"
2703
+ }
2704
+ },
2705
+ "compositePrimaryKeys": {},
2706
+ "uniqueConstraints": {},
2707
+ "checkConstraints": {}
2708
+ },
2709
+ "users": {
2710
+ "name": "users",
2711
+ "columns": {
2712
+ "id": {
2713
+ "name": "id",
2714
+ "type": "text",
2715
+ "primaryKey": true,
2716
+ "notNull": true,
2717
+ "autoincrement": false
2718
+ },
2719
+ "username": {
2720
+ "name": "username",
2721
+ "type": "text",
2722
+ "primaryKey": false,
2723
+ "notNull": true,
2724
+ "autoincrement": false
2725
+ },
2726
+ "password_hash": {
2727
+ "name": "password_hash",
2728
+ "type": "text",
2729
+ "primaryKey": false,
2730
+ "notNull": false,
2731
+ "autoincrement": false
2732
+ },
2733
+ "totp_secret_enc": {
2734
+ "name": "totp_secret_enc",
2735
+ "type": "blob",
2736
+ "primaryKey": false,
2737
+ "notNull": false,
2738
+ "autoincrement": false
2739
+ },
2740
+ "totp_enabled": {
2741
+ "name": "totp_enabled",
2742
+ "type": "integer",
2743
+ "primaryKey": false,
2744
+ "notNull": true,
2745
+ "autoincrement": false,
2746
+ "default": false
2747
+ },
2748
+ "totp_last_step": {
2749
+ "name": "totp_last_step",
2750
+ "type": "integer",
2751
+ "primaryKey": false,
2752
+ "notNull": false,
2753
+ "autoincrement": false
2754
+ },
2755
+ "recovery_codes_hash": {
2756
+ "name": "recovery_codes_hash",
2757
+ "type": "text",
2758
+ "primaryKey": false,
2759
+ "notNull": false,
2760
+ "autoincrement": false
2761
+ },
2762
+ "oidc_issuer": {
2763
+ "name": "oidc_issuer",
2764
+ "type": "text",
2765
+ "primaryKey": false,
2766
+ "notNull": false,
2767
+ "autoincrement": false
2768
+ },
2769
+ "oidc_subject": {
2770
+ "name": "oidc_subject",
2771
+ "type": "text",
2772
+ "primaryKey": false,
2773
+ "notNull": false,
2774
+ "autoincrement": false
2775
+ },
2776
+ "created_at": {
2777
+ "name": "created_at",
2778
+ "type": "integer",
2779
+ "primaryKey": false,
2780
+ "notNull": true,
2781
+ "autoincrement": false,
2782
+ "default": "(unixepoch() * 1000)"
2783
+ },
2784
+ "last_login_at": {
2785
+ "name": "last_login_at",
2786
+ "type": "integer",
2787
+ "primaryKey": false,
2788
+ "notNull": false,
2789
+ "autoincrement": false
2790
+ },
2791
+ "disabled": {
2792
+ "name": "disabled",
2793
+ "type": "integer",
2794
+ "primaryKey": false,
2795
+ "notNull": true,
2796
+ "autoincrement": false,
2797
+ "default": false
2798
+ },
2799
+ "role_id": {
2800
+ "name": "role_id",
2801
+ "type": "text",
2802
+ "primaryKey": false,
2803
+ "notNull": true,
2804
+ "autoincrement": false,
2805
+ "default": "'admin'"
2806
+ },
2807
+ "registered_via": {
2808
+ "name": "registered_via",
2809
+ "type": "text",
2810
+ "primaryKey": false,
2811
+ "notNull": false,
2812
+ "autoincrement": false
2813
+ }
2814
+ },
2815
+ "indexes": {
2816
+ "users_username_unique": {
2817
+ "name": "users_username_unique",
2818
+ "columns": [
2819
+ "username"
2820
+ ],
2821
+ "isUnique": true
2822
+ }
2823
+ },
2824
+ "foreignKeys": {},
2825
+ "compositePrimaryKeys": {},
2826
+ "uniqueConstraints": {},
2827
+ "checkConstraints": {}
2828
+ }
2829
+ },
2830
+ "views": {},
2831
+ "enums": {},
2832
+ "_meta": {
2833
+ "schemas": {},
2834
+ "tables": {},
2835
+ "columns": {}
2836
+ },
2837
+ "internal": {
2838
+ "indexes": {}
2839
+ }
2840
+ }