metis-desk/modules/assets/src/common/support.ts

43 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-10-07 08:16:39 +00:00
import { z } from "zod/v4";
import { SupportValuesSchema } from "../api/domain/support-values";
2026-10-07 08:16:39 +00:00
export type { SupportInput } from "../api/domain/support-values";
2026-10-07 08:16:39 +00:00
export { SupportValuesSchema };
2026-10-10 10:01:58 +00:00
2026-10-07 08:16:39 +00:00
export const SupportToolSchema = z.strictObject({
id: z.uuid(),
name: z.string(),
active: z.boolean(),
});
2026-10-10 10:01:58 +00:00
2026-10-07 08:16:39 +00:00
export const SupportConnectionSchema = z.strictObject({
id: z.uuid(),
companyId: z.uuid(),
assetId: z.uuid(),
values: SupportValuesSchema,
history: z.array(
z.strictObject({
id: z.uuid(),
values: SupportValuesSchema,
actorId: z.uuid(),
actorName: z.string(),
recordedAt: z.iso.datetime(),
})
),
});
2026-10-10 10:01:58 +00:00
2026-10-07 08:16:39 +00:00
export const SupportListSchema = z.strictObject({
connections: z.array(SupportConnectionSchema),
tools: z.array(SupportToolSchema),
});
2026-10-10 10:01:58 +00:00
2026-10-07 08:16:39 +00:00
export const SupportResponseSchema = z.strictObject({ connection: SupportConnectionSchema });
2026-10-10 10:01:58 +00:00
2026-10-07 08:16:39 +00:00
export type SupportConnectionDTO = z.infer<typeof SupportConnectionSchema>;
2026-10-10 10:01:58 +00:00
2026-10-07 08:16:39 +00:00
export type SupportToolDTO = z.infer<typeof SupportToolSchema>;
2026-10-10 10:01:58 +00:00
2026-10-07 08:16:39 +00:00
export type SupportListDTO = z.infer<typeof SupportListSchema>;