@adaptware/eagles-db 0.5.73 → 0.5.75
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/client/edge.js +195 -7
- package/client/index-browser.js +188 -1
- package/client/index.d.ts +66890 -49398
- package/client/index.js +195 -7
- package/client/package.json +1 -1
- package/client/schema.prisma +294 -21
- package/client/wasm.js +195 -7
- package/package.json +1 -1
- package/prisma/schema/assessment.prisma +2 -0
- package/prisma/schema/consent.prisma +132 -0
- package/prisma/schema/interview.prisma +6 -6
- package/prisma/schema/migrations/20261001120000_candidate_consent_and_erasure_plan/migration.sql +136 -0
- package/prisma/schema/migrations/20261003103000_assessment_consent_ref_drop_interview_dpdp/migration.sql +16 -0
- package/prisma/schema/migrations/20261003120000_consent_document_version_locale_en/migration.sql +2 -0
- package/prisma/schema/user.prisma +3 -0
- package/client/libquery_engine-darwin.dylib.node +0 -0
- package/prisma/.DS_Store +0 -0
- package/prisma/migrations/20260519120000_migrate_shortlisted_to_selected/migration.sql +0 -2
- package/prisma/schema/.DS_Store +0 -0
package/client/package.json
CHANGED
package/client/schema.prisma
CHANGED
|
@@ -519,6 +519,8 @@ model Assessment {
|
|
|
519
519
|
/// Attempt Expires At
|
|
520
520
|
attempt_expires_at DateTime?
|
|
521
521
|
evaluated_at DateTime?
|
|
522
|
+
/// When this moves forward, prior INTERVIEW_SESSION grants with reference ASSESSMENT are stale.
|
|
523
|
+
consent_epoch_at DateTime @default(now())
|
|
522
524
|
/// Audit fields
|
|
523
525
|
created_at DateTime @default(now())
|
|
524
526
|
updated_at DateTime @updatedAt
|
|
@@ -1244,6 +1246,139 @@ model CompetencyDictionary {
|
|
|
1244
1246
|
@@schema("public")
|
|
1245
1247
|
}
|
|
1246
1248
|
|
|
1249
|
+
/// Candidate consent catalog, audit records, and erasure planning (dry-run v1).
|
|
1250
|
+
|
|
1251
|
+
enum ConsentType {
|
|
1252
|
+
PLATFORM_TERMS
|
|
1253
|
+
INTERVIEW_SESSION
|
|
1254
|
+
|
|
1255
|
+
@@schema("public")
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
enum ConsentReferenceType {
|
|
1259
|
+
INTERVIEW
|
|
1260
|
+
ASSESSMENT
|
|
1261
|
+
|
|
1262
|
+
@@schema("public")
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
enum ConsentOutcome {
|
|
1266
|
+
GRANTED
|
|
1267
|
+
DECLINED
|
|
1268
|
+
|
|
1269
|
+
@@schema("public")
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
enum DataErasureTrigger {
|
|
1273
|
+
ADMIN
|
|
1274
|
+
USER_REQUEST
|
|
1275
|
+
RETENTION_POLICY
|
|
1276
|
+
CONSENT_WITHDRAWAL
|
|
1277
|
+
|
|
1278
|
+
@@schema("public")
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
enum DataErasureMode {
|
|
1282
|
+
DRY_RUN
|
|
1283
|
+
EXECUTE
|
|
1284
|
+
|
|
1285
|
+
@@schema("public")
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
enum DataErasureRequestStatus {
|
|
1289
|
+
PLANNED
|
|
1290
|
+
APPROVED
|
|
1291
|
+
EXECUTED
|
|
1292
|
+
REJECTED
|
|
1293
|
+
FAILED
|
|
1294
|
+
|
|
1295
|
+
@@schema("public")
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
model ConsentDocument {
|
|
1299
|
+
id String @id @default(uuid())
|
|
1300
|
+
/// Stable key, e.g. PLATFORM_TERMS, INTERVIEW_SESSION_DEFAULT
|
|
1301
|
+
slug String @unique
|
|
1302
|
+
consent_type ConsentType
|
|
1303
|
+
is_active Boolean @default(true)
|
|
1304
|
+
created_at DateTime @default(now())
|
|
1305
|
+
updated_at DateTime @updatedAt
|
|
1306
|
+
versions ConsentDocumentVersion[]
|
|
1307
|
+
|
|
1308
|
+
@@schema("public")
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
model ConsentDocumentVersion {
|
|
1312
|
+
id String @id @default(uuid())
|
|
1313
|
+
document_id String
|
|
1314
|
+
document ConsentDocument @relation(fields: [document_id], references: [id], onDelete: Cascade)
|
|
1315
|
+
version_number Int
|
|
1316
|
+
content_hash String
|
|
1317
|
+
locale String @default("en")
|
|
1318
|
+
content String @db.Text
|
|
1319
|
+
published_at DateTime?
|
|
1320
|
+
created_at DateTime @default(now())
|
|
1321
|
+
checkboxes ConsentCheckboxDefinition[]
|
|
1322
|
+
consent_records ConsentRecord[]
|
|
1323
|
+
|
|
1324
|
+
@@unique([document_id, version_number])
|
|
1325
|
+
@@index([document_id, published_at(sort: Desc)])
|
|
1326
|
+
@@schema("public")
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
model ConsentCheckboxDefinition {
|
|
1330
|
+
id String @id @default(uuid())
|
|
1331
|
+
document_version_id String
|
|
1332
|
+
document_version ConsentDocumentVersion @relation(fields: [document_version_id], references: [id], onDelete: Cascade)
|
|
1333
|
+
/// Stable machine key in ConsentRecord.selections JSON
|
|
1334
|
+
checkbox_key String
|
|
1335
|
+
label String
|
|
1336
|
+
sort_order Int @default(0)
|
|
1337
|
+
default_required_hint Boolean @default(true)
|
|
1338
|
+
|
|
1339
|
+
@@unique([document_version_id, checkbox_key])
|
|
1340
|
+
@@schema("public")
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
model ConsentRecord {
|
|
1344
|
+
id String @id @default(uuid())
|
|
1345
|
+
user_id String
|
|
1346
|
+
user User @relation(fields: [user_id], references: [id], onDelete: Cascade)
|
|
1347
|
+
consent_type ConsentType
|
|
1348
|
+
outcome ConsentOutcome
|
|
1349
|
+
document_version_id String
|
|
1350
|
+
document_version ConsentDocumentVersion @relation(fields: [document_version_id], references: [id], onDelete: Restrict)
|
|
1351
|
+
selections Json @default("{}")
|
|
1352
|
+
reference_type ConsentReferenceType?
|
|
1353
|
+
reference_id String?
|
|
1354
|
+
ip_address String?
|
|
1355
|
+
user_agent String?
|
|
1356
|
+
decline_reason String?
|
|
1357
|
+
created_at DateTime @default(now())
|
|
1358
|
+
|
|
1359
|
+
@@index([user_id, consent_type, created_at(sort: Desc)])
|
|
1360
|
+
@@index([reference_type, reference_id, consent_type, created_at(sort: Desc)])
|
|
1361
|
+
@@schema("public")
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
/// Append-only erasure plan snapshots (v1: DRY_RUN only in application code).
|
|
1365
|
+
model DataErasureRequest {
|
|
1366
|
+
id String @id @default(uuid())
|
|
1367
|
+
subject_user_id String
|
|
1368
|
+
subject_user User @relation("ErasureSubjectUser", fields: [subject_user_id], references: [id], onDelete: Cascade)
|
|
1369
|
+
trigger DataErasureTrigger
|
|
1370
|
+
mode DataErasureMode @default(DRY_RUN)
|
|
1371
|
+
status DataErasureRequestStatus @default(PLANNED)
|
|
1372
|
+
plan Json @default("{}")
|
|
1373
|
+
planner_version String
|
|
1374
|
+
requested_by_id String?
|
|
1375
|
+
requested_by User? @relation("ErasureRequestedByUser", fields: [requested_by_id], references: [id], onDelete: SetNull)
|
|
1376
|
+
created_at DateTime @default(now())
|
|
1377
|
+
|
|
1378
|
+
@@index([subject_user_id, created_at(sort: Desc)])
|
|
1379
|
+
@@schema("public")
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1247
1382
|
model ContactUs {
|
|
1248
1383
|
id String @id @default(uuid())
|
|
1249
1384
|
first_name String
|
|
@@ -1476,6 +1611,7 @@ enum EvaluationType {
|
|
|
1476
1611
|
TREADSPACE_FULL_AI
|
|
1477
1612
|
EXTERNAL_AI_ASSISTED
|
|
1478
1613
|
NON_AI_ASSISTED
|
|
1614
|
+
IN_PERSON
|
|
1479
1615
|
|
|
1480
1616
|
@@schema("public")
|
|
1481
1617
|
}
|
|
@@ -2001,6 +2137,7 @@ model Interview {
|
|
|
2001
2137
|
recording_url String?
|
|
2002
2138
|
recording_document_id String? @unique
|
|
2003
2139
|
evaluation_type EvaluationType? @default(TREADSPACE_AI_ASSISTED)
|
|
2140
|
+
is_proctored Boolean @default(false) @map("is_proctored")
|
|
2004
2141
|
ai_assistance_mode AiAssistanceMode? @default(ASSISTED)
|
|
2005
2142
|
interview_status InterviewStatus @default(SCHEDULED)
|
|
2006
2143
|
interview_platform InterviewPlatform @default(TREADSPACE)
|
|
@@ -2013,6 +2150,9 @@ model Interview {
|
|
|
2013
2150
|
final_feedback Json?
|
|
2014
2151
|
interview_analysis_ranges Json?
|
|
2015
2152
|
interview_flow_summary String?
|
|
2153
|
+
transcript_summary String?
|
|
2154
|
+
body_language_appropriate Boolean?
|
|
2155
|
+
tone_appropriate Boolean?
|
|
2016
2156
|
/// Extra Orion prose for downstream AI input (FitCheck, interview prep).
|
|
2017
2157
|
/// Not interviewer-facing; omit from evidence GET / snapshots / Zoho.
|
|
2018
2158
|
ai_context String?
|
|
@@ -2031,36 +2171,47 @@ model Interview {
|
|
|
2031
2171
|
/// When final human feedback was submitted.
|
|
2032
2172
|
evaluated_at DateTime?
|
|
2033
2173
|
|
|
2174
|
+
/// Candidate invite response (legal consent in ConsentRecord).
|
|
2175
|
+
candidate_status String? @default("INVITED")
|
|
2176
|
+
candidate_responded_at DateTime?
|
|
2177
|
+
decline_reason String?
|
|
2178
|
+
/// When this timestamp moves forward, prior INTERVIEW_SESSION consent grants are stale.
|
|
2179
|
+
consent_epoch_at DateTime @default(now())
|
|
2180
|
+
|
|
2034
2181
|
/// Self-scheduling
|
|
2035
|
-
reschedule_count Int
|
|
2182
|
+
reschedule_count Int @default(0)
|
|
2036
2183
|
last_rescheduled_at DateTime?
|
|
2037
2184
|
first_assigned_at DateTime?
|
|
2038
2185
|
/// True while the candidate is waiting on recruiter action (typically a
|
|
2039
2186
|
/// reassign) after they submitted alternate slots via "None match" /
|
|
2040
2187
|
/// "Suggest times". Cleared whenever the recruiter routes a fresh
|
|
2041
2188
|
/// request via `upsertInterviewRequestRecord`.
|
|
2042
|
-
awaiting_recruiter_action Boolean
|
|
2189
|
+
awaiting_recruiter_action Boolean @default(false)
|
|
2043
2190
|
/// Audit fields
|
|
2044
|
-
created_at DateTime
|
|
2045
|
-
updated_at DateTime
|
|
2191
|
+
created_at DateTime @default(now())
|
|
2192
|
+
updated_at DateTime @updatedAt
|
|
2046
2193
|
created_by String
|
|
2047
2194
|
updated_by String
|
|
2048
|
-
is_active Boolean
|
|
2195
|
+
is_active Boolean @default(true)
|
|
2196
|
+
|
|
2197
|
+
//interview proctoring
|
|
2198
|
+
proctoringSession ProctoringSession?
|
|
2199
|
+
|
|
2049
2200
|
// Relations
|
|
2050
|
-
candidate
|
|
2051
|
-
interviewer
|
|
2052
|
-
organisation
|
|
2053
|
-
recording_document
|
|
2054
|
-
job_description
|
|
2055
|
-
resume
|
|
2056
|
-
evaluation_plan
|
|
2057
|
-
application
|
|
2058
|
-
ongoing_evaluation
|
|
2059
|
-
transcripts
|
|
2060
|
-
suggestions
|
|
2061
|
-
interviewNotes
|
|
2062
|
-
liveAnalysis
|
|
2063
|
-
zoom_meeting
|
|
2201
|
+
candidate User? @relation("CandidateInterviews", fields: [candidate_id], references: [id], onDelete: SetNull)
|
|
2202
|
+
interviewer User? @relation("InterviewerInterviews", fields: [interviewer_id], references: [id], onDelete: SetNull)
|
|
2203
|
+
organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
2204
|
+
recording_document Document? @relation(fields: [recording_document_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
2205
|
+
job_description JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
2206
|
+
resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
2207
|
+
evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
2208
|
+
application Application? @relation(fields: [application_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
2209
|
+
ongoing_evaluation OngoingEvaluation?
|
|
2210
|
+
transcripts Transcript[]
|
|
2211
|
+
suggestions Suggestion[]
|
|
2212
|
+
interviewNotes InterviewNotes[]
|
|
2213
|
+
liveAnalysis LiveAnalysis[]
|
|
2214
|
+
zoom_meeting ZoomMeeting?
|
|
2064
2215
|
|
|
2065
2216
|
// Indexes
|
|
2066
2217
|
@@index([candidate_id])
|
|
@@ -3702,6 +3853,125 @@ model PipelineDistributionAnalyticsDaily {
|
|
|
3702
3853
|
@@schema("analytics")
|
|
3703
3854
|
}
|
|
3704
3855
|
|
|
3856
|
+
enum RiskLevel {
|
|
3857
|
+
LOW
|
|
3858
|
+
MEDIUM
|
|
3859
|
+
HIGH
|
|
3860
|
+
CRITICAL
|
|
3861
|
+
|
|
3862
|
+
@@schema("public")
|
|
3863
|
+
}
|
|
3864
|
+
|
|
3865
|
+
enum AnalysisStatus {
|
|
3866
|
+
QUEUED
|
|
3867
|
+
RUNNING
|
|
3868
|
+
COMPLETED
|
|
3869
|
+
FAILED
|
|
3870
|
+
|
|
3871
|
+
@@schema("public")
|
|
3872
|
+
}
|
|
3873
|
+
|
|
3874
|
+
enum ProctoringEventType {
|
|
3875
|
+
GAZE_DISRUPTION
|
|
3876
|
+
OBJECT_DETECTED
|
|
3877
|
+
FACE_MISSING
|
|
3878
|
+
MULTIPLE_FACES
|
|
3879
|
+
BROWSER_TAB_SWITCH
|
|
3880
|
+
BROWSER_BLUR
|
|
3881
|
+
FULLSCREEN_EXIT
|
|
3882
|
+
|
|
3883
|
+
@@schema("public")
|
|
3884
|
+
}
|
|
3885
|
+
|
|
3886
|
+
enum ProctoringSessionStatus {
|
|
3887
|
+
NOT_STARTED
|
|
3888
|
+
CALIBRATING
|
|
3889
|
+
CALIBRATED
|
|
3890
|
+
PROCESSING
|
|
3891
|
+
COMPLETED
|
|
3892
|
+
FAILED
|
|
3893
|
+
|
|
3894
|
+
@@schema("public")
|
|
3895
|
+
}
|
|
3896
|
+
|
|
3897
|
+
model ProctoringSession {
|
|
3898
|
+
id String @id @default(uuid()) @map("id")
|
|
3899
|
+
interviewId String @unique @map("interview_id")
|
|
3900
|
+
interview Interview @relation(fields: [interviewId], references: [id], onDelete: Cascade)
|
|
3901
|
+
|
|
3902
|
+
// Proctoring Lifecycle & Media
|
|
3903
|
+
status ProctoringSessionStatus @default(NOT_STARTED) @map("status")
|
|
3904
|
+
calibrationFeatures Json? @map("calibration_features")
|
|
3905
|
+
chunkCount Int @default(0) @map("chunk_count")
|
|
3906
|
+
completedChunks Int @default(0) @map("completed_chunks")
|
|
3907
|
+
|
|
3908
|
+
// High-Level Aggregated Metrics for Downstream AI Evaluation
|
|
3909
|
+
overallRisk RiskLevel @default(LOW) @map("overall_risk")
|
|
3910
|
+
integrityScore Float @default(100.0) @map("integrity_score")
|
|
3911
|
+
|
|
3912
|
+
totalDurationSec Float @default(0.0) @map("total_duration_sec")
|
|
3913
|
+
faceDetectedPct Float? @map("face_detected_pct")
|
|
3914
|
+
onScreenGazePct Float? @map("on_screen_gaze_pct")
|
|
3915
|
+
|
|
3916
|
+
// Event Counters
|
|
3917
|
+
totalGazeEvents Int @default(0) @map("total_gaze_events")
|
|
3918
|
+
totalObjectEvents Int @default(0) @map("total_object_events")
|
|
3919
|
+
totalFaceEvents Int @default(0) @map("total_face_events")
|
|
3920
|
+
totalBrowserEvents Int @default(0) @map("total_browser_events")
|
|
3921
|
+
|
|
3922
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
3923
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
3924
|
+
|
|
3925
|
+
analyses ProctoringAnalysis[]
|
|
3926
|
+
events ProctoringEvent[]
|
|
3927
|
+
|
|
3928
|
+
@@map("proctoring_sessions")
|
|
3929
|
+
@@schema("public")
|
|
3930
|
+
}
|
|
3931
|
+
|
|
3932
|
+
model ProctoringAnalysis {
|
|
3933
|
+
id String @id @default(uuid()) @map("id")
|
|
3934
|
+
sessionId String @map("session_id")
|
|
3935
|
+
session ProctoringSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)
|
|
3936
|
+
|
|
3937
|
+
status AnalysisStatus @default(QUEUED)
|
|
3938
|
+
|
|
3939
|
+
chunkIndex Int @default(0) @map("chunk_index")
|
|
3940
|
+
startTimeSec Float @default(0.0) @map("start_time_sec")
|
|
3941
|
+
endTimeSec Float @default(0.0) @map("end_time_sec")
|
|
3942
|
+
|
|
3943
|
+
videoKey String? @map("video_key")
|
|
3944
|
+
annotatedKey String? @map("annotated_key")
|
|
3945
|
+
|
|
3946
|
+
error String?
|
|
3947
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
3948
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
3949
|
+
|
|
3950
|
+
@@unique([sessionId, chunkIndex])
|
|
3951
|
+
@@map("proctoring_analyses")
|
|
3952
|
+
@@schema("public")
|
|
3953
|
+
}
|
|
3954
|
+
|
|
3955
|
+
model ProctoringEvent {
|
|
3956
|
+
id String @id @default(uuid()) @map("id")
|
|
3957
|
+
sessionId String @map("session_id")
|
|
3958
|
+
session ProctoringSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)
|
|
3959
|
+
|
|
3960
|
+
eventType ProctoringEventType @map("event_type")
|
|
3961
|
+
timestampSec Float @map("timestamp_sec")
|
|
3962
|
+
timestampStr String @map("timestamp_str")
|
|
3963
|
+
|
|
3964
|
+
risk RiskLevel @default(LOW)
|
|
3965
|
+
metadata Json?
|
|
3966
|
+
|
|
3967
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
3968
|
+
|
|
3969
|
+
@@index([sessionId, timestampSec])
|
|
3970
|
+
@@index([sessionId, eventType])
|
|
3971
|
+
@@map("proctoring_events")
|
|
3972
|
+
@@schema("public")
|
|
3973
|
+
}
|
|
3974
|
+
|
|
3705
3975
|
enum AsyncOperationStatus {
|
|
3706
3976
|
PENDING
|
|
3707
3977
|
IN_PROGRESS
|
|
@@ -4510,8 +4780,11 @@ model User {
|
|
|
4510
4780
|
employee_number Int?
|
|
4511
4781
|
employee_code String? @unique
|
|
4512
4782
|
|
|
4513
|
-
department_members
|
|
4514
|
-
assigned_hiring_units
|
|
4783
|
+
department_members DepartmentMember[] @relation("DepartmentMemberships")
|
|
4784
|
+
assigned_hiring_units PurchasedHiringUnit[] @relation("AssignedHiringUnits")
|
|
4785
|
+
consent_records ConsentRecord[]
|
|
4786
|
+
erasure_requests_as_subject DataErasureRequest[] @relation("ErasureSubjectUser")
|
|
4787
|
+
erasure_requests_requested DataErasureRequest[] @relation("ErasureRequestedByUser")
|
|
4515
4788
|
|
|
4516
4789
|
@@index([role_id])
|
|
4517
4790
|
@@index([permission_id])
|