UNPKG

@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.

86 lines • 3.03 kB
/* * 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 { Link$inboundSchema, Link$outboundSchema, } from "./link.js"; /** * The kind of event the metric tracks */ export const MetricV2RepKind = { Pageview: "pageview", Click: "click", Custom: "custom", Trace: "trace", }; /** * The type of unit aggregation to use for the metric */ export const MetricV2RepUnitAggregationType = { Sum: "sum", Average: "average", CountDistinct: "count_distinct", }; /** * The method for analyzing metric events */ export const MetricV2RepAnalysisType = { Mean: "mean", Percentile: "percentile", }; /** @internal */ export const MetricV2RepKind$inboundSchema = z.nativeEnum(MetricV2RepKind); /** @internal */ export const MetricV2RepKind$outboundSchema = MetricV2RepKind$inboundSchema; /** @internal */ export const MetricV2RepUnitAggregationType$inboundSchema = z.nativeEnum(MetricV2RepUnitAggregationType); /** @internal */ export const MetricV2RepUnitAggregationType$outboundSchema = MetricV2RepUnitAggregationType$inboundSchema; /** @internal */ export const MetricV2RepAnalysisType$inboundSchema = z.nativeEnum(MetricV2RepAnalysisType); /** @internal */ export const MetricV2RepAnalysisType$outboundSchema = MetricV2RepAnalysisType$inboundSchema; /** @internal */ export const MetricV2Rep$inboundSchema = z.object({ key: z.string(), _versionId: z.string().optional(), name: z.string(), kind: MetricV2RepKind$inboundSchema, isNumeric: z.boolean().optional(), unitAggregationType: MetricV2RepUnitAggregationType$inboundSchema.optional(), analysisType: MetricV2RepAnalysisType$inboundSchema.optional(), eventKey: z.string().optional(), analysisUnit: z.string().optional(), _links: z.record(Link$inboundSchema), }).transform((v) => { return remap$(v, { "_versionId": "versionId", "_links": "links", }); }); /** @internal */ export const MetricV2Rep$outboundSchema = z.object({ key: z.string(), versionId: z.string().optional(), name: z.string(), kind: MetricV2RepKind$outboundSchema, isNumeric: z.boolean().optional(), unitAggregationType: MetricV2RepUnitAggregationType$outboundSchema.optional(), analysisType: MetricV2RepAnalysisType$outboundSchema.optional(), eventKey: z.string().optional(), analysisUnit: z.string().optional(), links: z.record(Link$outboundSchema), }).transform((v) => { return remap$(v, { versionId: "_versionId", links: "_links", }); }); export function metricV2RepToJSON(metricV2Rep) { return JSON.stringify(MetricV2Rep$outboundSchema.parse(metricV2Rep)); } export function metricV2RepFromJSON(jsonString) { return safeParse(jsonString, (x) => MetricV2Rep$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetricV2Rep' from JSON`); } //# sourceMappingURL=metricv2rep.js.map