Openstatus www.openstatus.dev
at main 30 lines 658 B view raw
1import type { Tinybird } from "@chronark/zod-bird"; 2 3import { 4 ingestActionEventSchema, 5 pipeActionResponseData, 6} from "./action-validation"; 7import { pipeParameterData } from "./base-validation"; 8 9export class AuditLog { 10 private readonly tb: Tinybird; 11 12 constructor(opts: { tb: Tinybird }) { 13 this.tb = opts.tb; 14 } 15 16 get publishAuditLog() { 17 return this.tb.buildIngestEndpoint({ 18 datasource: "audit_log__v0", 19 event: ingestActionEventSchema, 20 }); 21 } 22 23 get getAuditLog() { 24 return this.tb.buildPipe({ 25 pipe: "endpoint_audit_log__v0", 26 parameters: pipeParameterData, 27 data: pipeActionResponseData, 28 }); 29 } 30}