@derwinjs/db 0.10.0 → 0.12.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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "prisma-client-deda071698db4a99242c121e3538d4b7fb3a521480d46d881f9efc884cebfc6f",
2
+ "name": "prisma-client-b50acb8ba6a971962b4114ac48cb52ea37c6a0a760ad2278d452f35f9c278c8c",
3
3
  "main": "index.js",
4
4
  "types": "index.d.ts",
5
5
  "browser": "index-browser.js",
@@ -151,6 +151,8 @@ model Project {
151
151
  visualBaselines VisualBaseline[]
152
152
  contractBaselines ContractBaseline[]
153
153
  tenantFuzzConfig TenantFuzzConfig?
154
+ rumSamples RumSample[]
155
+ milestoneEvents MilestoneEvent[]
154
156
 
155
157
  @@map("projects")
156
158
  @@schema("derwin")
@@ -1089,3 +1091,83 @@ model TenantFuzzConfig {
1089
1091
  @@map("tenant_fuzz_configs")
1090
1092
  @@schema("derwin")
1091
1093
  }
1094
+
1095
+ // ═══════════════════════════════════════════════════════════════════════════
1096
+ // QAP-113 (Sprint 11 Phase 3) — RUM / Web Vitals samples
1097
+ // ═══════════════════════════════════════════════════════════════════════════
1098
+ //
1099
+ // Stores consumer-pushed Real User Monitoring (RUM) samples emitted by the
1100
+ // consumer app's web-vitals hooks. Unlike Sprint 10/11 scanner surfaces this
1101
+ // is INGESTION — the data is pushed from client devices, not produced by a
1102
+ // Derwin-spawned scanner. One row per individual sample; baseline statistics
1103
+ // (p50/p75/p95) are derived on demand from this row set rather than
1104
+ // maintained as a rolling aggregate.
1105
+ //
1106
+ // The Prisma-backed implementation lives at
1107
+ // packages/db/src/rum-sample-store.ts; the SDK contract is in
1108
+ // @derwinjs/sdk (RumSampleStore in
1109
+ // packages/sdk/src/types/rum-sample-store.ts) and the ingest contract
1110
+ // (WebVitalsIngestor) in packages/sdk/src/types/web-vitals-ingestor.ts.
1111
+ //
1112
+ // `metric` and `rating` are held as String columns rather than Prisma enums
1113
+ // so consumers can emit custom metrics (alongside the canonical
1114
+ // CLS / FCP / INP / LCP / TTFB) without requiring a migration. The factory
1115
+ // validates the value at runtime where it matters.
1116
+
1117
+ model RumSample {
1118
+ id String @id @default(cuid())
1119
+ projectId String
1120
+ metric String // 'CLS' | 'FCP' | 'INP' | 'LCP' | 'TTFB' or custom
1121
+ value Float
1122
+ rating String // 'good' | 'needs-improvement' | 'poor'
1123
+ url String
1124
+ deviceType String?
1125
+ sessionId String?
1126
+ capturedAt DateTime @default(now())
1127
+
1128
+ project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
1129
+
1130
+ @@index([projectId, metric, capturedAt(sort: Desc)])
1131
+ @@map("rum_samples")
1132
+ @@schema("derwin")
1133
+ }
1134
+
1135
+ // ═══════════════════════════════════════════════════════════════════════════
1136
+ // QAP-115 (Sprint 11 Phase 5) — Cross-product tracking timeline (MilestoneEvent)
1137
+ // ═══════════════════════════════════════════════════════════════════════════
1138
+ //
1139
+ // Foundation for the Tracking Timeline Gantt UI shipped in Sprint 11 Phase 6.
1140
+ // One row per scheduled or in-progress milestone; ranges (releases, freeze
1141
+ // windows) carry both `startsAt` + `endsAt`; point-in-time milestones (demos,
1142
+ // launches) carry only `startsAt`. `kind` is intentionally a free-form String
1143
+ // rather than a Prisma enum so consumers can emit custom kinds (the conflict-
1144
+ // detection helpers in @derwinjs/core treat unknown kinds as "no conflict
1145
+ // computed against this kind" rather than throwing).
1146
+ //
1147
+ // The Prisma-backed implementation lives at
1148
+ // packages/db/src/milestone-event-store.ts; the SDK contract is in
1149
+ // @derwinjs/sdk (MilestoneEventStore in
1150
+ // packages/sdk/src/types/milestone-event-store.ts).
1151
+ //
1152
+ // Indexes mirror the two read paths: chronological per project (for the
1153
+ // Gantt's primary read) and per-kind per project (for swimlane grouping).
1154
+
1155
+ model MilestoneEvent {
1156
+ id String @id @default(cuid())
1157
+ projectId String
1158
+ name String
1159
+ description String? @db.Text
1160
+ startsAt DateTime
1161
+ endsAt DateTime?
1162
+ kind String // 'release' | 'freeze' | 'demo' | 'launch' | custom
1163
+ createdBy String
1164
+ createdAt DateTime @default(now())
1165
+ updatedAt DateTime @updatedAt
1166
+
1167
+ project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
1168
+
1169
+ @@index([projectId, startsAt(sort: Asc)])
1170
+ @@index([projectId, kind])
1171
+ @@map("milestone_events")
1172
+ @@schema("derwin")
1173
+ }
@@ -479,6 +479,31 @@ exports.Prisma.TenantFuzzConfigScalarFieldEnum = {
479
479
  updatedBy: 'updatedBy'
480
480
  };
481
481
 
482
+ exports.Prisma.RumSampleScalarFieldEnum = {
483
+ id: 'id',
484
+ projectId: 'projectId',
485
+ metric: 'metric',
486
+ value: 'value',
487
+ rating: 'rating',
488
+ url: 'url',
489
+ deviceType: 'deviceType',
490
+ sessionId: 'sessionId',
491
+ capturedAt: 'capturedAt'
492
+ };
493
+
494
+ exports.Prisma.MilestoneEventScalarFieldEnum = {
495
+ id: 'id',
496
+ projectId: 'projectId',
497
+ name: 'name',
498
+ description: 'description',
499
+ startsAt: 'startsAt',
500
+ endsAt: 'endsAt',
501
+ kind: 'kind',
502
+ createdBy: 'createdBy',
503
+ createdAt: 'createdAt',
504
+ updatedAt: 'updatedAt'
505
+ };
506
+
482
507
  exports.Prisma.SortOrder = {
483
508
  asc: 'asc',
484
509
  desc: 'desc'
@@ -690,7 +715,9 @@ exports.Prisma.ModelName = {
690
715
  QAUniformity: 'QAUniformity',
691
716
  VisualBaseline: 'VisualBaseline',
692
717
  ContractBaseline: 'ContractBaseline',
693
- TenantFuzzConfig: 'TenantFuzzConfig'
718
+ TenantFuzzConfig: 'TenantFuzzConfig',
719
+ RumSample: 'RumSample',
720
+ MilestoneEvent: 'MilestoneEvent'
694
721
  };
695
722
 
696
723
  /**