buena-typescript-sdk
Version:
Official TypeScript SDK for Buena.ai API - LinkedIn automation and lead management
93 lines • 3.23 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
/**
* Current status of the lead
*/
export const Status = {
New: "new",
Contacted: "contacted",
Responded: "responded",
Converted: "converted",
Unqualified: "unqualified",
};
/** @internal */
export const Status$inboundSchema = z
.nativeEnum(Status);
/** @internal */
export const Status$outboundSchema = Status$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var Status$;
(function (Status$) {
/** @deprecated use `Status$inboundSchema` instead. */
Status$.inboundSchema = Status$inboundSchema;
/** @deprecated use `Status$outboundSchema` instead. */
Status$.outboundSchema = Status$outboundSchema;
})(Status$ || (Status$ = {}));
/** @internal */
export const Lead$inboundSchema = z
.object({
id: z.string().optional(),
first_name: z.string().optional(),
last_name: z.string().optional(),
email: z.string().optional(),
company: z.string().optional(),
title: z.string().optional(),
linkedin_url: z.string().optional(),
status: Status$inboundSchema.optional(),
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
}).transform((v) => {
return remap$(v, {
"first_name": "firstName",
"last_name": "lastName",
"linkedin_url": "linkedinUrl",
"created_at": "createdAt",
"updated_at": "updatedAt",
});
});
/** @internal */
export const Lead$outboundSchema = z.object({
id: z.string().optional(),
firstName: z.string().optional(),
lastName: z.string().optional(),
email: z.string().optional(),
company: z.string().optional(),
title: z.string().optional(),
linkedinUrl: z.string().optional(),
status: Status$outboundSchema.optional(),
createdAt: z.date().transform(v => v.toISOString()).optional(),
updatedAt: z.date().transform(v => v.toISOString()).optional(),
}).transform((v) => {
return remap$(v, {
firstName: "first_name",
lastName: "last_name",
linkedinUrl: "linkedin_url",
createdAt: "created_at",
updatedAt: "updated_at",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var Lead$;
(function (Lead$) {
/** @deprecated use `Lead$inboundSchema` instead. */
Lead$.inboundSchema = Lead$inboundSchema;
/** @deprecated use `Lead$outboundSchema` instead. */
Lead$.outboundSchema = Lead$outboundSchema;
})(Lead$ || (Lead$ = {}));
export function leadToJSON(lead) {
return JSON.stringify(Lead$outboundSchema.parse(lead));
}
export function leadFromJSON(jsonString) {
return safeParse(jsonString, (x) => Lead$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Lead' from JSON`);
}
//# sourceMappingURL=lead.js.map