UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

39 lines 2.19 kB
import { z } from 'zod'; import { BaseResponseSchema, BaseGetParamsSchema } from '../../../core/schemas'; import { InvProfileLineTypeSchema } from './common'; /** Inv profile header - key field only, passthrough for API flexibility */ export const InvProfileHdrSchema = z.object({ invProfileHdrUid: z.number() }).passthrough(); /** Inv profile line - key field only, passthrough for API flexibility */ export const InvProfileLineSchema = z.object({ invProfileLineUid: z.number() }).passthrough(); export const InvProfileHdrListParamsSchema = BaseGetParamsSchema.extend({ customerId: z.number().optional(), limit: z.number().optional().default(10), offset: z.number().optional().default(0), }); export const InvProfileLineListParamsSchema = BaseGetParamsSchema.extend({ limit: z.number().optional().default(10), offset: z.number().optional().default(0), }); /** Create request - passthrough for flexible input */ export const CreateInvProfileHdrRequestSchema = z.object({}).passthrough(); /** Update request - passthrough for flexible input */ export const UpdateInvProfileHdrRequestSchema = z.object({}).passthrough(); /** Create line request - requires type validation for enum */ export const CreateInvProfileLineRequestSchema = z .object({ invProfileLineType: InvProfileLineTypeSchema, }) .passthrough(); /** Update line request - passthrough for flexible input */ export const UpdateInvProfileLineRequestSchema = z.object({}).passthrough(); export const InvProfileUploadParamsSchema = z.object({ customerId: z.coerce.number(), }); /** Upload data - passthrough for API flexibility */ export const InvProfileUploadDataSchema = z.object({}).passthrough(); export const InvProfileHdrListResponseSchema = BaseResponseSchema(z.array(InvProfileHdrSchema)); export const InvProfileHdrResponseSchema = BaseResponseSchema(InvProfileHdrSchema); export const InvProfileLineListResponseSchema = BaseResponseSchema(z.array(InvProfileLineSchema)); export const InvProfileLineResponseSchema = BaseResponseSchema(InvProfileLineSchema); export const InvProfileUploadResponseSchema = BaseResponseSchema(InvProfileUploadDataSchema); //# sourceMappingURL=profiles.js.map