@danielcok17/prisma-db 1.0.2 → 1.0.3

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 (41) hide show
  1. package/README.md +99 -8
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +1 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/paths.d.ts +4 -0
  7. package/dist/paths.d.ts.map +1 -0
  8. package/dist/paths.js +12 -0
  9. package/dist/paths.js.map +1 -0
  10. package/package.json +3 -3
  11. package/prisma/app.prisma +148 -74
  12. package/prisma/generated/app/edge.js +64 -10
  13. package/prisma/generated/app/index-browser.js +59 -5
  14. package/prisma/generated/app/index.d.ts +5169 -199
  15. package/prisma/generated/app/index.js +64 -10
  16. package/prisma/generated/app/libquery_engine-darwin-arm64.dylib.node +0 -0
  17. package/prisma/generated/app/package.json +2 -2
  18. package/prisma/generated/app/runtime/edge-esm.js +3 -3
  19. package/prisma/generated/app/runtime/edge.js +3 -3
  20. package/prisma/generated/app/runtime/library.d.ts +66 -92
  21. package/prisma/generated/app/runtime/library.js +21 -21
  22. package/prisma/generated/app/runtime/react-native.js +13 -13
  23. package/prisma/generated/app/runtime/wasm-compiler-edge.js +27 -27
  24. package/prisma/generated/app/runtime/wasm-engine-edge.js +13 -13
  25. package/prisma/generated/app/schema.prisma +94 -18
  26. package/prisma/generated/app/wasm.js +59 -5
  27. package/prisma/generated/law/edge.js +6 -6
  28. package/prisma/generated/law/index-browser.js +4 -4
  29. package/prisma/generated/law/index.d.ts +2 -2
  30. package/prisma/generated/law/index.js +6 -6
  31. package/prisma/generated/law/libquery_engine-darwin-arm64.dylib.node +0 -0
  32. package/prisma/generated/law/package.json +1 -1
  33. package/prisma/generated/law/runtime/edge-esm.js +3 -3
  34. package/prisma/generated/law/runtime/edge.js +3 -3
  35. package/prisma/generated/law/runtime/library.d.ts +66 -92
  36. package/prisma/generated/law/runtime/library.js +21 -21
  37. package/prisma/generated/law/runtime/react-native.js +13 -13
  38. package/prisma/generated/law/runtime/wasm-compiler-edge.js +27 -27
  39. package/prisma/generated/law/runtime/wasm-engine-edge.js +13 -13
  40. package/prisma/generated/law/wasm.js +4 -4
  41. package/prisma/migrations/20250903104817_add_workflow_log/migration.sql +103 -0
@@ -57,6 +57,7 @@ model User {
57
57
  feedbacks Feedback[]
58
58
  pageViews PageView[]
59
59
  sessions Session[]
60
+ workflowLogs WorkflowLog[]
60
61
  }
61
62
 
62
63
  // Nový model pre žiadosti o schválenie
