feat(audit-log-stream): frontend rework + some backend changes

This commit is contained in:
x032205
2025-09-04 22:14:11 -04:00
parent fcb931670a
commit d534e82646
36 changed files with 1664 additions and 490 deletions
@@ -1,6 +1,7 @@
import { z } from "zod";
import { LogProvider } from "../audit-log-stream-enums";
import { BaseProviderSchema } from "../audit-log-stream-schemas";
export const CustomProviderCredentialsSchema = z.object({
url: z.string().url().trim().min(1).max(255),
@@ -12,13 +13,13 @@ export const CustomProviderCredentialsSchema = z.object({
.array()
});
export const CustomProviderSchema = z.object({
provider: z.literal(LogProvider.Custom),
const BaseCustomProviderSchema = BaseProviderSchema.extend({ provider: z.literal(LogProvider.Custom) });
export const CustomProviderSchema = BaseCustomProviderSchema.extend({
credentials: CustomProviderCredentialsSchema
});
export const SanitizedCustomProviderSchema = z.object({
provider: z.literal(LogProvider.Custom),
export const SanitizedCustomProviderSchema = BaseCustomProviderSchema.extend({
credentials: z.object({
url: CustomProviderCredentialsSchema.shape.url,
// Only return header keys
@@ -30,3 +31,11 @@ export const CustomProviderListItemSchema = z.object({
name: z.literal("Custom"),
provider: z.literal(LogProvider.Custom)
});
export const CreateCustomProviderLogStreamSchema = z.object({
credentials: CustomProviderCredentialsSchema
});
export const UpdateCustomProviderLogStreamSchema = z.object({
credentials: CustomProviderCredentialsSchema
});