UNPKG

@citrineos/base

Version:

The base module for OCPP v2.0.1 including all interfaces. This module is not intended to be used directly, but rather as a dependency for other modules.

30 lines 1.04 kB
// SPDX-FileCopyrightText: 2025 Contributors to the CitrineOS Project // // SPDX-License-Identifier: Apache-2.0 import { z } from 'zod'; import { EvseTypeSchema } from './evse.type.dto.js'; import { BaseSchema } from './types/base.dto.js'; import { VariableSchema } from './variable.dto.js'; export const ComponentSchema = BaseSchema.extend({ id: z.number().int().optional(), name: z.string(), instance: z.string().nullable().optional(), evse: EvseTypeSchema.optional(), evseDatabaseId: z.number().int().nullable().optional(), variables: z.array(VariableSchema).optional(), customData: z.any().nullable().optional(), }); export const ComponentProps = ComponentSchema.keyof().enum; export const ComponentCreateSchema = ComponentSchema.omit({ id: true, tenant: true, evse: true, variables: true, updatedAt: true, createdAt: true, }); export const componentSchemas = { Component: ComponentSchema, ComponentCreate: ComponentCreateSchema, }; //# sourceMappingURL=component.dto.js.map