Defines Zod schemas for HubSpot credentials and entity models (contacts, companies, deals, tickets, engagements) for type-safe CRM data handling.
// Source: https://github.com/corsairdev/corsair | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from 'zod';
import {
HubSpotCompany,
HubSpotContact,
HubSpotDeal,
HubSpotEngagement,
HubSpotTicket,
} from './database';
export const HubSpotCredentials = z.object({
token: z.string(),
});
export type HubSpotCredentials = z.infer<typeof HubSpotCredentials>;
export const HubSpotSchema = {
version: '1.0.0',
entities: {
contacts: HubSpotContact,
companies: HubSpotCompany,
deals: HubSpotDeal,
tickets: HubSpotTicket,
engagements: HubSpotEngagement,
},
} as const;
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key