@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.
91 lines • 4.38 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 { CovariateInfoRep$inboundSchema, CovariateInfoRep$outboundSchema, } from "./covariateinforep.js";
import { DependentMetricGroupRepWithMetrics$inboundSchema, DependentMetricGroupRepWithMetrics$outboundSchema, } from "./dependentmetricgrouprepwithmetrics.js";
import { DependentMetricOrMetricGroupRep$inboundSchema, DependentMetricOrMetricGroupRep$outboundSchema, } from "./dependentmetricormetricgrouprep.js";
import { FlagRep$inboundSchema, FlagRep$outboundSchema, } from "./flagrep.js";
import { LayerSnapshotRep$inboundSchema, LayerSnapshotRep$outboundSchema, } from "./layersnapshotrep.js";
import { MetricV2Rep$inboundSchema, MetricV2Rep$outboundSchema, } from "./metricv2rep.js";
import { TreatmentRep$inboundSchema, TreatmentRep$outboundSchema, } from "./treatmentrep.js";
/**
* The status of the iteration: <code>not_started</code>, <code>running</code>, <code>stopped</code>
*/
export const Status = {
NotStarted: "not_started",
Running: "running",
Stopped: "stopped",
};
/** @internal */
export const Status$inboundSchema = z
.nativeEnum(Status);
/** @internal */
export const Status$outboundSchema = Status$inboundSchema;
/** @internal */
export const IterationRep$inboundSchema = z.object({
_id: z.string().optional(),
hypothesis: z.string().optional(),
status: Status$inboundSchema,
createdAt: z.number().int(),
startedAt: z.number().int().optional(),
endedAt: z.number().int().optional(),
winningTreatmentId: z.string().optional(),
winningReason: z.string().optional(),
canReshuffleTraffic: z.boolean().optional(),
flags: z.record(FlagRep$inboundSchema).optional(),
reallocationFrequencyMillis: z.number().int().optional(),
version: z.number().int().optional(),
primaryMetric: DependentMetricOrMetricGroupRep$inboundSchema.optional(),
primarySingleMetric: MetricV2Rep$inboundSchema.optional(),
primaryFunnel: DependentMetricGroupRepWithMetrics$inboundSchema.optional(),
randomizationUnit: z.string().optional(),
attributes: z.array(z.string()).optional(),
treatments: z.array(TreatmentRep$inboundSchema).optional(),
secondaryMetrics: z.array(MetricV2Rep$inboundSchema).optional(),
metrics: z.array(DependentMetricOrMetricGroupRep$inboundSchema).optional(),
layerSnapshot: LayerSnapshotRep$inboundSchema.optional(),
covariateInfo: CovariateInfoRep$inboundSchema.optional(),
}).transform((v) => {
return remap$(v, {
"_id": "id",
});
});
/** @internal */
export const IterationRep$outboundSchema = z.object({
id: z.string().optional(),
hypothesis: z.string().optional(),
status: Status$outboundSchema,
createdAt: z.number().int(),
startedAt: z.number().int().optional(),
endedAt: z.number().int().optional(),
winningTreatmentId: z.string().optional(),
winningReason: z.string().optional(),
canReshuffleTraffic: z.boolean().optional(),
flags: z.record(FlagRep$outboundSchema).optional(),
reallocationFrequencyMillis: z.number().int().optional(),
version: z.number().int().optional(),
primaryMetric: DependentMetricOrMetricGroupRep$outboundSchema.optional(),
primarySingleMetric: MetricV2Rep$outboundSchema.optional(),
primaryFunnel: DependentMetricGroupRepWithMetrics$outboundSchema.optional(),
randomizationUnit: z.string().optional(),
attributes: z.array(z.string()).optional(),
treatments: z.array(TreatmentRep$outboundSchema).optional(),
secondaryMetrics: z.array(MetricV2Rep$outboundSchema).optional(),
metrics: z.array(DependentMetricOrMetricGroupRep$outboundSchema).optional(),
layerSnapshot: LayerSnapshotRep$outboundSchema.optional(),
covariateInfo: CovariateInfoRep$outboundSchema.optional(),
}).transform((v) => {
return remap$(v, {
id: "_id",
});
});
export function iterationRepToJSON(iterationRep) {
return JSON.stringify(IterationRep$outboundSchema.parse(iterationRep));
}
export function iterationRepFromJSON(jsonString) {
return safeParse(jsonString, (x) => IterationRep$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IterationRep' from JSON`);
}
//# sourceMappingURL=iterationrep.js.map