@verdict-ai/db 0.1.0 → 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.
Files changed (42) hide show
  1. package/dist/auth.d.ts +12 -2
  2. package/dist/auth.js +5 -4
  3. package/dist/auth.js.map +1 -1
  4. package/dist/control.d.ts +58 -0
  5. package/dist/control.js +305 -0
  6. package/dist/control.js.map +1 -0
  7. package/dist/d1.d.ts +1201 -0
  8. package/dist/dialects.d.ts +7 -0
  9. package/dist/dialects.js +17 -0
  10. package/dist/dialects.js.map +1 -1
  11. package/dist/documents.d.ts +2 -0
  12. package/dist/postgres.d.ts +2454 -268
  13. package/dist/queries.d.ts +2 -0
  14. package/dist/queries.js +4 -0
  15. package/dist/queries.js.map +1 -1
  16. package/dist/schema/control.d.ts +71 -0
  17. package/dist/schema/control.js +29 -0
  18. package/dist/schema/control.js.map +1 -0
  19. package/dist/schema/pg.d.ts +2453 -262
  20. package/dist/schema/pg.js +44 -2
  21. package/dist/schema/pg.js.map +1 -1
  22. package/dist/schema/sqlite.d.ts +2680 -273
  23. package/dist/schema/sqlite.js +44 -2
  24. package/dist/schema/sqlite.js.map +1 -1
  25. package/dist/store.d.ts +12 -4
  26. package/dist/store.js +77 -6
  27. package/dist/store.js.map +1 -1
  28. package/drizzle/0002_publications.sql +20 -0
  29. package/drizzle/0003_publishers.sql +9 -0
  30. package/drizzle/0004_control_plane.sql +75 -0
  31. package/drizzle/meta/0002_snapshot.json +659 -0
  32. package/drizzle/meta/0003_snapshot.json +712 -0
  33. package/drizzle/meta/0004_snapshot.json +1191 -0
  34. package/drizzle/meta/_journal.json +21 -0
  35. package/drizzle/pg/0001_publications.sql +20 -0
  36. package/drizzle/pg/0002_publishers.sql +9 -0
  37. package/drizzle/pg/0003_control_plane.sql +75 -0
  38. package/drizzle/pg/meta/0001_snapshot.json +769 -0
  39. package/drizzle/pg/meta/0002_snapshot.json +828 -0
  40. package/drizzle/pg/meta/0003_snapshot.json +1381 -0
  41. package/drizzle/pg/meta/_journal.json +21 -0
  42. package/package.json +4 -3
