@derwinjs/db 0.10.0 → 0.11.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.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/milestone-event-store.d.ts +35 -0
- package/dist/milestone-event-store.d.ts.map +1 -0
- package/dist/milestone-event-store.js +221 -0
- package/dist/milestone-event-store.js.map +1 -0
- package/dist/rum-sample-store.d.ts +48 -0
- package/dist/rum-sample-store.d.ts.map +1 -0
- package/dist/rum-sample-store.js +155 -0
- package/dist/rum-sample-store.js.map +1 -0
- package/package.json +3 -3
- package/prisma/migrations/20260508000100_sprint11_phase3_rum_samples/migration.sql +31 -0
- package/prisma/migrations/20260508000200_sprint11_phase5_milestone_events/migration.sql +42 -0
- package/prisma/schema.prisma +82 -0
- package/prisma-client/edge.js +31 -4
- package/prisma-client/index-browser.js +28 -1
- package/prisma-client/index.d.ts +4102 -525
- package/prisma-client/index.js +31 -4
- package/prisma-client/package.json +1 -1
- package/prisma-client/schema.prisma +82 -0
- package/prisma-client/wasm.js +28 -1
package/prisma/schema.prisma
CHANGED
|
@@ -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
|
+
}
|