@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.
44 lines • 1.36 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { safeParse } from "../../lib/schemas.js";
/**
* Filter type. One of [contextAttribute, eventProperty, group]
*/
export const FilterType = {
Group: "group",
ContextAttribute: "contextAttribute",
EventProperty: "eventProperty",
};
/** @internal */
export const FilterType$inboundSchema = z
.nativeEnum(FilterType);
/** @internal */
export const FilterType$outboundSchema = FilterType$inboundSchema;
/** @internal */
export const Filter$inboundSchema = z
.object({
type: FilterType$inboundSchema,
attribute: z.string().optional(),
op: z.string(),
values: z.array(z.any()),
contextKind: z.string().optional(),
negate: z.boolean(),
});
/** @internal */
export const Filter$outboundSchema = z.object({
type: FilterType$outboundSchema,
attribute: z.string().optional(),
op: z.string(),
values: z.array(z.any()),
contextKind: z.string().optional(),
negate: z.boolean(),
});
export function filterToJSON(filter) {
return JSON.stringify(Filter$outboundSchema.parse(filter));
}
export function filterFromJSON(jsonString) {
return safeParse(jsonString, (x) => Filter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Filter' from JSON`);
}
//# sourceMappingURL=filter.js.map