@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.
115 lines (109 loc) • 3.59 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 ApprovalSettings = {
/**
* If approvals are required for this environment
*/
required: boolean;
/**
* Whether to skip approvals for pending changes
*/
bypassApprovalsForPendingChanges: boolean;
/**
* Sets the amount of approvals required before a member can apply a change. The minimum is one and the maximum is five.
*/
minNumApprovals: number;
/**
* Allow someone who makes an approval request to apply their own change
*/
canReviewOwnRequest: boolean;
/**
* Allow applying the change as long as at least one person has approved
*/
canApplyDeclinedChanges: boolean;
/**
* Automatically apply changes that have been approved by all reviewers. This field is only applicable for approval services other than LaunchDarkly.
*/
autoApplyApprovedChanges?: boolean | undefined;
/**
* Which service to use for managing approvals
*/
serviceKind: string;
serviceConfig: { [k: string]: any };
/**
* Require approval only on flags with the provided tags. Otherwise all flags will require approval.
*/
requiredApprovalTags: Array<string>;
/**
* Optional field for integration configuration ID of a custom approval integration. This is an Enterprise-only feature.
*/
serviceKindConfigurationId?: string | undefined;
};
/** @internal */
export const ApprovalSettings$inboundSchema: z.ZodType<
ApprovalSettings,
z.ZodTypeDef,
unknown
> = z.object({
required: z.boolean(),
bypassApprovalsForPendingChanges: z.boolean(),
minNumApprovals: z.number().int(),
canReviewOwnRequest: z.boolean(),
canApplyDeclinedChanges: z.boolean(),
autoApplyApprovedChanges: z.boolean().optional(),
serviceKind: z.string(),
serviceConfig: z.record(z.any()),
requiredApprovalTags: z.array(z.string()),
serviceKindConfigurationId: z.string().optional(),
});
/** @internal */
export type ApprovalSettings$Outbound = {
required: boolean;
bypassApprovalsForPendingChanges: boolean;
minNumApprovals: number;
canReviewOwnRequest: boolean;
canApplyDeclinedChanges: boolean;
autoApplyApprovedChanges?: boolean | undefined;
serviceKind: string;
serviceConfig: { [k: string]: any };
requiredApprovalTags: Array<string>;
serviceKindConfigurationId?: string | undefined;
};
/** @internal */
export const ApprovalSettings$outboundSchema: z.ZodType<
ApprovalSettings$Outbound,
z.ZodTypeDef,
ApprovalSettings
> = z.object({
required: z.boolean(),
bypassApprovalsForPendingChanges: z.boolean(),
minNumApprovals: z.number().int(),
canReviewOwnRequest: z.boolean(),
canApplyDeclinedChanges: z.boolean(),
autoApplyApprovedChanges: z.boolean().optional(),
serviceKind: z.string(),
serviceConfig: z.record(z.any()),
requiredApprovalTags: z.array(z.string()),
serviceKindConfigurationId: z.string().optional(),
});
export function approvalSettingsToJSON(
approvalSettings: ApprovalSettings,
): string {
return JSON.stringify(
ApprovalSettings$outboundSchema.parse(approvalSettings),
);
}
export function approvalSettingsFromJSON(
jsonString: string,
): SafeParseResult<ApprovalSettings, SDKValidationError> {
return safeParse(
jsonString,
(x) => ApprovalSettings$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'ApprovalSettings' from JSON`,
);
}