(logs: ProcessLog[])
| 554 | } |
| 555 | |
| 556 | public storeLogs(logs: ProcessLog[]): Result<number[]> { |
| 557 | try { |
| 558 | const sequences: number[] = []; |
| 559 | const transaction = this.db.transaction(() => { |
| 560 | for (const log of logs) { |
| 561 | const result = this.storeLog(log); |
| 562 | if (!result.success) { |
| 563 | if ('error' in result) { |
| 564 | throw result.error; |
| 565 | } |
| 566 | throw new Error('Unknown error storing log'); |
| 567 | } |
| 568 | sequences.push(result.data); |
| 569 | } |
| 570 | }); |
| 571 | |
| 572 | transaction(); |
| 573 | return { success: true, data: sequences }; |
| 574 | } catch (error) { |
| 575 | return { |
| 576 | success: false, |
| 577 | error: error instanceof Error ? error : new Error('Unknown error storing logs') |
| 578 | }; |
| 579 | } |
| 580 | } |
| 581 | |
| 582 | public getLogs(filter: LogFilter = {}): Result<LogRetrievalResponse> { |
| 583 | try { |
no test coverage detected