@@ -0,0 +1,659 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "068ab811-bd72-4cc4-9fcc-62b3928d887b",
5
+ "prevId": "b973008b-216b-42d8-88dd-ff7d6c876e93",
6
+ "tables": {
7
+ "api_keys": {
8
+ "name": "api_keys",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "tenant_id": {
18
+ "name": "tenant_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "name": {
25
+ "name": "name",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "key_hash": {
32
+ "name": "key_hash",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": true,
36
+ "autoincrement": false
37
+ },
38
+ "prefix": {
39
+ "name": "prefix",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": true,
43
+ "autoincrement": false
44
+ },
45
+ "created_at": {
46
+ "name": "created_at",
47
+ "type": "text",
48
+ "primaryKey": false,
49
+ "notNull": true,
50
+ "autoincrement": false
51
+ },
52
+ "last_used_at": {
53
+ "name": "last_used_at",
54
+ "type": "text",
55
+ "primaryKey": false,
56
+ "notNull": false,
57
+ "autoincrement": false
58
+ },
59
+ "revoked_at": {
60
+ "name": "revoked_at",
61
+ "type": "text",
62
+ "primaryKey": false,
63
+ "notNull": false,
64
+ "autoincrement": false
65
+ }
66
+ },
67
+ "indexes": {
68
+ "api_keys_hash": {
69
+ "name": "api_keys_hash",
70
+ "columns": [
71
+ "key_hash"
72
+ ],
73
+ "isUnique": true
74
+ },
75
+ "api_keys_tenant": {
76
+ "name": "api_keys_tenant",
77
+ "columns": [
78
+ "tenant_id"
79
+ ],
80
+ "isUnique": false
81
+ }
82
+ },
83
+ "foreignKeys": {},
84
+ "compositePrimaryKeys": {},
85
+ "uniqueConstraints": {},
86
+ "checkConstraints": {}
87
+ },
88
+ "evaluations": {
89
+ "name": "evaluations",
90
+ "columns": {
91
+ "id": {
92
+ "name": "id",
93
+ "type": "text",
94
+ "primaryKey": true,
95
+ "notNull": true,
96
+ "autoincrement": false
97
+ },
98
+ "tenant_id": {
99
+ "name": "tenant_id",
100
+ "type": "text",
101
+ "primaryKey": false,
102
+ "notNull": false,
103
+ "autoincrement": false
104
+ },
105
+ "rubric_id": {
106
+ "name": "rubric_id",
107
+ "type": "text",
108
+ "primaryKey": false,
109
+ "notNull": false,
110
+ "autoincrement": false
111
+ },
112
+ "rubric_name": {
113
+ "name": "rubric_name",
114
+ "type": "text",
115
+ "primaryKey": false,
116
+ "notNull": true,
117
+ "autoincrement": false
118
+ },
119
+ "subject_name": {
120
+ "name": "subject_name",
121
+ "type": "text",
122
+ "primaryKey": false,
123
+ "notNull": false,
124
+ "autoincrement": false
125
+ },
126
+ "status": {
127
+ "name": "status",
128
+ "type": "text",
129
+ "primaryKey": false,
130
+ "notNull": true,
131
+ "autoincrement": false
132
+ },
133
+ "score": {
134
+ "name": "score",
135
+ "type": "real",
136
+ "primaryKey": false,
137
+ "notNull": false,
138
+ "autoincrement": false
139
+ },
140
+ "grade": {
141
+ "name": "grade",
142
+ "type": "text",
143
+ "primaryKey": false,
144
+ "notNull": false,
145
+ "autoincrement": false
146
+ },
147
+ "passed": {
148
+ "name": "passed",
149
+ "type": "integer",
150
+ "primaryKey": false,
151
+ "notNull": false,
152
+ "autoincrement": false
153
+ },
154
+ "pending_human": {
155
+ "name": "pending_human",
156
+ "type": "integer",
157
+ "primaryKey": false,
158
+ "notNull": true,
159
+ "autoincrement": false,
160
+ "default": 0
161
+ },
162
+ "decision_calls": {
163
+ "name": "decision_calls",
164
+ "type": "integer",
165
+ "primaryKey": false,
166
+ "notNull": true,
167
+ "autoincrement": false,
168
+ "default": 0
169
+ },
170
+ "llm_calls": {
171
+ "name": "llm_calls",
172
+ "type": "integer",
173
+ "primaryKey": false,
174
+ "notNull": true,
175
+ "autoincrement": false,
176
+ "default": 0
177
+ },
178
+ "input_tokens": {
179
+ "name": "input_tokens",
180
+ "type": "integer",
181
+ "primaryKey": false,
182
+ "notNull": true,
183
+ "autoincrement": false,
184
+ "default": 0
185
+ },
186
+ "duration_ms": {
187
+ "name": "duration_ms",
188
+ "type": "integer",
189
+ "primaryKey": false,
190
+ "notNull": true,
191
+ "autoincrement": false,
192
+ "default": 0
193
+ },
194
+ "doc": {
195
+ "name": "doc",
196
+ "type": "text",
197
+ "primaryKey": false,
198
+ "notNull": true,
199
+ "autoincrement": false
200
+ },
201
+ "created_at": {
202
+ "name": "created_at",
203
+ "type": "text",
204
+ "primaryKey": false,
205
+ "notNull": true,
206
+ "autoincrement": false
207
+ },
208
+ "updated_at": {
209
+ "name": "updated_at",
210
+ "type": "text",
211
+ "primaryKey": false,
212
+ "notNull": true,
213
+ "autoincrement": false
214
+ }
215
+ },
216
+ "indexes": {
217
+ "evaluations_tenant_created": {
218
+ "name": "evaluations_tenant_created",
219
+ "columns": [
220
+ "tenant_id",
221
+ "created_at"
222
+ ],
223
+ "isUnique": false
224
+ },
225
+ "evaluations_rubric_created": {
226
+ "name": "evaluations_rubric_created",
227
+ "columns": [
228
+ "rubric_id",
229
+ "created_at"
230
+ ],
231
+ "isUnique": false
232
+ },
233
+ "evaluations_tenant_status": {
234
+ "name": "evaluations_tenant_status",
235
+ "columns": [
236
+ "tenant_id",
237
+ "status"
238
+ ],
239
+ "isUnique": false
240
+ }
241
+ },
242
+ "foreignKeys": {},
243
+ "compositePrimaryKeys": {},
244
+ "uniqueConstraints": {},
245
+ "checkConstraints": {}
246
+ },
247
+ "idempotency_keys": {
248
+ "name": "idempotency_keys",
249
+ "columns": {
250
+ "tenant_id": {
251
+ "name": "tenant_id",
252
+ "type": "text",
253
+ "primaryKey": false,
254
+ "notNull": false,
255
+ "autoincrement": false
256
+ },
257
+ "key": {
258
+ "name": "key",
259
+ "type": "text",
260
+ "primaryKey": false,
261
+ "notNull": true,
262
+ "autoincrement": false
263
+ },
264
+ "fingerprint": {
265
+ "name": "fingerprint",
266
+ "type": "text",
267
+ "primaryKey": false,
268
+ "notNull": true,
269
+ "autoincrement": false
270
+ },
271
+ "target_type": {
272
+ "name": "target_type",
273
+ "type": "text",
274
+ "primaryKey": false,
275
+ "notNull": true,
276
+ "autoincrement": false
277
+ },
278
+ "target_id": {
279
+ "name": "target_id",
280
+ "type": "text",
281
+ "primaryKey": false,
282
+ "notNull": false,
283
+ "autoincrement": false
284
+ },
285
+ "target_ids": {
286
+ "name": "target_ids",
287
+ "type": "text",
288
+ "primaryKey": false,
289
+ "notNull": false,
290
+ "autoincrement": false
291
+ },
292
+ "created_at": {
293
+ "name": "created_at",
294
+ "type": "text",
295
+ "primaryKey": false,
296
+ "notNull": true,
297
+ "autoincrement": false
298
+ },
299
+ "expires_at": {
300
+ "name": "expires_at",
301
+ "type": "text",
302
+ "primaryKey": false,
303
+ "notNull": true,
304
+ "autoincrement": false
305
+ }
306
+ },
307
+ "indexes": {
308
+ "idempotency_keys_tenant_key": {
309
+ "name": "idempotency_keys_tenant_key",
310
+ "columns": [
311
+ "tenant_id",
312
+ "key"
313
+ ],
314
+ "isUnique": true
315
+ }
316
+ },
317
+ "foreignKeys": {},
318
+ "compositePrimaryKeys": {},
319
+ "uniqueConstraints": {},
320
+ "checkConstraints": {}
321
+ },
322
+ "publications": {
323
+ "name": "publications",
324
+ "columns": {
325
+ "id": {
326
+ "name": "id",
327
+ "type": "text",
328
+ "primaryKey": true,
329
+ "notNull": true,
330
+ "autoincrement": false
331
+ },
332
+ "tenant_id": {
333
+ "name": "tenant_id",
334
+ "type": "text",
335
+ "primaryKey": false,
336
+ "notNull": false,
337
+ "autoincrement": false
338
+ },
339
+ "owner": {
340
+ "name": "owner",
341
+ "type": "text",
342
+ "primaryKey": false,
343
+ "notNull": true,
344
+ "autoincrement": false
345
+ },
346
+ "slug": {
347
+ "name": "slug",
348
+ "type": "text",
349
+ "primaryKey": false,
350
+ "notNull": true,
351
+ "autoincrement": false
352
+ },
353
+ "version_id": {
354
+ "name": "version_id",
355
+ "type": "text",
356
+ "primaryKey": false,
357
+ "notNull": true,
358
+ "autoincrement": false
359
+ },
360
+ "title": {
361
+ "name": "title",
362
+ "type": "text",
363
+ "primaryKey": false,
364
+ "notNull": true,
365
+ "autoincrement": false
366
+ },
367
+ "domain": {
368
+ "name": "domain",
369
+ "type": "text",
370
+ "primaryKey": false,
371
+ "notNull": false,
372
+ "autoincrement": false
373
+ },
374
+ "locale": {
375
+ "name": "locale",
376
+ "type": "text",
377
+ "primaryKey": false,
378
+ "notNull": false,
379
+ "autoincrement": false
380
+ },
381
+ "judgment_type": {
382
+ "name": "judgment_type",
383
+ "type": "text",
384
+ "primaryKey": false,
385
+ "notNull": true,
386
+ "autoincrement": false
387
+ },
388
+ "license": {
389
+ "name": "license",
390
+ "type": "text",
391
+ "primaryKey": false,
392
+ "notNull": true,
393
+ "autoincrement": false
394
+ },
395
+ "doc": {
396
+ "name": "doc",
397
+ "type": "text",
398
+ "primaryKey": false,
399
+ "notNull": true,
400
+ "autoincrement": false
401
+ },
402
+ "created_at": {
403
+ "name": "created_at",
404
+ "type": "text",
405
+ "primaryKey": false,
406
+ "notNull": true,
407
+ "autoincrement": false
408
+ },
409
+ "withdrawn_at": {
410
+ "name": "withdrawn_at",
411
+ "type": "text",
412
+ "primaryKey": false,
413
+ "notNull": false,
414
+ "autoincrement": false
415
+ }
416
+ },
417
+ "indexes": {
418
+ "publications_owner_slug_version": {
419
+ "name": "publications_owner_slug_version",
420
+ "columns": [
421
+ "owner",
422
+ "slug",
423
+ "version_id"
424
+ ],
425
+ "isUnique": true
426
+ },
427
+ "publications_created": {
428
+ "name": "publications_created",
429
+ "columns": [
430
+ "created_at"
431
+ ],
432
+ "isUnique": false
433
+ },
434
+ "publications_version": {
435
+ "name": "publications_version",
436
+ "columns": [
437
+ "version_id"
438
+ ],
439
+ "isUnique": false
440
+ },
441
+ "publications_tenant": {
442
+ "name": "publications_tenant",
443
+ "columns": [
444
+ "tenant_id"
445
+ ],
446
+ "isUnique": false
447
+ }
448
+ },
449
+ "foreignKeys": {},
450
+ "compositePrimaryKeys": {},
451
+ "uniqueConstraints": {},
452
+ "checkConstraints": {}
453
+ },
454
+ "ratings": {
455
+ "name": "ratings",
456
+ "columns": {
457
+ "id": {
458
+ "name": "id",
459
+ "type": "text",
460
+ "primaryKey": true,
461
+ "notNull": true,
462
+ "autoincrement": false
463
+ },
464
+ "evaluation_id": {
465
+ "name": "evaluation_id",
466
+ "type": "text",
467
+ "primaryKey": false,
468
+ "notNull": true,
469
+ "autoincrement": false
470
+ },
471
+ "tenant_id": {
472
+ "name": "tenant_id",
473
+ "type": "text",
474
+ "primaryKey": false,
475
+ "notNull": false,
476
+ "autoincrement": false
477
+ },
478
+ "rubric_id": {
479
+ "name": "rubric_id",
480
+ "type": "text",
481
+ "primaryKey": false,
482
+ "notNull": false,
483
+ "autoincrement": false
484
+ },
485
+ "criterion_id": {
486
+ "name": "criterion_id",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": true,
490
+ "autoincrement": false
491
+ },
492
+ "rater_id": {
493
+ "name": "rater_id",
494
+ "type": "text",
495
+ "primaryKey": false,
496
+ "notNull": true,
497
+ "autoincrement": false
498
+ },
499
+ "judge_type": {
500
+ "name": "judge_type",
501
+ "type": "text",
502
+ "primaryKey": false,
503
+ "notNull": true,
504
+ "autoincrement": false
505
+ },
506
+ "status": {
507
+ "name": "status",
508
+ "type": "text",
509
+ "primaryKey": false,
510
+ "notNull": true,
511
+ "autoincrement": false
512
+ },
513
+ "score": {
514
+ "name": "score",
515
+ "type": "real",
516
+ "primaryKey": false,
517
+ "notNull": false,
518
+ "autoincrement": false
519
+ },
520
+ "normalized": {
521
+ "name": "normalized",
522
+ "type": "real",
523
+ "primaryKey": false,
524
+ "notNull": false,
525
+ "autoincrement": false
526
+ },
527
+ "confidence": {
528
+ "name": "confidence",
529
+ "type": "real",
530
+ "primaryKey": false,
531
+ "notNull": false,
532
+ "autoincrement": false
533
+ },
534
+ "model": {
535
+ "name": "model",
536
+ "type": "text",
537
+ "primaryKey": false,
538
+ "notNull": false,
539
+ "autoincrement": false
540
+ },
541
+ "created_at": {
542
+ "name": "created_at",
543
+ "type": "text",
544
+ "primaryKey": false,
545
+ "notNull": true,
546
+ "autoincrement": false
547
+ }
548
+ },
549
+ "indexes": {
550
+ "ratings_evaluation": {
551
+ "name": "ratings_evaluation",
552
+ "columns": [
553
+ "evaluation_id"
554
+ ],
555
+ "isUnique": false
556
+ },
557
+ "ratings_rubric_criterion": {
558
+ "name": "ratings_rubric_criterion",
559
+ "columns": [
560
+ "rubric_id",
561
+ "criterion_id"
562
+ ],
563
+ "isUnique": false
564
+ },
565
+ "ratings_tenant_judge": {
566
+ "name": "ratings_tenant_judge",
567
+ "columns": [
568
+ "tenant_id",
569
+ "judge_type"
570
+ ],
571
+ "isUnique": false
572
+ }
573
+ },
574
+ "foreignKeys": {},
575
+ "compositePrimaryKeys": {},
576
+ "uniqueConstraints": {},
577
+ "checkConstraints": {}
578
+ },
579
+ "rubrics": {
580
+ "name": "rubrics",
581
+ "columns": {
582
+ "id": {
583
+ "name": "id",
584
+ "type": "text",
585
+ "primaryKey": true,
586
+ "notNull": true,
587
+ "autoincrement": false
588
+ },
589
+ "tenant_id": {
590
+ "name": "tenant_id",
591
+ "type": "text",
592
+ "primaryKey": false,
593
+ "notNull": false,
594
+ "autoincrement": false
595
+ },
596
+ "name": {
597
+ "name": "name",
598
+ "type": "text",
599
+ "primaryKey": false,
600
+ "notNull": true,
601
+ "autoincrement": false
602
+ },
603
+ "version": {
604
+ "name": "version",
605
+ "type": "text",
606
+ "primaryKey": false,
607
+ "notNull": true,
608
+ "autoincrement": false,
609
+ "default": "'1'"
610
+ },
611
+ "doc": {
612
+ "name": "doc",
613
+ "type": "text",
614
+ "primaryKey": false,
615
+ "notNull": true,
616
+ "autoincrement": false
617
+ },
618
+ "created_at": {
619
+ "name": "created_at",
620
+ "type": "text",
621
+ "primaryKey": false,
622
+ "notNull": true,
623
+ "autoincrement": false
624
+ },
625
+ "updated_at": {
626
+ "name": "updated_at",
627
+ "type": "text",
628
+ "primaryKey": false,
629
+ "notNull": true,
630
+ "autoincrement": false
631
+ }
632
+ },
633
+ "indexes": {
634
+ "rubrics_tenant_created": {
635
+ "name": "rubrics_tenant_created",
636
+ "columns": [
637
+ "tenant_id",
638
+ "created_at"
639
+ ],
640
+ "isUnique": false
641
+ }
642
+ },
643
+ "foreignKeys": {},
644
+ "compositePrimaryKeys": {},
645
+ "uniqueConstraints": {},
646
+ "checkConstraints": {}
647
+ }
648
+ },
649
+ "views": {},
650
+ "enums": {},
651
+ "_meta": {
652
+ "schemas": {},
653
+ "tables": {},
654
+ "columns": {}
655
+ },
656
+ "internal": {
657
+ "indexes": {}
658
+ }
659
+ }