@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.
129 lines (123 loc) • 4.3 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type GetFeatureFlagsRequest = {
/**
* The project key
*/
projectKey: string;
/**
* Filter configurations by environment
*/
env?: string | undefined;
/**
* Filter feature flags by tag
*/
tag?: string | undefined;
/**
* The number of feature flags to return. Defaults to 20.
*/
limit?: number | undefined;
/**
* Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.
*/
offset?: number | undefined;
/**
* Deprecated, use `filter=archived:true` instead. A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned
*
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
*/
archived?: boolean | undefined;
/**
* By default, flags do _not_ include their lists of prerequisites, targets, or rules for each environment. Set `summary=0` and include the `env` query parameter to include these fields for each flag returned.
*/
summary?: boolean | undefined;
/**
* A comma-separated list of filters. Each filter is of the form field:value. Read the endpoint description for a full list of available filter fields.
*/
filter?: string | undefined;
/**
* A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. Read the endpoint description for a full list of available sort fields.
*/
sort?: string | undefined;
/**
* Deprecated, unavailable in API version `20240415`. A boolean to filter results by only flags that have differences between environments.
*
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
*/
compare?: boolean | undefined;
/**
* A comma-separated list of fields to expand in the response. Supported fields are explained above.
*/
expand?: string | undefined;
};
/** @internal */
export const GetFeatureFlagsRequest$inboundSchema: z.ZodType<
GetFeatureFlagsRequest,
z.ZodTypeDef,
unknown
> = z.object({
projectKey: z.string(),
env: z.string().optional(),
tag: z.string().optional(),
limit: z.number().int().optional(),
offset: z.number().int().optional(),
archived: z.boolean().optional(),
summary: z.boolean().optional(),
filter: z.string().optional(),
sort: z.string().optional(),
compare: z.boolean().optional(),
expand: z.string().optional(),
});
/** @internal */
export type GetFeatureFlagsRequest$Outbound = {
projectKey: string;
env?: string | undefined;
tag?: string | undefined;
limit?: number | undefined;
offset?: number | undefined;
archived?: boolean | undefined;
summary?: boolean | undefined;
filter?: string | undefined;
sort?: string | undefined;
compare?: boolean | undefined;
expand?: string | undefined;
};
/** @internal */
export const GetFeatureFlagsRequest$outboundSchema: z.ZodType<
GetFeatureFlagsRequest$Outbound,
z.ZodTypeDef,
GetFeatureFlagsRequest
> = z.object({
projectKey: z.string(),
env: z.string().optional(),
tag: z.string().optional(),
limit: z.number().int().optional(),
offset: z.number().int().optional(),
archived: z.boolean().optional(),
summary: z.boolean().optional(),
filter: z.string().optional(),
sort: z.string().optional(),
compare: z.boolean().optional(),
expand: z.string().optional(),
});
export function getFeatureFlagsRequestToJSON(
getFeatureFlagsRequest: GetFeatureFlagsRequest,
): string {
return JSON.stringify(
GetFeatureFlagsRequest$outboundSchema.parse(getFeatureFlagsRequest),
);
}
export function getFeatureFlagsRequestFromJSON(
jsonString: string,
): SafeParseResult<GetFeatureFlagsRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetFeatureFlagsRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetFeatureFlagsRequest' from JSON`,
);
}