@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.
103 lines • 4.25 kB
JavaScript
/*
* 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 { Access$inboundSchema, Access$outboundSchema, } from "./access.js";
import { AnalysisConfigRep$inboundSchema, AnalysisConfigRep$outboundSchema, } from "./analysisconfigrep.js";
import { IterationRep$inboundSchema, IterationRep$outboundSchema, } from "./iterationrep.js";
import { Link$inboundSchema, Link$outboundSchema, } from "./link.js";
import { MutableFieldsByStatusRep$inboundSchema, MutableFieldsByStatusRep$outboundSchema, } from "./mutablefieldsbystatusrep.js";
/**
* The results analysis approach.
*/
export const ExperimentMethodology = {
Bayesian: "bayesian",
Frequentist: "frequentist",
ExportOnly: "export_only",
};
/**
* The source of metric data in order to analyze results. Defaults to "launchdarkly" when not provided.
*/
export const ExperimentDataSource = {
Launchdarkly: "launchdarkly",
Snowflake: "snowflake",
};
/** @internal */
export const ExperimentMethodology$inboundSchema = z.nativeEnum(ExperimentMethodology);
/** @internal */
export const ExperimentMethodology$outboundSchema = ExperimentMethodology$inboundSchema;
/** @internal */
export const ExperimentDataSource$inboundSchema = z.nativeEnum(ExperimentDataSource);
/** @internal */
export const ExperimentDataSource$outboundSchema = ExperimentDataSource$inboundSchema;
/** @internal */
export const Experiment$inboundSchema = z.object({
_id: z.string().optional(),
key: z.string(),
name: z.string(),
description: z.string().optional(),
_maintainerId: z.string(),
_creationDate: z.number().int(),
environmentKey: z.string(),
methodology: ExperimentMethodology$inboundSchema.optional(),
dataSource: ExperimentDataSource$inboundSchema.optional(),
archivedDate: z.number().int().optional(),
tags: z.array(z.string()).optional(),
_links: z.record(Link$inboundSchema),
holdoutId: z.string().optional(),
currentIteration: IterationRep$inboundSchema.optional(),
type: z.string().optional(),
_access: Access$inboundSchema.optional(),
draftIteration: IterationRep$inboundSchema.optional(),
previousIterations: z.array(IterationRep$inboundSchema).optional(),
analysisConfig: AnalysisConfigRep$inboundSchema.optional(),
mutableFieldsByStatus: MutableFieldsByStatusRep$inboundSchema.optional(),
}).transform((v) => {
return remap$(v, {
"_id": "id",
"_maintainerId": "maintainerId",
"_creationDate": "creationDate",
"_links": "links",
"_access": "access",
});
});
/** @internal */
export const Experiment$outboundSchema = z.object({
id: z.string().optional(),
key: z.string(),
name: z.string(),
description: z.string().optional(),
maintainerId: z.string(),
creationDate: z.number().int(),
environmentKey: z.string(),
methodology: ExperimentMethodology$outboundSchema.optional(),
dataSource: ExperimentDataSource$outboundSchema.optional(),
archivedDate: z.number().int().optional(),
tags: z.array(z.string()).optional(),
links: z.record(Link$outboundSchema),
holdoutId: z.string().optional(),
currentIteration: IterationRep$outboundSchema.optional(),
type: z.string().optional(),
access: Access$outboundSchema.optional(),
draftIteration: IterationRep$outboundSchema.optional(),
previousIterations: z.array(IterationRep$outboundSchema).optional(),
analysisConfig: AnalysisConfigRep$outboundSchema.optional(),
mutableFieldsByStatus: MutableFieldsByStatusRep$outboundSchema.optional(),
}).transform((v) => {
return remap$(v, {
id: "_id",
maintainerId: "_maintainerId",
creationDate: "_creationDate",
links: "_links",
access: "_access",
});
});
export function experimentToJSON(experiment) {
return JSON.stringify(Experiment$outboundSchema.parse(experiment));
}
export function experimentFromJSON(jsonString) {
return safeParse(jsonString, (x) => Experiment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Experiment' from JSON`);
}
//# sourceMappingURL=experiment.js.map