@launchdarkly/mcp-server
Version:
The local [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for [LaunchDarkly](https://launchdarkly.com/) federal and European Union (EU) environments.
93 lines (87 loc) • 2.28 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
Link,
Link$inboundSchema,
Link$Outbound,
Link$outboundSchema,
} from "./link.js";
export type MemberDataRep = {
links?: { [k: string]: Link } | undefined;
/**
* The member ID
*/
id?: string | undefined;
/**
* The member email
*/
email?: string | undefined;
/**
* The member first name
*/
firstName?: string | undefined;
/**
* The member last name
*/
lastName?: string | undefined;
};
/** @internal */
export const MemberDataRep$inboundSchema: z.ZodType<
MemberDataRep,
z.ZodTypeDef,
unknown
> = z.object({
_links: z.record(Link$inboundSchema).optional(),
_id: z.string().optional(),
email: z.string().optional(),
firstName: z.string().optional(),
lastName: z.string().optional(),
}).transform((v) => {
return remap$(v, {
"_links": "links",
"_id": "id",
});
});
/** @internal */
export type MemberDataRep$Outbound = {
_links?: { [k: string]: Link$Outbound } | undefined;
_id?: string | undefined;
email?: string | undefined;
firstName?: string | undefined;
lastName?: string | undefined;
};
/** @internal */
export const MemberDataRep$outboundSchema: z.ZodType<
MemberDataRep$Outbound,
z.ZodTypeDef,
MemberDataRep
> = z.object({
links: z.record(Link$outboundSchema).optional(),
id: z.string().optional(),
email: z.string().optional(),
firstName: z.string().optional(),
lastName: z.string().optional(),
}).transform((v) => {
return remap$(v, {
links: "_links",
id: "_id",
});
});
export function memberDataRepToJSON(memberDataRep: MemberDataRep): string {
return JSON.stringify(MemberDataRep$outboundSchema.parse(memberDataRep));
}
export function memberDataRepFromJSON(
jsonString: string,
): SafeParseResult<MemberDataRep, SDKValidationError> {
return safeParse(
jsonString,
(x) => MemberDataRep$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'MemberDataRep' from JSON`,
);
}