@@ -77,19 +78,20 @@ model UserApprovalRequest {
77
78
 
78
79
  // ZJEDNODUŠENÝ Conversation - len metadata, bez duplikátov
79
80
  model Conversation {
80
- id String @id @default(cuid())
81
+ id String @id @default(cuid())
81
82
  name String
82
83
  userId String
83
- isShareable Boolean @default(false)
84
- shareUrl String? @unique
84
+ isShareable Boolean @default(false)
85
+ shareUrl String? @unique
85
86
  sharedAt DateTime?
86
- createdAt DateTime @default(now())
87
- updatedAt DateTime @updatedAt
87
+ createdAt DateTime @default(now())
88
+ updatedAt DateTime @updatedAt
88
89
  summary String?
89
- messagesSinceLastSummary Int? @default(0)
90
+ messagesSinceLastSummary Int? @default(0)
90
91
  // Relácie
91
92
  answers Answer[]
92
- user User @relation(fields: [userId], references: [id])
93
+ user User @relation(fields: [userId], references: [id])
94
+ workflowLogs WorkflowLog[]
93
95
 
94
96
  @@index([userId])
95
97
  @@index([createdAt])
@@ -117,6 +119,7 @@ model Answer {
117
119
  feedback Feedback?
118
120
  references Reference[]
119
121
  metrics AnswerMetrics?
122
+ WorkflowLog WorkflowLog[]
120
123
 
121
124
  @@index([conversationId])
122
125
  @@index([messageId])
@@ -202,7 +205,7 @@ model Reference {
202
205
  model PageView {
203
206
  id String @id @default(cuid())
204
207
  userId String?
205
- sessionId String
208
+ sessionId String?
206
209
  page String
207
210
  path String
208
211
  referrer String?
@@ -218,7 +221,7 @@ model PageView {
218
221
  timeOnPage Int?
219
222
  isBounce Boolean @default(true)
220
223
  createdAt DateTime @default(now())
221
- session Session @relation(fields: [sessionId], references: [sessionId], onDelete: SetNull)
224
+ session Session? @relation(fields: [sessionId], references: [sessionId], onDelete: SetNull)
222
225
  user User? @relation(fields: [userId], references: [id])
223
226
 
224
227
  @@index([userId])
@@ -230,16 +233,16 @@ model PageView {
230
233
  }
231
234
 
232
235
  model Session {
233
- id String @id @default(cuid())
234
- sessionId String @unique
235
- userId String?
236
- startedAt DateTime @default(now())
237
- endedAt DateTime?
238
- duration Int?
239
- pageViews PageView[]
240
- user User? @relation(fields: [userId], references: [id])
236
+ id String @id @default(cuid())
237
+ sessionId String @unique
238
+ userId String?
239
+ startedAt DateTime @default(now())
240
+ endedAt DateTime?
241
+ duration Int?
242
+ pageViews PageView[]
243
+ user User? @relation(fields: [userId], references: [id])
244
+ workflowLogs WorkflowLog[]
241
245
 
242
- @@index([sessionId])
243
246
  @@index([userId])
244
247
  @@index([startedAt])
245
248
  }
@@ -284,3 +287,76 @@ model AdminActionLog {
284
287
  @@index([adminEmail])
285
288
  @@index([createdAt])
286
289
  }
290
+
291
+ model WorkflowLog {
292
+ id String @id @default(cuid()) // Added @default(cuid())
293
+ conversationId String
294
+ messageId String?
295
+ userId String? // Made optional to preserve logs when users are deleted
296
+ sessionId String? // Removed @unique to allow multiple workflows per session
297
+ startedAt DateTime @default(now())
298
+ completedAt DateTime?
299
+ status WorkflowStatus @default(IN_PROGRESS)
300
+ totalDuration Int? // milliseconds
301
+ error String?
302
+ metadata Json?
303
+ steps WorkflowStep[] // Renamed from WorkflowStep to steps (lowerCamel, plural)
304
+ conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
305
+ user User? @relation(fields: [userId], references: [id], onDelete: SetNull)
306
+ session Session? @relation(fields: [sessionId], references: [sessionId], onDelete: SetNull)
307
+ answer Answer? @relation(fields: [messageId], references: [messageId])
308
+
309
+ @@index([conversationId])
310
+ @@index([userId])
311
+ @@index([sessionId])
312
+ @@index([startedAt])
313
+ @@index([status])
314
+ @@index([conversationId, startedAt]) // Composite index for timeline queries
315
+ @@index([messageId])
316
+ }
317
+
318
+ model WorkflowStep {
319
+ id String @id @default(cuid()) // Added @default(cuid())
320
+ workflowId String
321
+ stepName String // 'classify_question', 'rag_search', 'ai_processing', 'generate_response'
322
+ stepType StepType
323
+ startedAt DateTime @default(now())
324
+ completedAt DateTime?
325
+ duration Int? // milliseconds
326
+ status StepStatus @default(IN_PROGRESS)
327
+ inputData Json? // Sanitized input data
328
+ outputData Json? // Sanitized output data
329
+ error String?
330
+ metadata Json? // Provider used, model used, tokens, costs, etc.
331
+ workflow WorkflowLog @relation(fields: [workflowId], references: [id], onDelete: Cascade)
332
+
333
+ @@index([workflowId])
334
+ @@index([stepName])
335
+ @@index([stepType])
336
+ @@index([startedAt])
337
+ @@index([status])
338
+ @@index([workflowId, startedAt]) // Composite index for timeline queries
339
+ }
340
+
341
+ enum WorkflowStatus {
342
+ IN_PROGRESS
343
+ COMPLETED
344
+ FAILED
345
+ CANCELLED
346
+ }
347
+
348
+ enum StepStatus {
349
+ IN_PROGRESS
350
+ COMPLETED
351
+ FAILED
352
+ SKIPPED
353
+ }
354
+
355
+ enum StepType {
356
+ CLASSIFICATION
357
+ RAG_RETRIEVAL
358
+ AI_PROCESSING
359
+ RESPONSE_GENERATION
360
+ DATA_PERSISTENCE
361
+ ERROR_HANDLING
362
+ }
@@ -20,12 +20,12 @@ exports.Prisma = Prisma
20
20
  exports.$Enums = {}
21
21
 
22
22
  /**
23
- * Prisma Client JS version: 6.14.0
24
- * Query Engine version: 717184b7b35ea05dfa71a3236b7af656013e1e49
23
+ * Prisma Client JS version: 6.15.0
24
+ * Query Engine version: 85179d7826409ee107a6ba334b5e305ae3fba9fb
25
25
  */
26
26
  Prisma.prismaVersion = {
27
- client: "6.14.0",
28
- engine: "717184b7b35ea05dfa71a3236b7af656013e1e49"
27
+ client: "6.15.0",
28
+ engine: "85179d7826409ee107a6ba334b5e305ae3fba9fb"
29
29
  }
30
30
 
31
31
  Prisma.PrismaClientKnownRequestError = () => {
@@ -282,6 +282,35 @@ exports.Prisma.AdminActionLogScalarFieldEnum = {
282
282
  createdAt: 'createdAt'
283
283
  };
284
284
 
285
+ exports.Prisma.WorkflowLogScalarFieldEnum = {
286
+ id: 'id',
287
+ conversationId: 'conversationId',
288
+ messageId: 'messageId',
289
+ userId: 'userId',
290
+ sessionId: 'sessionId',
291
+ startedAt: 'startedAt',
292
+ completedAt: 'completedAt',
293
+ status: 'status',
294
+ totalDuration: 'totalDuration',
295
+ error: 'error',
296
+ metadata: 'metadata'
297
+ };
298
+
299
+ exports.Prisma.WorkflowStepScalarFieldEnum = {
300
+ id: 'id',
301
+ workflowId: 'workflowId',
302
+ stepName: 'stepName',
303
+ stepType: 'stepType',
304
+ startedAt: 'startedAt',
305
+ completedAt: 'completedAt',
306
+ duration: 'duration',
307
+ status: 'status',
308
+ inputData: 'inputData',
309
+ outputData: 'outputData',
310
+ error: 'error',
311
+ metadata: 'metadata'
312
+ };
313
+
285
314
  exports.Prisma.SortOrder = {
286
315
  asc: 'asc',
287
316
  desc: 'desc'
@@ -333,6 +362,29 @@ exports.ReferenceType = exports.$Enums.ReferenceType = {
333
362
  OTHER: 'OTHER'
334
363
  };
335
364
 
365
+ exports.WorkflowStatus = exports.$Enums.WorkflowStatus = {
366
+ IN_PROGRESS: 'IN_PROGRESS',
367
+ COMPLETED: 'COMPLETED',
368
+ FAILED: 'FAILED',
369
+ CANCELLED: 'CANCELLED'
370
+ };
371
+
372
+ exports.StepType = exports.$Enums.StepType = {
373
+ CLASSIFICATION: 'CLASSIFICATION',
374
+ RAG_RETRIEVAL: 'RAG_RETRIEVAL',
375
+ AI_PROCESSING: 'AI_PROCESSING',
376
+ RESPONSE_GENERATION: 'RESPONSE_GENERATION',
377
+ DATA_PERSISTENCE: 'DATA_PERSISTENCE',
378
+ ERROR_HANDLING: 'ERROR_HANDLING'
379
+ };
380
+
381
+ exports.StepStatus = exports.$Enums.StepStatus = {
382
+ IN_PROGRESS: 'IN_PROGRESS',
383
+ COMPLETED: 'COMPLETED',
384
+ FAILED: 'FAILED',
385
+ SKIPPED: 'SKIPPED'
386
+ };
387
+
336
388
  exports.Prisma.ModelName = {
337
389
  Account: 'Account',
338
390
  User: 'User',
@@ -344,7 +396,9 @@ exports.Prisma.ModelName = {
344
396
  Reference: 'Reference',
345
397
  PageView: 'PageView',
346
398
  Session: 'Session',
347
- AdminActionLog: 'AdminActionLog'
399
+ AdminActionLog: 'AdminActionLog',
400
+ WorkflowLog: 'WorkflowLog',
401
+ WorkflowStep: 'WorkflowStep'
348
402
  };
349
403
 
350
404
  /**
@@ -35,12 +35,12 @@ exports.Prisma = Prisma
35
35
  exports.$Enums = {}
36
36
 
37
37
  /**
38
- * Prisma Client JS version: 6.14.0
39
- * Query Engine version: 717184b7b35ea05dfa71a3236b7af656013e1e49
38
+ * Prisma Client JS version: 6.15.0
39
+ * Query Engine version: 85179d7826409ee107a6ba334b5e305ae3fba9fb
40
40
  */
41
41
  Prisma.prismaVersion = {
42
- client: "6.14.0",
43
- engine: "717184b7b35ea05dfa71a3236b7af656013e1e49"
42
+ client: "6.15.0",
43
+ engine: "85179d7826409ee107a6ba334b5e305ae3fba9fb"
44
44
  }
45
45
 
46
46
  Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError;
@@ -209,8 +209,8 @@ const config = {
209
209
  "schemaEnvPath": "../../../.env"
210
210
  },
211
211
  "relativePath": "../..",
212
- "clientVersion": "6.14.0",
213
- "engineVersion": "717184b7b35ea05dfa71a3236b7af656013e1e49",
212
+ "clientVersion": "6.15.0",
213
+ "engineVersion": "85179d7826409ee107a6ba334b5e305ae3fba9fb",
214
214
  "datasourceNames": [
215
215
  "db"
216
216
  ],
@@ -20,12 +20,12 @@ exports.Prisma = Prisma
20
20
  exports.$Enums = {}
21
21
 
22
22
  /**
23
- * Prisma Client JS version: 6.14.0
24
- * Query Engine version: 717184b7b35ea05dfa71a3236b7af656013e1e49
23
+ * Prisma Client JS version: 6.15.0
24
+ * Query Engine version: 85179d7826409ee107a6ba334b5e305ae3fba9fb
25
25
  */
26
26
  Prisma.prismaVersion = {
27
- client: "6.14.0",
28
- engine: "717184b7b35ea05dfa71a3236b7af656013e1e49"
27
+ client: "6.15.0",
28
+ engine: "85179d7826409ee107a6ba334b5e305ae3fba9fb"
29
29
  }
30
30
 
31
31
  Prisma.PrismaClientKnownRequestError = () => {
@@ -234,8 +234,8 @@ export namespace Prisma {
234
234
  export import Exact = $Public.Exact
235
235
 
236
236
  /**
237
- * Prisma Client JS version: 6.14.0
238
- * Query Engine version: 717184b7b35ea05dfa71a3236b7af656013e1e49
237
+ * Prisma Client JS version: 6.15.0
238
+ * Query Engine version: 85179d7826409ee107a6ba334b5e305ae3fba9fb
239
239
  */
240
240
  export type PrismaVersion = {
241
241
  client: string
@@ -35,12 +35,12 @@ exports.Prisma = Prisma
35
35
  exports.$Enums = {}
36
36
 
37
37
  /**
38
- * Prisma Client JS version: 6.14.0
39
- * Query Engine version: 717184b7b35ea05dfa71a3236b7af656013e1e49
38
+ * Prisma Client JS version: 6.15.0
39
+ * Query Engine version: 85179d7826409ee107a6ba334b5e305ae3fba9fb
40
40
  */
41
41
  Prisma.prismaVersion = {
42
- client: "6.14.0",
43
- engine: "717184b7b35ea05dfa71a3236b7af656013e1e49"
42
+ client: "6.15.0",
43
+ engine: "85179d7826409ee107a6ba334b5e305ae3fba9fb"
44
44
  }
45
45
 
46
46
  Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError;
@@ -210,8 +210,8 @@ const config = {
210
210
  "schemaEnvPath": "../../../.env"
211
211
  },
212
212
  "relativePath": "../..",
213
- "clientVersion": "6.14.0",
214
- "engineVersion": "717184b7b35ea05dfa71a3236b7af656013e1e49",
213
+ "clientVersion": "6.15.0",
214
+ "engineVersion": "85179d7826409ee107a6ba334b5e305ae3fba9fb",
215
215
  "datasourceNames": [
216
216
  "db"
217
217
  ],
@@ -145,6 +145,6 @@
145
145
  },
146
146
  "./*": "./*"
147
147
  },
148
- "version": "6.14.0",
148
+ "version": "6.15.0",
149
149
  "sideEffects": false
150
150
  }