@simonecoelhosfo/optimizely-mcp-server
Version:
Optimizely MCP Server for AI assistants with integrated CLI tools
237 lines • 7.18 kB
TypeScript
/**
* OpenAPI Types - Response interfaces for OpenAPI Schema Reference Tool
* @description TypeScript interfaces defining the response formats for OpenAPI schema queries.
* These types ensure consistent, structured responses for all schema-related information.
*/
export interface SchemaResponse {
entity_type: string;
openapi_schema: {
required_fields: string[];
optional_fields: string[];
defaults: Record<string, any>;
enums: Record<string, string[]>;
field_types: Record<string, string>;
field_descriptions: Record<string, string>;
};
platform_specific?: {
feature_experimentation?: any;
web_experimentation?: any;
};
validation_rules?: Record<string, any>;
live_schema?: any;
}
export interface OperationResponse {
entity_type: string;
operation: string;
endpoint: string;
method: string;
full_url: string;
base_url: string;
required_parameters: {
path: string[];
query: string[];
body: string[];
};
optional_parameters?: {
path: string[];
query: string[];
body: string[];
};
request_body_schema?: any;
response_schema?: any;
example_payload?: any;
example_request: {
url: string;
method: string;
headers: Record<string, string>;
body?: any;
};
curl_example: string;
platform_specific?: string;
}
export interface FieldResponse {
entity_type: string;
field_name: string;
field_details: {
type: string;
required: boolean;
description: string;
default_value?: any;
enum_values?: string[];
validation_rules?: any;
example_value?: any;
validation_hints?: Record<string, any>;
traffic_allocation_helper?: Record<string, any>;
weight_allocation_helper?: Record<string, any>;
change_type_details?: Record<string, any>;
variable_type_details?: Record<string, any>;
examples_by_use_case?: Record<string, any>;
common_patterns?: any[];
descriptions?: Record<string, string>;
activation_code_examples?: Record<string, string>;
common_errors?: Record<string, string>;
};
platform_differences?: {
feature_experimentation?: any;
web_experimentation?: any;
};
}
export interface DependencyResponse {
entity_type: string;
operation: string;
dependencies: {
required_entities: DependencyInfo[];
optional_entities: DependencyInfo[];
creation_order: string[];
};
platform_specific?: {
feature_experimentation?: {
required: string[];
optional: string[];
};
web_experimentation?: {
required: string[];
optional: string[];
};
};
}
export interface ExamplesResponse {
entity_type: string;
operation?: string;
examples: {
basic_example: any;
advanced_example?: any;
template_example?: any;
platform_specific_examples?: {
feature_experimentation?: any;
web_experimentation?: any;
};
field_examples?: Record<string, any>;
use_case_examples?: Record<string, any>;
};
common_patterns?: {
pattern_name: string;
description: string;
example: any;
}[];
}
export interface ValidationResponse {
entity_type: string;
validation_rules: {
field_validations: Record<string, any>;
business_rules: {
rule_name: string;
description: string;
validation_logic: string;
}[];
platform_specific_rules?: {
feature_experimentation?: any;
web_experimentation?: any;
};
validation_hints?: Record<string, any>;
traffic_allocation_rules?: Record<string, any>;
type_specific_validation?: Record<string, any>;
};
common_validation_errors?: {
error_pattern: string;
description: string;
solution: string;
}[];
}
export interface RelationshipsResponse {
entity_type: string;
relationships: {
parent_entities: RelationshipInfo[];
child_entities: RelationshipInfo[];
referenced_by: RelationshipInfo[];
references: RelationshipInfo[];
};
entity_hierarchy?: {
level: number;
position: string;
depends_on: string[];
dependents: string[];
};
}
export interface DependencyInfo {
entity_type: string;
relationship: string;
field_mapping: string;
description: string;
minimum_count?: number;
maximum_count?: number;
default_behavior?: string;
platform_specific?: string;
creation_hints?: string;
}
export interface RelationshipInfo {
entity_type: string;
relationship_type: 'one-to-one' | 'one-to-many' | 'many-to-one' | 'many-to-many';
field_name: string;
description: string;
cascade_behavior?: 'delete' | 'archive' | 'none';
platform_specific?: boolean;
}
export interface EndpointMapping {
[entityType: string]: {
[operation: string]: {
method: string;
path: string;
platform?: 'feature' | 'web' | 'both';
};
};
}
export interface PlatformDifference {
field_name: string;
feature_experimentation?: {
type?: string;
required?: boolean;
description?: string;
default?: any;
};
web_experimentation?: {
type?: string;
required?: boolean;
description?: string;
default?: any;
};
}
export interface SchemaQueryParams {
entity_type: string;
project_id?: string;
}
export interface OperationQueryParams {
entity_type: string;
operation: string;
project_id?: string;
}
export interface FieldQueryParams {
entity_type: string;
field_name: string;
project_id?: string;
}
export interface DependencyQueryParams {
entity_type: string;
operation: string;
project_id?: string;
}
export interface ExamplesQueryParams {
entity_type: string;
operation?: string;
project_id?: string;
}
export interface ValidationQueryParams {
entity_type: string;
project_id?: string;
}
export interface RelationshipsQueryParams {
entity_type: string;
project_id?: string;
}
export declare const SUPPORTED_ENTITIES: readonly ["project", "experiment", "flag", "audience", "attribute", "event", "page", "campaign", "variation", "ruleset", "rule", "variable_definition", "feature", "environment", "webhook", "extension", "group", "collaborator"];
export declare const SUPPORTED_INFORMATION_TYPES: readonly ["schema", "operations", "field_details", "examples", "validation", "dependencies", "relationships"];
export declare const SUPPORTED_OPERATIONS: readonly ["create", "update", "delete", "list", "get"];
export type SupportedEntity = typeof SUPPORTED_ENTITIES[number];
export type SupportedInformationType = typeof SUPPORTED_INFORMATION_TYPES[number];
export type SupportedOperation = typeof SUPPORTED_OPERATIONS[number];
//# sourceMappingURL=OpenAPITypes.d.ts.map